aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/arm
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/arm')
-rw-r--r--drivers/net/arm/am79c961a.c35
-rw-r--r--drivers/net/arm/am79c961a.h1
-rw-r--r--drivers/net/arm/ep93xx_eth.c39
-rw-r--r--drivers/net/arm/ether1.c34
-rw-r--r--drivers/net/arm/ether1.h1
-rw-r--r--drivers/net/arm/ether3.c33
-rw-r--r--drivers/net/arm/ether3.h1
7 files changed, 53 insertions, 91 deletions
diff --git a/drivers/net/arm/am79c961a.c b/drivers/net/arm/am79c961a.c
index 8c496fb1ac9e..62f21106efec 100644
--- a/drivers/net/arm/am79c961a.c
+++ b/drivers/net/arm/am79c961a.c
@@ -300,8 +300,6 @@ am79c961_open(struct net_device *dev)
300 struct dev_priv *priv = netdev_priv(dev); 300 struct dev_priv *priv = netdev_priv(dev);
301 int ret; 301 int ret;
302 302
303 memset (&priv->stats, 0, sizeof (priv->stats));
304
305 ret = request_irq(dev->irq, am79c961_interrupt, 0, dev->name, dev); 303 ret = request_irq(dev->irq, am79c961_interrupt, 0, dev->name, dev);
306 if (ret) 304 if (ret)
307 return ret; 305 return ret;
@@ -347,8 +345,7 @@ am79c961_close(struct net_device *dev)
347 */ 345 */
348static struct net_device_stats *am79c961_getstats (struct net_device *dev) 346static struct net_device_stats *am79c961_getstats (struct net_device *dev)
349{ 347{
350 struct dev_priv *priv = netdev_priv(dev); 348 return &dev->stats;
351 return &priv->stats;
352} 349}
353 350
354static void am79c961_mc_hash(char *addr, unsigned short *hash) 351static void am79c961_mc_hash(char *addr, unsigned short *hash)
@@ -510,14 +507,14 @@ am79c961_rx(struct net_device *dev, struct dev_priv *priv)
510 507
511 if ((status & (RMD_ERR|RMD_STP|RMD_ENP)) != (RMD_STP|RMD_ENP)) { 508 if ((status & (RMD_ERR|RMD_STP|RMD_ENP)) != (RMD_STP|RMD_ENP)) {
512 am_writeword (dev, hdraddr + 2, RMD_OWN); 509 am_writeword (dev, hdraddr + 2, RMD_OWN);
513 priv->stats.rx_errors ++; 510 dev->stats.rx_errors++;
514 if (status & RMD_ERR) { 511 if (status & RMD_ERR) {
515 if (status & RMD_FRAM) 512 if (status & RMD_FRAM)
516 priv->stats.rx_frame_errors ++; 513 dev->stats.rx_frame_errors++;
517 if (status & RMD_CRC) 514 if (status & RMD_CRC)
518 priv->stats.rx_crc_errors ++; 515 dev->stats.rx_crc_errors++;
519 } else if (status & RMD_STP) 516 } else if (status & RMD_STP)
520 priv->stats.rx_length_errors ++; 517 dev->stats.rx_length_errors++;
521 continue; 518 continue;
522 } 519 }
523 520
@@ -531,12 +528,12 @@ am79c961_rx(struct net_device *dev, struct dev_priv *priv)
531 am_writeword(dev, hdraddr + 2, RMD_OWN); 528 am_writeword(dev, hdraddr + 2, RMD_OWN);
532 skb->protocol = eth_type_trans(skb, dev); 529 skb->protocol = eth_type_trans(skb, dev);
533 netif_rx(skb); 530 netif_rx(skb);
534 priv->stats.rx_bytes += len; 531 dev->stats.rx_bytes += len;
535 priv->stats.rx_packets ++; 532 dev->stats.rx_packets++;
536 } else { 533 } else {
537 am_writeword (dev, hdraddr + 2, RMD_OWN); 534 am_writeword (dev, hdraddr + 2, RMD_OWN);
538 printk (KERN_WARNING "%s: memory squeeze, dropping packet.\n", dev->name); 535 printk (KERN_WARNING "%s: memory squeeze, dropping packet.\n", dev->name);
539 priv->stats.rx_dropped ++; 536 dev->stats.rx_dropped++;
540 break; 537 break;
541 } 538 }
542 } while (1); 539 } while (1);
@@ -565,7 +562,7 @@ am79c961_tx(struct net_device *dev, struct dev_priv *priv)
565 if (status & TMD_ERR) { 562 if (status & TMD_ERR) {
566 u_int status2; 563 u_int status2;
567 564
568 priv->stats.tx_errors ++; 565 dev->stats.tx_errors++;
569 566
570 status2 = am_readword (dev, hdraddr + 6); 567 status2 = am_readword (dev, hdraddr + 6);
571 568
@@ -575,18 +572,18 @@ am79c961_tx(struct net_device *dev, struct dev_priv *priv)
575 am_writeword (dev, hdraddr + 6, 0); 572 am_writeword (dev, hdraddr + 6, 0);
576 573
577 if (status2 & TST_RTRY) 574 if (status2 & TST_RTRY)
578 priv->stats.collisions += 16; 575 dev->stats.collisions += 16;
579 if (status2 & TST_LCOL) 576 if (status2 & TST_LCOL)
580 priv->stats.tx_window_errors ++; 577 dev->stats.tx_window_errors++;
581 if (status2 & TST_LCAR) 578 if (status2 & TST_LCAR)
582 priv->stats.tx_carrier_errors ++; 579 dev->stats.tx_carrier_errors++;
583 if (status2 & TST_UFLO) 580 if (status2 & TST_UFLO)
584 priv->stats.tx_fifo_errors ++; 581 dev->stats.tx_fifo_errors++;
585 continue; 582 continue;
586 } 583 }
587 priv->stats.tx_packets ++; 584 dev->stats.tx_packets++;
588 len = am_readword (dev, hdraddr + 4); 585 len = am_readword (dev, hdraddr + 4);
589 priv->stats.tx_bytes += -len; 586 dev->stats.tx_bytes += -len;
590 } while (priv->txtail != priv->txhead); 587 } while (priv->txtail != priv->txhead);
591 588
592 netif_wake_queue(dev); 589 netif_wake_queue(dev);
@@ -616,7 +613,7 @@ am79c961_interrupt(int irq, void *dev_id)
616 } 613 }
617 if (status & CSR0_MISS) { 614 if (status & CSR0_MISS) {
618 handled = 1; 615 handled = 1;
619 priv->stats.rx_dropped ++; 616 dev->stats.rx_dropped++;
620 } 617 }
621 if (status & CSR0_CERR) { 618 if (status & CSR0_CERR) {
622 handled = 1; 619 handled = 1;
diff --git a/drivers/net/arm/am79c961a.h b/drivers/net/arm/am79c961a.h
index 483009fe6ec2..fd634d32756b 100644
--- a/drivers/net/arm/am79c961a.h
+++ b/drivers/net/arm/am79c961a.h
@@ -130,7 +130,6 @@
130#define ISALED0_LNKST 0x8000 130#define ISALED0_LNKST 0x8000
131 131
132struct dev_priv { 132struct dev_priv {
133 struct net_device_stats stats;
134 unsigned long rxbuffer[RX_BUFFERS]; 133 unsigned long rxbuffer[RX_BUFFERS];
135 unsigned long txbuffer[TX_BUFFERS]; 134 unsigned long txbuffer[TX_BUFFERS];
136 unsigned char txhead; 135 unsigned char txhead;
diff --git a/drivers/net/arm/ep93xx_eth.c b/drivers/net/arm/ep93xx_eth.c
index 4a5ec9470aa1..5a77001b6d10 100644
--- a/drivers/net/arm/ep93xx_eth.c
+++ b/drivers/net/arm/ep93xx_eth.c
@@ -175,8 +175,6 @@ struct ep93xx_priv
175 struct net_device *dev; 175 struct net_device *dev;
176 struct napi_struct napi; 176 struct napi_struct napi;
177 177
178 struct net_device_stats stats;
179
180 struct mii_if_info mii; 178 struct mii_if_info mii;
181 u8 mdc_divisor; 179 u8 mdc_divisor;
182}; 180};
@@ -230,12 +228,6 @@ static void ep93xx_mdio_write(struct net_device *dev, int phy_id, int reg, int d
230 pr_info("mdio write timed out\n"); 228 pr_info("mdio write timed out\n");
231} 229}
232 230
233static struct net_device_stats *ep93xx_get_stats(struct net_device *dev)
234{
235 struct ep93xx_priv *ep = netdev_priv(dev);
236 return &(ep->stats);
237}
238
239static int ep93xx_rx(struct net_device *dev, int processed, int budget) 231static int ep93xx_rx(struct net_device *dev, int processed, int budget)
240{ 232{
241 struct ep93xx_priv *ep = netdev_priv(dev); 233 struct ep93xx_priv *ep = netdev_priv(dev);
@@ -267,15 +259,15 @@ static int ep93xx_rx(struct net_device *dev, int processed, int budget)
267 pr_crit("entry mismatch %.8x %.8x\n", rstat0, rstat1); 259 pr_crit("entry mismatch %.8x %.8x\n", rstat0, rstat1);
268 260
269 if (!(rstat0 & RSTAT0_RWE)) { 261 if (!(rstat0 & RSTAT0_RWE)) {
270 ep->stats.rx_errors++; 262 dev->stats.rx_errors++;
271 if (rstat0 & RSTAT0_OE) 263 if (rstat0 & RSTAT0_OE)
272 ep->stats.rx_fifo_errors++; 264 dev->stats.rx_fifo_errors++;
273 if (rstat0 & RSTAT0_FE) 265 if (rstat0 & RSTAT0_FE)
274 ep->stats.rx_frame_errors++; 266 dev->stats.rx_frame_errors++;
275 if (rstat0 & (RSTAT0_RUNT | RSTAT0_EDATA)) 267 if (rstat0 & (RSTAT0_RUNT | RSTAT0_EDATA))
276 ep->stats.rx_length_errors++; 268 dev->stats.rx_length_errors++;
277 if (rstat0 & RSTAT0_CRCE) 269 if (rstat0 & RSTAT0_CRCE)
278 ep->stats.rx_crc_errors++; 270 dev->stats.rx_crc_errors++;
279 goto err; 271 goto err;
280 } 272 }
281 273
@@ -300,10 +292,10 @@ static int ep93xx_rx(struct net_device *dev, int processed, int budget)
300 292
301 netif_receive_skb(skb); 293 netif_receive_skb(skb);
302 294
303 ep->stats.rx_packets++; 295 dev->stats.rx_packets++;
304 ep->stats.rx_bytes += length; 296 dev->stats.rx_bytes += length;
305 } else { 297 } else {
306 ep->stats.rx_dropped++; 298 dev->stats.rx_dropped++;
307 } 299 }
308 300
309err: 301err:
@@ -359,7 +351,7 @@ static int ep93xx_xmit(struct sk_buff *skb, struct net_device *dev)
359 int entry; 351 int entry;
360 352
361 if (unlikely(skb->len > MAX_PKT_SIZE)) { 353 if (unlikely(skb->len > MAX_PKT_SIZE)) {
362 ep->stats.tx_dropped++; 354 dev->stats.tx_dropped++;
363 dev_kfree_skb(skb); 355 dev_kfree_skb(skb);
364 return NETDEV_TX_OK; 356 return NETDEV_TX_OK;
365 } 357 }
@@ -415,17 +407,17 @@ static void ep93xx_tx_complete(struct net_device *dev)
415 if (tstat0 & TSTAT0_TXWE) { 407 if (tstat0 & TSTAT0_TXWE) {
416 int length = ep->descs->tdesc[entry].tdesc1 & 0xfff; 408 int length = ep->descs->tdesc[entry].tdesc1 & 0xfff;
417 409
418 ep->stats.tx_packets++; 410 dev->stats.tx_packets++;
419 ep->stats.tx_bytes += length; 411 dev->stats.tx_bytes += length;
420 } else { 412 } else {
421 ep->stats.tx_errors++; 413 dev->stats.tx_errors++;
422 } 414 }
423 415
424 if (tstat0 & TSTAT0_OW) 416 if (tstat0 & TSTAT0_OW)
425 ep->stats.tx_window_errors++; 417 dev->stats.tx_window_errors++;
426 if (tstat0 & TSTAT0_TXU) 418 if (tstat0 & TSTAT0_TXU)
427 ep->stats.tx_fifo_errors++; 419 dev->stats.tx_fifo_errors++;
428 ep->stats.collisions += (tstat0 >> 16) & 0x1f; 420 dev->stats.collisions += (tstat0 >> 16) & 0x1f;
429 421
430 ep->tx_clean_pointer = (entry + 1) & (TX_QUEUE_ENTRIES - 1); 422 ep->tx_clean_pointer = (entry + 1) & (TX_QUEUE_ENTRIES - 1);
431 if (ep->tx_pending == TX_QUEUE_ENTRIES) 423 if (ep->tx_pending == TX_QUEUE_ENTRIES)
@@ -758,7 +750,6 @@ static const struct net_device_ops ep93xx_netdev_ops = {
758 .ndo_open = ep93xx_open, 750 .ndo_open = ep93xx_open,
759 .ndo_stop = ep93xx_close, 751 .ndo_stop = ep93xx_close,
760 .ndo_start_xmit = ep93xx_xmit, 752 .ndo_start_xmit = ep93xx_xmit,
761 .ndo_get_stats = ep93xx_get_stats,
762 .ndo_do_ioctl = ep93xx_ioctl, 753 .ndo_do_ioctl = ep93xx_ioctl,
763 .ndo_validate_addr = eth_validate_addr, 754 .ndo_validate_addr = eth_validate_addr,
764 .ndo_change_mtu = eth_change_mtu, 755 .ndo_change_mtu = eth_change_mtu,
diff --git a/drivers/net/arm/ether1.c b/drivers/net/arm/ether1.c
index b17ab5153f51..b00781c02d5d 100644
--- a/drivers/net/arm/ether1.c
+++ b/drivers/net/arm/ether1.c
@@ -68,7 +68,6 @@ static int ether1_open(struct net_device *dev);
68static int ether1_sendpacket(struct sk_buff *skb, struct net_device *dev); 68static int ether1_sendpacket(struct sk_buff *skb, struct net_device *dev);
69static irqreturn_t ether1_interrupt(int irq, void *dev_id); 69static irqreturn_t ether1_interrupt(int irq, void *dev_id);
70static int ether1_close(struct net_device *dev); 70static int ether1_close(struct net_device *dev);
71static struct net_device_stats *ether1_getstats(struct net_device *dev);
72static void ether1_setmulticastlist(struct net_device *dev); 71static void ether1_setmulticastlist(struct net_device *dev);
73static void ether1_timeout(struct net_device *dev); 72static void ether1_timeout(struct net_device *dev);
74 73
@@ -649,8 +648,6 @@ ether1_open (struct net_device *dev)
649 if (request_irq(dev->irq, ether1_interrupt, 0, "ether1", dev)) 648 if (request_irq(dev->irq, ether1_interrupt, 0, "ether1", dev))
650 return -EAGAIN; 649 return -EAGAIN;
651 650
652 memset (&priv(dev)->stats, 0, sizeof (struct net_device_stats));
653
654 if (ether1_init_for_open (dev)) { 651 if (ether1_init_for_open (dev)) {
655 free_irq (dev->irq, dev); 652 free_irq (dev->irq, dev);
656 return -EAGAIN; 653 return -EAGAIN;
@@ -673,7 +670,7 @@ ether1_timeout(struct net_device *dev)
673 if (ether1_init_for_open (dev)) 670 if (ether1_init_for_open (dev))
674 printk (KERN_ERR "%s: unable to restart interface\n", dev->name); 671 printk (KERN_ERR "%s: unable to restart interface\n", dev->name);
675 672
676 priv(dev)->stats.tx_errors++; 673 dev->stats.tx_errors++;
677 netif_wake_queue(dev); 674 netif_wake_queue(dev);
678} 675}
679 676
@@ -802,21 +799,21 @@ again:
802 799
803 while (nop.nop_status & STAT_COMPLETE) { 800 while (nop.nop_status & STAT_COMPLETE) {
804 if (nop.nop_status & STAT_OK) { 801 if (nop.nop_status & STAT_OK) {
805 priv(dev)->stats.tx_packets ++; 802 dev->stats.tx_packets++;
806 priv(dev)->stats.collisions += (nop.nop_status & STAT_COLLISIONS); 803 dev->stats.collisions += (nop.nop_status & STAT_COLLISIONS);
807 } else { 804 } else {
808 priv(dev)->stats.tx_errors ++; 805 dev->stats.tx_errors++;
809 806
810 if (nop.nop_status & STAT_COLLAFTERTX) 807 if (nop.nop_status & STAT_COLLAFTERTX)
811 priv(dev)->stats.collisions ++; 808 dev->stats.collisions++;
812 if (nop.nop_status & STAT_NOCARRIER) 809 if (nop.nop_status & STAT_NOCARRIER)
813 priv(dev)->stats.tx_carrier_errors ++; 810 dev->stats.tx_carrier_errors++;
814 if (nop.nop_status & STAT_TXLOSTCTS) 811 if (nop.nop_status & STAT_TXLOSTCTS)
815 printk (KERN_WARNING "%s: cts lost\n", dev->name); 812 printk (KERN_WARNING "%s: cts lost\n", dev->name);
816 if (nop.nop_status & STAT_TXSLOWDMA) 813 if (nop.nop_status & STAT_TXSLOWDMA)
817 priv(dev)->stats.tx_fifo_errors ++; 814 dev->stats.tx_fifo_errors++;
818 if (nop.nop_status & STAT_COLLEXCESSIVE) 815 if (nop.nop_status & STAT_COLLEXCESSIVE)
819 priv(dev)->stats.collisions += 16; 816 dev->stats.collisions += 16;
820 } 817 }
821 818
822 if (nop.nop_link == caddr) { 819 if (nop.nop_link == caddr) {
@@ -879,13 +876,13 @@ ether1_recv_done (struct net_device *dev)
879 876
880 skb->protocol = eth_type_trans (skb, dev); 877 skb->protocol = eth_type_trans (skb, dev);
881 netif_rx (skb); 878 netif_rx (skb);
882 priv(dev)->stats.rx_packets ++; 879 dev->stats.rx_packets++;
883 } else 880 } else
884 priv(dev)->stats.rx_dropped ++; 881 dev->stats.rx_dropped++;
885 } else { 882 } else {
886 printk(KERN_WARNING "%s: %s\n", dev->name, 883 printk(KERN_WARNING "%s: %s\n", dev->name,
887 (rbd.rbd_status & RBD_EOF) ? "oversized packet" : "acnt not valid"); 884 (rbd.rbd_status & RBD_EOF) ? "oversized packet" : "acnt not valid");
888 priv(dev)->stats.rx_dropped ++; 885 dev->stats.rx_dropped++;
889 } 886 }
890 887
891 nexttail = ether1_readw(dev, priv(dev)->rx_tail, rfd_t, rfd_link, NORMALIRQS); 888 nexttail = ether1_readw(dev, priv(dev)->rx_tail, rfd_t, rfd_link, NORMALIRQS);
@@ -939,7 +936,7 @@ ether1_interrupt (int irq, void *dev_id)
939 printk (KERN_WARNING "%s: RU went not ready: RU suspended\n", dev->name); 936 printk (KERN_WARNING "%s: RU went not ready: RU suspended\n", dev->name);
940 ether1_writew(dev, SCB_CMDRXRESUME, SCB_ADDR, scb_t, scb_command, NORMALIRQS); 937 ether1_writew(dev, SCB_CMDRXRESUME, SCB_ADDR, scb_t, scb_command, NORMALIRQS);
941 writeb(CTRL_CA, REG_CONTROL); 938 writeb(CTRL_CA, REG_CONTROL);
942 priv(dev)->stats.rx_dropped ++; /* we suspended due to lack of buffer space */ 939 dev->stats.rx_dropped++; /* we suspended due to lack of buffer space */
943 } else 940 } else
944 printk(KERN_WARNING "%s: RU went not ready: %04X\n", dev->name, 941 printk(KERN_WARNING "%s: RU went not ready: %04X\n", dev->name,
945 ether1_readw(dev, SCB_ADDR, scb_t, scb_status, NORMALIRQS)); 942 ether1_readw(dev, SCB_ADDR, scb_t, scb_status, NORMALIRQS));
@@ -962,12 +959,6 @@ ether1_close (struct net_device *dev)
962 return 0; 959 return 0;
963} 960}
964 961
965static struct net_device_stats *
966ether1_getstats (struct net_device *dev)
967{
968 return &priv(dev)->stats;
969}
970
971/* 962/*
972 * Set or clear the multicast filter for this adaptor. 963 * Set or clear the multicast filter for this adaptor.
973 * num_addrs == -1 Promiscuous mode, receive all packets. 964 * num_addrs == -1 Promiscuous mode, receive all packets.
@@ -994,7 +985,6 @@ static const struct net_device_ops ether1_netdev_ops = {
994 .ndo_open = ether1_open, 985 .ndo_open = ether1_open,
995 .ndo_stop = ether1_close, 986 .ndo_stop = ether1_close,
996 .ndo_start_xmit = ether1_sendpacket, 987 .ndo_start_xmit = ether1_sendpacket,
997 .ndo_get_stats = ether1_getstats,
998 .ndo_set_multicast_list = ether1_setmulticastlist, 988 .ndo_set_multicast_list = ether1_setmulticastlist,
999 .ndo_tx_timeout = ether1_timeout, 989 .ndo_tx_timeout = ether1_timeout,
1000 .ndo_validate_addr = eth_validate_addr, 990 .ndo_validate_addr = eth_validate_addr,
diff --git a/drivers/net/arm/ether1.h b/drivers/net/arm/ether1.h
index c8a4b2389d85..3a5830ab3dc7 100644
--- a/drivers/net/arm/ether1.h
+++ b/drivers/net/arm/ether1.h
@@ -38,7 +38,6 @@
38 38
39struct ether1_priv { 39struct ether1_priv {
40 void __iomem *base; 40 void __iomem *base;
41 struct net_device_stats stats;
42 unsigned int tx_link; 41 unsigned int tx_link;
43 unsigned int tx_head; 42 unsigned int tx_head;
44 volatile unsigned int tx_tail; 43 volatile unsigned int tx_tail;
diff --git a/drivers/net/arm/ether3.c b/drivers/net/arm/ether3.c
index 1361b7367c28..44a8746f4014 100644
--- a/drivers/net/arm/ether3.c
+++ b/drivers/net/arm/ether3.c
@@ -81,7 +81,6 @@ static int ether3_open (struct net_device *dev);
81static int ether3_sendpacket (struct sk_buff *skb, struct net_device *dev); 81static int ether3_sendpacket (struct sk_buff *skb, struct net_device *dev);
82static irqreturn_t ether3_interrupt (int irq, void *dev_id); 82static irqreturn_t ether3_interrupt (int irq, void *dev_id);
83static int ether3_close (struct net_device *dev); 83static int ether3_close (struct net_device *dev);
84static struct net_device_stats *ether3_getstats (struct net_device *dev);
85static void ether3_setmulticastlist (struct net_device *dev); 84static void ether3_setmulticastlist (struct net_device *dev);
86static void ether3_timeout(struct net_device *dev); 85static void ether3_timeout(struct net_device *dev);
87 86
@@ -323,8 +322,6 @@ ether3_init_for_open(struct net_device *dev)
323{ 322{
324 int i; 323 int i;
325 324
326 memset(&priv(dev)->stats, 0, sizeof(struct net_device_stats));
327
328 /* Reset the chip */ 325 /* Reset the chip */
329 ether3_outw(CFG2_RESET, REG_CONFIG2); 326 ether3_outw(CFG2_RESET, REG_CONFIG2);
330 udelay(4); 327 udelay(4);
@@ -442,15 +439,6 @@ ether3_close(struct net_device *dev)
442} 439}
443 440
444/* 441/*
445 * Get the current statistics. This may be called with the card open or
446 * closed.
447 */
448static struct net_device_stats *ether3_getstats(struct net_device *dev)
449{
450 return &priv(dev)->stats;
451}
452
453/*
454 * Set or clear promiscuous/multicast mode filter for this adaptor. 442 * Set or clear promiscuous/multicast mode filter for this adaptor.
455 * 443 *
456 * We don't attempt any packet filtering. The card may have a SEEQ 8004 444 * We don't attempt any packet filtering. The card may have a SEEQ 8004
@@ -490,7 +478,7 @@ static void ether3_timeout(struct net_device *dev)
490 local_irq_restore(flags); 478 local_irq_restore(flags);
491 479
492 priv(dev)->regs.config2 |= CFG2_CTRLO; 480 priv(dev)->regs.config2 |= CFG2_CTRLO;
493 priv(dev)->stats.tx_errors += 1; 481 dev->stats.tx_errors += 1;
494 ether3_outw(priv(dev)->regs.config2, REG_CONFIG2); 482 ether3_outw(priv(dev)->regs.config2, REG_CONFIG2);
495 priv(dev)->tx_head = priv(dev)->tx_tail = 0; 483 priv(dev)->tx_head = priv(dev)->tx_tail = 0;
496 484
@@ -509,7 +497,7 @@ ether3_sendpacket(struct sk_buff *skb, struct net_device *dev)
509 497
510 if (priv(dev)->broken) { 498 if (priv(dev)->broken) {
511 dev_kfree_skb(skb); 499 dev_kfree_skb(skb);
512 priv(dev)->stats.tx_dropped ++; 500 dev->stats.tx_dropped++;
513 netif_start_queue(dev); 501 netif_start_queue(dev);
514 return NETDEV_TX_OK; 502 return NETDEV_TX_OK;
515 } 503 }
@@ -673,7 +661,7 @@ if (next_ptr < RX_START || next_ptr >= RX_END) {
673 } else 661 } else
674 goto dropping; 662 goto dropping;
675 } else { 663 } else {
676 struct net_device_stats *stats = &priv(dev)->stats; 664 struct net_device_stats *stats = &dev->stats;
677 ether3_outw(next_ptr >> 8, REG_RECVEND); 665 ether3_outw(next_ptr >> 8, REG_RECVEND);
678 if (status & RXSTAT_OVERSIZE) stats->rx_over_errors ++; 666 if (status & RXSTAT_OVERSIZE) stats->rx_over_errors ++;
679 if (status & RXSTAT_CRCERROR) stats->rx_crc_errors ++; 667 if (status & RXSTAT_CRCERROR) stats->rx_crc_errors ++;
@@ -685,14 +673,14 @@ if (next_ptr < RX_START || next_ptr >= RX_END) {
685 while (-- maxcnt); 673 while (-- maxcnt);
686 674
687done: 675done:
688 priv(dev)->stats.rx_packets += received; 676 dev->stats.rx_packets += received;
689 priv(dev)->rx_head = next_ptr; 677 priv(dev)->rx_head = next_ptr;
690 /* 678 /*
691 * If rx went off line, then that means that the buffer may be full. We 679 * If rx went off line, then that means that the buffer may be full. We
692 * have dropped at least one packet. 680 * have dropped at least one packet.
693 */ 681 */
694 if (!(ether3_inw(REG_STATUS) & STAT_RXON)) { 682 if (!(ether3_inw(REG_STATUS) & STAT_RXON)) {
695 priv(dev)->stats.rx_dropped ++; 683 dev->stats.rx_dropped++;
696 ether3_outw(next_ptr, REG_RECVPTR); 684 ether3_outw(next_ptr, REG_RECVPTR);
697 ether3_outw(priv(dev)->regs.command | CMD_RXON, REG_COMMAND); 685 ether3_outw(priv(dev)->regs.command | CMD_RXON, REG_COMMAND);
698 } 686 }
@@ -710,7 +698,7 @@ dropping:{
710 last_warned = jiffies; 698 last_warned = jiffies;
711 printk("%s: memory squeeze, dropping packet.\n", dev->name); 699 printk("%s: memory squeeze, dropping packet.\n", dev->name);
712 } 700 }
713 priv(dev)->stats.rx_dropped ++; 701 dev->stats.rx_dropped++;
714 goto done; 702 goto done;
715 } 703 }
716} 704}
@@ -743,13 +731,13 @@ static void ether3_tx(struct net_device *dev)
743 * Update errors 731 * Update errors
744 */ 732 */
745 if (!(status & (TXSTAT_BABBLED | TXSTAT_16COLLISIONS))) 733 if (!(status & (TXSTAT_BABBLED | TXSTAT_16COLLISIONS)))
746 priv(dev)->stats.tx_packets++; 734 dev->stats.tx_packets++;
747 else { 735 else {
748 priv(dev)->stats.tx_errors ++; 736 dev->stats.tx_errors++;
749 if (status & TXSTAT_16COLLISIONS) 737 if (status & TXSTAT_16COLLISIONS)
750 priv(dev)->stats.collisions += 16; 738 dev->stats.collisions += 16;
751 if (status & TXSTAT_BABBLED) 739 if (status & TXSTAT_BABBLED)
752 priv(dev)->stats.tx_fifo_errors ++; 740 dev->stats.tx_fifo_errors++;
753 } 741 }
754 742
755 tx_tail = (tx_tail + 1) & 15; 743 tx_tail = (tx_tail + 1) & 15;
@@ -773,7 +761,6 @@ static const struct net_device_ops ether3_netdev_ops = {
773 .ndo_open = ether3_open, 761 .ndo_open = ether3_open,
774 .ndo_stop = ether3_close, 762 .ndo_stop = ether3_close,
775 .ndo_start_xmit = ether3_sendpacket, 763 .ndo_start_xmit = ether3_sendpacket,
776 .ndo_get_stats = ether3_getstats,
777 .ndo_set_multicast_list = ether3_setmulticastlist, 764 .ndo_set_multicast_list = ether3_setmulticastlist,
778 .ndo_tx_timeout = ether3_timeout, 765 .ndo_tx_timeout = ether3_timeout,
779 .ndo_validate_addr = eth_validate_addr, 766 .ndo_validate_addr = eth_validate_addr,
diff --git a/drivers/net/arm/ether3.h b/drivers/net/arm/ether3.h
index 1921a3a07da7..2db63b08bdf3 100644
--- a/drivers/net/arm/ether3.h
+++ b/drivers/net/arm/ether3.h
@@ -164,7 +164,6 @@ struct dev_priv {
164 unsigned char tx_head; /* buffer nr to insert next packet */ 164 unsigned char tx_head; /* buffer nr to insert next packet */
165 unsigned char tx_tail; /* buffer nr of transmitting packet */ 165 unsigned char tx_tail; /* buffer nr of transmitting packet */
166 unsigned int rx_head; /* address to fetch next packet from */ 166 unsigned int rx_head; /* address to fetch next packet from */
167 struct net_device_stats stats;
168 struct timer_list timer; 167 struct timer_list timer;
169 int broken; /* 0 = ok, 1 = something went wrong */ 168 int broken; /* 0 = ok, 1 = something went wrong */
170}; 169};