diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-03-19 18:30:44 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:24:32 -0400 |
commit | 459a98ed881802dee55897441bc7f77af614368e (patch) | |
tree | b81f76632d8f2e21eb91ec3d885091a98398d93e /drivers/net/arcnet | |
parent | 4c13eb6657fe9ef7b4dc8f1a405c902e9e5234e0 (diff) |
[SK_BUFF]: Introduce skb_reset_mac_header(skb)
For the common, open coded 'skb->mac.raw = skb->data' operation, so that we can
later turn skb->mac.raw into a offset, reducing the size of struct sk_buff in
64bit land while possibly keeping it as a pointer on 32bit.
This one touches just the most simple case, next will handle the slightly more
"complex" cases.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/arcnet')
-rw-r--r-- | drivers/net/arcnet/arc-rawmode.c | 2 | ||||
-rw-r--r-- | drivers/net/arcnet/capmode.c | 11 | ||||
-rw-r--r-- | drivers/net/arcnet/rfc1051.c | 2 | ||||
-rw-r--r-- | drivers/net/arcnet/rfc1201.c | 2 |
4 files changed, 7 insertions, 10 deletions
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) |