summaryrefslogtreecommitdiffstats
path: root/sys/net/if_var.h
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2009-03-01 12:42:54 +0000
committerrwatson <rwatson@FreeBSD.org>2009-03-01 12:42:54 +0000
commit16815243808e39728fb36990d4b900962c89c2f3 (patch)
tree773ccafaced88a8cdd94b7f6e7c24547d1cf4404 /sys/net/if_var.h
parent4321e2a8f43a9472c2ddab0fcf52583043b5eec9 (diff)
downloadFreeBSD-src-16815243808e39728fb36990d4b900962c89c2f3.zip
FreeBSD-src-16815243808e39728fb36990d4b900962c89c2f3.tar.gz
Do a bit of struct ifnet cleanup in preparation for 8.0: group function
pointers together, move padding to the bottom of the structure, and add two new integer spares due to attrition over time. Remove unused spare "flags" field, we can use one of the spare ints if we need it later. This change requires a rebuild of device driver modules that depend on the layout of ifnet for binary compatibility reasons. Discussed with: kmacy
Diffstat (limited to 'sys/net/if_var.h')
-rw-r--r--sys/net/if_var.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
index 250bed9..3ff019f2 100644
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -162,10 +162,13 @@ struct ifnet {
(void *);
int (*if_resolvemulti) /* validate/resolve multicast */
(struct ifnet *, struct sockaddr **, struct sockaddr *);
+ void (*if_qflush) /* flush any queues */
+ (struct ifnet *);
+ int (*if_transmit) /* initiate output routine */
+ (struct ifnet *, struct mbuf *);
struct ifaddr *if_addr; /* pointer to link-level address */
void *if_llsoftc; /* link layer softc */
int if_drv_flags; /* driver-managed status flags */
- u_int if_spare_flags2; /* spare flags 2 */
struct ifaltq if_snd; /* output queue (includes altq) */
const u_int8_t *if_broadcastaddr; /* linklevel broadcast bytestring */
@@ -187,12 +190,14 @@ struct ifnet {
/* protected by if_addr_mtx */
void *if_pf_kif;
void *if_lagg; /* lagg glue */
- void *if_pspare[8]; /* TOE 3; vimage 3; general use 4 */
- void (*if_qflush) /* flush any queues */
- (struct ifnet *);
- int (*if_transmit) /* initiate output routine */
- (struct ifnet *, struct mbuf *);
- int if_ispare[2]; /* general use 2 */
+
+ /*
+ * Spare fields are added so that we can modify sensitive data
+ * structures without changing the kernel binary interface, and must
+ * be used with care where binary compatibility is required.
+ */
+ void *if_pspare[8];
+ int if_ispare[4];
};
typedef void if_init_f_t(void *);
OpenPOWER on IntegriCloud