Skip to content

Commit

Permalink
mac80211: assign needed_headroom/tailroom for netdevs
Browse files Browse the repository at this point in the history
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 <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Johannes Berg authored and David S. Miller committed May 13, 2008
1 parent f5184d2 commit f3994ec
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions net/mac80211/iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ int ieee80211_if_add(struct net_device *dev, const char *name,
if (!ndev)
return -ENOMEM;

ndev->needed_headroom = local->tx_headroom +
4*6 /* four MAC addresses */
+ 2 + 2 + 2 + 2 /* ctl, dur, seq, qos */
+ 6 /* mesh */
+ 8 /* rfc1042/bridge tunnel */
- ETH_HLEN /* ethernet hard_header_len */
+ IEEE80211_ENCRYPT_HEADROOM;
ndev->needed_tailroom = IEEE80211_ENCRYPT_TAILROOM;

ret = dev_alloc_name(ndev, ndev->name);
if (ret < 0)
goto fail;
Expand Down

0 comments on commit f3994ec

Please sign in to comment.