diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-03-19 18:30:44 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:24:32 -0400 |
commit | 459a98ed881802dee55897441bc7f77af614368e (patch) | |
tree | b81f76632d8f2e21eb91ec3d885091a98398d93e /drivers/net/wireless/hostap | |
parent | 4c13eb6657fe9ef7b4dc8f1a405c902e9e5234e0 (diff) |
[SK_BUFF]: Introduce skb_reset_mac_header(skb)
For the common, open coded 'skb->mac.raw = skb->data' operation, so that we can
later turn skb->mac.raw into a offset, reducing the size of struct sk_buff in
64bit land while possibly keeping it as a pointer on 32bit.
This one touches just the most simple case, next will handle the slightly more
"complex" cases.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/hostap')
-rw-r--r-- | drivers/net/wireless/hostap/hostap_80211_rx.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_80211_tx.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_ap.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_hw.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_main.c | 3 |
5 files changed, 10 insertions, 7 deletions
diff --git a/drivers/net/wireless/hostap/hostap_80211_rx.c b/drivers/net/wireless/hostap/hostap_80211_rx.c index f78ee26d787a..e4082f9d766b 100644 --- a/drivers/net/wireless/hostap/hostap_80211_rx.c +++ b/drivers/net/wireless/hostap/hostap_80211_rx.c | |||
@@ -167,7 +167,7 @@ hdr->f.status = s; hdr->f.len = l; hdr->f.data = d | |||
167 | 167 | ||
168 | ret = skb->len - phdrlen; | 168 | ret = skb->len - phdrlen; |
169 | skb->dev = dev; | 169 | skb->dev = dev; |
170 | skb->mac.raw = skb->data; | 170 | skb_reset_mac_header(skb); |
171 | skb_pull(skb, hdrlen); | 171 | skb_pull(skb, hdrlen); |
172 | if (prism_header) | 172 | if (prism_header) |
173 | skb_pull(skb, phdrlen); | 173 | skb_pull(skb, phdrlen); |
@@ -1073,10 +1073,11 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb, | |||
1073 | 1073 | ||
1074 | if (skb2 != NULL) { | 1074 | if (skb2 != NULL) { |
1075 | /* send to wireless media */ | 1075 | /* send to wireless media */ |
1076 | skb2->dev = dev; | ||
1076 | skb2->protocol = __constant_htons(ETH_P_802_3); | 1077 | skb2->protocol = __constant_htons(ETH_P_802_3); |
1077 | skb2->mac.raw = skb2->nh.raw = skb2->data; | 1078 | skb_reset_mac_header(skb2); |
1079 | skb2->nh.raw = skb2->data; | ||
1078 | /* skb2->nh.raw = skb2->data + ETH_HLEN; */ | 1080 | /* skb2->nh.raw = skb2->data + ETH_HLEN; */ |
1079 | skb2->dev = dev; | ||
1080 | dev_queue_xmit(skb2); | 1081 | dev_queue_xmit(skb2); |
1081 | } | 1082 | } |
1082 | 1083 | ||
diff --git a/drivers/net/wireless/hostap/hostap_80211_tx.c b/drivers/net/wireless/hostap/hostap_80211_tx.c index 4a5be70c0419..159baef18e4a 100644 --- a/drivers/net/wireless/hostap/hostap_80211_tx.c +++ b/drivers/net/wireless/hostap/hostap_80211_tx.c | |||
@@ -237,7 +237,7 @@ int hostap_data_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
237 | iface->stats.tx_packets++; | 237 | iface->stats.tx_packets++; |
238 | iface->stats.tx_bytes += skb->len; | 238 | iface->stats.tx_bytes += skb->len; |
239 | 239 | ||
240 | skb->mac.raw = skb->data; | 240 | skb_reset_mac_header(skb); |
241 | meta = (struct hostap_skb_tx_data *) skb->cb; | 241 | meta = (struct hostap_skb_tx_data *) skb->cb; |
242 | memset(meta, 0, sizeof(*meta)); | 242 | memset(meta, 0, sizeof(*meta)); |
243 | meta->magic = HOSTAP_SKB_TX_DATA_MAGIC; | 243 | meta->magic = HOSTAP_SKB_TX_DATA_MAGIC; |
diff --git a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c index efb8cf3bd8ad..cc18f9686d27 100644 --- a/drivers/net/wireless/hostap/hostap_ap.c +++ b/drivers/net/wireless/hostap/hostap_ap.c | |||
@@ -982,7 +982,8 @@ static void prism2_send_mgmt(struct net_device *dev, | |||
982 | meta->tx_cb_idx = tx_cb_idx; | 982 | meta->tx_cb_idx = tx_cb_idx; |
983 | 983 | ||
984 | skb->dev = dev; | 984 | skb->dev = dev; |
985 | skb->mac.raw = skb->nh.raw = skb->data; | 985 | skb_reset_mac_header(skb); |
986 | skb->nh.raw = skb->data; | ||
986 | dev_queue_xmit(skb); | 987 | dev_queue_xmit(skb); |
987 | } | 988 | } |
988 | #endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ | 989 | #endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ |
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c index 3079378fb8cd..9003ff7d151a 100644 --- a/drivers/net/wireless/hostap/hostap_hw.c +++ b/drivers/net/wireless/hostap/hostap_hw.c | |||
@@ -2217,7 +2217,7 @@ static void hostap_tx_callback(local_info_t *local, | |||
2217 | memcpy(skb_put(skb, len), payload, len); | 2217 | memcpy(skb_put(skb, len), payload, len); |
2218 | 2218 | ||
2219 | skb->dev = local->dev; | 2219 | skb->dev = local->dev; |
2220 | skb->mac.raw = skb->data; | 2220 | skb_reset_mac_header(skb); |
2221 | 2221 | ||
2222 | cb->func(skb, ok, cb->data); | 2222 | cb->func(skb, ok, cb->data); |
2223 | } | 2223 | } |
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c index 9077e6edde34..0e29ff762879 100644 --- a/drivers/net/wireless/hostap/hostap_main.c +++ b/drivers/net/wireless/hostap/hostap_main.c | |||
@@ -1063,7 +1063,8 @@ int prism2_sta_send_mgmt(local_info_t *local, u8 *dst, u16 stype, | |||
1063 | meta->iface = netdev_priv(dev); | 1063 | meta->iface = netdev_priv(dev); |
1064 | 1064 | ||
1065 | skb->dev = dev; | 1065 | skb->dev = dev; |
1066 | skb->mac.raw = skb->nh.raw = skb->data; | 1066 | skb_reset_mac_header(skb); |
1067 | skb->nh.raw = skb->data; | ||
1067 | dev_queue_xmit(skb); | 1068 | dev_queue_xmit(skb); |
1068 | 1069 | ||
1069 | return 0; | 1070 | return 0; |