aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-04-10 23:45:18 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:24:46 -0400
commitc1d2bbe1cd6c7bbdc6d532cefebb66c7efb789ce (patch)
tree03a715961ba576a11cbc0e91c5d465e4c4d95d82 /drivers/net
parent57effc70a5be9f7804e9a99964eb7265367effca (diff)
[SK_BUFF]: Introduce skb_reset_network_header(skb)
For the common, open coded 'skb->nh.raw = skb->data' operation, so that we can later turn skb->nh.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')
-rw-r--r--drivers/net/cxgb3/sge.c3
-rw-r--r--drivers/net/hamradio/bpqether.c2
-rw-r--r--drivers/net/loopback.c2
-rw-r--r--drivers/net/pppoe.c4
-rw-r--r--drivers/net/wan/hdlc_cisco.c2
-rw-r--r--drivers/net/wan/hdlc_fr.c2
-rw-r--r--drivers/net/wan/lmc/lmc_main.c4
-rw-r--r--drivers/net/wireless/hostap/hostap_80211_rx.c4
-rw-r--r--drivers/net/wireless/hostap/hostap_ap.c2
-rw-r--r--drivers/net/wireless/hostap/hostap_main.c2
10 files changed, 14 insertions, 13 deletions
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
index b5cf2a60834d..4dd712088bcf 100644
--- a/drivers/net/cxgb3/sge.c
+++ b/drivers/net/cxgb3/sge.c
@@ -1621,7 +1621,8 @@ static inline int rx_offload(struct t3cdev *tdev, struct sge_rspq *rq,
1621{ 1621{
1622 rq->offload_pkts++; 1622 rq->offload_pkts++;
1623 skb_reset_mac_header(skb); 1623 skb_reset_mac_header(skb);
1624 skb->nh.raw = skb->h.raw = skb->data; 1624 skb_reset_network_header(skb);
1625 skb->h.raw = skb->data;
1625 1626
1626 if (rq->polling) { 1627 if (rq->polling) {
1627 rx_gather[gather_idx++] = skb; 1628 rx_gather[gather_idx++] = skb;
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c
index d2542697e298..656f2789c9ba 100644
--- a/drivers/net/hamradio/bpqether.c
+++ b/drivers/net/hamradio/bpqether.c
@@ -282,7 +282,7 @@ static int bpq_xmit(struct sk_buff *skb, struct net_device *dev)
282 } 282 }
283 283
284 skb->protocol = ax25_type_trans(skb, dev); 284 skb->protocol = ax25_type_trans(skb, dev);
285 skb->nh.raw = skb->data; 285 skb_reset_network_header(skb);
286 dev->hard_header(skb, dev, ETH_P_BPQ, bpq->dest_addr, NULL, 0); 286 dev->hard_header(skb, dev, ETH_P_BPQ, bpq->dest_addr, NULL, 0);
287 bpq->stats.tx_packets++; 287 bpq->stats.tx_packets++;
288 bpq->stats.tx_bytes+=skb->len; 288 bpq->stats.tx_bytes+=skb->len;
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index a71d8e0a9b57..af476d2a513d 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -91,7 +91,7 @@ static void emulate_large_send_offload(struct sk_buff *skb)
91 break; 91 break;
92 skb_reserve(nskb, 32); 92 skb_reserve(nskb, 32);
93 skb_set_mac_header(nskb, -ETH_HLEN); 93 skb_set_mac_header(nskb, -ETH_HLEN);
94 nskb->nh.raw = nskb->data; 94 skb_reset_network_header(nskb);
95 iph = nskb->nh.iph; 95 iph = nskb->nh.iph;
96 memcpy(nskb->data, skb->nh.raw, doffset); 96 memcpy(nskb->data, skb->nh.raw, doffset);
97 if (skb_copy_bits(skb, 97 if (skb_copy_bits(skb,
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c
index 3080a44b23ab..e94790632d55 100644
--- a/drivers/net/pppoe.c
+++ b/drivers/net/pppoe.c
@@ -799,7 +799,7 @@ static int pppoe_sendmsg(struct kiocb *iocb, struct socket *sock,
799 799
800 /* Reserve space for headers. */ 800 /* Reserve space for headers. */
801 skb_reserve(skb, dev->hard_header_len); 801 skb_reserve(skb, dev->hard_header_len);
802 skb->nh.raw = skb->data; 802 skb_reset_network_header(skb);
803 803
804 skb->dev = dev; 804 skb->dev = dev;
805 805
@@ -884,7 +884,7 @@ static int __pppoe_xmit(struct sock *sk, struct sk_buff *skb)
884 memcpy(ph, &hdr, sizeof(struct pppoe_hdr)); 884 memcpy(ph, &hdr, sizeof(struct pppoe_hdr));
885 skb2->protocol = __constant_htons(ETH_P_PPP_SES); 885 skb2->protocol = __constant_htons(ETH_P_PPP_SES);
886 886
887 skb2->nh.raw = skb2->data; 887 skb_reset_network_header(skb2);
888 888
889 skb2->dev = dev; 889 skb2->dev = dev;
890 890
diff --git a/drivers/net/wan/hdlc_cisco.c b/drivers/net/wan/hdlc_cisco.c
index c9664fd8a917..00e0aaadabcc 100644
--- a/drivers/net/wan/hdlc_cisco.c
+++ b/drivers/net/wan/hdlc_cisco.c
@@ -124,7 +124,7 @@ static void cisco_keepalive_send(struct net_device *dev, u32 type,
124 skb_put(skb, sizeof(struct cisco_packet)); 124 skb_put(skb, sizeof(struct cisco_packet));
125 skb->priority = TC_PRIO_CONTROL; 125 skb->priority = TC_PRIO_CONTROL;
126 skb->dev = dev; 126 skb->dev = dev;
127 skb->nh.raw = skb->data; 127 skb_reset_network_header(skb);
128 128
129 dev_queue_xmit(skb); 129 dev_queue_xmit(skb);
130} 130}
diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c
index 3240d10fc86d..b747228c7198 100644
--- a/drivers/net/wan/hdlc_fr.c
+++ b/drivers/net/wan/hdlc_fr.c
@@ -590,7 +590,7 @@ static void fr_lmi_send(struct net_device *dev, int fullrep)
590 skb_put(skb, i); 590 skb_put(skb, i);
591 skb->priority = TC_PRIO_CONTROL; 591 skb->priority = TC_PRIO_CONTROL;
592 skb->dev = dev; 592 skb->dev = dev;
593 skb->nh.raw = skb->data; 593 skb_reset_network_header(skb);
594 594
595 dev_queue_xmit(skb); 595 dev_queue_xmit(skb);
596} 596}
diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c
index 6d288839ddaa..d4851465c83b 100644
--- a/drivers/net/wan/lmc/lmc_main.c
+++ b/drivers/net/wan/lmc/lmc_main.c
@@ -1668,7 +1668,7 @@ static int lmc_rx (struct net_device *dev) /*fold00*/
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_reset_mac_header(skb); 1670 skb_reset_mac_header(skb);
1671// skb->nh.raw = skb->data; 1671 /* skb_reset_network_header(skb); */
1672 skb->dev = dev; 1672 skb->dev = dev;
1673 lmc_proto_netif(sc, skb); 1673 lmc_proto_netif(sc, skb);
1674 1674
@@ -1706,7 +1706,7 @@ static int lmc_rx (struct net_device *dev) /*fold00*/
1706 1706
1707 nsb->protocol = lmc_proto_type(sc, skb); 1707 nsb->protocol = lmc_proto_type(sc, skb);
1708 skb_reset_mac_header(nsb); 1708 skb_reset_mac_header(nsb);
1709// nsb->nh.raw = nsb->data; 1709 /* skb_reset_network_header(nsb); */
1710 nsb->dev = dev; 1710 nsb->dev = dev;
1711 lmc_proto_netif(sc, nsb); 1711 lmc_proto_netif(sc, nsb);
1712 } 1712 }
diff --git a/drivers/net/wireless/hostap/hostap_80211_rx.c b/drivers/net/wireless/hostap/hostap_80211_rx.c
index e4082f9d766b..7b7c1ca8f1f4 100644
--- a/drivers/net/wireless/hostap/hostap_80211_rx.c
+++ b/drivers/net/wireless/hostap/hostap_80211_rx.c
@@ -1076,8 +1076,8 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
1076 skb2->dev = dev; 1076 skb2->dev = dev;
1077 skb2->protocol = __constant_htons(ETH_P_802_3); 1077 skb2->protocol = __constant_htons(ETH_P_802_3);
1078 skb_reset_mac_header(skb2); 1078 skb_reset_mac_header(skb2);
1079 skb2->nh.raw = skb2->data; 1079 skb_reset_network_header(skb2);
1080 /* skb2->nh.raw = skb2->data + ETH_HLEN; */ 1080 /* skb2->nh.raw += ETH_HLEN; */
1081 dev_queue_xmit(skb2); 1081 dev_queue_xmit(skb2);
1082 } 1082 }
1083 1083
diff --git a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c
index cc18f9686d27..797d950d5d61 100644
--- a/drivers/net/wireless/hostap/hostap_ap.c
+++ b/drivers/net/wireless/hostap/hostap_ap.c
@@ -983,7 +983,7 @@ static void prism2_send_mgmt(struct net_device *dev,
983 983
984 skb->dev = dev; 984 skb->dev = dev;
985 skb_reset_mac_header(skb); 985 skb_reset_mac_header(skb);
986 skb->nh.raw = skb->data; 986 skb_reset_network_header(skb);
987 dev_queue_xmit(skb); 987 dev_queue_xmit(skb);
988} 988}
989#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ 989#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c
index c2616e7b0059..1f9edd91565d 100644
--- a/drivers/net/wireless/hostap/hostap_main.c
+++ b/drivers/net/wireless/hostap/hostap_main.c
@@ -1064,7 +1064,7 @@ int prism2_sta_send_mgmt(local_info_t *local, u8 *dst, u16 stype,
1064 1064
1065 skb->dev = dev; 1065 skb->dev = dev;
1066 skb_reset_mac_header(skb); 1066 skb_reset_mac_header(skb);
1067 skb->nh.raw = skb->data; 1067 skb_reset_network_header(skb);
1068 dev_queue_xmit(skb); 1068 dev_queue_xmit(skb);
1069 1069
1070 return 0; 1070 return 0;