diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-05-12 23:48:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-05-12 23:48:31 -0400 |
commit | f5184d267c1aedb9b7a8cc44e08ff6b8d382c3b5 (patch) | |
tree | 5ccce7558f9e1e53e5b189d6e2fe62a667988ac8 /include | |
parent | 8388e3da34edb141362bb42811ee487dfec15525 (diff) |
net: Allow netdevices to specify needed head/tailroom
This patch adds needed_headroom/needed_tailroom members to struct
net_device and updates many places that allocate sbks to use them. Not
all of them can be converted though, and I'm sure I missed some (I
mostly grepped for LL_RESERVED_SPACE)
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/netdevice.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index a3fb57fde623..b11e6e19e96c 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -246,11 +246,16 @@ struct hh_cache | |||
246 | * | 246 | * |
247 | * We could use other alignment values, but we must maintain the | 247 | * We could use other alignment values, but we must maintain the |
248 | * relationship HH alignment <= LL alignment. | 248 | * relationship HH alignment <= LL alignment. |
249 | * | ||
250 | * LL_ALLOCATED_SPACE also takes into account the tailroom the device | ||
251 | * may need. | ||
249 | */ | 252 | */ |
250 | #define LL_RESERVED_SPACE(dev) \ | 253 | #define LL_RESERVED_SPACE(dev) \ |
251 | (((dev)->hard_header_len&~(HH_DATA_MOD - 1)) + HH_DATA_MOD) | 254 | ((((dev)->hard_header_len+(dev)->needed_headroom)&~(HH_DATA_MOD - 1)) + HH_DATA_MOD) |
252 | #define LL_RESERVED_SPACE_EXTRA(dev,extra) \ | 255 | #define LL_RESERVED_SPACE_EXTRA(dev,extra) \ |
253 | ((((dev)->hard_header_len+extra)&~(HH_DATA_MOD - 1)) + HH_DATA_MOD) | 256 | ((((dev)->hard_header_len+(dev)->needed_headroom+(extra))&~(HH_DATA_MOD - 1)) + HH_DATA_MOD) |
257 | #define LL_ALLOCATED_SPACE(dev) \ | ||
258 | ((((dev)->hard_header_len+(dev)->needed_headroom+(dev)->needed_tailroom)&~(HH_DATA_MOD - 1)) + HH_DATA_MOD) | ||
254 | 259 | ||
255 | struct header_ops { | 260 | struct header_ops { |
256 | int (*create) (struct sk_buff *skb, struct net_device *dev, | 261 | int (*create) (struct sk_buff *skb, struct net_device *dev, |
@@ -569,6 +574,13 @@ struct net_device | |||
569 | unsigned short type; /* interface hardware type */ | 574 | unsigned short type; /* interface hardware type */ |
570 | unsigned short hard_header_len; /* hardware hdr length */ | 575 | unsigned short hard_header_len; /* hardware hdr length */ |
571 | 576 | ||
577 | /* extra head- and tailroom the hardware may need, but not in all cases | ||
578 | * can this be guaranteed, especially tailroom. Some cases also use | ||
579 | * LL_MAX_HEADER instead to allocate the skb. | ||
580 | */ | ||
581 | unsigned short needed_headroom; | ||
582 | unsigned short needed_tailroom; | ||
583 | |||
572 | struct net_device *master; /* Pointer to master device of a group, | 584 | struct net_device *master; /* Pointer to master device of a group, |
573 | * which this device is member of. | 585 | * which this device is member of. |
574 | */ | 586 | */ |