summaryrefslogtreecommitdiff
path: root/patches/0003-netdev-needed_headroom_tailroom.patch
blob: 7bcc86337c804eab9b2a83f09c086ddb55dfb620 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
This is an optimization introduced on newer kernels, just ignore for
older kernels on mac80211. For others the netdev->hard_header_len
could be used.

--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -1294,6 +1294,7 @@ int ieee80211_if_add(struct ieee80211_lo
 		return -ENOMEM;
 	dev_net_set(ndev, wiphy_net(local->hw.wiphy));
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26))
 	ndev->needed_headroom = local->tx_headroom +
 				4*6 /* four MAC addresses */
 				+ 2 + 2 + 2 + 2 /* ctl, dur, seq, qos */
@@ -1302,6 +1303,7 @@ int ieee80211_if_add(struct ieee80211_lo
 				- ETH_HLEN /* ethernet hard_header_len */
 				+ IEEE80211_ENCRYPT_HEADROOM;
 	ndev->needed_tailroom = IEEE80211_ENCRYPT_TAILROOM;
+#endif
 
 	ret = dev_alloc_name(ndev, ndev->name);
 	if (ret < 0)
--- a/drivers/net/wireless/orinoco/main.c
+++ b/drivers/net/wireless/orinoco/main.c
@@ -2285,7 +2285,11 @@ int orinoco_if_add(struct orinoco_privat
 	/* we use the default eth_mac_addr for setting the MAC addr */
 
 	/* Reserve space in skb for the SNAP header */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26))
 	dev->needed_headroom = ENCAPS_OVERHEAD;
+#else
+	dev->hard_header_len += ENCAPS_OVERHEAD;
+#endif
 
 	netif_carrier_off(dev);