Skip to content

Commit f3994ec

Browse files
jmbergdavem330
authored andcommitted
mac80211: assign needed_headroom/tailroom for netdevs
This assigns the netdev's needed_headroom/tailroom members to take advantage of pre-allocated space for 802.11 headers. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f5184d2 commit f3994ec

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

net/mac80211/iface.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ int ieee80211_if_add(struct net_device *dev, const char *name,
5454
if (!ndev)
5555
return -ENOMEM;
5656

57+
ndev->needed_headroom = local->tx_headroom +
58+
4*6 /* four MAC addresses */
59+
+ 2 + 2 + 2 + 2 /* ctl, dur, seq, qos */
60+
+ 6 /* mesh */
61+
+ 8 /* rfc1042/bridge tunnel */
62+
- ETH_HLEN /* ethernet hard_header_len */
63+
+ IEEE80211_ENCRYPT_HEADROOM;
64+
ndev->needed_tailroom = IEEE80211_ENCRYPT_TAILROOM;
65+
5766
ret = dev_alloc_name(ndev, ndev->name);
5867
if (ret < 0)
5968
goto fail;

0 commit comments

Comments
 (0)