aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tulip
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/tulip')
-rw-r--r--drivers/net/tulip/de4x5.c56
-rw-r--r--drivers/net/tulip/dmfe.c2
-rw-r--r--drivers/net/tulip/interrupt.c77
-rw-r--r--drivers/net/tulip/tulip.h3
-rw-r--r--drivers/net/tulip/tulip_core.c10
-rw-r--r--drivers/net/tulip/uli526x.c4
-rw-r--r--drivers/net/tulip/winbond-840.c2
-rw-r--r--drivers/net/tulip/xircom_cb.c15
8 files changed, 82 insertions, 87 deletions
diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c
index 75a64c88cf7a..251c6ce15aea 100644
--- a/drivers/net/tulip/de4x5.c
+++ b/drivers/net/tulip/de4x5.c
@@ -1448,7 +1448,7 @@ de4x5_sw_reset(struct net_device *dev)
1448 status = -EIO; 1448 status = -EIO;
1449 } 1449 }
1450 1450
1451 lp->tx_new = (++lp->tx_new) % lp->txRingSize; 1451 lp->tx_new = (lp->tx_new + 1) % lp->txRingSize;
1452 lp->tx_old = lp->tx_new; 1452 lp->tx_old = lp->tx_new;
1453 1453
1454 return status; 1454 return status;
@@ -1506,7 +1506,7 @@ de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev)
1506 lp->stats.tx_bytes += skb->len; 1506 lp->stats.tx_bytes += skb->len;
1507 outl(POLL_DEMAND, DE4X5_TPD);/* Start the TX */ 1507 outl(POLL_DEMAND, DE4X5_TPD);/* Start the TX */
1508 1508
1509 lp->tx_new = (++lp->tx_new) % lp->txRingSize; 1509 lp->tx_new = (lp->tx_new + 1) % lp->txRingSize;
1510 1510
1511 if (TX_BUFFS_AVAIL) { 1511 if (TX_BUFFS_AVAIL) {
1512 netif_start_queue(dev); /* Another pkt may be queued */ 1512 netif_start_queue(dev); /* Another pkt may be queued */
@@ -1657,7 +1657,7 @@ de4x5_rx(struct net_device *dev)
1657 } 1657 }
1658 1658
1659 /* Change buffer ownership for this frame, back to the adapter */ 1659 /* Change buffer ownership for this frame, back to the adapter */
1660 for (;lp->rx_old!=entry;lp->rx_old=(++lp->rx_old)%lp->rxRingSize) { 1660 for (;lp->rx_old!=entry;lp->rx_old=(lp->rx_old + 1)%lp->rxRingSize) {
1661 lp->rx_ring[lp->rx_old].status = cpu_to_le32(R_OWN); 1661 lp->rx_ring[lp->rx_old].status = cpu_to_le32(R_OWN);
1662 barrier(); 1662 barrier();
1663 } 1663 }
@@ -1668,7 +1668,7 @@ de4x5_rx(struct net_device *dev)
1668 /* 1668 /*
1669 ** Update entry information 1669 ** Update entry information
1670 */ 1670 */
1671 lp->rx_new = (++lp->rx_new) % lp->rxRingSize; 1671 lp->rx_new = (lp->rx_new + 1) % lp->rxRingSize;
1672 } 1672 }
1673 1673
1674 return 0; 1674 return 0;
@@ -1726,7 +1726,7 @@ de4x5_tx(struct net_device *dev)
1726 } 1726 }
1727 1727
1728 /* Update all the pointers */ 1728 /* Update all the pointers */
1729 lp->tx_old = (++lp->tx_old) % lp->txRingSize; 1729 lp->tx_old = (lp->tx_old + 1) % lp->txRingSize;
1730 } 1730 }
1731 1731
1732 /* Any resources available? */ 1732 /* Any resources available? */
@@ -1801,7 +1801,7 @@ de4x5_rx_ovfc(struct net_device *dev)
1801 1801
1802 for (; (s32)le32_to_cpu(lp->rx_ring[lp->rx_new].status)>=0;) { 1802 for (; (s32)le32_to_cpu(lp->rx_ring[lp->rx_new].status)>=0;) {
1803 lp->rx_ring[lp->rx_new].status = cpu_to_le32(R_OWN); 1803 lp->rx_ring[lp->rx_new].status = cpu_to_le32(R_OWN);
1804 lp->rx_new = (++lp->rx_new % lp->rxRingSize); 1804 lp->rx_new = (lp->rx_new + 1) % lp->rxRingSize;
1805 } 1805 }
1806 1806
1807 outl(omr, DE4X5_OMR); 1807 outl(omr, DE4X5_OMR);
@@ -1932,7 +1932,7 @@ set_multicast_list(struct net_device *dev)
1932 load_packet(dev, lp->setup_frame, TD_IC | PERFECT_F | TD_SET | 1932 load_packet(dev, lp->setup_frame, TD_IC | PERFECT_F | TD_SET |
1933 SETUP_FRAME_LEN, (struct sk_buff *)1); 1933 SETUP_FRAME_LEN, (struct sk_buff *)1);
1934 1934
1935 lp->tx_new = (++lp->tx_new) % lp->txRingSize; 1935 lp->tx_new = (lp->tx_new + 1) % lp->txRingSize;
1936 outl(POLL_DEMAND, DE4X5_TPD); /* Start the TX */ 1936 outl(POLL_DEMAND, DE4X5_TPD); /* Start the TX */
1937 dev->trans_start = jiffies; /* prevent tx timeout */ 1937 dev->trans_start = jiffies; /* prevent tx timeout */
1938 } 1938 }
@@ -3119,7 +3119,7 @@ dc2114x_autoconf(struct net_device *dev)
3119 if (lp->media == _100Mb) { 3119 if (lp->media == _100Mb) {
3120 if ((slnk = test_for_100Mb(dev, 6500)) < 0) { 3120 if ((slnk = test_for_100Mb(dev, 6500)) < 0) {
3121 lp->media = SPD_DET; 3121 lp->media = SPD_DET;
3122 return (slnk & ~TIMER_CB); 3122 return slnk & ~TIMER_CB;
3123 } 3123 }
3124 } else { 3124 } else {
3125 if (wait_for_link(dev) < 0) { 3125 if (wait_for_link(dev) < 0) {
@@ -3484,7 +3484,7 @@ is_spd_100(struct net_device *dev)
3484 spd = ((~gep_rd(dev)) & GEP_SLNK); 3484 spd = ((~gep_rd(dev)) & GEP_SLNK);
3485 } else { 3485 } else {
3486 if ((lp->ibn == 2) || !lp->asBitValid) 3486 if ((lp->ibn == 2) || !lp->asBitValid)
3487 return ((lp->chipset == DC21143)?(~inl(DE4X5_SISR)&SISR_LS100):0); 3487 return (lp->chipset == DC21143) ? (~inl(DE4X5_SISR)&SISR_LS100) : 0;
3488 3488
3489 spd = (lp->asBitValid & (lp->asPolarity ^ (gep_rd(dev) & lp->asBit))) | 3489 spd = (lp->asBitValid & (lp->asPolarity ^ (gep_rd(dev) & lp->asBit))) |
3490 (lp->linkOK & ~lp->asBitValid); 3490 (lp->linkOK & ~lp->asBitValid);
@@ -3502,15 +3502,15 @@ is_100_up(struct net_device *dev)
3502 if (lp->useMII) { 3502 if (lp->useMII) {
3503 /* Double read for sticky bits & temporary drops */ 3503 /* Double read for sticky bits & temporary drops */
3504 mii_rd(MII_SR, lp->phy[lp->active].addr, DE4X5_MII); 3504 mii_rd(MII_SR, lp->phy[lp->active].addr, DE4X5_MII);
3505 return (mii_rd(MII_SR, lp->phy[lp->active].addr, DE4X5_MII) & MII_SR_LKS); 3505 return mii_rd(MII_SR, lp->phy[lp->active].addr, DE4X5_MII) & MII_SR_LKS;
3506 } else if (!lp->useSROM) { /* de500-xa */ 3506 } else if (!lp->useSROM) { /* de500-xa */
3507 return ((~gep_rd(dev)) & GEP_SLNK); 3507 return (~gep_rd(dev)) & GEP_SLNK;
3508 } else { 3508 } else {
3509 if ((lp->ibn == 2) || !lp->asBitValid) 3509 if ((lp->ibn == 2) || !lp->asBitValid)
3510 return ((lp->chipset == DC21143)?(~inl(DE4X5_SISR)&SISR_LS100):0); 3510 return (lp->chipset == DC21143) ? (~inl(DE4X5_SISR)&SISR_LS100) : 0;
3511 3511
3512 return ((lp->asBitValid&(lp->asPolarity^(gep_rd(dev)&lp->asBit))) | 3512 return (lp->asBitValid&(lp->asPolarity^(gep_rd(dev)&lp->asBit))) |
3513 (lp->linkOK & ~lp->asBitValid)); 3513 (lp->linkOK & ~lp->asBitValid);
3514 } 3514 }
3515} 3515}
3516 3516
@@ -3523,17 +3523,17 @@ is_10_up(struct net_device *dev)
3523 if (lp->useMII) { 3523 if (lp->useMII) {
3524 /* Double read for sticky bits & temporary drops */ 3524 /* Double read for sticky bits & temporary drops */
3525 mii_rd(MII_SR, lp->phy[lp->active].addr, DE4X5_MII); 3525 mii_rd(MII_SR, lp->phy[lp->active].addr, DE4X5_MII);
3526 return (mii_rd(MII_SR, lp->phy[lp->active].addr, DE4X5_MII) & MII_SR_LKS); 3526 return mii_rd(MII_SR, lp->phy[lp->active].addr, DE4X5_MII) & MII_SR_LKS;
3527 } else if (!lp->useSROM) { /* de500-xa */ 3527 } else if (!lp->useSROM) { /* de500-xa */
3528 return ((~gep_rd(dev)) & GEP_LNP); 3528 return (~gep_rd(dev)) & GEP_LNP;
3529 } else { 3529 } else {
3530 if ((lp->ibn == 2) || !lp->asBitValid) 3530 if ((lp->ibn == 2) || !lp->asBitValid)
3531 return (((lp->chipset & ~0x00ff) == DC2114x) ? 3531 return ((lp->chipset & ~0x00ff) == DC2114x) ?
3532 (~inl(DE4X5_SISR)&SISR_LS10): 3532 (~inl(DE4X5_SISR)&SISR_LS10):
3533 0); 3533 0;
3534 3534
3535 return ((lp->asBitValid&(lp->asPolarity^(gep_rd(dev)&lp->asBit))) | 3535 return (lp->asBitValid&(lp->asPolarity^(gep_rd(dev)&lp->asBit))) |
3536 (lp->linkOK & ~lp->asBitValid)); 3536 (lp->linkOK & ~lp->asBitValid);
3537 } 3537 }
3538} 3538}
3539 3539
@@ -3544,7 +3544,7 @@ is_anc_capable(struct net_device *dev)
3544 u_long iobase = dev->base_addr; 3544 u_long iobase = dev->base_addr;
3545 3545
3546 if (lp->phy[lp->active].id && (!lp->useSROM || lp->useMII)) { 3546 if (lp->phy[lp->active].id && (!lp->useSROM || lp->useMII)) {
3547 return (mii_rd(MII_SR, lp->phy[lp->active].addr, DE4X5_MII)); 3547 return mii_rd(MII_SR, lp->phy[lp->active].addr, DE4X5_MII);
3548 } else if ((lp->chipset & ~0x00ff) == DC2114x) { 3548 } else if ((lp->chipset & ~0x00ff) == DC2114x) {
3549 return (inl(DE4X5_SISR) & SISR_LPN) >> 12; 3549 return (inl(DE4X5_SISR) & SISR_LPN) >> 12;
3550 } else { 3550 } else {
@@ -3568,7 +3568,7 @@ ping_media(struct net_device *dev, int msec)
3568 3568
3569 lp->tmp = lp->tx_new; /* Remember the ring position */ 3569 lp->tmp = lp->tx_new; /* Remember the ring position */
3570 load_packet(dev, lp->frame, TD_LS | TD_FS | sizeof(lp->frame), (struct sk_buff *)1); 3570 load_packet(dev, lp->frame, TD_LS | TD_FS | sizeof(lp->frame), (struct sk_buff *)1);
3571 lp->tx_new = (++lp->tx_new) % lp->txRingSize; 3571 lp->tx_new = (lp->tx_new + 1) % lp->txRingSize;
3572 outl(POLL_DEMAND, DE4X5_TPD); 3572 outl(POLL_DEMAND, DE4X5_TPD);
3573 } 3573 }
3574 3574
@@ -4930,7 +4930,7 @@ getfrom_mii(u32 command, u_long ioaddr)
4930 outl(command | MII_MDC, ioaddr); 4930 outl(command | MII_MDC, ioaddr);
4931 udelay(1); 4931 udelay(1);
4932 4932
4933 return ((inl(ioaddr) >> 19) & 1); 4933 return (inl(ioaddr) >> 19) & 1;
4934} 4934}
4935 4935
4936/* 4936/*
@@ -4975,8 +4975,8 @@ mii_get_oui(u_char phyaddr, u_long ioaddr)
4975 a.breg[0]=a.breg[1]; 4975 a.breg[0]=a.breg[1];
4976 a.breg[1]=i; 4976 a.breg[1]=i;
4977 4977
4978 return ((a.reg<<8)|ret); */ /* SEEQ and Cypress way */ 4978 return (a.reg<<8)|ret; */ /* SEEQ and Cypress way */
4979/* return ((r2<<6)|(u_int)(r3>>10)); */ /* NATIONAL and BROADCOM way */ 4979/* return (r2<<6)|(u_int)(r3>>10); */ /* NATIONAL and BROADCOM way */
4980 return r2; /* (I did it) My way */ 4980 return r2; /* (I did it) My way */
4981} 4981}
4982 4982
@@ -5144,7 +5144,7 @@ gep_rd(struct net_device *dev)
5144 if (lp->chipset == DC21140) { 5144 if (lp->chipset == DC21140) {
5145 return inl(DE4X5_GEP); 5145 return inl(DE4X5_GEP);
5146 } else if ((lp->chipset & ~0x00ff) == DC2114x) { 5146 } else if ((lp->chipset & ~0x00ff) == DC2114x) {
5147 return (inl(DE4X5_SIGR) & 0x000fffff); 5147 return inl(DE4X5_SIGR) & 0x000fffff;
5148 } 5148 }
5149 5149
5150 return 0; 5150 return 0;
@@ -5417,7 +5417,7 @@ de4x5_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
5417 /* Set up the descriptor and give ownership to the card */ 5417 /* Set up the descriptor and give ownership to the card */
5418 load_packet(dev, lp->setup_frame, TD_IC | PERFECT_F | TD_SET | 5418 load_packet(dev, lp->setup_frame, TD_IC | PERFECT_F | TD_SET |
5419 SETUP_FRAME_LEN, (struct sk_buff *)1); 5419 SETUP_FRAME_LEN, (struct sk_buff *)1);
5420 lp->tx_new = (++lp->tx_new) % lp->txRingSize; 5420 lp->tx_new = (lp->tx_new + 1) % lp->txRingSize;
5421 outl(POLL_DEMAND, DE4X5_TPD); /* Start the TX */ 5421 outl(POLL_DEMAND, DE4X5_TPD); /* Start the TX */
5422 netif_wake_queue(dev); /* Unlock the TX ring */ 5422 netif_wake_queue(dev); /* Unlock the TX ring */
5423 break; 5423 break;
@@ -5474,7 +5474,7 @@ de4x5_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
5474 tmp.lval[6] = inl(DE4X5_STRR); j+=4; 5474 tmp.lval[6] = inl(DE4X5_STRR); j+=4;
5475 tmp.lval[7] = inl(DE4X5_SIGR); j+=4; 5475 tmp.lval[7] = inl(DE4X5_SIGR); j+=4;
5476 ioc->len = j; 5476 ioc->len = j;
5477 if (copy_to_user(ioc->data, tmp.addr, ioc->len)) return -EFAULT; 5477 if (copy_to_user(ioc->data, tmp.lval, ioc->len)) return -EFAULT;
5478 break; 5478 break;
5479 5479
5480#define DE4X5_DUMP 0x0f /* Dump the DE4X5 Status */ 5480#define DE4X5_DUMP 0x0f /* Dump the DE4X5 Status */
diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c
index 0bc4f3030a80..a9f7d5d1a269 100644
--- a/drivers/net/tulip/dmfe.c
+++ b/drivers/net/tulip/dmfe.c
@@ -599,7 +599,7 @@ static int dmfe_open(struct DEVICE *dev)
599 init_timer(&db->timer); 599 init_timer(&db->timer);
600 db->timer.expires = DMFE_TIMER_WUT + HZ * 2; 600 db->timer.expires = DMFE_TIMER_WUT + HZ * 2;
601 db->timer.data = (unsigned long)dev; 601 db->timer.data = (unsigned long)dev;
602 db->timer.function = &dmfe_timer; 602 db->timer.function = dmfe_timer;
603 add_timer(&db->timer); 603 add_timer(&db->timer);
604 604
605 return 0; 605 return 0;
diff --git a/drivers/net/tulip/interrupt.c b/drivers/net/tulip/interrupt.c
index 1faf7a4d7202..0013642903ee 100644
--- a/drivers/net/tulip/interrupt.c
+++ b/drivers/net/tulip/interrupt.c
@@ -180,21 +180,24 @@ int tulip_poll(struct napi_struct *napi, int budget)
180 dev_warn(&dev->dev, 180 dev_warn(&dev->dev,
181 "Oversized Ethernet frame spanned multiple buffers, status %08x!\n", 181 "Oversized Ethernet frame spanned multiple buffers, status %08x!\n",
182 status); 182 status);
183 tp->stats.rx_length_errors++; 183 dev->stats.rx_length_errors++;
184 } 184 }
185 } else { 185 } else {
186 /* There was a fatal error. */ 186 /* There was a fatal error. */
187 if (tulip_debug > 2) 187 if (tulip_debug > 2)
188 printk(KERN_DEBUG "%s: Receive error, Rx status %08x\n", 188 printk(KERN_DEBUG "%s: Receive error, Rx status %08x\n",
189 dev->name, status); 189 dev->name, status);
190 tp->stats.rx_errors++; /* end of a packet.*/ 190 dev->stats.rx_errors++; /* end of a packet.*/
191 if (pkt_len > 1518 || 191 if (pkt_len > 1518 ||
192 (status & RxDescRunt)) 192 (status & RxDescRunt))
193 tp->stats.rx_length_errors++; 193 dev->stats.rx_length_errors++;
194 194
195 if (status & 0x0004) tp->stats.rx_frame_errors++; 195 if (status & 0x0004)
196 if (status & 0x0002) tp->stats.rx_crc_errors++; 196 dev->stats.rx_frame_errors++;
197 if (status & 0x0001) tp->stats.rx_fifo_errors++; 197 if (status & 0x0002)
198 dev->stats.rx_crc_errors++;
199 if (status & 0x0001)
200 dev->stats.rx_fifo_errors++;
198 } 201 }
199 } else { 202 } else {
200 struct sk_buff *skb; 203 struct sk_buff *skb;
@@ -244,8 +247,8 @@ int tulip_poll(struct napi_struct *napi, int budget)
244 247
245 netif_receive_skb(skb); 248 netif_receive_skb(skb);
246 249
247 tp->stats.rx_packets++; 250 dev->stats.rx_packets++;
248 tp->stats.rx_bytes += pkt_len; 251 dev->stats.rx_bytes += pkt_len;
249 } 252 }
250#ifdef CONFIG_TULIP_NAPI_HW_MITIGATION 253#ifdef CONFIG_TULIP_NAPI_HW_MITIGATION
251 received++; 254 received++;
@@ -404,20 +407,23 @@ static int tulip_rx(struct net_device *dev)
404 dev_warn(&dev->dev, 407 dev_warn(&dev->dev,
405 "Oversized Ethernet frame spanned multiple buffers, status %08x!\n", 408 "Oversized Ethernet frame spanned multiple buffers, status %08x!\n",
406 status); 409 status);
407 tp->stats.rx_length_errors++; 410 dev->stats.rx_length_errors++;
408 } 411 }
409 } else { 412 } else {
410 /* There was a fatal error. */ 413 /* There was a fatal error. */
411 if (tulip_debug > 2) 414 if (tulip_debug > 2)
412 printk(KERN_DEBUG "%s: Receive error, Rx status %08x\n", 415 printk(KERN_DEBUG "%s: Receive error, Rx status %08x\n",
413 dev->name, status); 416 dev->name, status);
414 tp->stats.rx_errors++; /* end of a packet.*/ 417 dev->stats.rx_errors++; /* end of a packet.*/
415 if (pkt_len > 1518 || 418 if (pkt_len > 1518 ||
416 (status & RxDescRunt)) 419 (status & RxDescRunt))
417 tp->stats.rx_length_errors++; 420 dev->stats.rx_length_errors++;
418 if (status & 0x0004) tp->stats.rx_frame_errors++; 421 if (status & 0x0004)
419 if (status & 0x0002) tp->stats.rx_crc_errors++; 422 dev->stats.rx_frame_errors++;
420 if (status & 0x0001) tp->stats.rx_fifo_errors++; 423 if (status & 0x0002)
424 dev->stats.rx_crc_errors++;
425 if (status & 0x0001)
426 dev->stats.rx_fifo_errors++;
421 } 427 }
422 } else { 428 } else {
423 struct sk_buff *skb; 429 struct sk_buff *skb;
@@ -467,8 +473,8 @@ static int tulip_rx(struct net_device *dev)
467 473
468 netif_rx(skb); 474 netif_rx(skb);
469 475
470 tp->stats.rx_packets++; 476 dev->stats.rx_packets++;
471 tp->stats.rx_bytes += pkt_len; 477 dev->stats.rx_bytes += pkt_len;
472 } 478 }
473 received++; 479 received++;
474 entry = (++tp->cur_rx) % RX_RING_SIZE; 480 entry = (++tp->cur_rx) % RX_RING_SIZE;
@@ -602,18 +608,22 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance)
602 printk(KERN_DEBUG "%s: Transmit error, Tx status %08x\n", 608 printk(KERN_DEBUG "%s: Transmit error, Tx status %08x\n",
603 dev->name, status); 609 dev->name, status);
604#endif 610#endif
605 tp->stats.tx_errors++; 611 dev->stats.tx_errors++;
606 if (status & 0x4104) tp->stats.tx_aborted_errors++; 612 if (status & 0x4104)
607 if (status & 0x0C00) tp->stats.tx_carrier_errors++; 613 dev->stats.tx_aborted_errors++;
608 if (status & 0x0200) tp->stats.tx_window_errors++; 614 if (status & 0x0C00)
609 if (status & 0x0002) tp->stats.tx_fifo_errors++; 615 dev->stats.tx_carrier_errors++;
616 if (status & 0x0200)
617 dev->stats.tx_window_errors++;
618 if (status & 0x0002)
619 dev->stats.tx_fifo_errors++;
610 if ((status & 0x0080) && tp->full_duplex == 0) 620 if ((status & 0x0080) && tp->full_duplex == 0)
611 tp->stats.tx_heartbeat_errors++; 621 dev->stats.tx_heartbeat_errors++;
612 } else { 622 } else {
613 tp->stats.tx_bytes += 623 dev->stats.tx_bytes +=
614 tp->tx_buffers[entry].skb->len; 624 tp->tx_buffers[entry].skb->len;
615 tp->stats.collisions += (status >> 3) & 15; 625 dev->stats.collisions += (status >> 3) & 15;
616 tp->stats.tx_packets++; 626 dev->stats.tx_packets++;
617 } 627 }
618 628
619 pci_unmap_single(tp->pdev, tp->tx_buffers[entry].mapping, 629 pci_unmap_single(tp->pdev, tp->tx_buffers[entry].mapping,
@@ -655,7 +665,8 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance)
655 if (csr5 & AbnormalIntr) { /* Abnormal error summary bit. */ 665 if (csr5 & AbnormalIntr) { /* Abnormal error summary bit. */
656 if (csr5 == 0xffffffff) 666 if (csr5 == 0xffffffff)
657 break; 667 break;
658 if (csr5 & TxJabber) tp->stats.tx_errors++; 668 if (csr5 & TxJabber)
669 dev->stats.tx_errors++;
659 if (csr5 & TxFIFOUnderflow) { 670 if (csr5 & TxFIFOUnderflow) {
660 if ((tp->csr6 & 0xC000) != 0xC000) 671 if ((tp->csr6 & 0xC000) != 0xC000)
661 tp->csr6 += 0x4000; /* Bump up the Tx threshold */ 672 tp->csr6 += 0x4000; /* Bump up the Tx threshold */
@@ -672,8 +683,8 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance)
672 } 683 }
673 } 684 }
674 if (csr5 & RxDied) { /* Missed a Rx frame. */ 685 if (csr5 & RxDied) { /* Missed a Rx frame. */
675 tp->stats.rx_missed_errors += ioread32(ioaddr + CSR8) & 0xffff; 686 dev->stats.rx_missed_errors += ioread32(ioaddr + CSR8) & 0xffff;
676 tp->stats.rx_errors++; 687 dev->stats.rx_errors++;
677 tulip_start_rxtx(tp); 688 tulip_start_rxtx(tp);
678 } 689 }
679 /* 690 /*
@@ -789,7 +800,7 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance)
789#endif /* CONFIG_TULIP_NAPI */ 800#endif /* CONFIG_TULIP_NAPI */
790 801
791 if ((missed = ioread32(ioaddr + CSR8) & 0x1ffff)) { 802 if ((missed = ioread32(ioaddr + CSR8) & 0x1ffff)) {
792 tp->stats.rx_dropped += missed & 0x10000 ? 0x10000 : missed; 803 dev->stats.rx_dropped += missed & 0x10000 ? 0x10000 : missed;
793 } 804 }
794 805
795 if (tulip_debug > 4) 806 if (tulip_debug > 4)
diff --git a/drivers/net/tulip/tulip.h b/drivers/net/tulip/tulip.h
index e525875ed67d..ed66a16711dc 100644
--- a/drivers/net/tulip/tulip.h
+++ b/drivers/net/tulip/tulip.h
@@ -417,7 +417,6 @@ struct tulip_private {
417 int revision; 417 int revision;
418 int flags; 418 int flags;
419 struct napi_struct napi; 419 struct napi_struct napi;
420 struct net_device_stats stats;
421 struct timer_list timer; /* Media selection timer. */ 420 struct timer_list timer; /* Media selection timer. */
422 struct timer_list oom_timer; /* Out of memory timer. */ 421 struct timer_list oom_timer; /* Out of memory timer. */
423 u32 mc_filter[2]; 422 u32 mc_filter[2];
@@ -570,7 +569,7 @@ static inline void tulip_tx_timeout_complete(struct tulip_private *tp, void __io
570 /* Trigger an immediate transmit demand. */ 569 /* Trigger an immediate transmit demand. */
571 iowrite32(0, ioaddr + CSR1); 570 iowrite32(0, ioaddr + CSR1);
572 571
573 tp->stats.tx_errors++; 572 tp->dev->stats.tx_errors++;
574} 573}
575 574
576#endif /* __NET_TULIP_H__ */ 575#endif /* __NET_TULIP_H__ */
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c
index 3a8d7efa2acf..2c39f2591216 100644
--- a/drivers/net/tulip/tulip_core.c
+++ b/drivers/net/tulip/tulip_core.c
@@ -725,7 +725,7 @@ static void tulip_clean_tx_ring(struct tulip_private *tp)
725 int status = le32_to_cpu(tp->tx_ring[entry].status); 725 int status = le32_to_cpu(tp->tx_ring[entry].status);
726 726
727 if (status < 0) { 727 if (status < 0) {
728 tp->stats.tx_errors++; /* It wasn't Txed */ 728 tp->dev->stats.tx_errors++; /* It wasn't Txed */
729 tp->tx_ring[entry].status = 0; 729 tp->tx_ring[entry].status = 0;
730 } 730 }
731 731
@@ -781,8 +781,8 @@ static void tulip_down (struct net_device *dev)
781 /* release any unconsumed transmit buffers */ 781 /* release any unconsumed transmit buffers */
782 tulip_clean_tx_ring(tp); 782 tulip_clean_tx_ring(tp);
783 783
784 if (ioread32 (ioaddr + CSR6) != 0xffffffff) 784 if (ioread32(ioaddr + CSR6) != 0xffffffff)
785 tp->stats.rx_missed_errors += ioread32 (ioaddr + CSR8) & 0xffff; 785 dev->stats.rx_missed_errors += ioread32(ioaddr + CSR8) & 0xffff;
786 786
787 spin_unlock_irqrestore (&tp->lock, flags); 787 spin_unlock_irqrestore (&tp->lock, flags);
788 788
@@ -864,12 +864,12 @@ static struct net_device_stats *tulip_get_stats(struct net_device *dev)
864 864
865 spin_lock_irqsave (&tp->lock, flags); 865 spin_lock_irqsave (&tp->lock, flags);
866 866
867 tp->stats.rx_missed_errors += ioread32(ioaddr + CSR8) & 0xffff; 867 dev->stats.rx_missed_errors += ioread32(ioaddr + CSR8) & 0xffff;
868 868
869 spin_unlock_irqrestore(&tp->lock, flags); 869 spin_unlock_irqrestore(&tp->lock, flags);
870 } 870 }
871 871
872 return &tp->stats; 872 return &dev->stats;
873} 873}
874 874
875 875
diff --git a/drivers/net/tulip/uli526x.c b/drivers/net/tulip/uli526x.c
index 96de5829b940..74217dbf0143 100644
--- a/drivers/net/tulip/uli526x.c
+++ b/drivers/net/tulip/uli526x.c
@@ -480,7 +480,7 @@ static int uli526x_open(struct net_device *dev)
480 init_timer(&db->timer); 480 init_timer(&db->timer);
481 db->timer.expires = ULI526X_TIMER_WUT + HZ * 2; 481 db->timer.expires = ULI526X_TIMER_WUT + HZ * 2;
482 db->timer.data = (unsigned long)dev; 482 db->timer.data = (unsigned long)dev;
483 db->timer.function = &uli526x_timer; 483 db->timer.function = uli526x_timer;
484 add_timer(&db->timer); 484 add_timer(&db->timer);
485 485
486 return 0; 486 return 0;
@@ -1747,7 +1747,7 @@ static u16 phy_readby_cr10(unsigned long iobase, u8 phy_addr, u8 offset)
1747 if(cr10_value&0x10000000) 1747 if(cr10_value&0x10000000)
1748 break; 1748 break;
1749 } 1749 }
1750 return (cr10_value&0x0ffff); 1750 return cr10_value & 0x0ffff;
1751} 1751}
1752 1752
1753static void phy_writeby_cr10(unsigned long iobase, u8 phy_addr, u8 offset, u16 phy_data) 1753static void phy_writeby_cr10(unsigned long iobase, u8 phy_addr, u8 offset, u16 phy_data)
diff --git a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c
index 66d41cf8da29..f0b231035dee 100644
--- a/drivers/net/tulip/winbond-840.c
+++ b/drivers/net/tulip/winbond-840.c
@@ -662,7 +662,7 @@ static int netdev_open(struct net_device *dev)
662 init_timer(&np->timer); 662 init_timer(&np->timer);
663 np->timer.expires = jiffies + 1*HZ; 663 np->timer.expires = jiffies + 1*HZ;
664 np->timer.data = (unsigned long)dev; 664 np->timer.data = (unsigned long)dev;
665 np->timer.function = &netdev_timer; /* timer handler */ 665 np->timer.function = netdev_timer; /* timer handler */
666 add_timer(&np->timer); 666 add_timer(&np->timer);
667 return 0; 667 return 0;
668out_err: 668out_err:
diff --git a/drivers/net/tulip/xircom_cb.c b/drivers/net/tulip/xircom_cb.c
index a439e93be22d..5a73752be2ca 100644
--- a/drivers/net/tulip/xircom_cb.c
+++ b/drivers/net/tulip/xircom_cb.c
@@ -29,7 +29,6 @@
29#include <linux/skbuff.h> 29#include <linux/skbuff.h>
30#include <linux/delay.h> 30#include <linux/delay.h>
31#include <linux/init.h> 31#include <linux/init.h>
32#include <linux/ethtool.h>
33#include <linux/bitops.h> 32#include <linux/bitops.h>
34 33
35#include <asm/uaccess.h> 34#include <asm/uaccess.h>
@@ -181,19 +180,6 @@ static void print_binary(unsigned int number)
181} 180}
182#endif 181#endif
183 182
184static void netdev_get_drvinfo(struct net_device *dev,
185 struct ethtool_drvinfo *info)
186{
187 struct xircom_private *private = netdev_priv(dev);
188
189 strcpy(info->driver, "xircom_cb");
190 strcpy(info->bus_info, pci_name(private->pdev));
191}
192
193static const struct ethtool_ops netdev_ethtool_ops = {
194 .get_drvinfo = netdev_get_drvinfo,
195};
196
197static const struct net_device_ops netdev_ops = { 183static const struct net_device_ops netdev_ops = {
198 .ndo_open = xircom_open, 184 .ndo_open = xircom_open,
199 .ndo_stop = xircom_close, 185 .ndo_stop = xircom_close,
@@ -279,7 +265,6 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_
279 setup_descriptors(private); 265 setup_descriptors(private);
280 266
281 dev->netdev_ops = &netdev_ops; 267 dev->netdev_ops = &netdev_ops;
282 SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
283 pci_set_drvdata(pdev, dev); 268 pci_set_drvdata(pdev, dev);
284 269
285 if (register_netdev(dev)) { 270 if (register_netdev(dev)) {