aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-03-19 18:33:04 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:24:41 -0400
commit98e399f82ab3a6d863d1d4a7ea48925cc91c830e (patch)
tree5f84043aeec1ec27c2e8e6cc25b5d2e6c3d07343 /drivers/net/wireless
parent31713c333ddbb66d694829082620b69b71c4b09a (diff)
[SK_BUFF]: Introduce skb_mac_header()
For the places where we need a pointer to the mac header, it is still legal to touch skb->mac.raw directly if just adding to, subtracting from or setting it to another layer header. This one also converts some more cases to skb_reset_mac_header() that my regex missed as it had no spaces before nor after '=', ugh. 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')
-rw-r--r--drivers/net/wireless/airo.c2
-rw-r--r--drivers/net/wireless/hostap/hostap_main.c14
-rw-r--r--drivers/net/wireless/orinoco.c2
-rw-r--r--drivers/net/wireless/wavelan.c5
-rw-r--r--drivers/net/wireless/wavelan_cs.c4
5 files changed, 14 insertions, 13 deletions
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 692a23f9834d..7fe0a61091a6 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -2444,7 +2444,7 @@ static int add_airo_dev( struct net_device *dev );
2444 2444
2445static int wll_header_parse(struct sk_buff *skb, unsigned char *haddr) 2445static int wll_header_parse(struct sk_buff *skb, unsigned char *haddr)
2446{ 2446{
2447 memcpy(haddr, skb->mac.raw + 10, ETH_ALEN); 2447 memcpy(haddr, skb_mac_header(skb) + 10, ETH_ALEN);
2448 return ETH_ALEN; 2448 return ETH_ALEN;
2449} 2449}
2450 2450
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c
index 0e29ff762879..c2616e7b0059 100644
--- a/drivers/net/wireless/hostap/hostap_main.c
+++ b/drivers/net/wireless/hostap/hostap_main.c
@@ -590,20 +590,20 @@ void hostap_dump_tx_header(const char *name, const struct hfa384x_tx_frame *tx)
590 590
591int hostap_80211_header_parse(struct sk_buff *skb, unsigned char *haddr) 591int hostap_80211_header_parse(struct sk_buff *skb, unsigned char *haddr)
592{ 592{
593 memcpy(haddr, skb->mac.raw + 10, ETH_ALEN); /* addr2 */ 593 memcpy(haddr, skb_mac_header(skb) + 10, ETH_ALEN); /* addr2 */
594 return ETH_ALEN; 594 return ETH_ALEN;
595} 595}
596 596
597 597
598int hostap_80211_prism_header_parse(struct sk_buff *skb, unsigned char *haddr) 598int hostap_80211_prism_header_parse(struct sk_buff *skb, unsigned char *haddr)
599{ 599{
600 if (*(u32 *)skb->mac.raw == LWNG_CAP_DID_BASE) { 600 const unsigned char *mac = skb_mac_header(skb);
601 memcpy(haddr, skb->mac.raw + 601
602 sizeof(struct linux_wlan_ng_prism_hdr) + 10, 602 if (*(u32 *)mac == LWNG_CAP_DID_BASE) {
603 memcpy(haddr, mac + sizeof(struct linux_wlan_ng_prism_hdr) + 10,
603 ETH_ALEN); /* addr2 */ 604 ETH_ALEN); /* addr2 */
604 } else { /* (*(u32 *)skb->mac.raw == htonl(LWNG_CAPHDR_VERSION)) */ 605 } else { /* (*(u32 *)mac == htonl(LWNG_CAPHDR_VERSION)) */
605 memcpy(haddr, skb->mac.raw + 606 memcpy(haddr, mac + sizeof(struct linux_wlan_ng_cap_hdr) + 10,
606 sizeof(struct linux_wlan_ng_cap_hdr) + 10,
607 ETH_ALEN); /* addr2 */ 607 ETH_ALEN); /* addr2 */
608 } 608 }
609 return ETH_ALEN; 609 return ETH_ALEN;
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
index f1415bff527f..062286dc8e15 100644
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -689,7 +689,7 @@ static void orinoco_stat_gather(struct net_device *dev,
689 /* Note : gcc will optimise the whole section away if 689 /* Note : gcc will optimise the whole section away if
690 * WIRELESS_SPY is not defined... - Jean II */ 690 * WIRELESS_SPY is not defined... - Jean II */
691 if (SPY_NUMBER(priv)) { 691 if (SPY_NUMBER(priv)) {
692 orinoco_spy_gather(dev, skb->mac.raw + ETH_ALEN, 692 orinoco_spy_gather(dev, skb_mac_header(skb) + ETH_ALEN,
693 desc->signal, desc->silence); 693 desc->signal, desc->silence);
694 } 694 }
695} 695}
diff --git a/drivers/net/wireless/wavelan.c b/drivers/net/wireless/wavelan.c
index 69cb1471096b..2bf77b1ee531 100644
--- a/drivers/net/wireless/wavelan.c
+++ b/drivers/net/wireless/wavelan.c
@@ -2517,7 +2517,8 @@ wv_packet_read(struct net_device * dev, u16 buf_off, int sksize)
2517 skb->protocol = eth_type_trans(skb, dev); 2517 skb->protocol = eth_type_trans(skb, dev);
2518 2518
2519#ifdef DEBUG_RX_INFO 2519#ifdef DEBUG_RX_INFO
2520 wv_packet_info(skb->mac.raw, sksize, dev->name, "wv_packet_read"); 2520 wv_packet_info(skb_mac_header(skb), sksize, dev->name,
2521 "wv_packet_read");
2521#endif /* DEBUG_RX_INFO */ 2522#endif /* DEBUG_RX_INFO */
2522 2523
2523 /* Statistics-gathering and associated stuff. 2524 /* Statistics-gathering and associated stuff.
@@ -2553,7 +2554,7 @@ wv_packet_read(struct net_device * dev, u16 buf_off, int sksize)
2553 2554
2554 /* Spying stuff */ 2555 /* Spying stuff */
2555#ifdef IW_WIRELESS_SPY 2556#ifdef IW_WIRELESS_SPY
2556 wl_spy_gather(dev, skb->mac.raw + WAVELAN_ADDR_SIZE, 2557 wl_spy_gather(dev, skb_mac_header(skb) + WAVELAN_ADDR_SIZE,
2557 stats); 2558 stats);
2558#endif /* IW_WIRELESS_SPY */ 2559#endif /* IW_WIRELESS_SPY */
2559#ifdef HISTOGRAM 2560#ifdef HISTOGRAM
diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c
index 9351ee773314..67b867f837ca 100644
--- a/drivers/net/wireless/wavelan_cs.c
+++ b/drivers/net/wireless/wavelan_cs.c
@@ -2889,7 +2889,7 @@ wv_packet_read(struct net_device * dev,
2889 skb->protocol = eth_type_trans(skb, dev); 2889 skb->protocol = eth_type_trans(skb, dev);
2890 2890
2891#ifdef DEBUG_RX_INFO 2891#ifdef DEBUG_RX_INFO
2892 wv_packet_info(skb->mac.raw, sksize, dev->name, "wv_packet_read"); 2892 wv_packet_info(skb_mac_header(skb), sksize, dev->name, "wv_packet_read");
2893#endif /* DEBUG_RX_INFO */ 2893#endif /* DEBUG_RX_INFO */
2894 2894
2895 /* Statistics gathering & stuff associated. 2895 /* Statistics gathering & stuff associated.
@@ -2923,7 +2923,7 @@ wv_packet_read(struct net_device * dev,
2923#endif /* WAVELAN_ROAMING */ 2923#endif /* WAVELAN_ROAMING */
2924 2924
2925#ifdef WIRELESS_SPY 2925#ifdef WIRELESS_SPY
2926 wl_spy_gather(dev, skb->mac.raw + WAVELAN_ADDR_SIZE, stats); 2926 wl_spy_gather(dev, skb_mac_header(skb) + WAVELAN_ADDR_SIZE, stats);
2927#endif /* WIRELESS_SPY */ 2927#endif /* WIRELESS_SPY */
2928#ifdef HISTOGRAM 2928#ifdef HISTOGRAM
2929 wl_his_gather(dev, stats); 2929 wl_his_gather(dev, stats);