diff options
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 7c1d4466583b..25f87102ab66 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -88,19 +88,23 @@ struct wireless_dev; | |||
88 | #define NETDEV_TX_BUSY 1 /* driver tx path was busy*/ | 88 | #define NETDEV_TX_BUSY 1 /* driver tx path was busy*/ |
89 | #define NETDEV_TX_LOCKED -1 /* driver tx lock was already taken */ | 89 | #define NETDEV_TX_LOCKED -1 /* driver tx lock was already taken */ |
90 | 90 | ||
91 | #ifdef __KERNEL__ | ||
92 | |||
91 | /* | 93 | /* |
92 | * Compute the worst case header length according to the protocols | 94 | * Compute the worst case header length according to the protocols |
93 | * used. | 95 | * used. |
94 | */ | 96 | */ |
95 | 97 | ||
96 | #if !defined(CONFIG_AX25) && !defined(CONFIG_AX25_MODULE) && !defined(CONFIG_TR) | 98 | #if defined(CONFIG_WLAN_80211) || defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) |
97 | #define LL_MAX_HEADER 32 | 99 | # if defined(CONFIG_MAC80211_MESH) |
98 | #else | 100 | # define LL_MAX_HEADER 128 |
99 | #if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) | 101 | # else |
100 | #define LL_MAX_HEADER 96 | 102 | # define LL_MAX_HEADER 96 |
103 | # endif | ||
104 | #elif defined(CONFIG_TR) | ||
105 | # define LL_MAX_HEADER 48 | ||
101 | #else | 106 | #else |
102 | #define LL_MAX_HEADER 48 | 107 | # define LL_MAX_HEADER 32 |
103 | #endif | ||
104 | #endif | 108 | #endif |
105 | 109 | ||
106 | #if !defined(CONFIG_NET_IPIP) && !defined(CONFIG_NET_IPIP_MODULE) && \ | 110 | #if !defined(CONFIG_NET_IPIP) && !defined(CONFIG_NET_IPIP_MODULE) && \ |
@@ -112,6 +116,8 @@ struct wireless_dev; | |||
112 | #define MAX_HEADER (LL_MAX_HEADER + 48) | 116 | #define MAX_HEADER (LL_MAX_HEADER + 48) |
113 | #endif | 117 | #endif |
114 | 118 | ||
119 | #endif /* __KERNEL__ */ | ||
120 | |||
115 | struct net_device_subqueue | 121 | struct net_device_subqueue |
116 | { | 122 | { |
117 | /* Give a control state for each queue. This struct may contain | 123 | /* Give a control state for each queue. This struct may contain |
@@ -244,11 +250,16 @@ struct hh_cache | |||
244 | * | 250 | * |
245 | * We could use other alignment values, but we must maintain the | 251 | * We could use other alignment values, but we must maintain the |
246 | * relationship HH alignment <= LL alignment. | 252 | * relationship HH alignment <= LL alignment. |
253 | * | ||
254 | * LL_ALLOCATED_SPACE also takes into account the tailroom the device | ||
255 | * may need. | ||
247 | */ | 256 | */ |
248 | #define LL_RESERVED_SPACE(dev) \ | 257 | #define LL_RESERVED_SPACE(dev) \ |
249 | (((dev)->hard_header_len&~(HH_DATA_MOD - 1)) + HH_DATA_MOD) | 258 | ((((dev)->hard_header_len+(dev)->needed_headroom)&~(HH_DATA_MOD - 1)) + HH_DATA_MOD) |
250 | #define LL_RESERVED_SPACE_EXTRA(dev,extra) \ | 259 | #define LL_RESERVED_SPACE_EXTRA(dev,extra) \ |
251 | ((((dev)->hard_header_len+extra)&~(HH_DATA_MOD - 1)) + HH_DATA_MOD) | 260 | ((((dev)->hard_header_len+(dev)->needed_headroom+(extra))&~(HH_DATA_MOD - 1)) + HH_DATA_MOD) |
261 | #define LL_ALLOCATED_SPACE(dev) \ | ||
262 | ((((dev)->hard_header_len+(dev)->needed_headroom+(dev)->needed_tailroom)&~(HH_DATA_MOD - 1)) + HH_DATA_MOD) | ||
252 | 263 | ||
253 | struct header_ops { | 264 | struct header_ops { |
254 | int (*create) (struct sk_buff *skb, struct net_device *dev, | 265 | int (*create) (struct sk_buff *skb, struct net_device *dev, |
@@ -567,6 +578,13 @@ struct net_device | |||
567 | unsigned short type; /* interface hardware type */ | 578 | unsigned short type; /* interface hardware type */ |
568 | unsigned short hard_header_len; /* hardware hdr length */ | 579 | unsigned short hard_header_len; /* hardware hdr length */ |
569 | 580 | ||
581 | /* extra head- and tailroom the hardware may need, but not in all cases | ||
582 | * can this be guaranteed, especially tailroom. Some cases also use | ||
583 | * LL_MAX_HEADER instead to allocate the skb. | ||
584 | */ | ||
585 | unsigned short needed_headroom; | ||
586 | unsigned short needed_tailroom; | ||
587 | |||
570 | struct net_device *master; /* Pointer to master device of a group, | 588 | struct net_device *master; /* Pointer to master device of a group, |
571 | * which this device is member of. | 589 | * which this device is member of. |
572 | */ | 590 | */ |
@@ -715,6 +733,9 @@ struct net_device | |||
715 | struct net *nd_net; | 733 | struct net *nd_net; |
716 | #endif | 734 | #endif |
717 | 735 | ||
736 | /* mid-layer private */ | ||
737 | void *ml_priv; | ||
738 | |||
718 | /* bridge stuff */ | 739 | /* bridge stuff */ |
719 | struct net_bridge_port *br_port; | 740 | struct net_bridge_port *br_port; |
720 | /* macvlan */ | 741 | /* macvlan */ |
@@ -728,6 +749,9 @@ struct net_device | |||
728 | /* rtnetlink link ops */ | 749 | /* rtnetlink link ops */ |
729 | const struct rtnl_link_ops *rtnl_link_ops; | 750 | const struct rtnl_link_ops *rtnl_link_ops; |
730 | 751 | ||
752 | /* VLAN feature mask */ | ||
753 | unsigned long vlan_features; | ||
754 | |||
731 | /* for setting kernel sock attribute on TCP connection setup */ | 755 | /* for setting kernel sock attribute on TCP connection setup */ |
732 | #define GSO_MAX_SIZE 65536 | 756 | #define GSO_MAX_SIZE 65536 |
733 | unsigned int gso_max_size; | 757 | unsigned int gso_max_size; |