diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-05-12 23:51:44 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-05-12 23:51:44 -0400 |
commit | f3994eceebf64cf356a82ffb2718ef538eb8d4f4 (patch) | |
tree | f5d6b53c6026d721a9ba7e31b16e281f02f20a21 /net/mac80211/iface.c | |
parent | f5184d267c1aedb9b7a8cc44e08ff6b8d382c3b5 (diff) |
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 <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mac80211/iface.c')
-rw-r--r-- | net/mac80211/iface.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 80954a512185..06e88a5a036d 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
@@ -54,6 +54,15 @@ int ieee80211_if_add(struct net_device *dev, const char *name, | |||
54 | if (!ndev) | 54 | if (!ndev) |
55 | return -ENOMEM; | 55 | return -ENOMEM; |
56 | 56 | ||
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 | |||
57 | ret = dev_alloc_name(ndev, ndev->name); | 66 | ret = dev_alloc_name(ndev, ndev->name); |
58 | if (ret < 0) | 67 | if (ret < 0) |
59 | goto fail; | 68 | goto fail; |