aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-03-19 18:30:44 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:24:32 -0400
commit459a98ed881802dee55897441bc7f77af614368e (patch)
treeb81f76632d8f2e21eb91ec3d885091a98398d93e
parent4c13eb6657fe9ef7b4dc8f1a405c902e9e5234e0 (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>
-rw-r--r--arch/um/drivers/net_kern.c2
-rw-r--r--arch/xtensa/platform-iss/network.c2
-rw-r--r--drivers/block/aoe/aoecmd.c3
-rw-r--r--drivers/ieee1394/eth1394.c2
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_cm.c2
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_ib.c2
-rw-r--r--drivers/isdn/i4l/isdn_net.c4
-rw-r--r--drivers/isdn/i4l/isdn_ppp.c2
-rw-r--r--drivers/message/fusion/mptlan.c4
-rw-r--r--drivers/net/appletalk/cops.c2
-rw-r--r--drivers/net/appletalk/ltpc.c2
-rw-r--r--drivers/net/arcnet/arc-rawmode.c2
-rw-r--r--drivers/net/arcnet/capmode.c11
-rw-r--r--drivers/net/arcnet/rfc1051.c2
-rw-r--r--drivers/net/arcnet/rfc1201.c2
-rw-r--r--drivers/net/bonding/bond_3ad.c4
-rw-r--r--drivers/net/bonding/bond_alb.c4
-rw-r--r--drivers/net/cxgb3/cxgb3_offload.c2
-rw-r--r--drivers/net/cxgb3/sge.c3
-rw-r--r--drivers/net/irda/ali-ircc.c2
-rw-r--r--drivers/net/irda/au1k_ir.c2
-rw-r--r--drivers/net/irda/donauboe.c2
-rw-r--r--drivers/net/irda/irda-usb.c2
-rw-r--r--drivers/net/irda/mcs7780.c4
-rw-r--r--drivers/net/irda/nsc-ircc.c2
-rw-r--r--drivers/net/irda/pxaficp_ir.c2
-rw-r--r--drivers/net/irda/sa1100_ir.c2
-rw-r--r--drivers/net/irda/smsc-ircc2.c2
-rw-r--r--drivers/net/irda/stir4200.c2
-rw-r--r--drivers/net/irda/via-ircc.c8
-rw-r--r--drivers/net/irda/vlsi_ir.c2
-rw-r--r--drivers/net/irda/w83977af_ir.c2
-rw-r--r--drivers/net/myri_sbus.c2
-rw-r--r--drivers/net/ppp_generic.c2
-rw-r--r--drivers/net/sb1000.c2
-rw-r--r--drivers/net/tun.c2
-rw-r--r--drivers/net/wan/cosa.c2
-rw-r--r--drivers/net/wan/cycx_x25.c2
-rw-r--r--drivers/net/wan/dlci.c2
-rw-r--r--drivers/net/wan/farsync.c2
-rw-r--r--drivers/net/wan/lmc/lmc_main.c4
-rw-r--r--drivers/net/wan/pc300_drv.c2
-rw-r--r--drivers/net/wan/pc300_tty.c2
-rw-r--r--drivers/net/wireless/airo.c4
-rw-r--r--drivers/net/wireless/hostap/hostap_80211_rx.c7
-rw-r--r--drivers/net/wireless/hostap/hostap_80211_tx.c2
-rw-r--r--drivers/net/wireless/hostap/hostap_ap.c3
-rw-r--r--drivers/net/wireless/hostap/hostap_hw.c2
-rw-r--r--drivers/net/wireless/hostap/hostap_main.c3
-rw-r--r--drivers/net/wireless/ipw2200.c2
-rw-r--r--drivers/net/wireless/orinoco.c2
-rw-r--r--drivers/net/wireless/prism54/islpci_eth.c2
-rw-r--r--drivers/net/wireless/strip.c2
-rw-r--r--drivers/s390/net/ctcmain.c4
-rw-r--r--drivers/s390/net/netiucv.c4
-rw-r--r--drivers/s390/net/qeth_eddp.c2
-rw-r--r--drivers/s390/net/qeth_main.c4
-rw-r--r--include/linux/hdlc.h4
-rw-r--r--include/linux/skbuff.h5
-rw-r--r--include/net/ax25.h2
-rw-r--r--include/net/x25device.h2
-rw-r--r--net/802/fddi.c2
-rw-r--r--net/802/hippi.c2
-rw-r--r--net/802/tr.c2
-rw-r--r--net/atm/br2684.c2
-rw-r--r--net/atm/clip.c2
-rw-r--r--net/ax25/ax25_in.c2
-rw-r--r--net/bluetooth/bnep/core.c2
-rw-r--r--net/bridge/br_device.c2
-rw-r--r--net/core/dev.c4
-rw-r--r--net/core/netpoll.c2
-rw-r--r--net/core/skbuff.c2
-rw-r--r--net/decnet/dn_route.c2
-rw-r--r--net/ethernet/eth.c2
-rw-r--r--net/ieee80211/ieee80211_rx.c7
-rw-r--r--net/ipv4/ip_gre.c2
-rw-r--r--net/ipv4/ip_output.c2
-rw-r--r--net/ipv4/route.c3
-rw-r--r--net/ipv6/ip6_output.c2
-rw-r--r--net/ipv6/route.c2
-rw-r--r--net/irda/irlap_frame.c3
-rw-r--r--net/irda/wrapper.c2
-rw-r--r--net/llc/llc_output.c2
-rw-r--r--net/netrom/nr_dev.c2
-rw-r--r--net/wanrouter/wanmain.c2
85 files changed, 119 insertions, 109 deletions
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c
index 04e31f86c10a..859303730b2f 100644
--- a/arch/um/drivers/net_kern.c
+++ b/arch/um/drivers/net_kern.c
@@ -55,7 +55,7 @@ static int uml_net_rx(struct net_device *dev)
55 55
56 skb->dev = dev; 56 skb->dev = dev;
57 skb_put(skb, dev->mtu); 57 skb_put(skb, dev->mtu);
58 skb->mac.raw = skb->data; 58 skb_reset_mac_header(skb);
59 pkt_len = (*lp->read)(lp->fd, &skb, lp); 59 pkt_len = (*lp->read)(lp->fd, &skb, lp);
60 60
61 if (pkt_len > 0) { 61 if (pkt_len > 0) {
diff --git a/arch/xtensa/platform-iss/network.c b/arch/xtensa/platform-iss/network.c
index 8ebfc8761229..ab05bff40104 100644
--- a/arch/xtensa/platform-iss/network.c
+++ b/arch/xtensa/platform-iss/network.c
@@ -386,7 +386,7 @@ static int iss_net_rx(struct net_device *dev)
386 /* Setup skb */ 386 /* Setup skb */
387 387
388 skb->dev = dev; 388 skb->dev = dev;
389 skb->mac.raw = skb->data; 389 skb_reset_mac_header(skb);
390 pkt_len = lp->tp.read(lp, &skb); 390 pkt_len = lp->tp.read(lp, &skb);
391 skb_put(skb, pkt_len); 391 skb_put(skb, pkt_len);
392 392
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
index 4ab7b40e8c5a..74062dc4e90d 100644
--- a/drivers/block/aoe/aoecmd.c
+++ b/drivers/block/aoe/aoecmd.c
@@ -27,7 +27,8 @@ new_skb(ulong len)
27 27
28 skb = alloc_skb(len, GFP_ATOMIC); 28 skb = alloc_skb(len, GFP_ATOMIC);
29 if (skb) { 29 if (skb) {
30 skb->nh.raw = skb->mac.raw = skb->data; 30 skb_reset_mac_header(skb);
31 skb->nh.raw = skb->data;
31 skb->protocol = __constant_htons(ETH_P_AOE); 32 skb->protocol = __constant_htons(ETH_P_AOE);
32 skb->priority = 0; 33 skb->priority = 0;
33 skb->next = skb->prev = NULL; 34 skb->next = skb->prev = NULL;
diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c
index 03e44b337eb0..db2346f4d207 100644
--- a/drivers/ieee1394/eth1394.c
+++ b/drivers/ieee1394/eth1394.c
@@ -834,7 +834,7 @@ static inline u16 ether1394_type_trans(struct sk_buff *skb,
834 struct eth1394hdr *eth; 834 struct eth1394hdr *eth;
835 unsigned char *rawp; 835 unsigned char *rawp;
836 836
837 skb->mac.raw = skb->data; 837 skb_reset_mac_header(skb);
838 skb_pull (skb, ETH1394_HLEN); 838 skb_pull (skb, ETH1394_HLEN);
839 eth = eth1394_hdr(skb); 839 eth = eth1394_hdr(skb);
840 840
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index 2b242a4823f8..c722e5c141b3 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -408,7 +408,7 @@ void ipoib_cm_handle_rx_wc(struct net_device *dev, struct ib_wc *wc)
408 skb_put_frags(skb, IPOIB_CM_HEAD_SIZE, wc->byte_len, newskb); 408 skb_put_frags(skb, IPOIB_CM_HEAD_SIZE, wc->byte_len, newskb);
409 409
410 skb->protocol = ((struct ipoib_header *) skb->data)->proto; 410 skb->protocol = ((struct ipoib_header *) skb->data)->proto;
411 skb->mac.raw = skb->data; 411 skb_reset_mac_header(skb);
412 skb_pull(skb, IPOIB_ENCAP_LEN); 412 skb_pull(skb, IPOIB_ENCAP_LEN);
413 413
414 dev->last_rx = jiffies; 414 dev->last_rx = jiffies;
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
index ba0ee5cf2ad7..93f74567897e 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
@@ -216,7 +216,7 @@ static void ipoib_ib_handle_rx_wc(struct net_device *dev, struct ib_wc *wc)
216 if (wc->slid != priv->local_lid || 216 if (wc->slid != priv->local_lid ||
217 wc->src_qp != priv->qp->qp_num) { 217 wc->src_qp != priv->qp->qp_num) {
218 skb->protocol = ((struct ipoib_header *) skb->data)->proto; 218 skb->protocol = ((struct ipoib_header *) skb->data)->proto;
219 skb->mac.raw = skb->data; 219 skb_reset_mac_header(skb);
220 skb_pull(skb, IPOIB_ENCAP_LEN); 220 skb_pull(skb, IPOIB_ENCAP_LEN);
221 221
222 dev->last_rx = jiffies; 222 dev->last_rx = jiffies;
diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c
index 838b3734e2b6..fadb9291bc1b 100644
--- a/drivers/isdn/i4l/isdn_net.c
+++ b/drivers/isdn/i4l/isdn_net.c
@@ -1366,7 +1366,7 @@ isdn_net_type_trans(struct sk_buff *skb, struct net_device *dev)
1366 struct ethhdr *eth; 1366 struct ethhdr *eth;
1367 unsigned char *rawp; 1367 unsigned char *rawp;
1368 1368
1369 skb->mac.raw = skb->data; 1369 skb_reset_mac_header(skb);
1370 skb_pull(skb, ETH_HLEN); 1370 skb_pull(skb, ETH_HLEN);
1371 eth = eth_hdr(skb); 1371 eth = eth_hdr(skb);
1372 1372
@@ -1786,7 +1786,7 @@ isdn_net_receive(struct net_device *ndev, struct sk_buff *skb)
1786 } 1786 }
1787 skb->dev = ndev; 1787 skb->dev = ndev;
1788 skb->pkt_type = PACKET_HOST; 1788 skb->pkt_type = PACKET_HOST;
1789 skb->mac.raw = skb->data; 1789 skb_reset_mac_header(skb);
1790#ifdef ISDN_DEBUG_NET_DUMP 1790#ifdef ISDN_DEBUG_NET_DUMP
1791 isdn_dumppkt("R:", skb->data, skb->len, 40); 1791 isdn_dumppkt("R:", skb->data, skb->len, 40);
1792#endif 1792#endif
diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c
index 1b2df80c3bce..be915051cb2e 100644
--- a/drivers/isdn/i4l/isdn_ppp.c
+++ b/drivers/isdn/i4l/isdn_ppp.c
@@ -1167,7 +1167,7 @@ isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff
1167 mlp->huptimer = 0; 1167 mlp->huptimer = 0;
1168#endif /* CONFIG_IPPP_FILTER */ 1168#endif /* CONFIG_IPPP_FILTER */
1169 skb->dev = dev; 1169 skb->dev = dev;
1170 skb->mac.raw = skb->data; 1170 skb_reset_mac_header(skb);
1171 netif_rx(skb); 1171 netif_rx(skb);
1172 /* net_dev->local->stats.rx_packets++; done in isdn_net.c */ 1172 /* net_dev->local->stats.rx_packets++; done in isdn_net.c */
1173 return; 1173 return;
diff --git a/drivers/message/fusion/mptlan.c b/drivers/message/fusion/mptlan.c
index b691292ff599..d5b878d56280 100644
--- a/drivers/message/fusion/mptlan.c
+++ b/drivers/message/fusion/mptlan.c
@@ -753,7 +753,7 @@ mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev)
753 /* Set the mac.raw pointer, since this apparently isn't getting 753 /* Set the mac.raw pointer, since this apparently isn't getting
754 * done before we get the skb. Pull the data pointer past the mac data. 754 * done before we get the skb. Pull the data pointer past the mac data.
755 */ 755 */
756 skb->mac.raw = skb->data; 756 skb_reset_mac_header(skb);
757 skb_pull(skb, 12); 757 skb_pull(skb, 12);
758 758
759 dma = pci_map_single(mpt_dev->pcidev, skb->data, skb->len, 759 dma = pci_map_single(mpt_dev->pcidev, skb->data, skb->len,
@@ -1549,7 +1549,7 @@ mpt_lan_type_trans(struct sk_buff *skb, struct net_device *dev)
1549 struct mpt_lan_ohdr *fch = (struct mpt_lan_ohdr *)skb->data; 1549 struct mpt_lan_ohdr *fch = (struct mpt_lan_ohdr *)skb->data;
1550 struct fcllc *fcllc; 1550 struct fcllc *fcllc;
1551 1551
1552 skb->mac.raw = skb->data; 1552 skb_reset_mac_header(skb);
1553 skb_pull(skb, sizeof(struct mpt_lan_ohdr)); 1553 skb_pull(skb, sizeof(struct mpt_lan_ohdr));
1554 1554
1555 if (fch->dtype == htons(0xffff)) { 1555 if (fch->dtype == htons(0xffff)) {
diff --git a/drivers/net/appletalk/cops.c b/drivers/net/appletalk/cops.c
index dba5e5165452..28cb79cee910 100644
--- a/drivers/net/appletalk/cops.c
+++ b/drivers/net/appletalk/cops.c
@@ -853,7 +853,7 @@ static void cops_rx(struct net_device *dev)
853 return; 853 return;
854 } 854 }
855 855
856 skb->mac.raw = skb->data; /* Point to entire packet. */ 856 skb_reset_mac_header(skb); /* Point to entire packet. */
857 skb_pull(skb,3); 857 skb_pull(skb,3);
858 skb->h.raw = skb->data; /* Point to data (Skip header). */ 858 skb->h.raw = skb->data; /* Point to data (Skip header). */
859 859
diff --git a/drivers/net/appletalk/ltpc.c b/drivers/net/appletalk/ltpc.c
index 2ea44ce49810..12682439f8bd 100644
--- a/drivers/net/appletalk/ltpc.c
+++ b/drivers/net/appletalk/ltpc.c
@@ -770,7 +770,7 @@ static int sendup_buffer (struct net_device *dev)
770 skb->data[0] = dnode; 770 skb->data[0] = dnode;
771 skb->data[1] = snode; 771 skb->data[1] = snode;
772 skb->data[2] = llaptype; 772 skb->data[2] = llaptype;
773 skb->mac.raw = skb->data; /* save pointer to llap header */ 773 skb_reset_mac_header(skb); /* save pointer to llap header */
774 skb_pull(skb,3); 774 skb_pull(skb,3);
775 775
776 /* copy ddp(s,e)hdr + contents */ 776 /* copy ddp(s,e)hdr + contents */
diff --git a/drivers/net/arcnet/arc-rawmode.c b/drivers/net/arcnet/arc-rawmode.c
index 6318814a11a8..e0a18e7c73cb 100644
--- a/drivers/net/arcnet/arc-rawmode.c
+++ b/drivers/net/arcnet/arc-rawmode.c
@@ -110,7 +110,7 @@ static void rx(struct net_device *dev, int bufnum,
110 110
111 pkt = (struct archdr *) skb->data; 111 pkt = (struct archdr *) skb->data;
112 112
113 skb->mac.raw = skb->data; 113 skb_reset_mac_header(skb);
114 skb_pull(skb, ARC_HDR_SIZE); 114 skb_pull(skb, ARC_HDR_SIZE);
115 115
116 /* up to sizeof(pkt->soft) has already been copied from the card */ 116 /* up to sizeof(pkt->soft) has already been copied from the card */
diff --git a/drivers/net/arcnet/capmode.c b/drivers/net/arcnet/capmode.c
index 66485585ab39..6c764b66e9cc 100644
--- a/drivers/net/arcnet/capmode.c
+++ b/drivers/net/arcnet/capmode.c
@@ -122,10 +122,8 @@ static void rx(struct net_device *dev, int bufnum,
122 } 122 }
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 125 skb_reset_mac_header(skb);
126 pkt = (struct archdr *) skb->data; 126 pkt = (struct archdr *)skb->mac.raw;
127
128 skb->mac.raw = skb->data;
129 skb_pull(skb, ARC_HDR_SIZE); 127 skb_pull(skb, ARC_HDR_SIZE);
130 128
131 /* 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 */
@@ -270,9 +268,8 @@ static int ack_tx(struct net_device *dev, int acked)
270 skb_put(ackskb, length + ARC_HDR_SIZE ); 268 skb_put(ackskb, length + ARC_HDR_SIZE );
271 ackskb->dev = dev; 269 ackskb->dev = dev;
272 270
273 ackpkt = (struct archdr *) ackskb->data; 271 skb_reset_mac_header(ackskb);
274 272 ackpkt = (struct archdr *)ackskb->mac.raw;
275 ackskb->mac.raw = ackskb->data;
276 /* skb_pull(ackskb, ARC_HDR_SIZE); */ 273 /* skb_pull(ackskb, ARC_HDR_SIZE); */
277 274
278 275
diff --git a/drivers/net/arcnet/rfc1051.c b/drivers/net/arcnet/rfc1051.c
index 6d6c69f036ef..2de8877ece29 100644
--- a/drivers/net/arcnet/rfc1051.c
+++ b/drivers/net/arcnet/rfc1051.c
@@ -94,7 +94,7 @@ static unsigned short type_trans(struct sk_buff *skb, struct net_device *dev)
94 int hdr_size = ARC_HDR_SIZE + RFC1051_HDR_SIZE; 94 int hdr_size = ARC_HDR_SIZE + RFC1051_HDR_SIZE;
95 95
96 /* Pull off the arcnet header. */ 96 /* Pull off the arcnet header. */
97 skb->mac.raw = skb->data; 97 skb_reset_mac_header(skb);
98 skb_pull(skb, hdr_size); 98 skb_pull(skb, hdr_size);
99 99
100 if (pkt->hard.dest == 0) 100 if (pkt->hard.dest == 0)
diff --git a/drivers/net/arcnet/rfc1201.c b/drivers/net/arcnet/rfc1201.c
index bee34226abfa..460a095000c2 100644
--- a/drivers/net/arcnet/rfc1201.c
+++ b/drivers/net/arcnet/rfc1201.c
@@ -96,7 +96,7 @@ static unsigned short type_trans(struct sk_buff *skb, struct net_device *dev)
96 int hdr_size = ARC_HDR_SIZE + RFC1201_HDR_SIZE; 96 int hdr_size = ARC_HDR_SIZE + RFC1201_HDR_SIZE;
97 97
98 /* Pull off the arcnet header. */ 98 /* Pull off the arcnet header. */
99 skb->mac.raw = skb->data; 99 skb_reset_mac_header(skb);
100 skb_pull(skb, hdr_size); 100 skb_pull(skb, hdr_size);
101 101
102 if (pkt->hard.dest == 0) 102 if (pkt->hard.dest == 0)
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 3fb354d9c515..e3c9e2e56d14 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -884,7 +884,7 @@ static int ad_lacpdu_send(struct port *port)
884 } 884 }
885 885
886 skb->dev = slave->dev; 886 skb->dev = slave->dev;
887 skb->mac.raw = skb->data; 887 skb_reset_mac_header(skb);
888 skb->nh.raw = skb->data + ETH_HLEN; 888 skb->nh.raw = skb->data + ETH_HLEN;
889 skb->protocol = PKT_TYPE_LACPDU; 889 skb->protocol = PKT_TYPE_LACPDU;
890 skb->priority = TC_PRIO_CONTROL; 890 skb->priority = TC_PRIO_CONTROL;
@@ -928,7 +928,7 @@ static int ad_marker_send(struct port *port, struct marker *marker)
928 skb_reserve(skb, 16); 928 skb_reserve(skb, 16);
929 929
930 skb->dev = slave->dev; 930 skb->dev = slave->dev;
931 skb->mac.raw = skb->data; 931 skb_reset_mac_header(skb);
932 skb->nh.raw = skb->data + ETH_HLEN; 932 skb->nh.raw = skb->data + ETH_HLEN;
933 skb->protocol = PKT_TYPE_LACPDU; 933 skb->protocol = PKT_TYPE_LACPDU;
934 934
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index 217a2eedee0a..916162ca0c98 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -890,7 +890,7 @@ static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[])
890 data = skb_put(skb, size); 890 data = skb_put(skb, size);
891 memcpy(data, &pkt, size); 891 memcpy(data, &pkt, size);
892 892
893 skb->mac.raw = data; 893 skb_reset_mac_header(skb);
894 skb->nh.raw = data + ETH_HLEN; 894 skb->nh.raw = data + ETH_HLEN;
895 skb->protocol = pkt.type; 895 skb->protocol = pkt.type;
896 skb->priority = TC_PRIO_CONTROL; 896 skb->priority = TC_PRIO_CONTROL;
@@ -1266,7 +1266,7 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
1266 u8 *hash_start = NULL; 1266 u8 *hash_start = NULL;
1267 int res = 1; 1267 int res = 1;
1268 1268
1269 skb->mac.raw = (unsigned char *)skb->data; 1269 skb_reset_mac_header(skb);
1270 eth_data = eth_hdr(skb); 1270 eth_data = eth_hdr(skb);
1271 1271
1272 /* make sure that the curr_active_slave and the slaves list do 1272 /* make sure that the curr_active_slave and the slaves list do
diff --git a/drivers/net/cxgb3/cxgb3_offload.c b/drivers/net/cxgb3/cxgb3_offload.c
index 199e5066acf3..ebcf35e4cf5b 100644
--- a/drivers/net/cxgb3/cxgb3_offload.c
+++ b/drivers/net/cxgb3/cxgb3_offload.c
@@ -783,7 +783,7 @@ static int do_trace(struct t3cdev *dev, struct sk_buff *skb)
783 skb->protocol = htons(0xffff); 783 skb->protocol = htons(0xffff);
784 skb->dev = dev->lldev; 784 skb->dev = dev->lldev;
785 skb_pull(skb, sizeof(*p)); 785 skb_pull(skb, sizeof(*p));
786 skb->mac.raw = skb->data; 786 skb_reset_mac_header(skb);
787 netif_receive_skb(skb); 787 netif_receive_skb(skb);
788 return 0; 788 return 0;
789} 789}
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
index 8946f7aa97cd..b5cf2a60834d 100644
--- a/drivers/net/cxgb3/sge.c
+++ b/drivers/net/cxgb3/sge.c
@@ -1620,7 +1620,8 @@ static inline int rx_offload(struct t3cdev *tdev, struct sge_rspq *rq,
1620 unsigned int gather_idx) 1620 unsigned int gather_idx)
1621{ 1621{
1622 rq->offload_pkts++; 1622 rq->offload_pkts++;
1623 skb->mac.raw = skb->nh.raw = skb->h.raw = skb->data; 1623 skb_reset_mac_header(skb);
1624 skb->nh.raw = skb->h.raw = skb->data;
1624 1625
1625 if (rq->polling) { 1626 if (rq->polling) {
1626 rx_gather[gather_idx++] = skb; 1627 rx_gather[gather_idx++] = skb;
diff --git a/drivers/net/irda/ali-ircc.c b/drivers/net/irda/ali-ircc.c
index cebf8c374bc5..0f10758226fa 100644
--- a/drivers/net/irda/ali-ircc.c
+++ b/drivers/net/irda/ali-ircc.c
@@ -1932,7 +1932,7 @@ static int ali_ircc_dma_receive_complete(struct ali_ircc_cb *self)
1932 self->stats.rx_packets++; 1932 self->stats.rx_packets++;
1933 1933
1934 skb->dev = self->netdev; 1934 skb->dev = self->netdev;
1935 skb->mac.raw = skb->data; 1935 skb_reset_mac_header(skb);
1936 skb->protocol = htons(ETH_P_IRDA); 1936 skb->protocol = htons(ETH_P_IRDA);
1937 netif_rx(skb); 1937 netif_rx(skb);
1938 self->netdev->last_rx = jiffies; 1938 self->netdev->last_rx = jiffies;
diff --git a/drivers/net/irda/au1k_ir.c b/drivers/net/irda/au1k_ir.c
index 37914dc5b90e..27afd0f367d6 100644
--- a/drivers/net/irda/au1k_ir.c
+++ b/drivers/net/irda/au1k_ir.c
@@ -606,7 +606,7 @@ static int au1k_irda_rx(struct net_device *dev)
606 skb_put(skb, count-2); 606 skb_put(skb, count-2);
607 memcpy(skb->data, (void *)pDB->vaddr, count-2); 607 memcpy(skb->data, (void *)pDB->vaddr, count-2);
608 skb->dev = dev; 608 skb->dev = dev;
609 skb->mac.raw = skb->data; 609 skb_reset_mac_header(skb);
610 skb->protocol = htons(ETH_P_IRDA); 610 skb->protocol = htons(ETH_P_IRDA);
611 netif_rx(skb); 611 netif_rx(skb);
612 prxd->count_0 = 0; 612 prxd->count_0 = 0;
diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c
index 11af0ae7510e..ddfa6c38a16b 100644
--- a/drivers/net/irda/donauboe.c
+++ b/drivers/net/irda/donauboe.c
@@ -1286,7 +1286,7 @@ dumpbufs(self->rx_bufs[self->rxs],len,'<');
1286 1286
1287 self->stats.rx_packets++; 1287 self->stats.rx_packets++;
1288 skb->dev = self->netdev; 1288 skb->dev = self->netdev;
1289 skb->mac.raw = skb->data; 1289 skb_reset_mac_header(skb);
1290 skb->protocol = htons (ETH_P_IRDA); 1290 skb->protocol = htons (ETH_P_IRDA);
1291 } 1291 }
1292 else 1292 else
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c
index 1d510bdc9b84..6ef375a095f4 100644
--- a/drivers/net/irda/irda-usb.c
+++ b/drivers/net/irda/irda-usb.c
@@ -921,7 +921,7 @@ static void irda_usb_receive(struct urb *urb)
921 921
922 /* Ask the networking layer to queue the packet for the IrDA stack */ 922 /* Ask the networking layer to queue the packet for the IrDA stack */
923 dataskb->dev = self->netdev; 923 dataskb->dev = self->netdev;
924 dataskb->mac.raw = dataskb->data; 924 skb_reset_mac_header(dataskb);
925 dataskb->protocol = htons(ETH_P_IRDA); 925 dataskb->protocol = htons(ETH_P_IRDA);
926 len = dataskb->len; 926 len = dataskb->len;
927 netif_rx(dataskb); 927 netif_rx(dataskb);
diff --git a/drivers/net/irda/mcs7780.c b/drivers/net/irda/mcs7780.c
index f0c61f3b2a82..3ff1f4b33c06 100644
--- a/drivers/net/irda/mcs7780.c
+++ b/drivers/net/irda/mcs7780.c
@@ -428,7 +428,7 @@ static void mcs_unwrap_mir(struct mcs_cb *mcs, __u8 *buf, int len)
428 skb_reserve(skb, 1); 428 skb_reserve(skb, 1);
429 memcpy(skb->data, buf, new_len); 429 memcpy(skb->data, buf, new_len);
430 skb_put(skb, new_len); 430 skb_put(skb, new_len);
431 skb->mac.raw = skb->data; 431 skb_reset_mac_header(skb);
432 skb->protocol = htons(ETH_P_IRDA); 432 skb->protocol = htons(ETH_P_IRDA);
433 skb->dev = mcs->netdev; 433 skb->dev = mcs->netdev;
434 434
@@ -481,7 +481,7 @@ static void mcs_unwrap_fir(struct mcs_cb *mcs, __u8 *buf, int len)
481 skb_reserve(skb, 1); 481 skb_reserve(skb, 1);
482 memcpy(skb->data, buf, new_len); 482 memcpy(skb->data, buf, new_len);
483 skb_put(skb, new_len); 483 skb_put(skb, new_len);
484 skb->mac.raw = skb->data; 484 skb_reset_mac_header(skb);
485 skb->protocol = htons(ETH_P_IRDA); 485 skb->protocol = htons(ETH_P_IRDA);
486 skb->dev = mcs->netdev; 486 skb->dev = mcs->netdev;
487 487
diff --git a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c
index 29b5ccd29d0b..8ce7dad582f4 100644
--- a/drivers/net/irda/nsc-ircc.c
+++ b/drivers/net/irda/nsc-ircc.c
@@ -1881,7 +1881,7 @@ static int nsc_ircc_dma_receive_complete(struct nsc_ircc_cb *self, int iobase)
1881 self->stats.rx_packets++; 1881 self->stats.rx_packets++;
1882 1882
1883 skb->dev = self->netdev; 1883 skb->dev = self->netdev;
1884 skb->mac.raw = skb->data; 1884 skb_reset_mac_header(skb);
1885 skb->protocol = htons(ETH_P_IRDA); 1885 skb->protocol = htons(ETH_P_IRDA);
1886 netif_rx(skb); 1886 netif_rx(skb);
1887 self->netdev->last_rx = jiffies; 1887 self->netdev->last_rx = jiffies;
diff --git a/drivers/net/irda/pxaficp_ir.c b/drivers/net/irda/pxaficp_ir.c
index 2272156af31e..f35d7d42624e 100644
--- a/drivers/net/irda/pxaficp_ir.c
+++ b/drivers/net/irda/pxaficp_ir.c
@@ -391,7 +391,7 @@ static void pxa_irda_fir_irq_eif(struct pxa_irda *si, struct net_device *dev, in
391 391
392 /* Feed it to IrLAP */ 392 /* Feed it to IrLAP */
393 skb->dev = dev; 393 skb->dev = dev;
394 skb->mac.raw = skb->data; 394 skb_reset_mac_header(skb);
395 skb->protocol = htons(ETH_P_IRDA); 395 skb->protocol = htons(ETH_P_IRDA);
396 netif_rx(skb); 396 netif_rx(skb);
397 397
diff --git a/drivers/net/irda/sa1100_ir.c b/drivers/net/irda/sa1100_ir.c
index 937372d00398..056639f72bec 100644
--- a/drivers/net/irda/sa1100_ir.c
+++ b/drivers/net/irda/sa1100_ir.c
@@ -504,7 +504,7 @@ static void sa1100_irda_fir_error(struct sa1100_irda *si, struct net_device *dev
504 504
505 skb_put(skb, len); 505 skb_put(skb, len);
506 skb->dev = dev; 506 skb->dev = dev;
507 skb->mac.raw = skb->data; 507 skb_reset_mac_header(skb);
508 skb->protocol = htons(ETH_P_IRDA); 508 skb->protocol = htons(ETH_P_IRDA);
509 si->stats.rx_packets++; 509 si->stats.rx_packets++;
510 si->stats.rx_bytes += len; 510 si->stats.rx_bytes += len;
diff --git a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c
index 31c623381ea8..103a2d18ed2f 100644
--- a/drivers/net/irda/smsc-ircc2.c
+++ b/drivers/net/irda/smsc-ircc2.c
@@ -1412,7 +1412,7 @@ static void smsc_ircc_dma_receive_complete(struct smsc_ircc_cb *self)
1412 self->stats.rx_bytes += len; 1412 self->stats.rx_bytes += len;
1413 1413
1414 skb->dev = self->netdev; 1414 skb->dev = self->netdev;
1415 skb->mac.raw = skb->data; 1415 skb_reset_mac_header(skb);
1416 skb->protocol = htons(ETH_P_IRDA); 1416 skb->protocol = htons(ETH_P_IRDA);
1417 netif_rx(skb); 1417 netif_rx(skb);
1418} 1418}
diff --git a/drivers/net/irda/stir4200.c b/drivers/net/irda/stir4200.c
index 20d306fea4cb..a22175f4ea81 100644
--- a/drivers/net/irda/stir4200.c
+++ b/drivers/net/irda/stir4200.c
@@ -364,7 +364,7 @@ static void fir_eof(struct stir_cb *stir)
364 364
365 skb_put(skb, len); 365 skb_put(skb, len);
366 366
367 skb->mac.raw = skb->data; 367 skb_reset_mac_header(skb);
368 skb->protocol = htons(ETH_P_IRDA); 368 skb->protocol = htons(ETH_P_IRDA);
369 skb->dev = stir->netdev; 369 skb->dev = stir->netdev;
370 370
diff --git a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c
index c3ed9b3067e5..5ff416314604 100644
--- a/drivers/net/irda/via-ircc.c
+++ b/drivers/net/irda/via-ircc.c
@@ -1125,7 +1125,7 @@ static int via_ircc_dma_receive_complete(struct via_ircc_cb *self,
1125 self->stats.rx_bytes += len; 1125 self->stats.rx_bytes += len;
1126 self->stats.rx_packets++; 1126 self->stats.rx_packets++;
1127 skb->dev = self->netdev; 1127 skb->dev = self->netdev;
1128 skb->mac.raw = skb->data; 1128 skb_reset_mac_header(skb);
1129 skb->protocol = htons(ETH_P_IRDA); 1129 skb->protocol = htons(ETH_P_IRDA);
1130 netif_rx(skb); 1130 netif_rx(skb);
1131 return TRUE; 1131 return TRUE;
@@ -1198,7 +1198,7 @@ F01_E */
1198 self->stats.rx_bytes += len; 1198 self->stats.rx_bytes += len;
1199 self->stats.rx_packets++; 1199 self->stats.rx_packets++;
1200 skb->dev = self->netdev; 1200 skb->dev = self->netdev;
1201 skb->mac.raw = skb->data; 1201 skb_reset_mac_header(skb);
1202 skb->protocol = htons(ETH_P_IRDA); 1202 skb->protocol = htons(ETH_P_IRDA);
1203 netif_rx(skb); 1203 netif_rx(skb);
1204 1204
@@ -1244,7 +1244,7 @@ static int upload_rxdata(struct via_ircc_cb *self, int iobase)
1244 self->stats.rx_bytes += len; 1244 self->stats.rx_bytes += len;
1245 self->stats.rx_packets++; 1245 self->stats.rx_packets++;
1246 skb->dev = self->netdev; 1246 skb->dev = self->netdev;
1247 skb->mac.raw = skb->data; 1247 skb_reset_mac_header(skb);
1248 skb->protocol = htons(ETH_P_IRDA); 1248 skb->protocol = htons(ETH_P_IRDA);
1249 netif_rx(skb); 1249 netif_rx(skb);
1250 if (st_fifo->len < (MAX_RX_WINDOW + 2)) { 1250 if (st_fifo->len < (MAX_RX_WINDOW + 2)) {
@@ -1313,7 +1313,7 @@ static int RxTimerHandler(struct via_ircc_cb *self, int iobase)
1313 self->stats.rx_bytes += len; 1313 self->stats.rx_bytes += len;
1314 self->stats.rx_packets++; 1314 self->stats.rx_packets++;
1315 skb->dev = self->netdev; 1315 skb->dev = self->netdev;
1316 skb->mac.raw = skb->data; 1316 skb_reset_mac_header(skb);
1317 skb->protocol = htons(ETH_P_IRDA); 1317 skb->protocol = htons(ETH_P_IRDA);
1318 netif_rx(skb); 1318 netif_rx(skb);
1319 } //while 1319 } //while
diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c
index 3457e9d8b667..79b407f3a49a 100644
--- a/drivers/net/irda/vlsi_ir.c
+++ b/drivers/net/irda/vlsi_ir.c
@@ -595,7 +595,7 @@ static int vlsi_process_rx(struct vlsi_ring *r, struct ring_descr *rd)
595 rd->skb = NULL; 595 rd->skb = NULL;
596 skb->dev = ndev; 596 skb->dev = ndev;
597 memcpy(skb_put(skb,len), rd->buf, len); 597 memcpy(skb_put(skb,len), rd->buf, len);
598 skb->mac.raw = skb->data; 598 skb_reset_mac_header(skb);
599 if (in_interrupt()) 599 if (in_interrupt())
600 netif_rx(skb); 600 netif_rx(skb);
601 else 601 else
diff --git a/drivers/net/irda/w83977af_ir.c b/drivers/net/irda/w83977af_ir.c
index 4212657fa4f9..bee445130952 100644
--- a/drivers/net/irda/w83977af_ir.c
+++ b/drivers/net/irda/w83977af_ir.c
@@ -919,7 +919,7 @@ int w83977af_dma_receive_complete(struct w83977af_ir *self)
919 self->stats.rx_packets++; 919 self->stats.rx_packets++;
920 920
921 skb->dev = self->netdev; 921 skb->dev = self->netdev;
922 skb->mac.raw = skb->data; 922 skb_reset_mac_header(skb);
923 skb->protocol = htons(ETH_P_IRDA); 923 skb->protocol = htons(ETH_P_IRDA);
924 netif_rx(skb); 924 netif_rx(skb);
925 self->netdev->last_rx = jiffies; 925 self->netdev->last_rx = jiffies;
diff --git a/drivers/net/myri_sbus.c b/drivers/net/myri_sbus.c
index ee26ef52289f..de092658db6c 100644
--- a/drivers/net/myri_sbus.c
+++ b/drivers/net/myri_sbus.c
@@ -368,7 +368,7 @@ static __be16 myri_type_trans(struct sk_buff *skb, struct net_device *dev)
368 struct ethhdr *eth; 368 struct ethhdr *eth;
369 unsigned char *rawp; 369 unsigned char *rawp;
370 370
371 skb->mac.raw = (((unsigned char *)skb->data) + MYRI_PAD_LEN); 371 skb->mac.raw = skb->data + MYRI_PAD_LEN;
372 skb_pull(skb, dev->hard_header_len); 372 skb_pull(skb, dev->hard_header_len);
373 eth = eth_hdr(skb); 373 eth = eth_hdr(skb);
374 374
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
index ef58e4128782..18f1790aab9a 100644
--- a/drivers/net/ppp_generic.c
+++ b/drivers/net/ppp_generic.c
@@ -1685,7 +1685,7 @@ ppp_receive_nonmp_frame(struct ppp *ppp, struct sk_buff *skb)
1685 skb_pull_rcsum(skb, 2); 1685 skb_pull_rcsum(skb, 2);
1686 skb->dev = ppp->dev; 1686 skb->dev = ppp->dev;
1687 skb->protocol = htons(npindex_to_ethertype[npi]); 1687 skb->protocol = htons(npindex_to_ethertype[npi]);
1688 skb->mac.raw = skb->data; 1688 skb_reset_mac_header(skb);
1689 netif_rx(skb); 1689 netif_rx(skb);
1690 ppp->dev->last_rx = jiffies; 1690 ppp->dev->last_rx = jiffies;
1691 } 1691 }
diff --git a/drivers/net/sb1000.c b/drivers/net/sb1000.c
index b9fa4fbb1398..1de3eec1a792 100644
--- a/drivers/net/sb1000.c
+++ b/drivers/net/sb1000.c
@@ -834,7 +834,7 @@ printk("cm0: IP identification: %02x%02x fragment offset: %02x%02x\n", buffer[3
834 goto dropped_frame; 834 goto dropped_frame;
835 } 835 }
836 skb->dev = dev; 836 skb->dev = dev;
837 skb->mac.raw = skb->data; 837 skb_reset_mac_header(skb);
838 skb->protocol = (unsigned short) buffer[NewDatagramHeaderSkip + 16]; 838 skb->protocol = (unsigned short) buffer[NewDatagramHeaderSkip + 16];
839 insw(ioaddr, skb_put(skb, NewDatagramDataSize), 839 insw(ioaddr, skb_put(skb, NewDatagramDataSize),
840 NewDatagramDataSize / 2); 840 NewDatagramDataSize / 2);
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index a57aa010cb25..288d8559f8c5 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -256,7 +256,7 @@ static __inline__ ssize_t tun_get_user(struct tun_struct *tun, struct iovec *iv,
256 256
257 switch (tun->flags & TUN_TYPE_MASK) { 257 switch (tun->flags & TUN_TYPE_MASK) {
258 case TUN_TUN_DEV: 258 case TUN_TUN_DEV:
259 skb->mac.raw = skb->data; 259 skb_reset_mac_header(skb);
260 skb->protocol = pi.proto; 260 skb->protocol = pi.proto;
261 skb->dev = tun->dev; 261 skb->dev = tun->dev;
262 break; 262 break;
diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
index 5b82e4fd0d73..c198511ec3f5 100644
--- a/drivers/net/wan/cosa.c
+++ b/drivers/net/wan/cosa.c
@@ -773,7 +773,7 @@ static int sppp_rx_done(struct channel_data *chan)
773 } 773 }
774 chan->rx_skb->protocol = htons(ETH_P_WAN_PPP); 774 chan->rx_skb->protocol = htons(ETH_P_WAN_PPP);
775 chan->rx_skb->dev = chan->pppdev.dev; 775 chan->rx_skb->dev = chan->pppdev.dev;
776 chan->rx_skb->mac.raw = chan->rx_skb->data; 776 skb_reset_mac_header(chan->rx_skb)
777 chan->stats.rx_packets++; 777 chan->stats.rx_packets++;
778 chan->stats.rx_bytes += chan->cosa->rxsize; 778 chan->stats.rx_bytes += chan->cosa->rxsize;
779 netif_rx(chan->rx_skb); 779 netif_rx(chan->rx_skb);
diff --git a/drivers/net/wan/cycx_x25.c b/drivers/net/wan/cycx_x25.c
index a631d1c2fa14..016b3ff3ea5e 100644
--- a/drivers/net/wan/cycx_x25.c
+++ b/drivers/net/wan/cycx_x25.c
@@ -834,7 +834,7 @@ static void cycx_x25_irq_rx(struct cycx_device *card, struct cycx_x25_cmd *cmd)
834 ++chan->ifstats.rx_packets; 834 ++chan->ifstats.rx_packets;
835 chan->ifstats.rx_bytes += pktlen; 835 chan->ifstats.rx_bytes += pktlen;
836 836
837 skb->mac.raw = skb->data; 837 skb_reset_mac_header(skb);
838 netif_rx(skb); 838 netif_rx(skb);
839 dev->last_rx = jiffies; /* timestamp */ 839 dev->last_rx = jiffies; /* timestamp */
840} 840}
diff --git a/drivers/net/wan/dlci.c b/drivers/net/wan/dlci.c
index 736987559432..66be20c292b6 100644
--- a/drivers/net/wan/dlci.c
+++ b/drivers/net/wan/dlci.c
@@ -176,7 +176,7 @@ static void dlci_receive(struct sk_buff *skb, struct net_device *dev)
176 if (process) 176 if (process)
177 { 177 {
178 /* we've set up the protocol, so discard the header */ 178 /* we've set up the protocol, so discard the header */
179 skb->mac.raw = skb->data; 179 skb_reset_mac_header(skb);
180 skb_pull(skb, header); 180 skb_pull(skb, header);
181 dlp->stats.rx_bytes += skb->len; 181 dlp->stats.rx_bytes += skb->len;
182 netif_rx(skb); 182 netif_rx(skb);
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
index c45d6a83339d..58a53b6d9b42 100644
--- a/drivers/net/wan/farsync.c
+++ b/drivers/net/wan/farsync.c
@@ -864,7 +864,7 @@ fst_tx_dma_complete(struct fst_card_info *card, struct fst_port_info *port,
864static __be16 farsync_type_trans(struct sk_buff *skb, struct net_device *dev) 864static __be16 farsync_type_trans(struct sk_buff *skb, struct net_device *dev)
865{ 865{
866 skb->dev = dev; 866 skb->dev = dev;
867 skb->mac.raw = skb->data; 867 skb_reset_mac_header(skb);
868 skb->pkt_type = PACKET_HOST; 868 skb->pkt_type = PACKET_HOST;
869 return htons(ETH_P_CUST); 869 return htons(ETH_P_CUST);
870} 870}
diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c
index 2b54f1bc3a0d..6d288839ddaa 100644
--- a/drivers/net/wan/lmc/lmc_main.c
+++ b/drivers/net/wan/lmc/lmc_main.c
@@ -1667,7 +1667,7 @@ static int lmc_rx (struct net_device *dev) /*fold00*/
1667 skb_put (skb, len); 1667 skb_put (skb, len);
1668 skb->protocol = lmc_proto_type(sc, skb); 1668 skb->protocol = lmc_proto_type(sc, skb);
1669 skb->protocol = htons(ETH_P_WAN_PPP); 1669 skb->protocol = htons(ETH_P_WAN_PPP);
1670 skb->mac.raw = skb->data; 1670 skb_reset_mac_header(skb);
1671// skb->nh.raw = skb->data; 1671// skb->nh.raw = skb->data;
1672 skb->dev = dev; 1672 skb->dev = dev;
1673 lmc_proto_netif(sc, skb); 1673 lmc_proto_netif(sc, skb);
@@ -1705,7 +1705,7 @@ static int lmc_rx (struct net_device *dev) /*fold00*/
1705 memcpy(skb_put(nsb, len), skb->data, len); 1705 memcpy(skb_put(nsb, len), skb->data, len);
1706 1706
1707 nsb->protocol = lmc_proto_type(sc, skb); 1707 nsb->protocol = lmc_proto_type(sc, skb);
1708 nsb->mac.raw = nsb->data; 1708 skb_reset_mac_header(nsb);
1709// nsb->nh.raw = nsb->data; 1709// nsb->nh.raw = nsb->data;
1710 nsb->dev = dev; 1710 nsb->dev = dev;
1711 lmc_proto_netif(sc, nsb); 1711 lmc_proto_netif(sc, nsb);
diff --git a/drivers/net/wan/pc300_drv.c b/drivers/net/wan/pc300_drv.c
index 62184dee377c..edbc55528be5 100644
--- a/drivers/net/wan/pc300_drv.c
+++ b/drivers/net/wan/pc300_drv.c
@@ -1755,7 +1755,7 @@ cpc_trace(struct net_device *dev, struct sk_buff *skb_main, char rx_tx)
1755 1755
1756 skb->dev = dev; 1756 skb->dev = dev;
1757 skb->protocol = htons(ETH_P_CUST); 1757 skb->protocol = htons(ETH_P_CUST);
1758 skb->mac.raw = skb->data; 1758 skb_reset_mac_header(skb);
1759 skb->pkt_type = PACKET_HOST; 1759 skb->pkt_type = PACKET_HOST;
1760 skb->len = 10 + skb_main->len; 1760 skb->len = 10 + skb_main->len;
1761 1761
diff --git a/drivers/net/wan/pc300_tty.c b/drivers/net/wan/pc300_tty.c
index 5873c346e7e9..de02a07259cf 100644
--- a/drivers/net/wan/pc300_tty.c
+++ b/drivers/net/wan/pc300_tty.c
@@ -1003,7 +1003,7 @@ static void cpc_tty_trace(pc300dev_t *dev, char* buf, int len, char rxtx)
1003 skb_put (skb, 10 + len); 1003 skb_put (skb, 10 + len);
1004 skb->dev = dev->dev; 1004 skb->dev = dev->dev;
1005 skb->protocol = htons(ETH_P_CUST); 1005 skb->protocol = htons(ETH_P_CUST);
1006 skb->mac.raw = skb->data; 1006 skb_reset_mac_header(skb);
1007 skb->pkt_type = PACKET_HOST; 1007 skb->pkt_type = PACKET_HOST;
1008 skb->len = 10 + len; 1008 skb->len = 10 + len;
1009 1009
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index e50b1482d792..692a23f9834d 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -3411,7 +3411,7 @@ badrx:
3411 OUT4500( apriv, EVACK, EV_RX); 3411 OUT4500( apriv, EVACK, EV_RX);
3412 3412
3413 if (test_bit(FLAG_802_11, &apriv->flags)) { 3413 if (test_bit(FLAG_802_11, &apriv->flags)) {
3414 skb->mac.raw = skb->data; 3414 skb_reset_mac_header(skb);
3415 skb->pkt_type = PACKET_OTHERHOST; 3415 skb->pkt_type = PACKET_OTHERHOST;
3416 skb->dev = apriv->wifidev; 3416 skb->dev = apriv->wifidev;
3417 skb->protocol = htons(ETH_P_802_2); 3417 skb->protocol = htons(ETH_P_802_2);
@@ -3746,7 +3746,7 @@ void mpi_receive_802_11 (struct airo_info *ai)
3746 wireless_spy_update(ai->dev, sa, &wstats); 3746 wireless_spy_update(ai->dev, sa, &wstats);
3747 } 3747 }
3748#endif /* IW_WIRELESS_SPY */ 3748#endif /* IW_WIRELESS_SPY */
3749 skb->mac.raw = skb->data; 3749 skb_reset_mac_header(skb);
3750 skb->pkt_type = PACKET_OTHERHOST; 3750 skb->pkt_type = PACKET_OTHERHOST;
3751 skb->dev = ai->wifidev; 3751 skb->dev = ai->wifidev;
3752 skb->protocol = htons(ETH_P_802_2); 3752 skb->protocol = htons(ETH_P_802_2);
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;
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index c878a2f3239c..b04c56a25cc5 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -8133,7 +8133,7 @@ static void ipw_handle_mgmt_packet(struct ipw_priv *priv,
8133 skb->dev = priv->ieee->dev; 8133 skb->dev = priv->ieee->dev;
8134 8134
8135 /* Point raw at the ieee80211_stats */ 8135 /* Point raw at the ieee80211_stats */
8136 skb->mac.raw = skb->data; 8136 skb_reset_mac_header(skb);
8137 8137
8138 skb->pkt_type = PACKET_OTHERHOST; 8138 skb->pkt_type = PACKET_OTHERHOST;
8139 skb->protocol = __constant_htons(ETH_P_80211_STATS); 8139 skb->protocol = __constant_htons(ETH_P_80211_STATS);
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
index 3f9d78d059b5..f1415bff527f 100644
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -770,7 +770,7 @@ static void orinoco_rx_monitor(struct net_device *dev, u16 rxfid,
770 770
771 /* Copy the 802.11 header to the skb */ 771 /* Copy the 802.11 header to the skb */
772 memcpy(skb_put(skb, hdrlen), &(desc->frame_ctl), hdrlen); 772 memcpy(skb_put(skb, hdrlen), &(desc->frame_ctl), hdrlen);
773 skb->mac.raw = skb->data; 773 skb_reset_mac_header(skb);
774 774
775 /* If any, copy the data from the card to the skb */ 775 /* If any, copy the data from the card to the skb */
776 if (datalen > 0) { 776 if (datalen > 0) {
diff --git a/drivers/net/wireless/prism54/islpci_eth.c b/drivers/net/wireless/prism54/islpci_eth.c
index fc2e0f3a896e..6ebfff034242 100644
--- a/drivers/net/wireless/prism54/islpci_eth.c
+++ b/drivers/net/wireless/prism54/islpci_eth.c
@@ -303,7 +303,7 @@ islpci_monitor_rx(islpci_private *priv, struct sk_buff **skb)
303 skb_pull(*skb, sizeof (struct rfmon_header)); 303 skb_pull(*skb, sizeof (struct rfmon_header));
304 304
305 (*skb)->protocol = htons(ETH_P_802_2); 305 (*skb)->protocol = htons(ETH_P_802_2);
306 (*skb)->mac.raw = (*skb)->data; 306 skb_reset_mac_header(*skb);
307 (*skb)->pkt_type = PACKET_OTHERHOST; 307 (*skb)->pkt_type = PACKET_OTHERHOST;
308 308
309 return 0; 309 return 0;
diff --git a/drivers/net/wireless/strip.c b/drivers/net/wireless/strip.c
index f5ce1c6063d8..2a299a0676a6 100644
--- a/drivers/net/wireless/strip.c
+++ b/drivers/net/wireless/strip.c
@@ -2009,7 +2009,7 @@ static void deliver_packet(struct strip *strip_info, STRIP_Header * header,
2009 packetlen); 2009 packetlen);
2010 skb->dev = get_strip_dev(strip_info); 2010 skb->dev = get_strip_dev(strip_info);
2011 skb->protocol = header->protocol; 2011 skb->protocol = header->protocol;
2012 skb->mac.raw = skb->data; 2012 skb_reset_mac_header(skb);
2013 2013
2014 /* Having put a fake header on the front of the sk_buff for the */ 2014 /* Having put a fake header on the front of the sk_buff for the */
2015 /* benefit of tools like tcpdump, skb_pull now 'consumes' that */ 2015 /* benefit of tools like tcpdump, skb_pull now 'consumes' that */
diff --git a/drivers/s390/net/ctcmain.c b/drivers/s390/net/ctcmain.c
index 0d6d5fcc128b..787c01317042 100644
--- a/drivers/s390/net/ctcmain.c
+++ b/drivers/s390/net/ctcmain.c
@@ -455,7 +455,7 @@ ctc_unpack_skb(struct channel *ch, struct sk_buff *pskb)
455 return; 455 return;
456 } 456 }
457 skb_put(pskb, header->length); 457 skb_put(pskb, header->length);
458 pskb->mac.raw = pskb->data; 458 skb_reset_mac_header(pskb);
459 len -= header->length; 459 len -= header->length;
460 skb = dev_alloc_skb(pskb->len); 460 skb = dev_alloc_skb(pskb->len);
461 if (!skb) { 461 if (!skb) {
@@ -473,7 +473,7 @@ ctc_unpack_skb(struct channel *ch, struct sk_buff *pskb)
473 return; 473 return;
474 } 474 }
475 memcpy(skb_put(skb, pskb->len), pskb->data, pskb->len); 475 memcpy(skb_put(skb, pskb->len), pskb->data, pskb->len);
476 skb->mac.raw = skb->data; 476 skb_reset_mac_header(skb);
477 skb->dev = pskb->dev; 477 skb->dev = pskb->dev;
478 skb->protocol = pskb->protocol; 478 skb->protocol = pskb->protocol;
479 pskb->ip_summed = CHECKSUM_UNNECESSARY; 479 pskb->ip_summed = CHECKSUM_UNNECESSARY;
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c
index 594320ca1b7c..82edf2014402 100644
--- a/drivers/s390/net/netiucv.c
+++ b/drivers/s390/net/netiucv.c
@@ -635,7 +635,7 @@ static void netiucv_unpack_skb(struct iucv_connection *conn,
635 return; 635 return;
636 } 636 }
637 skb_put(pskb, header->next); 637 skb_put(pskb, header->next);
638 pskb->mac.raw = pskb->data; 638 skb_reset_mac_header(pskb);
639 skb = dev_alloc_skb(pskb->len); 639 skb = dev_alloc_skb(pskb->len);
640 if (!skb) { 640 if (!skb) {
641 PRINT_WARN("%s Out of memory in netiucv_unpack_skb\n", 641 PRINT_WARN("%s Out of memory in netiucv_unpack_skb\n",
@@ -646,7 +646,7 @@ static void netiucv_unpack_skb(struct iucv_connection *conn,
646 return; 646 return;
647 } 647 }
648 memcpy(skb_put(skb, pskb->len), pskb->data, pskb->len); 648 memcpy(skb_put(skb, pskb->len), pskb->data, pskb->len);
649 skb->mac.raw = skb->data; 649 skb_reset_mac_header(skb);
650 skb->dev = pskb->dev; 650 skb->dev = pskb->dev;
651 skb->protocol = pskb->protocol; 651 skb->protocol = pskb->protocol;
652 pskb->ip_summed = CHECKSUM_UNNECESSARY; 652 pskb->ip_summed = CHECKSUM_UNNECESSARY;
diff --git a/drivers/s390/net/qeth_eddp.c b/drivers/s390/net/qeth_eddp.c
index 7c735e1fe063..910a8ab66b05 100644
--- a/drivers/s390/net/qeth_eddp.c
+++ b/drivers/s390/net/qeth_eddp.c
@@ -486,7 +486,7 @@ qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx,
486 return -ENOMEM; 486 return -ENOMEM;
487 } 487 }
488 if (qhdr->hdr.l2.id == QETH_HEADER_TYPE_LAYER2) { 488 if (qhdr->hdr.l2.id == QETH_HEADER_TYPE_LAYER2) {
489 skb->mac.raw = (skb->data) + sizeof(struct qeth_hdr); 489 skb->mac.raw = skb->data + sizeof(struct qeth_hdr);
490 memcpy(&eddp->mac, eth_hdr(skb), ETH_HLEN); 490 memcpy(&eddp->mac, eth_hdr(skb), ETH_HLEN);
491#ifdef CONFIG_QETH_VLAN 491#ifdef CONFIG_QETH_VLAN
492 if (eddp->mac.h_proto == __constant_htons(ETH_P_8021Q)) { 492 if (eddp->mac.h_proto == __constant_htons(ETH_P_8021Q)) {
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c
index d502b77adf6b..28822025b791 100644
--- a/drivers/s390/net/qeth_main.c
+++ b/drivers/s390/net/qeth_main.c
@@ -2278,7 +2278,7 @@ qeth_type_trans(struct sk_buff *skb, struct net_device *dev)
2278 (card->info.link_type == QETH_LINK_TYPE_LANE_TR)) 2278 (card->info.link_type == QETH_LINK_TYPE_LANE_TR))
2279 return tr_type_trans(skb,dev); 2279 return tr_type_trans(skb,dev);
2280#endif /* CONFIG_TR */ 2280#endif /* CONFIG_TR */
2281 skb->mac.raw = skb->data; 2281 skb_reset_mac_header(skb);
2282 skb_pull(skb, ETH_HLEN ); 2282 skb_pull(skb, ETH_HLEN );
2283 eth = eth_hdr(skb); 2283 eth = eth_hdr(skb);
2284 2284
@@ -2461,7 +2461,7 @@ qeth_rebuild_skb(struct qeth_card *card, struct sk_buff *skb,
2461 if (card->options.fake_ll) 2461 if (card->options.fake_ll)
2462 qeth_rebuild_skb_fake_ll(card, skb, hdr); 2462 qeth_rebuild_skb_fake_ll(card, skb, hdr);
2463 else 2463 else
2464 skb->mac.raw = skb->data; 2464 skb_reset_mac_header(skb);
2465 skb->ip_summed = card->options.checksum_type; 2465 skb->ip_summed = card->options.checksum_type;
2466 if (card->options.checksum_type == HW_CHECKSUMMING){ 2466 if (card->options.checksum_type == HW_CHECKSUMMING){
2467 if ( (hdr->hdr.l3.ext_flags & 2467 if ( (hdr->hdr.l3.ext_flags &
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h
index d4b333938f73..0fe562af9c8c 100644
--- a/include/linux/hdlc.h
+++ b/include/linux/hdlc.h
@@ -132,8 +132,8 @@ static __inline__ __be16 hdlc_type_trans(struct sk_buff *skb,
132{ 132{
133 hdlc_device *hdlc = dev_to_hdlc(dev); 133 hdlc_device *hdlc = dev_to_hdlc(dev);
134 134
135 skb->mac.raw = skb->data; 135 skb->dev = dev;
136 skb->dev = dev; 136 skb_reset_mac_header(skb);
137 137
138 if (hdlc->proto->type_trans) 138 if (hdlc->proto->type_trans)
139 return hdlc->proto->type_trans(skb, dev); 139 return hdlc->proto->type_trans(skb, dev);
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index df229bd5f1a9..748f254b50cc 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -960,6 +960,11 @@ static inline void skb_reserve(struct sk_buff *skb, int len)
960 skb->tail += len; 960 skb->tail += len;
961} 961}
962 962
963static inline void skb_reset_mac_header(struct sk_buff *skb)
964{
965 skb->mac.raw = skb->data;
966}
967
963/* 968/*
964 * CPUs often take a performance hit when accessing unaligned memory 969 * CPUs often take a performance hit when accessing unaligned memory
965 * locations. The actual performance hit varies, it can be small if the 970 * locations. The actual performance hit varies, it can be small if the
diff --git a/include/net/ax25.h b/include/net/ax25.h
index 47ff2f46e908..99a4e364c74a 100644
--- a/include/net/ax25.h
+++ b/include/net/ax25.h
@@ -263,8 +263,8 @@ static __inline__ void ax25_cb_put(ax25_cb *ax25)
263static inline __be16 ax25_type_trans(struct sk_buff *skb, struct net_device *dev) 263static inline __be16 ax25_type_trans(struct sk_buff *skb, struct net_device *dev)
264{ 264{
265 skb->dev = dev; 265 skb->dev = dev;
266 skb_reset_mac_header(skb);
266 skb->pkt_type = PACKET_HOST; 267 skb->pkt_type = PACKET_HOST;
267 skb->mac.raw = skb->data;
268 return htons(ETH_P_AX25); 268 return htons(ETH_P_AX25);
269} 269}
270 270
diff --git a/include/net/x25device.h b/include/net/x25device.h
index 1d10c879f7e2..1415bcf93980 100644
--- a/include/net/x25device.h
+++ b/include/net/x25device.h
@@ -7,8 +7,8 @@
7 7
8static inline __be16 x25_type_trans(struct sk_buff *skb, struct net_device *dev) 8static inline __be16 x25_type_trans(struct sk_buff *skb, struct net_device *dev)
9{ 9{
10 skb->mac.raw = skb->data;
11 skb->dev = dev; 10 skb->dev = dev;
11 skb_reset_mac_header(skb);
12 skb->pkt_type = PACKET_HOST; 12 skb->pkt_type = PACKET_HOST;
13 13
14 return htons(ETH_P_X25); 14 return htons(ETH_P_X25);
diff --git a/net/802/fddi.c b/net/802/fddi.c
index f8a0c9f6fec9..91dde41b5481 100644
--- a/net/802/fddi.c
+++ b/net/802/fddi.c
@@ -131,7 +131,7 @@ __be16 fddi_type_trans(struct sk_buff *skb, struct net_device *dev)
131 */ 131 */
132 132
133 skb->dev = dev; 133 skb->dev = dev;
134 skb->mac.raw = skb->data; /* point to frame control (FC) */ 134 skb_reset_mac_header(skb); /* point to frame control (FC) */
135 135
136 if(fddi->hdr.llc_8022_1.dsap==0xe0) 136 if(fddi->hdr.llc_8022_1.dsap==0xe0)
137 { 137 {
diff --git a/net/802/hippi.c b/net/802/hippi.c
index 138302c14ee6..d87190038edb 100644
--- a/net/802/hippi.c
+++ b/net/802/hippi.c
@@ -131,7 +131,7 @@ __be16 hippi_type_trans(struct sk_buff *skb, struct net_device *dev)
131 * set the raw address here. 131 * set the raw address here.
132 */ 132 */
133 skb->dev = dev; 133 skb->dev = dev;
134 skb->mac.raw = skb->data; 134 skb_reset_mac_header(skb);
135 hip = (struct hippi_hdr *)skb->mac.raw; 135 hip = (struct hippi_hdr *)skb->mac.raw;
136 skb_pull(skb, HIPPI_HLEN); 136 skb_pull(skb, HIPPI_HLEN);
137 137
diff --git a/net/802/tr.c b/net/802/tr.c
index 987d91559bcc..eb2de0d16208 100644
--- a/net/802/tr.c
+++ b/net/802/tr.c
@@ -194,7 +194,7 @@ __be16 tr_type_trans(struct sk_buff *skb, struct net_device *dev)
194 unsigned riflen=0; 194 unsigned riflen=0;
195 195
196 skb->dev = dev; 196 skb->dev = dev;
197 skb->mac.raw = skb->data; 197 skb_reset_mac_header(skb);
198 trh = tr_hdr(skb); 198 trh = tr_hdr(skb);
199 199
200 if(trh->saddr[0] & TR_RII) 200 if(trh->saddr[0] & TR_RII)
diff --git a/net/atm/br2684.c b/net/atm/br2684.c
index c444f5eda22d..900d42ca8a50 100644
--- a/net/atm/br2684.c
+++ b/net/atm/br2684.c
@@ -458,7 +458,7 @@ static void br2684_push(struct atm_vcc *atmvcc, struct sk_buff *skb)
458 /* FIXME: tcpdump shows that pointer to mac header is 2 bytes earlier, 458 /* FIXME: tcpdump shows that pointer to mac header is 2 bytes earlier,
459 than should be. What else should I set? */ 459 than should be. What else should I set? */
460 skb_pull(skb, plen); 460 skb_pull(skb, plen);
461 skb->mac.raw = ((char *) (skb->data)) - ETH_HLEN; 461 skb->mac.raw = skb->data - ETH_HLEN;
462 skb->pkt_type = PACKET_HOST; 462 skb->pkt_type = PACKET_HOST;
463#ifdef CONFIG_BR2684_FAST_TRANS 463#ifdef CONFIG_BR2684_FAST_TRANS
464 skb->protocol = ((u16 *) skb->data)[-1]; 464 skb->protocol = ((u16 *) skb->data)[-1];
diff --git a/net/atm/clip.c b/net/atm/clip.c
index 8c3825816085..ccba24ffb966 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -213,7 +213,7 @@ static void clip_push(struct atm_vcc *vcc, struct sk_buff *skb)
213 return; 213 return;
214 } 214 }
215 ATM_SKB(skb)->vcc = vcc; 215 ATM_SKB(skb)->vcc = vcc;
216 skb->mac.raw = skb->data; 216 skb_reset_mac_header(skb);
217 if (!clip_vcc->encap 217 if (!clip_vcc->encap
218 || skb->len < RFC1483LLC_LEN 218 || skb->len < RFC1483LLC_LEN
219 || memcmp(skb->data, llc_oui, sizeof (llc_oui))) 219 || memcmp(skb->data, llc_oui, sizeof (llc_oui)))
diff --git a/net/ax25/ax25_in.c b/net/ax25/ax25_in.c
index 4a6b26becadc..6d11b0633d5a 100644
--- a/net/ax25/ax25_in.c
+++ b/net/ax25/ax25_in.c
@@ -122,7 +122,7 @@ int ax25_rx_iframe(ax25_cb *ax25, struct sk_buff *skb)
122 } 122 }
123 123
124 skb_pull(skb, 1); /* Remove PID */ 124 skb_pull(skb, 1); /* Remove PID */
125 skb->mac.raw = skb->nh.raw; 125 skb_reset_mac_header(skb);
126 skb->nh.raw = skb->data; 126 skb->nh.raw = skb->data;
127 skb->dev = ax25->ax25_dev->dev; 127 skb->dev = ax25->ax25_dev->dev;
128 skb->pkt_type = PACKET_HOST; 128 skb->pkt_type = PACKET_HOST;
diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c
index f7ade186bf93..b1c2fa96c69e 100644
--- a/net/bluetooth/bnep/core.c
+++ b/net/bluetooth/bnep/core.c
@@ -326,7 +326,7 @@ static inline int bnep_rx_frame(struct bnep_session *s, struct sk_buff *skb)
326 return 0; 326 return 0;
327 } 327 }
328 328
329 skb->mac.raw = skb->data; 329 skb_reset_mac_header(skb);
330 330
331 /* Verify and pull out header */ 331 /* Verify and pull out header */
332 if (!skb_pull(skb, __bnep_rx_hlen[type & BNEP_TYPE_MASK])) 332 if (!skb_pull(skb, __bnep_rx_hlen[type & BNEP_TYPE_MASK]))
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index 905a39c33a16..b22ada529cc3 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -37,7 +37,7 @@ int br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
37 br->statistics.tx_packets++; 37 br->statistics.tx_packets++;
38 br->statistics.tx_bytes += skb->len; 38 br->statistics.tx_bytes += skb->len;
39 39
40 skb->mac.raw = skb->data; 40 skb_reset_mac_header(skb);
41 skb_pull(skb, ETH_HLEN); 41 skb_pull(skb, ETH_HLEN);
42 42
43 if (dest[0] & 1) 43 if (dest[0] & 1)
diff --git a/net/core/dev.c b/net/core/dev.c
index 424d6d0e98f8..2fcaf5bc4a9c 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1066,7 +1066,7 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
1066 set by sender, so that the second statement is 1066 set by sender, so that the second statement is
1067 just protection against buggy protocols. 1067 just protection against buggy protocols.
1068 */ 1068 */
1069 skb2->mac.raw = skb2->data; 1069 skb_reset_mac_header(skb2);
1070 1070
1071 if (skb2->nh.raw < skb2->data || 1071 if (skb2->nh.raw < skb2->data ||
1072 skb2->nh.raw > skb2->tail) { 1072 skb2->nh.raw > skb2->tail) {
@@ -1206,7 +1206,7 @@ struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features)
1206 1206
1207 BUG_ON(skb_shinfo(skb)->frag_list); 1207 BUG_ON(skb_shinfo(skb)->frag_list);
1208 1208
1209 skb->mac.raw = skb->data; 1209 skb_reset_mac_header(skb);
1210 skb->mac_len = skb->nh.raw - skb->data; 1210 skb->mac_len = skb->nh.raw - skb->data;
1211 __skb_pull(skb, skb->mac_len); 1211 __skb_pull(skb, skb->mac_len);
1212 1212
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 32a9f80b5f19..0ad3896bbf62 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -324,7 +324,7 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
324 iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl); 324 iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
325 325
326 eth = (struct ethhdr *) skb_push(skb, ETH_HLEN); 326 eth = (struct ethhdr *) skb_push(skb, ETH_HLEN);
327 skb->mac.raw = skb->data; 327 skb_reset_mac_header(skb);
328 skb->protocol = eth->h_proto = htons(ETH_P_IP); 328 skb->protocol = eth->h_proto = htons(ETH_P_IP);
329 memcpy(eth->h_source, np->local_mac, 6); 329 memcpy(eth->h_source, np->local_mac, 6);
330 memcpy(eth->h_dest, np->remote_mac, 6); 330 memcpy(eth->h_dest, np->remote_mac, 6);
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 336958fbbcb2..8f6ebd0d3693 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1928,7 +1928,7 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features)
1928 nskb->mac_len = skb->mac_len; 1928 nskb->mac_len = skb->mac_len;
1929 1929
1930 skb_reserve(nskb, headroom); 1930 skb_reserve(nskb, headroom);
1931 nskb->mac.raw = nskb->data; 1931 skb_reset_mac_header(nskb);
1932 nskb->nh.raw = nskb->data + skb->mac_len; 1932 nskb->nh.raw = nskb->data + skb->mac_len;
1933 nskb->h.raw = nskb->nh.raw + (skb->h.raw - skb->nh.raw); 1933 nskb->h.raw = nskb->nh.raw + (skb->h.raw - skb->nh.raw);
1934 memcpy(skb_put(nskb, doffset), skb->data, doffset); 1934 memcpy(skb_put(nskb, doffset), skb->data, doffset);
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index c1b5502f195b..ef94ca56d7bd 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -1537,7 +1537,7 @@ int dn_cache_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void *arg)
1537 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); 1537 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
1538 if (skb == NULL) 1538 if (skb == NULL)
1539 return -ENOBUFS; 1539 return -ENOBUFS;
1540 skb->mac.raw = skb->data; 1540 skb_reset_mac_header(skb);
1541 cb = DN_SKB_CB(skb); 1541 cb = DN_SKB_CB(skb);
1542 1542
1543 if (rta[RTA_SRC-1]) 1543 if (rta[RTA_SRC-1])
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index 01ecbe42b1e7..0ac2524f3b68 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -157,7 +157,7 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
157 unsigned char *rawp; 157 unsigned char *rawp;
158 158
159 skb->dev = dev; 159 skb->dev = dev;
160 skb->mac.raw = skb->data; 160 skb_reset_mac_header(skb);
161 skb_pull(skb, ETH_HLEN); 161 skb_pull(skb, ETH_HLEN);
162 eth = eth_hdr(skb); 162 eth = eth_hdr(skb);
163 163
diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c
index d5f5c6616689..f39bf7c41012 100644
--- a/net/ieee80211/ieee80211_rx.c
+++ b/net/ieee80211/ieee80211_rx.c
@@ -42,7 +42,7 @@ static void ieee80211_monitor_rx(struct ieee80211_device *ieee,
42 u16 fc = le16_to_cpu(hdr->frame_ctl); 42 u16 fc = le16_to_cpu(hdr->frame_ctl);
43 43
44 skb->dev = ieee->dev; 44 skb->dev = ieee->dev;
45 skb->mac.raw = skb->data; 45 skb_reset_mac_header(skb);
46 skb_pull(skb, ieee80211_get_hdrlen(fc)); 46 skb_pull(skb, ieee80211_get_hdrlen(fc));
47 skb->pkt_type = PACKET_OTHERHOST; 47 skb->pkt_type = PACKET_OTHERHOST;
48 skb->protocol = __constant_htons(ETH_P_80211_RAW); 48 skb->protocol = __constant_htons(ETH_P_80211_RAW);
@@ -789,10 +789,11 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
789 789
790 if (skb2 != NULL) { 790 if (skb2 != NULL) {
791 /* send to wireless media */ 791 /* send to wireless media */
792 skb2->dev = dev;
792 skb2->protocol = __constant_htons(ETH_P_802_3); 793 skb2->protocol = __constant_htons(ETH_P_802_3);
793 skb2->mac.raw = skb2->nh.raw = skb2->data; 794 skb_reset_mac_header(skb2);
795 skb2->nh.raw = skb2->data;
794 /* skb2->nh.raw = skb2->data + ETH_HLEN; */ 796 /* skb2->nh.raw = skb2->data + ETH_HLEN; */
795 skb2->dev = dev;
796 dev_queue_xmit(skb2); 797 dev_queue_xmit(skb2);
797 } 798 }
798#endif 799#endif
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 9151da642318..88f8aae873f4 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -616,7 +616,7 @@ static int ipgre_rcv(struct sk_buff *skb)
616 offset += 4; 616 offset += 4;
617 } 617 }
618 618
619 skb->mac.raw = skb->nh.raw; 619 skb_reset_mac_header(skb);
620 skb->nh.raw = __pskb_pull(skb, offset); 620 skb->nh.raw = __pskb_pull(skb, offset);
621 skb_postpull_rcsum(skb, skb->h.raw, offset); 621 skb_postpull_rcsum(skb, skb->h.raw, offset);
622 skb->pkt_type = PACKET_HOST; 622 skb->pkt_type = PACKET_HOST;
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 5db301b33372..ddba857bd243 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -95,7 +95,7 @@ __inline__ void ip_send_check(struct iphdr *iph)
95/* dev_loopback_xmit for use with netfilter. */ 95/* dev_loopback_xmit for use with netfilter. */
96static int ip_dev_loopback_xmit(struct sk_buff *newskb) 96static int ip_dev_loopback_xmit(struct sk_buff *newskb)
97{ 97{
98 newskb->mac.raw = newskb->data; 98 skb_reset_mac_header(newskb);
99 __skb_pull(newskb, newskb->nh.raw - newskb->data); 99 __skb_pull(newskb, newskb->nh.raw - newskb->data);
100 newskb->pkt_type = PACKET_LOOPBACK; 100 newskb->pkt_type = PACKET_LOOPBACK;
101 newskb->ip_summed = CHECKSUM_UNNECESSARY; 101 newskb->ip_summed = CHECKSUM_UNNECESSARY;
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 0b3d7bf40f4e..29ee7be45aa6 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2747,7 +2747,8 @@ int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg)
2747 /* Reserve room for dummy headers, this skb can pass 2747 /* Reserve room for dummy headers, this skb can pass
2748 through good chunk of routing engine. 2748 through good chunk of routing engine.
2749 */ 2749 */
2750 skb->mac.raw = skb->nh.raw = skb->data; 2750 skb_reset_mac_header(skb);
2751 skb->nh.raw = skb->data;
2751 2752
2752 /* Bugfix: need to give ip_route_input enough of an IP header to not gag. */ 2753 /* Bugfix: need to give ip_route_input enough of an IP header to not gag. */
2753 skb->nh.iph->protocol = IPPROTO_ICMP; 2754 skb->nh.iph->protocol = IPPROTO_ICMP;
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 7e25043d826c..a5f4562b5d29 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -88,7 +88,7 @@ static inline int ip6_output_finish(struct sk_buff *skb)
88/* dev_loopback_xmit for use with netfilter. */ 88/* dev_loopback_xmit for use with netfilter. */
89static int ip6_dev_loopback_xmit(struct sk_buff *newskb) 89static int ip6_dev_loopback_xmit(struct sk_buff *newskb)
90{ 90{
91 newskb->mac.raw = newskb->data; 91 skb_reset_mac_header(newskb);
92 __skb_pull(newskb, newskb->nh.raw - newskb->data); 92 __skb_pull(newskb, newskb->nh.raw - newskb->data);
93 newskb->pkt_type = PACKET_LOOPBACK; 93 newskb->pkt_type = PACKET_LOOPBACK;
94 newskb->ip_summed = CHECKSUM_UNNECESSARY; 94 newskb->ip_summed = CHECKSUM_UNNECESSARY;
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index cc08cc48e9e9..0aa4762f53f7 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2218,7 +2218,7 @@ int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg)
2218 /* Reserve room for dummy headers, this skb can pass 2218 /* Reserve room for dummy headers, this skb can pass
2219 through good chunk of routing engine. 2219 through good chunk of routing engine.
2220 */ 2220 */
2221 skb->mac.raw = skb->data; 2221 skb_reset_mac_header(skb);
2222 skb_reserve(skb, MAX_HEADER + sizeof(struct ipv6hdr)); 2222 skb_reserve(skb, MAX_HEADER + sizeof(struct ipv6hdr));
2223 2223
2224 rt = (struct rt6_info*) ip6_route_output(NULL, &fl); 2224 rt = (struct rt6_info*) ip6_route_output(NULL, &fl);
diff --git a/net/irda/irlap_frame.c b/net/irda/irlap_frame.c
index 0b04603e9c47..1b7e2490e2e1 100644
--- a/net/irda/irlap_frame.c
+++ b/net/irda/irlap_frame.c
@@ -93,7 +93,8 @@ void irlap_queue_xmit(struct irlap_cb *self, struct sk_buff *skb)
93{ 93{
94 /* Some common init stuff */ 94 /* Some common init stuff */
95 skb->dev = self->netdev; 95 skb->dev = self->netdev;
96 skb->h.raw = skb->nh.raw = skb->mac.raw = skb->data; 96 skb_reset_mac_header(skb);
97 skb->h.raw = skb->nh.raw = skb->data;
97 skb->protocol = htons(ETH_P_IRDA); 98 skb->protocol = htons(ETH_P_IRDA);
98 skb->priority = TC_PRIO_BESTEFFORT; 99 skb->priority = TC_PRIO_BESTEFFORT;
99 100
diff --git a/net/irda/wrapper.c b/net/irda/wrapper.c
index 5abfb71aae8d..2acc66dfb558 100644
--- a/net/irda/wrapper.c
+++ b/net/irda/wrapper.c
@@ -256,7 +256,7 @@ async_bump(struct net_device *dev,
256 256
257 /* Feed it to IrLAP layer */ 257 /* Feed it to IrLAP layer */
258 dataskb->dev = dev; 258 dataskb->dev = dev;
259 dataskb->mac.raw = dataskb->data; 259 skb_reset_mac_header(dataskb);
260 dataskb->protocol = htons(ETH_P_IRDA); 260 dataskb->protocol = htons(ETH_P_IRDA);
261 261
262 netif_rx(dataskb); 262 netif_rx(dataskb);
diff --git a/net/llc/llc_output.c b/net/llc/llc_output.c
index f4291f349e92..729e25108275 100644
--- a/net/llc/llc_output.c
+++ b/net/llc/llc_output.c
@@ -52,7 +52,7 @@ int llc_mac_hdr_init(struct sk_buff *skb,
52 if (da) { 52 if (da) {
53 memcpy(trh->daddr, da, dev->addr_len); 53 memcpy(trh->daddr, da, dev->addr_len);
54 tr_source_route(skb, trh, dev); 54 tr_source_route(skb, trh, dev);
55 skb->mac.raw = skb->data; 55 skb_reset_mac_header(skb);
56 } 56 }
57 break; 57 break;
58 } 58 }
diff --git a/net/netrom/nr_dev.c b/net/netrom/nr_dev.c
index 9a97ed6e6910..17c3f1ef83e9 100644
--- a/net/netrom/nr_dev.c
+++ b/net/netrom/nr_dev.c
@@ -56,7 +56,7 @@ int nr_rx_ip(struct sk_buff *skb, struct net_device *dev)
56 56
57 /* Spoof incoming device */ 57 /* Spoof incoming device */
58 skb->dev = dev; 58 skb->dev = dev;
59 skb->mac.raw = skb->nh.raw; 59 skb_reset_mac_header(skb);
60 skb->nh.raw = skb->data; 60 skb->nh.raw = skb->data;
61 skb->pkt_type = PACKET_HOST; 61 skb->pkt_type = PACKET_HOST;
62 62
diff --git a/net/wanrouter/wanmain.c b/net/wanrouter/wanmain.c
index 5d2d93dc0837..c49e223084f1 100644
--- a/net/wanrouter/wanmain.c
+++ b/net/wanrouter/wanmain.c
@@ -339,7 +339,7 @@ __be16 wanrouter_type_trans(struct sk_buff *skb, struct net_device *dev)
339 skb->protocol = ethertype; 339 skb->protocol = ethertype;
340 skb->pkt_type = PACKET_HOST; /* Physically point to point */ 340 skb->pkt_type = PACKET_HOST; /* Physically point to point */
341 skb_pull(skb, cnt); 341 skb_pull(skb, cnt);
342 skb->mac.raw = skb->data; 342 skb_reset_mac_header(skb);
343 return ethertype; 343 return ethertype;
344} 344}
345 345