aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/arcnet/rfc1201.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2009-01-09 08:01:08 -0500
committerDavid S. Miller <davem@davemloft.net>2009-01-21 17:02:19 -0500
commit5803c5122acb31ebf5f76b1a9925e2c72c4436e1 (patch)
tree5c676bbf593c28fd211ea3af451b5040ef1e6700 /drivers/net/arcnet/rfc1201.c
parent60961ce4d09db7c1ba49da3375123a18845ec864 (diff)
arcnet: convert to internal stats
Use pre-existing network_device_stats inside network_device rather than own private structure. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/arcnet/rfc1201.c')
-rw-r--r--drivers/net/arcnet/rfc1201.c47
1 files changed, 23 insertions, 24 deletions
diff --git a/drivers/net/arcnet/rfc1201.c b/drivers/net/arcnet/rfc1201.c
index 2303d3a1f4b6..745530651c45 100644
--- a/drivers/net/arcnet/rfc1201.c
+++ b/drivers/net/arcnet/rfc1201.c
@@ -92,7 +92,6 @@ static __be16 type_trans(struct sk_buff *skb, struct net_device *dev)
92{ 92{
93 struct archdr *pkt = (struct archdr *) skb->data; 93 struct archdr *pkt = (struct archdr *) skb->data;
94 struct arc_rfc1201 *soft = &pkt->soft.rfc1201; 94 struct arc_rfc1201 *soft = &pkt->soft.rfc1201;
95 struct arcnet_local *lp = netdev_priv(dev);
96 int hdr_size = ARC_HDR_SIZE + RFC1201_HDR_SIZE; 95 int hdr_size = ARC_HDR_SIZE + RFC1201_HDR_SIZE;
97 96
98 /* Pull off the arcnet header. */ 97 /* Pull off the arcnet header. */
@@ -121,8 +120,8 @@ static __be16 type_trans(struct sk_buff *skb, struct net_device *dev)
121 case ARC_P_NOVELL_EC: 120 case ARC_P_NOVELL_EC:
122 return htons(ETH_P_802_3); 121 return htons(ETH_P_802_3);
123 default: 122 default:
124 lp->stats.rx_errors++; 123 dev->stats.rx_errors++;
125 lp->stats.rx_crc_errors++; 124 dev->stats.rx_crc_errors++;
126 return 0; 125 return 0;
127 } 126 }
128 127
@@ -172,8 +171,8 @@ static void rx(struct net_device *dev, int bufnum,
172 in->sequence, soft->split_flag, soft->sequence); 171 in->sequence, soft->split_flag, soft->sequence);
173 lp->rfc1201.aborted_seq = soft->sequence; 172 lp->rfc1201.aborted_seq = soft->sequence;
174 dev_kfree_skb_irq(in->skb); 173 dev_kfree_skb_irq(in->skb);
175 lp->stats.rx_errors++; 174 dev->stats.rx_errors++;
176 lp->stats.rx_missed_errors++; 175 dev->stats.rx_missed_errors++;
177 in->skb = NULL; 176 in->skb = NULL;
178 } 177 }
179 in->sequence = soft->sequence; 178 in->sequence = soft->sequence;
@@ -181,7 +180,7 @@ static void rx(struct net_device *dev, int bufnum,
181 skb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC); 180 skb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC);
182 if (skb == NULL) { 181 if (skb == NULL) {
183 BUGMSG(D_NORMAL, "Memory squeeze, dropping packet.\n"); 182 BUGMSG(D_NORMAL, "Memory squeeze, dropping packet.\n");
184 lp->stats.rx_dropped++; 183 dev->stats.rx_dropped++;
185 return; 184 return;
186 } 185 }
187 skb_put(skb, length + ARC_HDR_SIZE); 186 skb_put(skb, length + ARC_HDR_SIZE);
@@ -213,7 +212,7 @@ static void rx(struct net_device *dev, int bufnum,
213 BUGMSG(D_EXTRA, 212 BUGMSG(D_EXTRA,
214 "ARP source address was 00h, set to %02Xh.\n", 213 "ARP source address was 00h, set to %02Xh.\n",
215 saddr); 214 saddr);
216 lp->stats.rx_crc_errors++; 215 dev->stats.rx_crc_errors++;
217 *cptr = saddr; 216 *cptr = saddr;
218 } else { 217 } else {
219 BUGMSG(D_DURING, "ARP source address (%Xh) is fine.\n", 218 BUGMSG(D_DURING, "ARP source address (%Xh) is fine.\n",
@@ -222,8 +221,8 @@ static void rx(struct net_device *dev, int bufnum,
222 } else { 221 } else {
223 BUGMSG(D_NORMAL, "funny-shaped ARP packet. (%Xh, %Xh)\n", 222 BUGMSG(D_NORMAL, "funny-shaped ARP packet. (%Xh, %Xh)\n",
224 arp->ar_hln, arp->ar_pln); 223 arp->ar_hln, arp->ar_pln);
225 lp->stats.rx_errors++; 224 dev->stats.rx_errors++;
226 lp->stats.rx_crc_errors++; 225 dev->stats.rx_crc_errors++;
227 } 226 }
228 } 227 }
229 BUGLVL(D_SKB) arcnet_dump_skb(dev, skb, "rx"); 228 BUGLVL(D_SKB) arcnet_dump_skb(dev, skb, "rx");
@@ -257,8 +256,8 @@ static void rx(struct net_device *dev, int bufnum,
257 soft->split_flag); 256 soft->split_flag);
258 dev_kfree_skb_irq(in->skb); 257 dev_kfree_skb_irq(in->skb);
259 in->skb = NULL; 258 in->skb = NULL;
260 lp->stats.rx_errors++; 259 dev->stats.rx_errors++;
261 lp->stats.rx_missed_errors++; 260 dev->stats.rx_missed_errors++;
262 in->lastpacket = in->numpackets = 0; 261 in->lastpacket = in->numpackets = 0;
263 } 262 }
264 if (soft->split_flag & 1) { /* first packet in split */ 263 if (soft->split_flag & 1) { /* first packet in split */
@@ -269,8 +268,8 @@ static void rx(struct net_device *dev, int bufnum,
269 "(splitflag=%d, seq=%d)\n", 268 "(splitflag=%d, seq=%d)\n",
270 in->sequence, soft->split_flag, 269 in->sequence, soft->split_flag,
271 soft->sequence); 270 soft->sequence);
272 lp->stats.rx_errors++; 271 dev->stats.rx_errors++;
273 lp->stats.rx_missed_errors++; 272 dev->stats.rx_missed_errors++;
274 dev_kfree_skb_irq(in->skb); 273 dev_kfree_skb_irq(in->skb);
275 } 274 }
276 in->sequence = soft->sequence; 275 in->sequence = soft->sequence;
@@ -281,8 +280,8 @@ static void rx(struct net_device *dev, int bufnum,
281 BUGMSG(D_EXTRA, "incoming packet more than 16 segments; dropping. (splitflag=%d)\n", 280 BUGMSG(D_EXTRA, "incoming packet more than 16 segments; dropping. (splitflag=%d)\n",
282 soft->split_flag); 281 soft->split_flag);
283 lp->rfc1201.aborted_seq = soft->sequence; 282 lp->rfc1201.aborted_seq = soft->sequence;
284 lp->stats.rx_errors++; 283 dev->stats.rx_errors++;
285 lp->stats.rx_length_errors++; 284 dev->stats.rx_length_errors++;
286 return; 285 return;
287 } 286 }
288 in->skb = skb = alloc_skb(508 * in->numpackets + ARC_HDR_SIZE, 287 in->skb = skb = alloc_skb(508 * in->numpackets + ARC_HDR_SIZE,
@@ -290,7 +289,7 @@ static void rx(struct net_device *dev, int bufnum,
290 if (skb == NULL) { 289 if (skb == NULL) {
291 BUGMSG(D_NORMAL, "(split) memory squeeze, dropping packet.\n"); 290 BUGMSG(D_NORMAL, "(split) memory squeeze, dropping packet.\n");
292 lp->rfc1201.aborted_seq = soft->sequence; 291 lp->rfc1201.aborted_seq = soft->sequence;
293 lp->stats.rx_dropped++; 292 dev->stats.rx_dropped++;
294 return; 293 return;
295 } 294 }
296 skb->dev = dev; 295 skb->dev = dev;
@@ -314,8 +313,8 @@ static void rx(struct net_device *dev, int bufnum,
314 "first! (splitflag=%d, seq=%d, aborted=%d)\n", 313 "first! (splitflag=%d, seq=%d, aborted=%d)\n",
315 soft->split_flag, soft->sequence, 314 soft->split_flag, soft->sequence,
316 lp->rfc1201.aborted_seq); 315 lp->rfc1201.aborted_seq);
317 lp->stats.rx_errors++; 316 dev->stats.rx_errors++;
318 lp->stats.rx_missed_errors++; 317 dev->stats.rx_missed_errors++;
319 } 318 }
320 return; 319 return;
321 } 320 }
@@ -325,8 +324,8 @@ static void rx(struct net_device *dev, int bufnum,
325 if (packetnum <= in->lastpacket - 1) { 324 if (packetnum <= in->lastpacket - 1) {
326 BUGMSG(D_EXTRA, "duplicate splitpacket ignored! (splitflag=%d)\n", 325 BUGMSG(D_EXTRA, "duplicate splitpacket ignored! (splitflag=%d)\n",
327 soft->split_flag); 326 soft->split_flag);
328 lp->stats.rx_errors++; 327 dev->stats.rx_errors++;
329 lp->stats.rx_frame_errors++; 328 dev->stats.rx_frame_errors++;
330 return; 329 return;
331 } 330 }
332 /* "bad" duplicate, kill reassembly */ 331 /* "bad" duplicate, kill reassembly */
@@ -336,8 +335,8 @@ static void rx(struct net_device *dev, int bufnum,
336 lp->rfc1201.aborted_seq = soft->sequence; 335 lp->rfc1201.aborted_seq = soft->sequence;
337 dev_kfree_skb_irq(in->skb); 336 dev_kfree_skb_irq(in->skb);
338 in->skb = NULL; 337 in->skb = NULL;
339 lp->stats.rx_errors++; 338 dev->stats.rx_errors++;
340 lp->stats.rx_missed_errors++; 339 dev->stats.rx_missed_errors++;
341 in->lastpacket = in->numpackets = 0; 340 in->lastpacket = in->numpackets = 0;
342 return; 341 return;
343 } 342 }
@@ -404,8 +403,8 @@ static int build_header(struct sk_buff *skb, struct net_device *dev,
404 default: 403 default:
405 BUGMSG(D_NORMAL, "RFC1201: I don't understand protocol %d (%Xh)\n", 404 BUGMSG(D_NORMAL, "RFC1201: I don't understand protocol %d (%Xh)\n",
406 type, type); 405 type, type);
407 lp->stats.tx_errors++; 406 dev->stats.tx_errors++;
408 lp->stats.tx_aborted_errors++; 407 dev->stats.tx_aborted_errors++;
409 return 0; 408 return 0;
410 } 409 }
411 410