aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/arcnet
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/arcnet')
-rw-r--r--drivers/net/arcnet/arc-rawmode.c2
-rw-r--r--drivers/net/arcnet/arcnet.c17
-rw-r--r--drivers/net/arcnet/capmode.c14
-rw-r--r--drivers/net/arcnet/rfc1051.c2
-rw-r--r--drivers/net/arcnet/rfc1201.c2
5 files changed, 20 insertions, 17 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/arcnet.c b/drivers/net/arcnet/arcnet.c
index 83004fdab0a4..681e20b8466f 100644
--- a/drivers/net/arcnet/arcnet.c
+++ b/drivers/net/arcnet/arcnet.c
@@ -519,9 +519,12 @@ static int arcnet_header(struct sk_buff *skb, struct net_device *dev,
519 * real header when we do rebuild_header. 519 * real header when we do rebuild_header.
520 */ 520 */
521 *(uint16_t *) skb_push(skb, 2) = type; 521 *(uint16_t *) skb_push(skb, 2) = type;
522 if (skb->nh.raw - skb->mac.raw != 2) 522 /*
523 * XXX: Why not use skb->mac_len?
524 */
525 if (skb->network_header - skb->mac_header != 2)
523 BUGMSG(D_NORMAL, "arcnet_header: Yikes! diff (%d) is not 2!\n", 526 BUGMSG(D_NORMAL, "arcnet_header: Yikes! diff (%d) is not 2!\n",
524 (int)(skb->nh.raw - skb->mac.raw)); 527 (int)(skb->network_header - skb->mac_header));
525 return -2; /* return error -- can't transmit yet! */ 528 return -2; /* return error -- can't transmit yet! */
526 } 529 }
527 else { 530 else {
@@ -554,11 +557,13 @@ static int arcnet_rebuild_header(struct sk_buff *skb)
554 unsigned short type; 557 unsigned short type;
555 uint8_t daddr=0; 558 uint8_t daddr=0;
556 struct ArcProto *proto; 559 struct ArcProto *proto;
557 560 /*
558 if (skb->nh.raw - skb->mac.raw != 2) { 561 * XXX: Why not use skb->mac_len?
562 */
563 if (skb->network_header - skb->mac_header != 2) {
559 BUGMSG(D_NORMAL, 564 BUGMSG(D_NORMAL,
560 "rebuild_header: shouldn't be here! (hdrsize=%d)\n", 565 "rebuild_header: shouldn't be here! (hdrsize=%d)\n",
561 (int)(skb->nh.raw - skb->mac.raw)); 566 (int)(skb->network_header - skb->mac_header));
562 return 0; 567 return 0;
563 } 568 }
564 type = *(uint16_t *) skb_pull(skb, 2); 569 type = *(uint16_t *) skb_pull(skb, 2);
diff --git a/drivers/net/arcnet/capmode.c b/drivers/net/arcnet/capmode.c
index 66485585ab39..cc4610db6395 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_header(skb);
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,13 +268,13 @@ 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 *)skb_mac_header(ackskb);
275 ackskb->mac.raw = ackskb->data;
276 /* skb_pull(ackskb, ARC_HDR_SIZE); */ 273 /* skb_pull(ackskb, ARC_HDR_SIZE); */
277 274
278 275
279 memcpy(ackpkt, lp->outgoing.skb->data, ARC_HDR_SIZE+sizeof(struct arc_cap)); 276 skb_copy_from_linear_data(lp->outgoing.skb, ackpkt,
277 ARC_HDR_SIZE + sizeof(struct arc_cap));
280 ackpkt->soft.cap.proto=0; /* using protocol 0 for acknowledge */ 278 ackpkt->soft.cap.proto=0; /* using protocol 0 for acknowledge */
281 ackpkt->soft.cap.mes.ack=acked; 279 ackpkt->soft.cap.mes.ack=acked;
282 280
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)