nothing else in the kernel needs to look inside struct ifvlan.
so this diff moves it. the next step will be renaming ifvlan to
vlan_softc so it is like all the other drivers in the tree, and
referring to it as "sc" instead of "ifv" as a variable. but this is a
first step.
ok?
Index: if_vlan.c
===================================================================
RCS file: /cvs/src/sys/net/if_vlan.c,v
retrieving revision 1.186
diff -u -p -r1.186 if_vlan.c
--- if_vlan.c 22 Apr 2019 03:29:40 -0000 1.186
+++ if_vlan.c 26 Apr 2019 05:47:09 -0000
@@ -57,6 +57,7 @@
#include <sys/systm.h>
#include <sys/rwlock.h>
#include <sys/percpu.h>
+#include <sys/refcnt.h>
#include <net/if.h>
#include <net/if_dl.h>
@@ -71,6 +72,41 @@
#if NBPFILTER > 0
#include <net/bpf.h>
#endif
+
+struct vlan_mc_entry {
+ LIST_ENTRY(vlan_mc_entry) mc_entries;
+ union {
+ struct ether_multi *mcu_enm;
+ } mc_u;
+#define mc_enm mc_u.mcu_enm
+ struct sockaddr_storage mc_addr;
+};
+
+struct ifvlan {
+ struct arpcom ifv_ac; /* make this an interface */
+ unsigned int ifv_ifidx0; /* parent interface of this vlan */
+ int ifv_rxprio;
+ struct ifv_linkmib {
+ int ifvm_prio; /* prio to apply on packet leaving if */
+ u_int16_t ifvm_proto; /* encapsulation ethertype */
+ u_int16_t ifvm_tag; /* tag to apply on packets leaving if */
+ u_int16_t ifvm_type; /* non-standard ethertype or 0x8100 */
+ } ifv_mib;
+ LIST_HEAD(__vlan_mchead, vlan_mc_entry) vlan_mc_listhead;
+ SRPL_ENTRY(ifvlan) ifv_list;
+ int ifv_flags;
+ struct refcnt ifv_refcnt;
+ void *lh_cookie;
+ void *dh_cookie;
+ struct ifih *ifv_ifih;
+};
+
+#define ifv_if ifv_ac.ac_if
+#define ifv_tag ifv_mib.ifvm_tag
+#define ifv_prio ifv_mib.ifvm_prio
+#define ifv_type ifv_mib.ifvm_type
+#define IFVF_PROMISC 0x01 /* the parent should be made promisc */
+#define IFVF_LLADDR 0x02 /* don't inherit the parents mac */
#define TAG_HASH_BITS 5
#define TAG_HASH_SIZE (1 << TAG_HASH_BITS)
Index: if_vlan_var.h
===================================================================
RCS file: /cvs/src/sys/net/if_vlan_var.h,v
retrieving revision 1.40
diff -u -p -r1.40 if_vlan_var.h
--- if_vlan_var.h 19 Apr 2019 04:36:12 -0000 1.40
+++ if_vlan_var.h 26 Apr 2019 05:47:09 -0000
@@ -47,44 +47,6 @@ struct vlanreq {
};
#ifdef _KERNEL
-#include <sys/refcnt.h>
-
-#define mc_enm mc_u.mcu_enm
-
-struct vlan_mc_entry {
- LIST_ENTRY(vlan_mc_entry) mc_entries;
- union {
- struct ether_multi *mcu_enm;
- } mc_u;
- struct sockaddr_storage mc_addr;
-};
-
-struct ifvlan {
- struct arpcom ifv_ac; /* make this an interface */
- unsigned int ifv_ifidx0; /* parent interface of this vlan */
- int ifv_rxprio;
- struct ifv_linkmib {
- int ifvm_prio; /* prio to apply on packet leaving if */
- u_int16_t ifvm_proto; /* encapsulation ethertype */
- u_int16_t ifvm_tag; /* tag to apply on packets leaving if */
- u_int16_t ifvm_type; /* non-standard ethertype or 0x8100 */
- } ifv_mib;
- LIST_HEAD(__vlan_mchead, vlan_mc_entry) vlan_mc_listhead;
- SRPL_ENTRY(ifvlan) ifv_list;
- int ifv_flags;
- struct refcnt ifv_refcnt;
- void *lh_cookie;
- void *dh_cookie;
- struct ifih *ifv_ifih;
-};
-
-#define ifv_if ifv_ac.ac_if
-#define ifv_tag ifv_mib.ifvm_tag
-#define ifv_prio ifv_mib.ifvm_prio
-#define ifv_type ifv_mib.ifvm_type
-#define IFVF_PROMISC 0x01 /* the parent should be made promisc */
-#define IFVF_LLADDR 0x02 /* don't inherit the parents mac */
-
struct mbuf *vlan_inject(struct mbuf *, uint16_t, uint16_t);
#endif /* _KERNEL */