aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
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
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')
-rw-r--r--drivers/block/aoe/aoe.h2
-rw-r--r--drivers/ieee1394/eth1394.h2
-rw-r--r--drivers/media/dvb/dvb-core/dvb_net.c2
-rw-r--r--drivers/message/fusion/mptlan.c26
-rw-r--r--drivers/net/arcnet/capmode.c4
-rw-r--r--drivers/net/plip.c2
-rw-r--r--drivers/net/slip.c2
-rw-r--r--drivers/net/wan/hostess_sv11.c2
-rw-r--r--drivers/net/wan/sealevel.c2
-rw-r--r--drivers/net/wan/syncppp.c2
-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
-rw-r--r--drivers/s390/net/claw.c2
16 files changed, 39 insertions, 36 deletions
diff --git a/drivers/block/aoe/aoe.h b/drivers/block/aoe/aoe.h
index 4c34f8d31cc9..1d8466817943 100644
--- a/drivers/block/aoe/aoe.h
+++ b/drivers/block/aoe/aoe.h
@@ -53,7 +53,7 @@ struct aoe_hdr {
53 53
54static inline struct aoe_hdr *aoe_hdr(const struct sk_buff *skb) 54static inline struct aoe_hdr *aoe_hdr(const struct sk_buff *skb)
55{ 55{
56 return (struct aoe_hdr *)skb->mac.raw; 56 return (struct aoe_hdr *)skb_mac_header(skb);
57} 57}
58#endif 58#endif
59 59
diff --git a/drivers/ieee1394/eth1394.h b/drivers/ieee1394/eth1394.h
index c45cbff9138d..1e8356535149 100644
--- a/drivers/ieee1394/eth1394.h
+++ b/drivers/ieee1394/eth1394.h
@@ -90,7 +90,7 @@ struct eth1394hdr {
90 90
91static inline struct eth1394hdr *eth1394_hdr(const struct sk_buff *skb) 91static inline struct eth1394hdr *eth1394_hdr(const struct sk_buff *skb)
92{ 92{
93 return (struct eth1394hdr *)skb->mac.raw; 93 return (struct eth1394hdr *)skb_mac_header(skb);
94} 94}
95#endif 95#endif
96 96
diff --git a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c
index 76e9c36597eb..c6b004182d91 100644
--- a/drivers/media/dvb/dvb-core/dvb_net.c
+++ b/drivers/media/dvb/dvb-core/dvb_net.c
@@ -174,7 +174,7 @@ static unsigned short dvb_net_eth_type_trans(struct sk_buff *skb,
174 struct ethhdr *eth; 174 struct ethhdr *eth;
175 unsigned char *rawp; 175 unsigned char *rawp;
176 176
177 skb->mac.raw=skb->data; 177 skb_reset_mac_header(skb);
178 skb_pull(skb,dev->hard_header_len); 178 skb_pull(skb,dev->hard_header_len);
179 eth = eth_hdr(skb); 179 eth = eth_hdr(skb);
180 180
diff --git a/drivers/message/fusion/mptlan.c b/drivers/message/fusion/mptlan.c
index d5b878d56280..21fe1b66808c 100644
--- a/drivers/message/fusion/mptlan.c
+++ b/drivers/message/fusion/mptlan.c
@@ -714,6 +714,7 @@ mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev)
714 LANSendRequest_t *pSendReq; 714 LANSendRequest_t *pSendReq;
715 SGETransaction32_t *pTrans; 715 SGETransaction32_t *pTrans;
716 SGESimple64_t *pSimple; 716 SGESimple64_t *pSimple;
717 const unsigned char *mac;
717 dma_addr_t dma; 718 dma_addr_t dma;
718 unsigned long flags; 719 unsigned long flags;
719 int ctx; 720 int ctx;
@@ -784,6 +785,7 @@ mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev)
784// IOC_AND_NETDEV_NAMES_s_s(dev), 785// IOC_AND_NETDEV_NAMES_s_s(dev),
785// ctx, skb, skb->data)); 786// ctx, skb, skb->data));
786 787
788 mac = skb_mac_header(skb);
787#ifdef QLOGIC_NAA_WORKAROUND 789#ifdef QLOGIC_NAA_WORKAROUND
788{ 790{
789 struct NAA_Hosed *nh; 791 struct NAA_Hosed *nh;
@@ -793,12 +795,12 @@ mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev)
793 drops. */ 795 drops. */
794 read_lock_irq(&bad_naa_lock); 796 read_lock_irq(&bad_naa_lock);
795 for (nh = mpt_bad_naa; nh != NULL; nh=nh->next) { 797 for (nh = mpt_bad_naa; nh != NULL; nh=nh->next) {
796 if ((nh->ieee[0] == skb->mac.raw[0]) && 798 if ((nh->ieee[0] == mac[0]) &&
797 (nh->ieee[1] == skb->mac.raw[1]) && 799 (nh->ieee[1] == mac[1]) &&
798 (nh->ieee[2] == skb->mac.raw[2]) && 800 (nh->ieee[2] == mac[2]) &&
799 (nh->ieee[3] == skb->mac.raw[3]) && 801 (nh->ieee[3] == mac[3]) &&
800 (nh->ieee[4] == skb->mac.raw[4]) && 802 (nh->ieee[4] == mac[4]) &&
801 (nh->ieee[5] == skb->mac.raw[5])) { 803 (nh->ieee[5] == mac[5])) {
802 cur_naa = nh->NAA; 804 cur_naa = nh->NAA;
803 dlprintk ((KERN_INFO "mptlan/sdu_send: using NAA value " 805 dlprintk ((KERN_INFO "mptlan/sdu_send: using NAA value "
804 "= %04x.\n", cur_naa)); 806 "= %04x.\n", cur_naa));
@@ -810,12 +812,12 @@ mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev)
810#endif 812#endif
811 813
812 pTrans->TransactionDetails[0] = cpu_to_le32((cur_naa << 16) | 814 pTrans->TransactionDetails[0] = cpu_to_le32((cur_naa << 16) |
813 (skb->mac.raw[0] << 8) | 815 (mac[0] << 8) |
814 (skb->mac.raw[1] << 0)); 816 (mac[1] << 0));
815 pTrans->TransactionDetails[1] = cpu_to_le32((skb->mac.raw[2] << 24) | 817 pTrans->TransactionDetails[1] = cpu_to_le32((mac[2] << 24) |
816 (skb->mac.raw[3] << 16) | 818 (mac[3] << 16) |
817 (skb->mac.raw[4] << 8) | 819 (mac[4] << 8) |
818 (skb->mac.raw[5] << 0)); 820 (mac[5] << 0));
819 821
820 pSimple = (SGESimple64_t *) &pTrans->TransactionDetails[2]; 822 pSimple = (SGESimple64_t *) &pTrans->TransactionDetails[2];
821 823
diff --git a/drivers/net/arcnet/capmode.c b/drivers/net/arcnet/capmode.c
index 6c764b66e9cc..f6a87bd20ff2 100644
--- a/drivers/net/arcnet/capmode.c
+++ b/drivers/net/arcnet/capmode.c
@@ -123,7 +123,7 @@ static void rx(struct net_device *dev, int bufnum,
123 skb_put(skb, length + ARC_HDR_SIZE + sizeof(int)); 123 skb_put(skb, length + ARC_HDR_SIZE + sizeof(int));
124 skb->dev = dev; 124 skb->dev = dev;
125 skb_reset_mac_header(skb); 125 skb_reset_mac_header(skb);
126 pkt = (struct archdr *)skb->mac.raw; 126 pkt = (struct archdr *)skb_mac_header(skb);
127 skb_pull(skb, ARC_HDR_SIZE); 127 skb_pull(skb, ARC_HDR_SIZE);
128 128
129 /* up to sizeof(pkt->soft) has already been copied from the card */ 129 /* up to sizeof(pkt->soft) has already been copied from the card */
@@ -269,7 +269,7 @@ static int ack_tx(struct net_device *dev, int acked)
269 ackskb->dev = dev; 269 ackskb->dev = dev;
270 270
271 skb_reset_mac_header(ackskb); 271 skb_reset_mac_header(ackskb);
272 ackpkt = (struct archdr *)ackskb->mac.raw; 272 ackpkt = (struct archdr *)skb_mac_header(ackskb);
273 /* skb_pull(ackskb, ARC_HDR_SIZE); */ 273 /* skb_pull(ackskb, ARC_HDR_SIZE); */
274 274
275 275
diff --git a/drivers/net/plip.c b/drivers/net/plip.c
index 6bb085f54437..8754cf3356b0 100644
--- a/drivers/net/plip.c
+++ b/drivers/net/plip.c
@@ -546,7 +546,7 @@ static __be16 plip_type_trans(struct sk_buff *skb, struct net_device *dev)
546 struct ethhdr *eth; 546 struct ethhdr *eth;
547 unsigned char *rawp; 547 unsigned char *rawp;
548 548
549 skb->mac.raw=skb->data; 549 skb_reset_mac_header(skb);
550 skb_pull(skb,dev->hard_header_len); 550 skb_pull(skb,dev->hard_header_len);
551 eth = eth_hdr(skb); 551 eth = eth_hdr(skb);
552 552
diff --git a/drivers/net/slip.c b/drivers/net/slip.c
index 2f4b1de7a2b4..65bd20fac820 100644
--- a/drivers/net/slip.c
+++ b/drivers/net/slip.c
@@ -363,7 +363,7 @@ sl_bump(struct slip *sl)
363 } 363 }
364 skb->dev = sl->dev; 364 skb->dev = sl->dev;
365 memcpy(skb_put(skb,count), sl->rbuff, count); 365 memcpy(skb_put(skb,count), sl->rbuff, count);
366 skb->mac.raw=skb->data; 366 skb_reset_mac_header(skb);
367 skb->protocol=htons(ETH_P_IP); 367 skb->protocol=htons(ETH_P_IP);
368 netif_rx(skb); 368 netif_rx(skb);
369 sl->dev->last_rx = jiffies; 369 sl->dev->last_rx = jiffies;
diff --git a/drivers/net/wan/hostess_sv11.c b/drivers/net/wan/hostess_sv11.c
index a02c5fb40567..9ba3e4ee6ec7 100644
--- a/drivers/net/wan/hostess_sv11.c
+++ b/drivers/net/wan/hostess_sv11.c
@@ -59,7 +59,7 @@ static void hostess_input(struct z8530_channel *c, struct sk_buff *skb)
59 /* Drop the CRC - it's not a good idea to try and negotiate it ;) */ 59 /* Drop the CRC - it's not a good idea to try and negotiate it ;) */
60 skb_trim(skb, skb->len-2); 60 skb_trim(skb, skb->len-2);
61 skb->protocol=__constant_htons(ETH_P_WAN_PPP); 61 skb->protocol=__constant_htons(ETH_P_WAN_PPP);
62 skb->mac.raw=skb->data; 62 skb_reset_mac_header(skb);
63 skb->dev=c->netdevice; 63 skb->dev=c->netdevice;
64 /* 64 /*
65 * Send it to the PPP layer. We don't have time to process 65 * Send it to the PPP layer. We don't have time to process
diff --git a/drivers/net/wan/sealevel.c b/drivers/net/wan/sealevel.c
index 70fb1b98b1dd..131358108c5a 100644
--- a/drivers/net/wan/sealevel.c
+++ b/drivers/net/wan/sealevel.c
@@ -61,7 +61,7 @@ static void sealevel_input(struct z8530_channel *c, struct sk_buff *skb)
61 /* Drop the CRC - it's not a good idea to try and negotiate it ;) */ 61 /* Drop the CRC - it's not a good idea to try and negotiate it ;) */
62 skb_trim(skb, skb->len-2); 62 skb_trim(skb, skb->len-2);
63 skb->protocol=htons(ETH_P_WAN_PPP); 63 skb->protocol=htons(ETH_P_WAN_PPP);
64 skb->mac.raw=skb->data; 64 skb_reset_mac_header(skb);
65 skb->dev=c->netdevice; 65 skb->dev=c->netdevice;
66 /* 66 /*
67 * Send it to the PPP layer. We don't have time to process 67 * Send it to the PPP layer. We don't have time to process
diff --git a/drivers/net/wan/syncppp.c b/drivers/net/wan/syncppp.c
index 218f7b574ab3..67fc67cfd452 100644
--- a/drivers/net/wan/syncppp.c
+++ b/drivers/net/wan/syncppp.c
@@ -227,7 +227,7 @@ static void sppp_input (struct net_device *dev, struct sk_buff *skb)
227 unsigned long flags; 227 unsigned long flags;
228 228
229 skb->dev=dev; 229 skb->dev=dev;
230 skb->mac.raw=skb->data; 230 skb_reset_mac_header(skb);
231 231
232 if (dev->flags & IFF_RUNNING) 232 if (dev->flags & IFF_RUNNING)
233 { 233 {
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);
diff --git a/drivers/s390/net/claw.c b/drivers/s390/net/claw.c
index 7809a79feec7..6dd64d0c8d45 100644
--- a/drivers/s390/net/claw.c
+++ b/drivers/s390/net/claw.c
@@ -3525,8 +3525,8 @@ unpack_next:
3525 memcpy(skb_put(skb,len_of_data), 3525 memcpy(skb_put(skb,len_of_data),
3526 privptr->p_mtc_envelope, 3526 privptr->p_mtc_envelope,
3527 len_of_data); 3527 len_of_data);
3528 skb->mac.raw=skb->data;
3529 skb->dev=dev; 3528 skb->dev=dev;
3529 skb_reset_mac_header(skb);
3530 skb->protocol=htons(ETH_P_IP); 3530 skb->protocol=htons(ETH_P_IP);
3531 skb->ip_summed=CHECKSUM_UNNECESSARY; 3531 skb->ip_summed=CHECKSUM_UNNECESSARY;
3532 privptr->stats.rx_packets++; 3532 privptr->stats.rx_packets++;