aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/3c507.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/3c507.c')
-rw-r--r--drivers/net/3c507.c52
1 files changed, 19 insertions, 33 deletions
diff --git a/drivers/net/3c507.c b/drivers/net/3c507.c
index fac6edff2b8b..3d06271c3a8b 100644
--- a/drivers/net/3c507.c
+++ b/drivers/net/3c507.c
@@ -118,7 +118,6 @@ enum commands {
118 118
119/* Information that need to be kept for each board. */ 119/* Information that need to be kept for each board. */
120struct net_local { 120struct net_local {
121 struct net_device_stats stats;
122 int last_restart; 121 int last_restart;
123 ushort rx_head; 122 ushort rx_head;
124 ushort rx_tail; 123 ushort rx_tail;
@@ -289,7 +288,6 @@ static int el16_send_packet(struct sk_buff *skb, struct net_device *dev);
289static irqreturn_t el16_interrupt(int irq, void *dev_id); 288static irqreturn_t el16_interrupt(int irq, void *dev_id);
290static void el16_rx(struct net_device *dev); 289static void el16_rx(struct net_device *dev);
291static int el16_close(struct net_device *dev); 290static int el16_close(struct net_device *dev);
292static struct net_device_stats *el16_get_stats(struct net_device *dev);
293static void el16_tx_timeout (struct net_device *dev); 291static void el16_tx_timeout (struct net_device *dev);
294 292
295static void hardware_send_packet(struct net_device *dev, void *buf, short length, short pad); 293static void hardware_send_packet(struct net_device *dev, void *buf, short length, short pad);
@@ -455,7 +453,6 @@ static int __init el16_probe1(struct net_device *dev, int ioaddr)
455 dev->open = el16_open; 453 dev->open = el16_open;
456 dev->stop = el16_close; 454 dev->stop = el16_close;
457 dev->hard_start_xmit = el16_send_packet; 455 dev->hard_start_xmit = el16_send_packet;
458 dev->get_stats = el16_get_stats;
459 dev->tx_timeout = el16_tx_timeout; 456 dev->tx_timeout = el16_tx_timeout;
460 dev->watchdog_timeo = TX_TIMEOUT; 457 dev->watchdog_timeo = TX_TIMEOUT;
461 dev->ethtool_ops = &netdev_ethtool_ops; 458 dev->ethtool_ops = &netdev_ethtool_ops;
@@ -489,7 +486,7 @@ static void el16_tx_timeout (struct net_device *dev)
489 readw(shmem + iSCB_STATUS) & 0x8000 ? "IRQ conflict" : 486 readw(shmem + iSCB_STATUS) & 0x8000 ? "IRQ conflict" :
490 "network cable problem"); 487 "network cable problem");
491 /* Try to restart the adaptor. */ 488 /* Try to restart the adaptor. */
492 if (lp->last_restart == lp->stats.tx_packets) { 489 if (lp->last_restart == dev->stats.tx_packets) {
493 if (net_debug > 1) 490 if (net_debug > 1)
494 printk ("Resetting board.\n"); 491 printk ("Resetting board.\n");
495 /* Completely reset the adaptor. */ 492 /* Completely reset the adaptor. */
@@ -501,7 +498,7 @@ static void el16_tx_timeout (struct net_device *dev)
501 printk ("Kicking board.\n"); 498 printk ("Kicking board.\n");
502 writew(0xf000 | CUC_START | RX_START, shmem + iSCB_CMD); 499 writew(0xf000 | CUC_START | RX_START, shmem + iSCB_CMD);
503 outb (0, ioaddr + SIGNAL_CA); /* Issue channel-attn. */ 500 outb (0, ioaddr + SIGNAL_CA); /* Issue channel-attn. */
504 lp->last_restart = lp->stats.tx_packets; 501 lp->last_restart = dev->stats.tx_packets;
505 } 502 }
506 dev->trans_start = jiffies; 503 dev->trans_start = jiffies;
507 netif_wake_queue (dev); 504 netif_wake_queue (dev);
@@ -520,7 +517,7 @@ static int el16_send_packet (struct sk_buff *skb, struct net_device *dev)
520 517
521 spin_lock_irqsave (&lp->lock, flags); 518 spin_lock_irqsave (&lp->lock, flags);
522 519
523 lp->stats.tx_bytes += length; 520 dev->stats.tx_bytes += length;
524 /* Disable the 82586's input to the interrupt line. */ 521 /* Disable the 82586's input to the interrupt line. */
525 outb (0x80, ioaddr + MISC_CTRL); 522 outb (0x80, ioaddr + MISC_CTRL);
526 523
@@ -579,14 +576,14 @@ static irqreturn_t el16_interrupt(int irq, void *dev_id)
579 } 576 }
580 /* Tx unsuccessful or some interesting status bit set. */ 577 /* Tx unsuccessful or some interesting status bit set. */
581 if (!(tx_status & 0x2000) || (tx_status & 0x0f3f)) { 578 if (!(tx_status & 0x2000) || (tx_status & 0x0f3f)) {
582 lp->stats.tx_errors++; 579 dev->stats.tx_errors++;
583 if (tx_status & 0x0600) lp->stats.tx_carrier_errors++; 580 if (tx_status & 0x0600) dev->stats.tx_carrier_errors++;
584 if (tx_status & 0x0100) lp->stats.tx_fifo_errors++; 581 if (tx_status & 0x0100) dev->stats.tx_fifo_errors++;
585 if (!(tx_status & 0x0040)) lp->stats.tx_heartbeat_errors++; 582 if (!(tx_status & 0x0040)) dev->stats.tx_heartbeat_errors++;
586 if (tx_status & 0x0020) lp->stats.tx_aborted_errors++; 583 if (tx_status & 0x0020) dev->stats.tx_aborted_errors++;
587 lp->stats.collisions += tx_status & 0xf; 584 dev->stats.collisions += tx_status & 0xf;
588 } 585 }
589 lp->stats.tx_packets++; 586 dev->stats.tx_packets++;
590 if (net_debug > 5) 587 if (net_debug > 5)
591 printk("Reaped %x, Tx status %04x.\n" , lp->tx_reap, tx_status); 588 printk("Reaped %x, Tx status %04x.\n" , lp->tx_reap, tx_status);
592 lp->tx_reap += TX_BUF_SIZE; 589 lp->tx_reap += TX_BUF_SIZE;
@@ -665,17 +662,6 @@ static int el16_close(struct net_device *dev)
665 return 0; 662 return 0;
666} 663}
667 664
668/* Get the current statistics. This may be called with the card open or
669 closed. */
670static struct net_device_stats *el16_get_stats(struct net_device *dev)
671{
672 struct net_local *lp = netdev_priv(dev);
673
674 /* ToDo: decide if there are any useful statistics from the SCB. */
675
676 return &lp->stats;
677}
678
679/* Initialize the Rx-block list. */ 665/* Initialize the Rx-block list. */
680static void init_rx_bufs(struct net_device *dev) 666static void init_rx_bufs(struct net_device *dev)
681{ 667{
@@ -852,12 +838,12 @@ static void el16_rx(struct net_device *dev)
852 pkt_len); 838 pkt_len);
853 } else if ((frame_status & 0x2000) == 0) { 839 } else if ((frame_status & 0x2000) == 0) {
854 /* Frame Rxed, but with error. */ 840 /* Frame Rxed, but with error. */
855 lp->stats.rx_errors++; 841 dev->stats.rx_errors++;
856 if (frame_status & 0x0800) lp->stats.rx_crc_errors++; 842 if (frame_status & 0x0800) dev->stats.rx_crc_errors++;
857 if (frame_status & 0x0400) lp->stats.rx_frame_errors++; 843 if (frame_status & 0x0400) dev->stats.rx_frame_errors++;
858 if (frame_status & 0x0200) lp->stats.rx_fifo_errors++; 844 if (frame_status & 0x0200) dev->stats.rx_fifo_errors++;
859 if (frame_status & 0x0100) lp->stats.rx_over_errors++; 845 if (frame_status & 0x0100) dev->stats.rx_over_errors++;
860 if (frame_status & 0x0080) lp->stats.rx_length_errors++; 846 if (frame_status & 0x0080) dev->stats.rx_length_errors++;
861 } else { 847 } else {
862 /* Malloc up new buffer. */ 848 /* Malloc up new buffer. */
863 struct sk_buff *skb; 849 struct sk_buff *skb;
@@ -866,7 +852,7 @@ static void el16_rx(struct net_device *dev)
866 skb = dev_alloc_skb(pkt_len+2); 852 skb = dev_alloc_skb(pkt_len+2);
867 if (skb == NULL) { 853 if (skb == NULL) {
868 printk("%s: Memory squeeze, dropping packet.\n", dev->name); 854 printk("%s: Memory squeeze, dropping packet.\n", dev->name);
869 lp->stats.rx_dropped++; 855 dev->stats.rx_dropped++;
870 break; 856 break;
871 } 857 }
872 858
@@ -878,8 +864,8 @@ static void el16_rx(struct net_device *dev)
878 skb->protocol=eth_type_trans(skb,dev); 864 skb->protocol=eth_type_trans(skb,dev);
879 netif_rx(skb); 865 netif_rx(skb);
880 dev->last_rx = jiffies; 866 dev->last_rx = jiffies;
881 lp->stats.rx_packets++; 867 dev->stats.rx_packets++;
882 lp->stats.rx_bytes += pkt_len; 868 dev->stats.rx_bytes += pkt_len;
883 } 869 }
884 870
885 /* Clear the status word and set End-of-List on the rx frame. */ 871 /* Clear the status word and set End-of-List on the rx frame. */