aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/3c501.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-11 22:40:14 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-11 22:40:14 -0400
commit038a5008b2f395c85e6e71d6ddf3c684e7c405b0 (patch)
tree4735eab577e97e5a22c3141e3f60071c8065585e /drivers/net/3c501.c
parentdd6d1844af33acb4edd0a40b1770d091a22c94be (diff)
parent266918303226cceac7eca38ced30f15f277bd89c (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (867 commits) [SKY2]: status polling loop (post merge) [NET]: Fix NAPI completion handling in some drivers. [TCP]: Limit processing lost_retrans loop to work-to-do cases [TCP]: Fix lost_retrans loop vs fastpath problems [TCP]: No need to re-count fackets_out/sacked_out at RTO [TCP]: Extract tcp_match_queue_to_sack from sacktag code [TCP]: Kill almost unused variable pcount from sacktag [TCP]: Fix mark_head_lost to ignore R-bit when trying to mark L [TCP]: Add bytes_acked (ABC) clearing to FRTO too [IPv6]: Update setsockopt(IPV6_MULTICAST_IF) to support RFC 3493, try2 [NETFILTER]: x_tables: add missing ip6t_modulename aliases [NETFILTER]: nf_conntrack_tcp: fix connection reopening [QETH]: fix qeth_main.c [NETLINK]: fib_frontend build fixes [IPv6]: Export userland ND options through netlink (RDNSS support) [9P]: build fix with !CONFIG_SYSCTL [NET]: Fix dev_put() and dev_hold() comments [NET]: make netlink user -> kernel interface synchronious [NET]: unify netlink kernel socket recognition [NET]: cleanup 3rd argument in netlink_sendskb ... Fix up conflicts manually in Documentation/feature-removal-schedule.txt and my new least favourite crap, the "mod_devicetable" support in the files include/linux/mod_devicetable.h and scripts/mod/file2alias.c. (The latter files seem to be explicitly _designed_ to get conflicts when different subsystems work with them - that have an absolutely horrid lack of subsystem separation!) Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/net/3c501.c')
-rw-r--r--drivers/net/3c501.c43
1 files changed, 11 insertions, 32 deletions
diff --git a/drivers/net/3c501.c b/drivers/net/3c501.c
index 4bee99ba7dbb..be71868d1513 100644
--- a/drivers/net/3c501.c
+++ b/drivers/net/3c501.c
@@ -174,8 +174,6 @@ struct net_device * __init el1_probe(int unit)
174 mem_start = dev->mem_start & 7; 174 mem_start = dev->mem_start & 7;
175 } 175 }
176 176
177 SET_MODULE_OWNER(dev);
178
179 if (io > 0x1ff) { /* Check a single specified location. */ 177 if (io > 0x1ff) { /* Check a single specified location. */
180 err = el1_probe1(dev, io); 178 err = el1_probe1(dev, io);
181 } else if (io != 0) { 179 } else if (io != 0) {
@@ -317,7 +315,6 @@ static int __init el1_probe1(struct net_device *dev, int ioaddr)
317 dev->tx_timeout = &el_timeout; 315 dev->tx_timeout = &el_timeout;
318 dev->watchdog_timeo = HZ; 316 dev->watchdog_timeo = HZ;
319 dev->stop = &el1_close; 317 dev->stop = &el1_close;
320 dev->get_stats = &el1_get_stats;
321 dev->set_multicast_list = &set_multicast_list; 318 dev->set_multicast_list = &set_multicast_list;
322 dev->ethtool_ops = &netdev_ethtool_ops; 319 dev->ethtool_ops = &netdev_ethtool_ops;
323 return 0; 320 return 0;
@@ -376,7 +373,7 @@ static void el_timeout(struct net_device *dev)
376 if (el_debug) 373 if (el_debug)
377 printk (KERN_DEBUG "%s: transmit timed out, txsr %#2x axsr=%02x rxsr=%02x.\n", 374 printk (KERN_DEBUG "%s: transmit timed out, txsr %#2x axsr=%02x rxsr=%02x.\n",
378 dev->name, inb(TX_STATUS), inb(AX_STATUS), inb(RX_STATUS)); 375 dev->name, inb(TX_STATUS), inb(AX_STATUS), inb(RX_STATUS));
379 lp->stats.tx_errors++; 376 dev->stats.tx_errors++;
380 outb(TX_NORM, TX_CMD); 377 outb(TX_NORM, TX_CMD);
381 outb(RX_NORM, RX_CMD); 378 outb(RX_NORM, RX_CMD);
382 outb(AX_OFF, AX_CMD); /* Just trigger a false interrupt. */ 379 outb(AX_OFF, AX_CMD); /* Just trigger a false interrupt. */
@@ -443,7 +440,7 @@ static int el_start_xmit(struct sk_buff *skb, struct net_device *dev)
443 lp->tx_pkt_start = gp_start; 440 lp->tx_pkt_start = gp_start;
444 lp->collisions = 0; 441 lp->collisions = 0;
445 442
446 lp->stats.tx_bytes += skb->len; 443 dev->stats.tx_bytes += skb->len;
447 444
448 /* 445 /*
449 * Command mode with status cleared should [in theory] 446 * Command mode with status cleared should [in theory]
@@ -590,7 +587,7 @@ static irqreturn_t el_interrupt(int irq, void *dev_id)
590 printk (KERN_DEBUG "%s: Transmit failed 16 times, Ethernet jammed?\n",dev->name); 587 printk (KERN_DEBUG "%s: Transmit failed 16 times, Ethernet jammed?\n",dev->name);
591 outb(AX_SYS, AX_CMD); 588 outb(AX_SYS, AX_CMD);
592 lp->txing = 0; 589 lp->txing = 0;
593 lp->stats.tx_aborted_errors++; 590 dev->stats.tx_aborted_errors++;
594 netif_wake_queue(dev); 591 netif_wake_queue(dev);
595 } 592 }
596 else if (txsr & TX_COLLISION) 593 else if (txsr & TX_COLLISION)
@@ -608,7 +605,7 @@ static irqreturn_t el_interrupt(int irq, void *dev_id)
608 outb(AX_SYS, AX_CMD); 605 outb(AX_SYS, AX_CMD);
609 outw(lp->tx_pkt_start, GP_LOW); 606 outw(lp->tx_pkt_start, GP_LOW);
610 outb(AX_XMIT, AX_CMD); 607 outb(AX_XMIT, AX_CMD);
611 lp->stats.collisions++; 608 dev->stats.collisions++;
612 spin_unlock(&lp->lock); 609 spin_unlock(&lp->lock);
613 goto out; 610 goto out;
614 } 611 }
@@ -617,7 +614,7 @@ static irqreturn_t el_interrupt(int irq, void *dev_id)
617 /* 614 /*
618 * It worked.. we will now fall through and receive 615 * It worked.. we will now fall through and receive
619 */ 616 */
620 lp->stats.tx_packets++; 617 dev->stats.tx_packets++;
621 if (el_debug > 6) 618 if (el_debug > 6)
622 printk(KERN_DEBUG " Tx succeeded %s\n", 619 printk(KERN_DEBUG " Tx succeeded %s\n",
623 (txsr & TX_RDY) ? "." : "but tx is busy!"); 620 (txsr & TX_RDY) ? "." : "but tx is busy!");
@@ -642,10 +639,10 @@ static irqreturn_t el_interrupt(int irq, void *dev_id)
642 * Just reading rx_status fixes most errors. 639 * Just reading rx_status fixes most errors.
643 */ 640 */
644 if (rxsr & RX_MISSED) 641 if (rxsr & RX_MISSED)
645 lp->stats.rx_missed_errors++; 642 dev->stats.rx_missed_errors++;
646 else if (rxsr & RX_RUNT) 643 else if (rxsr & RX_RUNT)
647 { /* Handled to avoid board lock-up. */ 644 { /* Handled to avoid board lock-up. */
648 lp->stats.rx_length_errors++; 645 dev->stats.rx_length_errors++;
649 if (el_debug > 5) 646 if (el_debug > 5)
650 printk(KERN_DEBUG " runt.\n"); 647 printk(KERN_DEBUG " runt.\n");
651 } 648 }
@@ -696,7 +693,6 @@ out:
696 693
697static void el_receive(struct net_device *dev) 694static void el_receive(struct net_device *dev)
698{ 695{
699 struct net_local *lp = netdev_priv(dev);
700 int ioaddr = dev->base_addr; 696 int ioaddr = dev->base_addr;
701 int pkt_len; 697 int pkt_len;
702 struct sk_buff *skb; 698 struct sk_buff *skb;
@@ -710,7 +706,7 @@ static void el_receive(struct net_device *dev)
710 { 706 {
711 if (el_debug) 707 if (el_debug)
712 printk(KERN_DEBUG "%s: bogus packet, length=%d\n", dev->name, pkt_len); 708 printk(KERN_DEBUG "%s: bogus packet, length=%d\n", dev->name, pkt_len);
713 lp->stats.rx_over_errors++; 709 dev->stats.rx_over_errors++;
714 return; 710 return;
715 } 711 }
716 712
@@ -729,7 +725,7 @@ static void el_receive(struct net_device *dev)
729 if (skb == NULL) 725 if (skb == NULL)
730 { 726 {
731 printk(KERN_INFO "%s: Memory squeeze, dropping packet.\n", dev->name); 727 printk(KERN_INFO "%s: Memory squeeze, dropping packet.\n", dev->name);
732 lp->stats.rx_dropped++; 728 dev->stats.rx_dropped++;
733 return; 729 return;
734 } 730 }
735 else 731 else
@@ -744,8 +740,8 @@ static void el_receive(struct net_device *dev)
744 skb->protocol=eth_type_trans(skb,dev); 740 skb->protocol=eth_type_trans(skb,dev);
745 netif_rx(skb); 741 netif_rx(skb);
746 dev->last_rx = jiffies; 742 dev->last_rx = jiffies;
747 lp->stats.rx_packets++; 743 dev->stats.rx_packets++;
748 lp->stats.rx_bytes+=pkt_len; 744 dev->stats.rx_bytes+=pkt_len;
749 } 745 }
750 return; 746 return;
751} 747}
@@ -813,23 +809,6 @@ static int el1_close(struct net_device *dev)
813} 809}
814 810
815/** 811/**
816 * el1_get_stats:
817 * @dev: The card to get the statistics for
818 *
819 * In smarter devices this function is needed to pull statistics off the
820 * board itself. The 3c501 has no hardware statistics. We maintain them all
821 * so they are by definition always up to date.
822 *
823 * Returns the statistics for the card from the card private data
824 */
825
826static struct net_device_stats *el1_get_stats(struct net_device *dev)
827{
828 struct net_local *lp = netdev_priv(dev);
829 return &lp->stats;
830}
831
832/**
833 * set_multicast_list: 812 * set_multicast_list:
834 * @dev: The device to adjust 813 * @dev: The device to adjust
835 * 814 *