diff options
author | David S. Miller <davem@davemloft.net> | 2008-05-13 04:19:43 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-05-13 04:19:43 -0400 |
commit | 99dd1a2b8347ac2ae802300b7862f6f7bcf17139 (patch) | |
tree | 4f583715a29ac95723b85532f47c3c568a544f1d /drivers/net | |
parent | 7ef43ebaa538e0cc9063cbf84593a05091bcace2 (diff) | |
parent | 7d2e3cb7000b883a8e489485ac249be572fe17b1 (diff) |
Merge branch 'upstream-next' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
Diffstat (limited to 'drivers/net')
30 files changed, 257 insertions, 304 deletions
diff --git a/drivers/net/3c523.c b/drivers/net/3c523.c index 239fc42fb8df..dc6e474229b1 100644 --- a/drivers/net/3c523.c +++ b/drivers/net/3c523.c | |||
@@ -202,7 +202,6 @@ static void elmc_xmt_int(struct net_device *dev); | |||
202 | static void elmc_rnr_int(struct net_device *dev); | 202 | static void elmc_rnr_int(struct net_device *dev); |
203 | 203 | ||
204 | struct priv { | 204 | struct priv { |
205 | struct net_device_stats stats; | ||
206 | unsigned long base; | 205 | unsigned long base; |
207 | char *memtop; | 206 | char *memtop; |
208 | unsigned long mapped_start; /* Start of ioremap */ | 207 | unsigned long mapped_start; /* Start of ioremap */ |
@@ -989,18 +988,18 @@ static void elmc_rcv_int(struct net_device *dev) | |||
989 | skb->protocol = eth_type_trans(skb, dev); | 988 | skb->protocol = eth_type_trans(skb, dev); |
990 | netif_rx(skb); | 989 | netif_rx(skb); |
991 | dev->last_rx = jiffies; | 990 | dev->last_rx = jiffies; |
992 | p->stats.rx_packets++; | 991 | dev->stats.rx_packets++; |
993 | p->stats.rx_bytes += totlen; | 992 | dev->stats.rx_bytes += totlen; |
994 | } else { | 993 | } else { |
995 | p->stats.rx_dropped++; | 994 | dev->stats.rx_dropped++; |
996 | } | 995 | } |
997 | } else { | 996 | } else { |
998 | printk(KERN_WARNING "%s: received oversized frame.\n", dev->name); | 997 | printk(KERN_WARNING "%s: received oversized frame.\n", dev->name); |
999 | p->stats.rx_dropped++; | 998 | dev->stats.rx_dropped++; |
1000 | } | 999 | } |
1001 | } else { /* frame !(ok), only with 'save-bad-frames' */ | 1000 | } else { /* frame !(ok), only with 'save-bad-frames' */ |
1002 | printk(KERN_WARNING "%s: oops! rfd-error-status: %04x\n", dev->name, status); | 1001 | printk(KERN_WARNING "%s: oops! rfd-error-status: %04x\n", dev->name, status); |
1003 | p->stats.rx_errors++; | 1002 | dev->stats.rx_errors++; |
1004 | } | 1003 | } |
1005 | p->rfd_top->status = 0; | 1004 | p->rfd_top->status = 0; |
1006 | p->rfd_top->last = RFD_SUSP; | 1005 | p->rfd_top->last = RFD_SUSP; |
@@ -1018,7 +1017,7 @@ static void elmc_rnr_int(struct net_device *dev) | |||
1018 | { | 1017 | { |
1019 | struct priv *p = (struct priv *) dev->priv; | 1018 | struct priv *p = (struct priv *) dev->priv; |
1020 | 1019 | ||
1021 | p->stats.rx_errors++; | 1020 | dev->stats.rx_errors++; |
1022 | 1021 | ||
1023 | WAIT_4_SCB_CMD(); /* wait for the last cmd */ | 1022 | WAIT_4_SCB_CMD(); /* wait for the last cmd */ |
1024 | p->scb->cmd = RUC_ABORT; /* usually the RU is in the 'no resource'-state .. abort it now. */ | 1023 | p->scb->cmd = RUC_ABORT; /* usually the RU is in the 'no resource'-state .. abort it now. */ |
@@ -1046,24 +1045,24 @@ static void elmc_xmt_int(struct net_device *dev) | |||
1046 | printk(KERN_WARNING "%s: strange .. xmit-int without a 'COMPLETE'\n", dev->name); | 1045 | printk(KERN_WARNING "%s: strange .. xmit-int without a 'COMPLETE'\n", dev->name); |
1047 | } | 1046 | } |
1048 | if (status & STAT_OK) { | 1047 | if (status & STAT_OK) { |
1049 | p->stats.tx_packets++; | 1048 | dev->stats.tx_packets++; |
1050 | p->stats.collisions += (status & TCMD_MAXCOLLMASK); | 1049 | dev->stats.collisions += (status & TCMD_MAXCOLLMASK); |
1051 | } else { | 1050 | } else { |
1052 | p->stats.tx_errors++; | 1051 | dev->stats.tx_errors++; |
1053 | if (status & TCMD_LATECOLL) { | 1052 | if (status & TCMD_LATECOLL) { |
1054 | printk(KERN_WARNING "%s: late collision detected.\n", dev->name); | 1053 | printk(KERN_WARNING "%s: late collision detected.\n", dev->name); |
1055 | p->stats.collisions++; | 1054 | dev->stats.collisions++; |
1056 | } else if (status & TCMD_NOCARRIER) { | 1055 | } else if (status & TCMD_NOCARRIER) { |
1057 | p->stats.tx_carrier_errors++; | 1056 | dev->stats.tx_carrier_errors++; |
1058 | printk(KERN_WARNING "%s: no carrier detected.\n", dev->name); | 1057 | printk(KERN_WARNING "%s: no carrier detected.\n", dev->name); |
1059 | } else if (status & TCMD_LOSTCTS) { | 1058 | } else if (status & TCMD_LOSTCTS) { |
1060 | printk(KERN_WARNING "%s: loss of CTS detected.\n", dev->name); | 1059 | printk(KERN_WARNING "%s: loss of CTS detected.\n", dev->name); |
1061 | } else if (status & TCMD_UNDERRUN) { | 1060 | } else if (status & TCMD_UNDERRUN) { |
1062 | p->stats.tx_fifo_errors++; | 1061 | dev->stats.tx_fifo_errors++; |
1063 | printk(KERN_WARNING "%s: DMA underrun detected.\n", dev->name); | 1062 | printk(KERN_WARNING "%s: DMA underrun detected.\n", dev->name); |
1064 | } else if (status & TCMD_MAXCOLL) { | 1063 | } else if (status & TCMD_MAXCOLL) { |
1065 | printk(KERN_WARNING "%s: Max. collisions exceeded.\n", dev->name); | 1064 | printk(KERN_WARNING "%s: Max. collisions exceeded.\n", dev->name); |
1066 | p->stats.collisions += 16; | 1065 | dev->stats.collisions += 16; |
1067 | } | 1066 | } |
1068 | } | 1067 | } |
1069 | 1068 | ||
@@ -1215,12 +1214,12 @@ static struct net_device_stats *elmc_get_stats(struct net_device *dev) | |||
1215 | ovrn = p->scb->ovrn_errs; | 1214 | ovrn = p->scb->ovrn_errs; |
1216 | p->scb->ovrn_errs -= ovrn; | 1215 | p->scb->ovrn_errs -= ovrn; |
1217 | 1216 | ||
1218 | p->stats.rx_crc_errors += crc; | 1217 | dev->stats.rx_crc_errors += crc; |
1219 | p->stats.rx_fifo_errors += ovrn; | 1218 | dev->stats.rx_fifo_errors += ovrn; |
1220 | p->stats.rx_frame_errors += aln; | 1219 | dev->stats.rx_frame_errors += aln; |
1221 | p->stats.rx_dropped += rsc; | 1220 | dev->stats.rx_dropped += rsc; |
1222 | 1221 | ||
1223 | return &p->stats; | 1222 | return &dev->stats; |
1224 | } | 1223 | } |
1225 | 1224 | ||
1226 | /******************************************************** | 1225 | /******************************************************** |
diff --git a/drivers/net/3c527.c b/drivers/net/3c527.c index fae295b6809c..6aca0c640f13 100644 --- a/drivers/net/3c527.c +++ b/drivers/net/3c527.c | |||
@@ -158,7 +158,6 @@ struct mc32_local | |||
158 | int slot; | 158 | int slot; |
159 | 159 | ||
160 | u32 base; | 160 | u32 base; |
161 | struct net_device_stats net_stats; | ||
162 | volatile struct mc32_mailbox *rx_box; | 161 | volatile struct mc32_mailbox *rx_box; |
163 | volatile struct mc32_mailbox *tx_box; | 162 | volatile struct mc32_mailbox *tx_box; |
164 | volatile struct mc32_mailbox *exec_box; | 163 | volatile struct mc32_mailbox *exec_box; |
@@ -1093,24 +1092,24 @@ static void mc32_update_stats(struct net_device *dev) | |||
1093 | 1092 | ||
1094 | u32 rx_errors=0; | 1093 | u32 rx_errors=0; |
1095 | 1094 | ||
1096 | rx_errors+=lp->net_stats.rx_crc_errors +=st->rx_crc_errors; | 1095 | rx_errors+=dev->stats.rx_crc_errors +=st->rx_crc_errors; |
1097 | st->rx_crc_errors=0; | 1096 | st->rx_crc_errors=0; |
1098 | rx_errors+=lp->net_stats.rx_fifo_errors +=st->rx_overrun_errors; | 1097 | rx_errors+=dev->stats.rx_fifo_errors +=st->rx_overrun_errors; |
1099 | st->rx_overrun_errors=0; | 1098 | st->rx_overrun_errors=0; |
1100 | rx_errors+=lp->net_stats.rx_frame_errors +=st->rx_alignment_errors; | 1099 | rx_errors+=dev->stats.rx_frame_errors +=st->rx_alignment_errors; |
1101 | st->rx_alignment_errors=0; | 1100 | st->rx_alignment_errors=0; |
1102 | rx_errors+=lp->net_stats.rx_length_errors+=st->rx_tooshort_errors; | 1101 | rx_errors+=dev->stats.rx_length_errors+=st->rx_tooshort_errors; |
1103 | st->rx_tooshort_errors=0; | 1102 | st->rx_tooshort_errors=0; |
1104 | rx_errors+=lp->net_stats.rx_missed_errors+=st->rx_outofresource_errors; | 1103 | rx_errors+=dev->stats.rx_missed_errors+=st->rx_outofresource_errors; |
1105 | st->rx_outofresource_errors=0; | 1104 | st->rx_outofresource_errors=0; |
1106 | lp->net_stats.rx_errors=rx_errors; | 1105 | dev->stats.rx_errors=rx_errors; |
1107 | 1106 | ||
1108 | /* Number of packets which saw one collision */ | 1107 | /* Number of packets which saw one collision */ |
1109 | lp->net_stats.collisions+=st->dataC[10]; | 1108 | dev->stats.collisions+=st->dataC[10]; |
1110 | st->dataC[10]=0; | 1109 | st->dataC[10]=0; |
1111 | 1110 | ||
1112 | /* Number of packets which saw 2--15 collisions */ | 1111 | /* Number of packets which saw 2--15 collisions */ |
1113 | lp->net_stats.collisions+=st->dataC[11]; | 1112 | dev->stats.collisions+=st->dataC[11]; |
1114 | st->dataC[11]=0; | 1113 | st->dataC[11]=0; |
1115 | } | 1114 | } |
1116 | 1115 | ||
@@ -1178,7 +1177,7 @@ static void mc32_rx_ring(struct net_device *dev) | |||
1178 | skb=dev_alloc_skb(length+2); | 1177 | skb=dev_alloc_skb(length+2); |
1179 | 1178 | ||
1180 | if(skb==NULL) { | 1179 | if(skb==NULL) { |
1181 | lp->net_stats.rx_dropped++; | 1180 | dev->stats.rx_dropped++; |
1182 | goto dropped; | 1181 | goto dropped; |
1183 | } | 1182 | } |
1184 | 1183 | ||
@@ -1189,8 +1188,8 @@ static void mc32_rx_ring(struct net_device *dev) | |||
1189 | 1188 | ||
1190 | skb->protocol=eth_type_trans(skb,dev); | 1189 | skb->protocol=eth_type_trans(skb,dev); |
1191 | dev->last_rx = jiffies; | 1190 | dev->last_rx = jiffies; |
1192 | lp->net_stats.rx_packets++; | 1191 | dev->stats.rx_packets++; |
1193 | lp->net_stats.rx_bytes += length; | 1192 | dev->stats.rx_bytes += length; |
1194 | netif_rx(skb); | 1193 | netif_rx(skb); |
1195 | } | 1194 | } |
1196 | 1195 | ||
@@ -1253,34 +1252,34 @@ static void mc32_tx_ring(struct net_device *dev) | |||
1253 | /* Not COMPLETED */ | 1252 | /* Not COMPLETED */ |
1254 | break; | 1253 | break; |
1255 | } | 1254 | } |
1256 | lp->net_stats.tx_packets++; | 1255 | dev->stats.tx_packets++; |
1257 | if(!(np->status & (1<<6))) /* Not COMPLETED_OK */ | 1256 | if(!(np->status & (1<<6))) /* Not COMPLETED_OK */ |
1258 | { | 1257 | { |
1259 | lp->net_stats.tx_errors++; | 1258 | dev->stats.tx_errors++; |
1260 | 1259 | ||
1261 | switch(np->status&0x0F) | 1260 | switch(np->status&0x0F) |
1262 | { | 1261 | { |
1263 | case 1: | 1262 | case 1: |
1264 | lp->net_stats.tx_aborted_errors++; | 1263 | dev->stats.tx_aborted_errors++; |
1265 | break; /* Max collisions */ | 1264 | break; /* Max collisions */ |
1266 | case 2: | 1265 | case 2: |
1267 | lp->net_stats.tx_fifo_errors++; | 1266 | dev->stats.tx_fifo_errors++; |
1268 | break; | 1267 | break; |
1269 | case 3: | 1268 | case 3: |
1270 | lp->net_stats.tx_carrier_errors++; | 1269 | dev->stats.tx_carrier_errors++; |
1271 | break; | 1270 | break; |
1272 | case 4: | 1271 | case 4: |
1273 | lp->net_stats.tx_window_errors++; | 1272 | dev->stats.tx_window_errors++; |
1274 | break; /* CTS Lost */ | 1273 | break; /* CTS Lost */ |
1275 | case 5: | 1274 | case 5: |
1276 | lp->net_stats.tx_aborted_errors++; | 1275 | dev->stats.tx_aborted_errors++; |
1277 | break; /* Transmit timeout */ | 1276 | break; /* Transmit timeout */ |
1278 | } | 1277 | } |
1279 | } | 1278 | } |
1280 | /* Packets are sent in order - this is | 1279 | /* Packets are sent in order - this is |
1281 | basically a FIFO queue of buffers matching | 1280 | basically a FIFO queue of buffers matching |
1282 | the card ring */ | 1281 | the card ring */ |
1283 | lp->net_stats.tx_bytes+=lp->tx_ring[t].skb->len; | 1282 | dev->stats.tx_bytes+=lp->tx_ring[t].skb->len; |
1284 | dev_kfree_skb_irq(lp->tx_ring[t].skb); | 1283 | dev_kfree_skb_irq(lp->tx_ring[t].skb); |
1285 | lp->tx_ring[t].skb=NULL; | 1284 | lp->tx_ring[t].skb=NULL; |
1286 | atomic_inc(&lp->tx_count); | 1285 | atomic_inc(&lp->tx_count); |
@@ -1367,7 +1366,7 @@ static irqreturn_t mc32_interrupt(int irq, void *dev_id) | |||
1367 | case 6: | 1366 | case 6: |
1368 | /* Out of RX buffers stat */ | 1367 | /* Out of RX buffers stat */ |
1369 | /* Must restart rx */ | 1368 | /* Must restart rx */ |
1370 | lp->net_stats.rx_dropped++; | 1369 | dev->stats.rx_dropped++; |
1371 | mc32_rx_ring(dev); | 1370 | mc32_rx_ring(dev); |
1372 | mc32_start_transceiver(dev); | 1371 | mc32_start_transceiver(dev); |
1373 | break; | 1372 | break; |
@@ -1489,10 +1488,8 @@ static int mc32_close(struct net_device *dev) | |||
1489 | 1488 | ||
1490 | static struct net_device_stats *mc32_get_stats(struct net_device *dev) | 1489 | static struct net_device_stats *mc32_get_stats(struct net_device *dev) |
1491 | { | 1490 | { |
1492 | struct mc32_local *lp = netdev_priv(dev); | ||
1493 | |||
1494 | mc32_update_stats(dev); | 1491 | mc32_update_stats(dev); |
1495 | return &lp->net_stats; | 1492 | return &dev->stats; |
1496 | } | 1493 | } |
1497 | 1494 | ||
1498 | 1495 | ||
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index a453eda834d5..934db350e339 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c | |||
@@ -340,7 +340,6 @@ struct cp_private { | |||
340 | u32 rx_config; | 340 | u32 rx_config; |
341 | u16 cpcmd; | 341 | u16 cpcmd; |
342 | 342 | ||
343 | struct net_device_stats net_stats; | ||
344 | struct cp_extra_stats cp_stats; | 343 | struct cp_extra_stats cp_stats; |
345 | 344 | ||
346 | unsigned rx_head ____cacheline_aligned; | 345 | unsigned rx_head ____cacheline_aligned; |
@@ -457,8 +456,8 @@ static inline void cp_rx_skb (struct cp_private *cp, struct sk_buff *skb, | |||
457 | { | 456 | { |
458 | skb->protocol = eth_type_trans (skb, cp->dev); | 457 | skb->protocol = eth_type_trans (skb, cp->dev); |
459 | 458 | ||
460 | cp->net_stats.rx_packets++; | 459 | cp->dev->stats.rx_packets++; |
461 | cp->net_stats.rx_bytes += skb->len; | 460 | cp->dev->stats.rx_bytes += skb->len; |
462 | cp->dev->last_rx = jiffies; | 461 | cp->dev->last_rx = jiffies; |
463 | 462 | ||
464 | #if CP_VLAN_TAG_USED | 463 | #if CP_VLAN_TAG_USED |
@@ -477,17 +476,17 @@ static void cp_rx_err_acct (struct cp_private *cp, unsigned rx_tail, | |||
477 | printk (KERN_DEBUG | 476 | printk (KERN_DEBUG |
478 | "%s: rx err, slot %d status 0x%x len %d\n", | 477 | "%s: rx err, slot %d status 0x%x len %d\n", |
479 | cp->dev->name, rx_tail, status, len); | 478 | cp->dev->name, rx_tail, status, len); |
480 | cp->net_stats.rx_errors++; | 479 | cp->dev->stats.rx_errors++; |
481 | if (status & RxErrFrame) | 480 | if (status & RxErrFrame) |
482 | cp->net_stats.rx_frame_errors++; | 481 | cp->dev->stats.rx_frame_errors++; |
483 | if (status & RxErrCRC) | 482 | if (status & RxErrCRC) |
484 | cp->net_stats.rx_crc_errors++; | 483 | cp->dev->stats.rx_crc_errors++; |
485 | if ((status & RxErrRunt) || (status & RxErrLong)) | 484 | if ((status & RxErrRunt) || (status & RxErrLong)) |
486 | cp->net_stats.rx_length_errors++; | 485 | cp->dev->stats.rx_length_errors++; |
487 | if ((status & (FirstFrag | LastFrag)) != (FirstFrag | LastFrag)) | 486 | if ((status & (FirstFrag | LastFrag)) != (FirstFrag | LastFrag)) |
488 | cp->net_stats.rx_length_errors++; | 487 | cp->dev->stats.rx_length_errors++; |
489 | if (status & RxErrFIFO) | 488 | if (status & RxErrFIFO) |
490 | cp->net_stats.rx_fifo_errors++; | 489 | cp->dev->stats.rx_fifo_errors++; |
491 | } | 490 | } |
492 | 491 | ||
493 | static inline unsigned int cp_rx_csum_ok (u32 status) | 492 | static inline unsigned int cp_rx_csum_ok (u32 status) |
@@ -539,7 +538,7 @@ rx_status_loop: | |||
539 | * that RX fragments are never encountered | 538 | * that RX fragments are never encountered |
540 | */ | 539 | */ |
541 | cp_rx_err_acct(cp, rx_tail, status, len); | 540 | cp_rx_err_acct(cp, rx_tail, status, len); |
542 | cp->net_stats.rx_dropped++; | 541 | dev->stats.rx_dropped++; |
543 | cp->cp_stats.rx_frags++; | 542 | cp->cp_stats.rx_frags++; |
544 | goto rx_next; | 543 | goto rx_next; |
545 | } | 544 | } |
@@ -556,7 +555,7 @@ rx_status_loop: | |||
556 | buflen = cp->rx_buf_sz + RX_OFFSET; | 555 | buflen = cp->rx_buf_sz + RX_OFFSET; |
557 | new_skb = dev_alloc_skb (buflen); | 556 | new_skb = dev_alloc_skb (buflen); |
558 | if (!new_skb) { | 557 | if (!new_skb) { |
559 | cp->net_stats.rx_dropped++; | 558 | dev->stats.rx_dropped++; |
560 | goto rx_next; | 559 | goto rx_next; |
561 | } | 560 | } |
562 | 561 | ||
@@ -710,20 +709,20 @@ static void cp_tx (struct cp_private *cp) | |||
710 | if (netif_msg_tx_err(cp)) | 709 | if (netif_msg_tx_err(cp)) |
711 | printk(KERN_DEBUG "%s: tx err, status 0x%x\n", | 710 | printk(KERN_DEBUG "%s: tx err, status 0x%x\n", |
712 | cp->dev->name, status); | 711 | cp->dev->name, status); |
713 | cp->net_stats.tx_errors++; | 712 | cp->dev->stats.tx_errors++; |
714 | if (status & TxOWC) | 713 | if (status & TxOWC) |
715 | cp->net_stats.tx_window_errors++; | 714 | cp->dev->stats.tx_window_errors++; |
716 | if (status & TxMaxCol) | 715 | if (status & TxMaxCol) |
717 | cp->net_stats.tx_aborted_errors++; | 716 | cp->dev->stats.tx_aborted_errors++; |
718 | if (status & TxLinkFail) | 717 | if (status & TxLinkFail) |
719 | cp->net_stats.tx_carrier_errors++; | 718 | cp->dev->stats.tx_carrier_errors++; |
720 | if (status & TxFIFOUnder) | 719 | if (status & TxFIFOUnder) |
721 | cp->net_stats.tx_fifo_errors++; | 720 | cp->dev->stats.tx_fifo_errors++; |
722 | } else { | 721 | } else { |
723 | cp->net_stats.collisions += | 722 | cp->dev->stats.collisions += |
724 | ((status >> TxColCntShift) & TxColCntMask); | 723 | ((status >> TxColCntShift) & TxColCntMask); |
725 | cp->net_stats.tx_packets++; | 724 | cp->dev->stats.tx_packets++; |
726 | cp->net_stats.tx_bytes += skb->len; | 725 | cp->dev->stats.tx_bytes += skb->len; |
727 | if (netif_msg_tx_done(cp)) | 726 | if (netif_msg_tx_done(cp)) |
728 | printk(KERN_DEBUG "%s: tx done, slot %d\n", cp->dev->name, tx_tail); | 727 | printk(KERN_DEBUG "%s: tx done, slot %d\n", cp->dev->name, tx_tail); |
729 | } | 728 | } |
@@ -956,7 +955,7 @@ static void cp_set_rx_mode (struct net_device *dev) | |||
956 | static void __cp_get_stats(struct cp_private *cp) | 955 | static void __cp_get_stats(struct cp_private *cp) |
957 | { | 956 | { |
958 | /* only lower 24 bits valid; write any value to clear */ | 957 | /* only lower 24 bits valid; write any value to clear */ |
959 | cp->net_stats.rx_missed_errors += (cpr32 (RxMissed) & 0xffffff); | 958 | cp->dev->stats.rx_missed_errors += (cpr32 (RxMissed) & 0xffffff); |
960 | cpw32 (RxMissed, 0); | 959 | cpw32 (RxMissed, 0); |
961 | } | 960 | } |
962 | 961 | ||
@@ -971,7 +970,7 @@ static struct net_device_stats *cp_get_stats(struct net_device *dev) | |||
971 | __cp_get_stats(cp); | 970 | __cp_get_stats(cp); |
972 | spin_unlock_irqrestore(&cp->lock, flags); | 971 | spin_unlock_irqrestore(&cp->lock, flags); |
973 | 972 | ||
974 | return &cp->net_stats; | 973 | return &dev->stats; |
975 | } | 974 | } |
976 | 975 | ||
977 | static void cp_stop_hw (struct cp_private *cp) | 976 | static void cp_stop_hw (struct cp_private *cp) |
@@ -1142,7 +1141,7 @@ static void cp_clean_rings (struct cp_private *cp) | |||
1142 | PCI_DMA_TODEVICE); | 1141 | PCI_DMA_TODEVICE); |
1143 | if (le32_to_cpu(desc->opts1) & LastFrag) | 1142 | if (le32_to_cpu(desc->opts1) & LastFrag) |
1144 | dev_kfree_skb(skb); | 1143 | dev_kfree_skb(skb); |
1145 | cp->net_stats.tx_dropped++; | 1144 | cp->dev->stats.tx_dropped++; |
1146 | } | 1145 | } |
1147 | } | 1146 | } |
1148 | 1147 | ||
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c index 53bd903d2321..b23a00c5b84f 100644 --- a/drivers/net/8139too.c +++ b/drivers/net/8139too.c | |||
@@ -574,7 +574,6 @@ struct rtl8139_private { | |||
574 | u32 msg_enable; | 574 | u32 msg_enable; |
575 | struct napi_struct napi; | 575 | struct napi_struct napi; |
576 | struct net_device *dev; | 576 | struct net_device *dev; |
577 | struct net_device_stats stats; | ||
578 | 577 | ||
579 | unsigned char *rx_ring; | 578 | unsigned char *rx_ring; |
580 | unsigned int cur_rx; /* RX buf index of next pkt */ | 579 | unsigned int cur_rx; /* RX buf index of next pkt */ |
@@ -1711,7 +1710,7 @@ static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev) | |||
1711 | dev_kfree_skb(skb); | 1710 | dev_kfree_skb(skb); |
1712 | } else { | 1711 | } else { |
1713 | dev_kfree_skb(skb); | 1712 | dev_kfree_skb(skb); |
1714 | tp->stats.tx_dropped++; | 1713 | dev->stats.tx_dropped++; |
1715 | return 0; | 1714 | return 0; |
1716 | } | 1715 | } |
1717 | 1716 | ||
@@ -1762,27 +1761,27 @@ static void rtl8139_tx_interrupt (struct net_device *dev, | |||
1762 | if (netif_msg_tx_err(tp)) | 1761 | if (netif_msg_tx_err(tp)) |
1763 | printk(KERN_DEBUG "%s: Transmit error, Tx status %8.8x.\n", | 1762 | printk(KERN_DEBUG "%s: Transmit error, Tx status %8.8x.\n", |
1764 | dev->name, txstatus); | 1763 | dev->name, txstatus); |
1765 | tp->stats.tx_errors++; | 1764 | dev->stats.tx_errors++; |
1766 | if (txstatus & TxAborted) { | 1765 | if (txstatus & TxAborted) { |
1767 | tp->stats.tx_aborted_errors++; | 1766 | dev->stats.tx_aborted_errors++; |
1768 | RTL_W32 (TxConfig, TxClearAbt); | 1767 | RTL_W32 (TxConfig, TxClearAbt); |
1769 | RTL_W16 (IntrStatus, TxErr); | 1768 | RTL_W16 (IntrStatus, TxErr); |
1770 | wmb(); | 1769 | wmb(); |
1771 | } | 1770 | } |
1772 | if (txstatus & TxCarrierLost) | 1771 | if (txstatus & TxCarrierLost) |
1773 | tp->stats.tx_carrier_errors++; | 1772 | dev->stats.tx_carrier_errors++; |
1774 | if (txstatus & TxOutOfWindow) | 1773 | if (txstatus & TxOutOfWindow) |
1775 | tp->stats.tx_window_errors++; | 1774 | dev->stats.tx_window_errors++; |
1776 | } else { | 1775 | } else { |
1777 | if (txstatus & TxUnderrun) { | 1776 | if (txstatus & TxUnderrun) { |
1778 | /* Add 64 to the Tx FIFO threshold. */ | 1777 | /* Add 64 to the Tx FIFO threshold. */ |
1779 | if (tp->tx_flag < 0x00300000) | 1778 | if (tp->tx_flag < 0x00300000) |
1780 | tp->tx_flag += 0x00020000; | 1779 | tp->tx_flag += 0x00020000; |
1781 | tp->stats.tx_fifo_errors++; | 1780 | dev->stats.tx_fifo_errors++; |
1782 | } | 1781 | } |
1783 | tp->stats.collisions += (txstatus >> 24) & 15; | 1782 | dev->stats.collisions += (txstatus >> 24) & 15; |
1784 | tp->stats.tx_bytes += txstatus & 0x7ff; | 1783 | dev->stats.tx_bytes += txstatus & 0x7ff; |
1785 | tp->stats.tx_packets++; | 1784 | dev->stats.tx_packets++; |
1786 | } | 1785 | } |
1787 | 1786 | ||
1788 | dirty_tx++; | 1787 | dirty_tx++; |
@@ -1818,7 +1817,7 @@ static void rtl8139_rx_err (u32 rx_status, struct net_device *dev, | |||
1818 | if (netif_msg_rx_err (tp)) | 1817 | if (netif_msg_rx_err (tp)) |
1819 | printk(KERN_DEBUG "%s: Ethernet frame had errors, status %8.8x.\n", | 1818 | printk(KERN_DEBUG "%s: Ethernet frame had errors, status %8.8x.\n", |
1820 | dev->name, rx_status); | 1819 | dev->name, rx_status); |
1821 | tp->stats.rx_errors++; | 1820 | dev->stats.rx_errors++; |
1822 | if (!(rx_status & RxStatusOK)) { | 1821 | if (!(rx_status & RxStatusOK)) { |
1823 | if (rx_status & RxTooLong) { | 1822 | if (rx_status & RxTooLong) { |
1824 | DPRINTK ("%s: Oversized Ethernet frame, status %4.4x!\n", | 1823 | DPRINTK ("%s: Oversized Ethernet frame, status %4.4x!\n", |
@@ -1826,11 +1825,11 @@ static void rtl8139_rx_err (u32 rx_status, struct net_device *dev, | |||
1826 | /* A.C.: The chip hangs here. */ | 1825 | /* A.C.: The chip hangs here. */ |
1827 | } | 1826 | } |
1828 | if (rx_status & (RxBadSymbol | RxBadAlign)) | 1827 | if (rx_status & (RxBadSymbol | RxBadAlign)) |
1829 | tp->stats.rx_frame_errors++; | 1828 | dev->stats.rx_frame_errors++; |
1830 | if (rx_status & (RxRunt | RxTooLong)) | 1829 | if (rx_status & (RxRunt | RxTooLong)) |
1831 | tp->stats.rx_length_errors++; | 1830 | dev->stats.rx_length_errors++; |
1832 | if (rx_status & RxCRCErr) | 1831 | if (rx_status & RxCRCErr) |
1833 | tp->stats.rx_crc_errors++; | 1832 | dev->stats.rx_crc_errors++; |
1834 | } else { | 1833 | } else { |
1835 | tp->xstats.rx_lost_in_ring++; | 1834 | tp->xstats.rx_lost_in_ring++; |
1836 | } | 1835 | } |
@@ -1913,9 +1912,9 @@ static void rtl8139_isr_ack(struct rtl8139_private *tp) | |||
1913 | /* Clear out errors and receive interrupts */ | 1912 | /* Clear out errors and receive interrupts */ |
1914 | if (likely(status != 0)) { | 1913 | if (likely(status != 0)) { |
1915 | if (unlikely(status & (RxFIFOOver | RxOverflow))) { | 1914 | if (unlikely(status & (RxFIFOOver | RxOverflow))) { |
1916 | tp->stats.rx_errors++; | 1915 | tp->dev->stats.rx_errors++; |
1917 | if (status & RxFIFOOver) | 1916 | if (status & RxFIFOOver) |
1918 | tp->stats.rx_fifo_errors++; | 1917 | tp->dev->stats.rx_fifo_errors++; |
1919 | } | 1918 | } |
1920 | RTL_W16_F (IntrStatus, RxAckBits); | 1919 | RTL_W16_F (IntrStatus, RxAckBits); |
1921 | } | 1920 | } |
@@ -2016,8 +2015,8 @@ no_early_rx: | |||
2016 | skb->protocol = eth_type_trans (skb, dev); | 2015 | skb->protocol = eth_type_trans (skb, dev); |
2017 | 2016 | ||
2018 | dev->last_rx = jiffies; | 2017 | dev->last_rx = jiffies; |
2019 | tp->stats.rx_bytes += pkt_size; | 2018 | dev->stats.rx_bytes += pkt_size; |
2020 | tp->stats.rx_packets++; | 2019 | dev->stats.rx_packets++; |
2021 | 2020 | ||
2022 | netif_receive_skb (skb); | 2021 | netif_receive_skb (skb); |
2023 | } else { | 2022 | } else { |
@@ -2025,7 +2024,7 @@ no_early_rx: | |||
2025 | printk (KERN_WARNING | 2024 | printk (KERN_WARNING |
2026 | "%s: Memory squeeze, dropping packet.\n", | 2025 | "%s: Memory squeeze, dropping packet.\n", |
2027 | dev->name); | 2026 | dev->name); |
2028 | tp->stats.rx_dropped++; | 2027 | dev->stats.rx_dropped++; |
2029 | } | 2028 | } |
2030 | received++; | 2029 | received++; |
2031 | 2030 | ||
@@ -2072,7 +2071,7 @@ static void rtl8139_weird_interrupt (struct net_device *dev, | |||
2072 | assert (ioaddr != NULL); | 2071 | assert (ioaddr != NULL); |
2073 | 2072 | ||
2074 | /* Update the error count. */ | 2073 | /* Update the error count. */ |
2075 | tp->stats.rx_missed_errors += RTL_R32 (RxMissed); | 2074 | dev->stats.rx_missed_errors += RTL_R32 (RxMissed); |
2076 | RTL_W32 (RxMissed, 0); | 2075 | RTL_W32 (RxMissed, 0); |
2077 | 2076 | ||
2078 | if ((status & RxUnderrun) && link_changed && | 2077 | if ((status & RxUnderrun) && link_changed && |
@@ -2082,12 +2081,12 @@ static void rtl8139_weird_interrupt (struct net_device *dev, | |||
2082 | } | 2081 | } |
2083 | 2082 | ||
2084 | if (status & (RxUnderrun | RxErr)) | 2083 | if (status & (RxUnderrun | RxErr)) |
2085 | tp->stats.rx_errors++; | 2084 | dev->stats.rx_errors++; |
2086 | 2085 | ||
2087 | if (status & PCSTimeout) | 2086 | if (status & PCSTimeout) |
2088 | tp->stats.rx_length_errors++; | 2087 | dev->stats.rx_length_errors++; |
2089 | if (status & RxUnderrun) | 2088 | if (status & RxUnderrun) |
2090 | tp->stats.rx_fifo_errors++; | 2089 | dev->stats.rx_fifo_errors++; |
2091 | if (status & PCIErr) { | 2090 | if (status & PCIErr) { |
2092 | u16 pci_cmd_status; | 2091 | u16 pci_cmd_status; |
2093 | pci_read_config_word (tp->pci_dev, PCI_STATUS, &pci_cmd_status); | 2092 | pci_read_config_word (tp->pci_dev, PCI_STATUS, &pci_cmd_status); |
@@ -2227,7 +2226,7 @@ static int rtl8139_close (struct net_device *dev) | |||
2227 | RTL_W16 (IntrMask, 0); | 2226 | RTL_W16 (IntrMask, 0); |
2228 | 2227 | ||
2229 | /* Update the error counts. */ | 2228 | /* Update the error counts. */ |
2230 | tp->stats.rx_missed_errors += RTL_R32 (RxMissed); | 2229 | dev->stats.rx_missed_errors += RTL_R32 (RxMissed); |
2231 | RTL_W32 (RxMissed, 0); | 2230 | RTL_W32 (RxMissed, 0); |
2232 | 2231 | ||
2233 | spin_unlock_irqrestore (&tp->lock, flags); | 2232 | spin_unlock_irqrestore (&tp->lock, flags); |
@@ -2472,12 +2471,12 @@ static struct net_device_stats *rtl8139_get_stats (struct net_device *dev) | |||
2472 | 2471 | ||
2473 | if (netif_running(dev)) { | 2472 | if (netif_running(dev)) { |
2474 | spin_lock_irqsave (&tp->lock, flags); | 2473 | spin_lock_irqsave (&tp->lock, flags); |
2475 | tp->stats.rx_missed_errors += RTL_R32 (RxMissed); | 2474 | dev->stats.rx_missed_errors += RTL_R32 (RxMissed); |
2476 | RTL_W32 (RxMissed, 0); | 2475 | RTL_W32 (RxMissed, 0); |
2477 | spin_unlock_irqrestore (&tp->lock, flags); | 2476 | spin_unlock_irqrestore (&tp->lock, flags); |
2478 | } | 2477 | } |
2479 | 2478 | ||
2480 | return &tp->stats; | 2479 | return &dev->stats; |
2481 | } | 2480 | } |
2482 | 2481 | ||
2483 | /* Set or clear the multicast filter for this adaptor. | 2482 | /* Set or clear the multicast filter for this adaptor. |
@@ -2561,7 +2560,7 @@ static int rtl8139_suspend (struct pci_dev *pdev, pm_message_t state) | |||
2561 | RTL_W8 (ChipCmd, 0); | 2560 | RTL_W8 (ChipCmd, 0); |
2562 | 2561 | ||
2563 | /* Update the error counts. */ | 2562 | /* Update the error counts. */ |
2564 | tp->stats.rx_missed_errors += RTL_R32 (RxMissed); | 2563 | dev->stats.rx_missed_errors += RTL_R32 (RxMissed); |
2565 | RTL_W32 (RxMissed, 0); | 2564 | RTL_W32 (RxMissed, 0); |
2566 | 2565 | ||
2567 | spin_unlock_irqrestore (&tp->lock, flags); | 2566 | spin_unlock_irqrestore (&tp->lock, flags); |
diff --git a/drivers/net/8390.h b/drivers/net/8390.h index 04ddec0f4c61..cf020d45aea6 100644 --- a/drivers/net/8390.h +++ b/drivers/net/8390.h | |||
@@ -69,7 +69,6 @@ struct ei_device { | |||
69 | unsigned char reg0; /* Register '0' in a WD8013 */ | 69 | unsigned char reg0; /* Register '0' in a WD8013 */ |
70 | unsigned char reg5; /* Register '5' in a WD8013 */ | 70 | unsigned char reg5; /* Register '5' in a WD8013 */ |
71 | unsigned char saved_irq; /* Original dev->irq value. */ | 71 | unsigned char saved_irq; /* Original dev->irq value. */ |
72 | struct net_device_stats stat; /* The new statistics table. */ | ||
73 | u32 *reg_offset; /* Register mapping table */ | 72 | u32 *reg_offset; /* Register mapping table */ |
74 | spinlock_t page_lock; /* Page register locks */ | 73 | spinlock_t page_lock; /* Page register locks */ |
75 | unsigned long priv; /* Private field to store bus IDs etc. */ | 74 | unsigned long priv; /* Private field to store bus IDs etc. */ |
diff --git a/drivers/net/acenic.c b/drivers/net/acenic.c index 6c192650d349..e4483de84e7f 100644 --- a/drivers/net/acenic.c +++ b/drivers/net/acenic.c | |||
@@ -1457,11 +1457,6 @@ static int __devinit ace_init(struct net_device *dev) | |||
1457 | ace_set_txprd(regs, ap, 0); | 1457 | ace_set_txprd(regs, ap, 0); |
1458 | writel(0, ®s->RxRetCsm); | 1458 | writel(0, ®s->RxRetCsm); |
1459 | 1459 | ||
1460 | /* | ||
1461 | * Zero the stats before starting the interface | ||
1462 | */ | ||
1463 | memset(&ap->stats, 0, sizeof(ap->stats)); | ||
1464 | |||
1465 | /* | 1460 | /* |
1466 | * Enable DMA engine now. | 1461 | * Enable DMA engine now. |
1467 | * If we do this sooner, Mckinley box pukes. | 1462 | * If we do this sooner, Mckinley box pukes. |
@@ -2041,8 +2036,8 @@ static void ace_rx_int(struct net_device *dev, u32 rxretprd, u32 rxretcsm) | |||
2041 | netif_rx(skb); | 2036 | netif_rx(skb); |
2042 | 2037 | ||
2043 | dev->last_rx = jiffies; | 2038 | dev->last_rx = jiffies; |
2044 | ap->stats.rx_packets++; | 2039 | dev->stats.rx_packets++; |
2045 | ap->stats.rx_bytes += retdesc->size; | 2040 | dev->stats.rx_bytes += retdesc->size; |
2046 | 2041 | ||
2047 | idx = (idx + 1) % RX_RETURN_RING_ENTRIES; | 2042 | idx = (idx + 1) % RX_RETURN_RING_ENTRIES; |
2048 | } | 2043 | } |
@@ -2090,8 +2085,8 @@ static inline void ace_tx_int(struct net_device *dev, | |||
2090 | } | 2085 | } |
2091 | 2086 | ||
2092 | if (skb) { | 2087 | if (skb) { |
2093 | ap->stats.tx_packets++; | 2088 | dev->stats.tx_packets++; |
2094 | ap->stats.tx_bytes += skb->len; | 2089 | dev->stats.tx_bytes += skb->len; |
2095 | dev_kfree_skb_irq(skb); | 2090 | dev_kfree_skb_irq(skb); |
2096 | info->skb = NULL; | 2091 | info->skb = NULL; |
2097 | } | 2092 | } |
@@ -2863,11 +2858,11 @@ static struct net_device_stats *ace_get_stats(struct net_device *dev) | |||
2863 | struct ace_mac_stats __iomem *mac_stats = | 2858 | struct ace_mac_stats __iomem *mac_stats = |
2864 | (struct ace_mac_stats __iomem *)ap->regs->Stats; | 2859 | (struct ace_mac_stats __iomem *)ap->regs->Stats; |
2865 | 2860 | ||
2866 | ap->stats.rx_missed_errors = readl(&mac_stats->drop_space); | 2861 | dev->stats.rx_missed_errors = readl(&mac_stats->drop_space); |
2867 | ap->stats.multicast = readl(&mac_stats->kept_mc); | 2862 | dev->stats.multicast = readl(&mac_stats->kept_mc); |
2868 | ap->stats.collisions = readl(&mac_stats->coll); | 2863 | dev->stats.collisions = readl(&mac_stats->coll); |
2869 | 2864 | ||
2870 | return &ap->stats; | 2865 | return &dev->stats; |
2871 | } | 2866 | } |
2872 | 2867 | ||
2873 | 2868 | ||
diff --git a/drivers/net/acenic.h b/drivers/net/acenic.h index 60ed1837fa8f..4487f32759a4 100644 --- a/drivers/net/acenic.h +++ b/drivers/net/acenic.h | |||
@@ -693,7 +693,6 @@ struct ace_private | |||
693 | __attribute__ ((aligned (SMP_CACHE_BYTES))); | 693 | __attribute__ ((aligned (SMP_CACHE_BYTES))); |
694 | u32 last_tx, last_std_rx, last_mini_rx; | 694 | u32 last_tx, last_std_rx, last_mini_rx; |
695 | #endif | 695 | #endif |
696 | struct net_device_stats stats; | ||
697 | int pci_using_dac; | 696 | int pci_using_dac; |
698 | }; | 697 | }; |
699 | 698 | ||
diff --git a/drivers/net/cpmac.c b/drivers/net/cpmac.c index 2b5740b3d182..ae07100bb935 100644 --- a/drivers/net/cpmac.c +++ b/drivers/net/cpmac.c | |||
@@ -708,7 +708,7 @@ static void cpmac_tx_timeout(struct net_device *dev) | |||
708 | spin_unlock(&priv->lock); | 708 | spin_unlock(&priv->lock); |
709 | if (netif_msg_tx_err(priv) && net_ratelimit()) | 709 | if (netif_msg_tx_err(priv) && net_ratelimit()) |
710 | printk(KERN_WARNING "%s: transmit timeout\n", dev->name); | 710 | printk(KERN_WARNING "%s: transmit timeout\n", dev->name); |
711 | /* | 711 | /* |
712 | * FIXME: waking up random queue is not the best thing to | 712 | * FIXME: waking up random queue is not the best thing to |
713 | * do... on the other hand why we got here at all? | 713 | * do... on the other hand why we got here at all? |
714 | */ | 714 | */ |
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c index e6fe2614ea6d..12b4626102e1 100644 --- a/drivers/net/dm9000.c +++ b/drivers/net/dm9000.c | |||
@@ -696,7 +696,7 @@ dm9000_probe(struct platform_device *pdev) | |||
696 | 696 | ||
697 | if (!is_valid_ether_addr(ndev->dev_addr)) { | 697 | if (!is_valid_ether_addr(ndev->dev_addr)) { |
698 | /* try reading from mac */ | 698 | /* try reading from mac */ |
699 | 699 | ||
700 | mac_src = "chip"; | 700 | mac_src = "chip"; |
701 | for (i = 0; i < 6; i++) | 701 | for (i = 0; i < 6; i++) |
702 | ndev->dev_addr[i] = ior(db, i+DM9000_PAR); | 702 | ndev->dev_addr[i] = ior(db, i+DM9000_PAR); |
@@ -746,7 +746,7 @@ dm9000_open(struct net_device *dev) | |||
746 | dev_warn(db->dev, "WARNING: no IRQ resource flags set.\n"); | 746 | dev_warn(db->dev, "WARNING: no IRQ resource flags set.\n"); |
747 | irqflags = DEFAULT_TRIGGER; | 747 | irqflags = DEFAULT_TRIGGER; |
748 | } | 748 | } |
749 | 749 | ||
750 | irqflags |= IRQF_SHARED; | 750 | irqflags |= IRQF_SHARED; |
751 | 751 | ||
752 | if (request_irq(dev->irq, &dm9000_interrupt, irqflags, dev->name, dev)) | 752 | if (request_irq(dev->irq, &dm9000_interrupt, irqflags, dev->name, dev)) |
@@ -1089,7 +1089,7 @@ static int dm9000_wait_eeprom(board_info_t *db) | |||
1089 | /* The DM9000 data sheets say we should be able to | 1089 | /* The DM9000 data sheets say we should be able to |
1090 | * poll the ERRE bit in EPCR to wait for the EEPROM | 1090 | * poll the ERRE bit in EPCR to wait for the EEPROM |
1091 | * operation. From testing several chips, this bit | 1091 | * operation. From testing several chips, this bit |
1092 | * does not seem to work. | 1092 | * does not seem to work. |
1093 | * | 1093 | * |
1094 | * We attempt to use the bit, but fall back to the | 1094 | * We attempt to use the bit, but fall back to the |
1095 | * timeout (which is why we do not return an error | 1095 | * timeout (which is why we do not return an error |
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index 587afe7be689..642dc633b444 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c | |||
@@ -925,7 +925,7 @@ rx_irq_fail: | |||
925 | tx_irq_fail: | 925 | tx_irq_fail: |
926 | free_irq(priv->interruptError, dev); | 926 | free_irq(priv->interruptError, dev); |
927 | err_irq_fail: | 927 | err_irq_fail: |
928 | err_rxalloc_fail: | 928 | err_rxalloc_fail: |
929 | rx_skb_fail: | 929 | rx_skb_fail: |
930 | free_skb_resources(priv); | 930 | free_skb_resources(priv); |
931 | tx_skb_fail: | 931 | tx_skb_fail: |
diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c index 9d5721287d6f..06ad9f302b5a 100644 --- a/drivers/net/hamradio/6pack.c +++ b/drivers/net/hamradio/6pack.c | |||
@@ -99,9 +99,6 @@ struct sixpack { | |||
99 | unsigned int rx_count; | 99 | unsigned int rx_count; |
100 | unsigned int rx_count_cooked; | 100 | unsigned int rx_count_cooked; |
101 | 101 | ||
102 | /* 6pack interface statistics. */ | ||
103 | struct net_device_stats stats; | ||
104 | |||
105 | int mtu; /* Our mtu (to spot changes!) */ | 102 | int mtu; /* Our mtu (to spot changes!) */ |
106 | int buffsize; /* Max buffers sizes */ | 103 | int buffsize; /* Max buffers sizes */ |
107 | 104 | ||
@@ -237,7 +234,7 @@ static void sp_encaps(struct sixpack *sp, unsigned char *icp, int len) | |||
237 | return; | 234 | return; |
238 | 235 | ||
239 | out_drop: | 236 | out_drop: |
240 | sp->stats.tx_dropped++; | 237 | sp->dev->stats.tx_dropped++; |
241 | netif_start_queue(sp->dev); | 238 | netif_start_queue(sp->dev); |
242 | if (net_ratelimit()) | 239 | if (net_ratelimit()) |
243 | printk(KERN_DEBUG "%s: %s - dropped.\n", sp->dev->name, msg); | 240 | printk(KERN_DEBUG "%s: %s - dropped.\n", sp->dev->name, msg); |
@@ -252,7 +249,7 @@ static int sp_xmit(struct sk_buff *skb, struct net_device *dev) | |||
252 | spin_lock_bh(&sp->lock); | 249 | spin_lock_bh(&sp->lock); |
253 | /* We were not busy, so we are now... :-) */ | 250 | /* We were not busy, so we are now... :-) */ |
254 | netif_stop_queue(dev); | 251 | netif_stop_queue(dev); |
255 | sp->stats.tx_bytes += skb->len; | 252 | dev->stats.tx_bytes += skb->len; |
256 | sp_encaps(sp, skb->data, skb->len); | 253 | sp_encaps(sp, skb->data, skb->len); |
257 | spin_unlock_bh(&sp->lock); | 254 | spin_unlock_bh(&sp->lock); |
258 | 255 | ||
@@ -298,12 +295,6 @@ static int sp_header(struct sk_buff *skb, struct net_device *dev, | |||
298 | return 0; | 295 | return 0; |
299 | } | 296 | } |
300 | 297 | ||
301 | static struct net_device_stats *sp_get_stats(struct net_device *dev) | ||
302 | { | ||
303 | struct sixpack *sp = netdev_priv(dev); | ||
304 | return &sp->stats; | ||
305 | } | ||
306 | |||
307 | static int sp_set_mac_address(struct net_device *dev, void *addr) | 298 | static int sp_set_mac_address(struct net_device *dev, void *addr) |
308 | { | 299 | { |
309 | struct sockaddr_ax25 *sa = addr; | 300 | struct sockaddr_ax25 *sa = addr; |
@@ -338,7 +329,6 @@ static void sp_setup(struct net_device *dev) | |||
338 | dev->destructor = free_netdev; | 329 | dev->destructor = free_netdev; |
339 | dev->stop = sp_close; | 330 | dev->stop = sp_close; |
340 | 331 | ||
341 | dev->get_stats = sp_get_stats; | ||
342 | dev->set_mac_address = sp_set_mac_address; | 332 | dev->set_mac_address = sp_set_mac_address; |
343 | dev->hard_header_len = AX25_MAX_HEADER_LEN; | 333 | dev->hard_header_len = AX25_MAX_HEADER_LEN; |
344 | dev->header_ops = &sp_header_ops; | 334 | dev->header_ops = &sp_header_ops; |
@@ -370,7 +360,7 @@ static void sp_bump(struct sixpack *sp, char cmd) | |||
370 | 360 | ||
371 | count = sp->rcount + 1; | 361 | count = sp->rcount + 1; |
372 | 362 | ||
373 | sp->stats.rx_bytes += count; | 363 | sp->dev->stats.rx_bytes += count; |
374 | 364 | ||
375 | if ((skb = dev_alloc_skb(count)) == NULL) | 365 | if ((skb = dev_alloc_skb(count)) == NULL) |
376 | goto out_mem; | 366 | goto out_mem; |
@@ -382,12 +372,12 @@ static void sp_bump(struct sixpack *sp, char cmd) | |||
382 | skb->protocol = ax25_type_trans(skb, sp->dev); | 372 | skb->protocol = ax25_type_trans(skb, sp->dev); |
383 | netif_rx(skb); | 373 | netif_rx(skb); |
384 | sp->dev->last_rx = jiffies; | 374 | sp->dev->last_rx = jiffies; |
385 | sp->stats.rx_packets++; | 375 | sp->dev->stats.rx_packets++; |
386 | 376 | ||
387 | return; | 377 | return; |
388 | 378 | ||
389 | out_mem: | 379 | out_mem: |
390 | sp->stats.rx_dropped++; | 380 | sp->dev->stats.rx_dropped++; |
391 | } | 381 | } |
392 | 382 | ||
393 | 383 | ||
@@ -436,7 +426,7 @@ static void sixpack_write_wakeup(struct tty_struct *tty) | |||
436 | if (sp->xleft <= 0) { | 426 | if (sp->xleft <= 0) { |
437 | /* Now serial buffer is almost free & we can start | 427 | /* Now serial buffer is almost free & we can start |
438 | * transmission of another packet */ | 428 | * transmission of another packet */ |
439 | sp->stats.tx_packets++; | 429 | sp->dev->stats.tx_packets++; |
440 | clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); | 430 | clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); |
441 | sp->tx_enable = 0; | 431 | sp->tx_enable = 0; |
442 | netif_wake_queue(sp->dev); | 432 | netif_wake_queue(sp->dev); |
@@ -484,7 +474,7 @@ static void sixpack_receive_buf(struct tty_struct *tty, | |||
484 | count--; | 474 | count--; |
485 | if (fp && *fp++) { | 475 | if (fp && *fp++) { |
486 | if (!test_and_set_bit(SIXPF_ERROR, &sp->flags)) | 476 | if (!test_and_set_bit(SIXPF_ERROR, &sp->flags)) |
487 | sp->stats.rx_errors++; | 477 | sp->dev->stats.rx_errors++; |
488 | continue; | 478 | continue; |
489 | } | 479 | } |
490 | } | 480 | } |
diff --git a/drivers/net/lib8390.c b/drivers/net/lib8390.c index 0c5447dac03b..ed495275b577 100644 --- a/drivers/net/lib8390.c +++ b/drivers/net/lib8390.c | |||
@@ -150,19 +150,19 @@ static void __NS8390_init(struct net_device *dev, int startp); | |||
150 | * card means that approach caused horrible problems like losing serial data | 150 | * card means that approach caused horrible problems like losing serial data |
151 | * at 38400 baud on some chips. Remember many 8390 nics on PCI were ISA | 151 | * at 38400 baud on some chips. Remember many 8390 nics on PCI were ISA |
152 | * chips with FPGA front ends. | 152 | * chips with FPGA front ends. |
153 | * | 153 | * |
154 | * Ok the logic behind the 8390 is very simple: | 154 | * Ok the logic behind the 8390 is very simple: |
155 | * | 155 | * |
156 | * Things to know | 156 | * Things to know |
157 | * - IRQ delivery is asynchronous to the PCI bus | 157 | * - IRQ delivery is asynchronous to the PCI bus |
158 | * - Blocking the local CPU IRQ via spin locks was too slow | 158 | * - Blocking the local CPU IRQ via spin locks was too slow |
159 | * - The chip has register windows needing locking work | 159 | * - The chip has register windows needing locking work |
160 | * | 160 | * |
161 | * So the path was once (I say once as people appear to have changed it | 161 | * So the path was once (I say once as people appear to have changed it |
162 | * in the mean time and it now looks rather bogus if the changes to use | 162 | * in the mean time and it now looks rather bogus if the changes to use |
163 | * disable_irq_nosync_irqsave are disabling the local IRQ) | 163 | * disable_irq_nosync_irqsave are disabling the local IRQ) |
164 | * | 164 | * |
165 | * | 165 | * |
166 | * Take the page lock | 166 | * Take the page lock |
167 | * Mask the IRQ on chip | 167 | * Mask the IRQ on chip |
168 | * Disable the IRQ (but not mask locally- someone seems to have | 168 | * Disable the IRQ (but not mask locally- someone seems to have |
@@ -170,22 +170,22 @@ static void __NS8390_init(struct net_device *dev, int startp); | |||
170 | * [This must be _nosync as the page lock may otherwise | 170 | * [This must be _nosync as the page lock may otherwise |
171 | * deadlock us] | 171 | * deadlock us] |
172 | * Drop the page lock and turn IRQs back on | 172 | * Drop the page lock and turn IRQs back on |
173 | * | 173 | * |
174 | * At this point an existing IRQ may still be running but we can't | 174 | * At this point an existing IRQ may still be running but we can't |
175 | * get a new one | 175 | * get a new one |
176 | * | 176 | * |
177 | * Take the lock (so we know the IRQ has terminated) but don't mask | 177 | * Take the lock (so we know the IRQ has terminated) but don't mask |
178 | * the IRQs on the processor | 178 | * the IRQs on the processor |
179 | * Set irqlock [for debug] | 179 | * Set irqlock [for debug] |
180 | * | 180 | * |
181 | * Transmit (slow as ****) | 181 | * Transmit (slow as ****) |
182 | * | 182 | * |
183 | * re-enable the IRQ | 183 | * re-enable the IRQ |
184 | * | 184 | * |
185 | * | 185 | * |
186 | * We have to use disable_irq because otherwise you will get delayed | 186 | * We have to use disable_irq because otherwise you will get delayed |
187 | * interrupts on the APIC bus deadlocking the transmit path. | 187 | * interrupts on the APIC bus deadlocking the transmit path. |
188 | * | 188 | * |
189 | * Quite hairy but the chip simply wasn't designed for SMP and you can't | 189 | * Quite hairy but the chip simply wasn't designed for SMP and you can't |
190 | * even ACK an interrupt without risking corrupting other parallel | 190 | * even ACK an interrupt without risking corrupting other parallel |
191 | * activities on the chip." [lkml, 25 Jul 2007] | 191 | * activities on the chip." [lkml, 25 Jul 2007] |
@@ -265,7 +265,7 @@ static void ei_tx_timeout(struct net_device *dev) | |||
265 | int txsr, isr, tickssofar = jiffies - dev->trans_start; | 265 | int txsr, isr, tickssofar = jiffies - dev->trans_start; |
266 | unsigned long flags; | 266 | unsigned long flags; |
267 | 267 | ||
268 | ei_local->stat.tx_errors++; | 268 | dev->stats.tx_errors++; |
269 | 269 | ||
270 | spin_lock_irqsave(&ei_local->page_lock, flags); | 270 | spin_lock_irqsave(&ei_local->page_lock, flags); |
271 | txsr = ei_inb(e8390_base+EN0_TSR); | 271 | txsr = ei_inb(e8390_base+EN0_TSR); |
@@ -276,7 +276,7 @@ static void ei_tx_timeout(struct net_device *dev) | |||
276 | dev->name, (txsr & ENTSR_ABT) ? "excess collisions." : | 276 | dev->name, (txsr & ENTSR_ABT) ? "excess collisions." : |
277 | (isr) ? "lost interrupt?" : "cable problem?", txsr, isr, tickssofar); | 277 | (isr) ? "lost interrupt?" : "cable problem?", txsr, isr, tickssofar); |
278 | 278 | ||
279 | if (!isr && !ei_local->stat.tx_packets) | 279 | if (!isr && !dev->stats.tx_packets) |
280 | { | 280 | { |
281 | /* The 8390 probably hasn't gotten on the cable yet. */ | 281 | /* The 8390 probably hasn't gotten on the cable yet. */ |
282 | ei_local->interface_num ^= 1; /* Try a different xcvr. */ | 282 | ei_local->interface_num ^= 1; /* Try a different xcvr. */ |
@@ -374,7 +374,7 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
374 | ei_outb_p(ENISR_ALL, e8390_base + EN0_IMR); | 374 | ei_outb_p(ENISR_ALL, e8390_base + EN0_IMR); |
375 | spin_unlock(&ei_local->page_lock); | 375 | spin_unlock(&ei_local->page_lock); |
376 | enable_irq_lockdep_irqrestore(dev->irq, &flags); | 376 | enable_irq_lockdep_irqrestore(dev->irq, &flags); |
377 | ei_local->stat.tx_errors++; | 377 | dev->stats.tx_errors++; |
378 | return 1; | 378 | return 1; |
379 | } | 379 | } |
380 | 380 | ||
@@ -417,7 +417,7 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
417 | enable_irq_lockdep_irqrestore(dev->irq, &flags); | 417 | enable_irq_lockdep_irqrestore(dev->irq, &flags); |
418 | 418 | ||
419 | dev_kfree_skb (skb); | 419 | dev_kfree_skb (skb); |
420 | ei_local->stat.tx_bytes += send_length; | 420 | dev->stats.tx_bytes += send_length; |
421 | 421 | ||
422 | return 0; | 422 | return 0; |
423 | } | 423 | } |
@@ -493,9 +493,9 @@ static irqreturn_t __ei_interrupt(int irq, void *dev_id) | |||
493 | 493 | ||
494 | if (interrupts & ENISR_COUNTERS) | 494 | if (interrupts & ENISR_COUNTERS) |
495 | { | 495 | { |
496 | ei_local->stat.rx_frame_errors += ei_inb_p(e8390_base + EN0_COUNTER0); | 496 | dev->stats.rx_frame_errors += ei_inb_p(e8390_base + EN0_COUNTER0); |
497 | ei_local->stat.rx_crc_errors += ei_inb_p(e8390_base + EN0_COUNTER1); | 497 | dev->stats.rx_crc_errors += ei_inb_p(e8390_base + EN0_COUNTER1); |
498 | ei_local->stat.rx_missed_errors+= ei_inb_p(e8390_base + EN0_COUNTER2); | 498 | dev->stats.rx_missed_errors+= ei_inb_p(e8390_base + EN0_COUNTER2); |
499 | ei_outb_p(ENISR_COUNTERS, e8390_base + EN0_ISR); /* Ack intr. */ | 499 | ei_outb_p(ENISR_COUNTERS, e8390_base + EN0_ISR); /* Ack intr. */ |
500 | } | 500 | } |
501 | 501 | ||
@@ -553,7 +553,6 @@ static void __ei_poll(struct net_device *dev) | |||
553 | static void ei_tx_err(struct net_device *dev) | 553 | static void ei_tx_err(struct net_device *dev) |
554 | { | 554 | { |
555 | unsigned long e8390_base = dev->base_addr; | 555 | unsigned long e8390_base = dev->base_addr; |
556 | struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev); | ||
557 | unsigned char txsr = ei_inb_p(e8390_base+EN0_TSR); | 556 | unsigned char txsr = ei_inb_p(e8390_base+EN0_TSR); |
558 | unsigned char tx_was_aborted = txsr & (ENTSR_ABT+ENTSR_FU); | 557 | unsigned char tx_was_aborted = txsr & (ENTSR_ABT+ENTSR_FU); |
559 | 558 | ||
@@ -578,10 +577,10 @@ static void ei_tx_err(struct net_device *dev) | |||
578 | ei_tx_intr(dev); | 577 | ei_tx_intr(dev); |
579 | else | 578 | else |
580 | { | 579 | { |
581 | ei_local->stat.tx_errors++; | 580 | dev->stats.tx_errors++; |
582 | if (txsr & ENTSR_CRS) ei_local->stat.tx_carrier_errors++; | 581 | if (txsr & ENTSR_CRS) dev->stats.tx_carrier_errors++; |
583 | if (txsr & ENTSR_CDH) ei_local->stat.tx_heartbeat_errors++; | 582 | if (txsr & ENTSR_CDH) dev->stats.tx_heartbeat_errors++; |
584 | if (txsr & ENTSR_OWC) ei_local->stat.tx_window_errors++; | 583 | if (txsr & ENTSR_OWC) dev->stats.tx_window_errors++; |
585 | } | 584 | } |
586 | } | 585 | } |
587 | 586 | ||
@@ -645,25 +644,25 @@ static void ei_tx_intr(struct net_device *dev) | |||
645 | 644 | ||
646 | /* Minimize Tx latency: update the statistics after we restart TXing. */ | 645 | /* Minimize Tx latency: update the statistics after we restart TXing. */ |
647 | if (status & ENTSR_COL) | 646 | if (status & ENTSR_COL) |
648 | ei_local->stat.collisions++; | 647 | dev->stats.collisions++; |
649 | if (status & ENTSR_PTX) | 648 | if (status & ENTSR_PTX) |
650 | ei_local->stat.tx_packets++; | 649 | dev->stats.tx_packets++; |
651 | else | 650 | else |
652 | { | 651 | { |
653 | ei_local->stat.tx_errors++; | 652 | dev->stats.tx_errors++; |
654 | if (status & ENTSR_ABT) | 653 | if (status & ENTSR_ABT) |
655 | { | 654 | { |
656 | ei_local->stat.tx_aborted_errors++; | 655 | dev->stats.tx_aborted_errors++; |
657 | ei_local->stat.collisions += 16; | 656 | dev->stats.collisions += 16; |
658 | } | 657 | } |
659 | if (status & ENTSR_CRS) | 658 | if (status & ENTSR_CRS) |
660 | ei_local->stat.tx_carrier_errors++; | 659 | dev->stats.tx_carrier_errors++; |
661 | if (status & ENTSR_FU) | 660 | if (status & ENTSR_FU) |
662 | ei_local->stat.tx_fifo_errors++; | 661 | dev->stats.tx_fifo_errors++; |
663 | if (status & ENTSR_CDH) | 662 | if (status & ENTSR_CDH) |
664 | ei_local->stat.tx_heartbeat_errors++; | 663 | dev->stats.tx_heartbeat_errors++; |
665 | if (status & ENTSR_OWC) | 664 | if (status & ENTSR_OWC) |
666 | ei_local->stat.tx_window_errors++; | 665 | dev->stats.tx_window_errors++; |
667 | } | 666 | } |
668 | netif_wake_queue(dev); | 667 | netif_wake_queue(dev); |
669 | } | 668 | } |
@@ -730,7 +729,7 @@ static void ei_receive(struct net_device *dev) | |||
730 | && rx_frame.next != next_frame + 1 - num_rx_pages) { | 729 | && rx_frame.next != next_frame + 1 - num_rx_pages) { |
731 | ei_local->current_page = rxing_page; | 730 | ei_local->current_page = rxing_page; |
732 | ei_outb(ei_local->current_page-1, e8390_base+EN0_BOUNDARY); | 731 | ei_outb(ei_local->current_page-1, e8390_base+EN0_BOUNDARY); |
733 | ei_local->stat.rx_errors++; | 732 | dev->stats.rx_errors++; |
734 | continue; | 733 | continue; |
735 | } | 734 | } |
736 | 735 | ||
@@ -740,8 +739,8 @@ static void ei_receive(struct net_device *dev) | |||
740 | printk(KERN_DEBUG "%s: bogus packet size: %d, status=%#2x nxpg=%#2x.\n", | 739 | printk(KERN_DEBUG "%s: bogus packet size: %d, status=%#2x nxpg=%#2x.\n", |
741 | dev->name, rx_frame.count, rx_frame.status, | 740 | dev->name, rx_frame.count, rx_frame.status, |
742 | rx_frame.next); | 741 | rx_frame.next); |
743 | ei_local->stat.rx_errors++; | 742 | dev->stats.rx_errors++; |
744 | ei_local->stat.rx_length_errors++; | 743 | dev->stats.rx_length_errors++; |
745 | } | 744 | } |
746 | else if ((pkt_stat & 0x0F) == ENRSR_RXOK) | 745 | else if ((pkt_stat & 0x0F) == ENRSR_RXOK) |
747 | { | 746 | { |
@@ -753,7 +752,7 @@ static void ei_receive(struct net_device *dev) | |||
753 | if (ei_debug > 1) | 752 | if (ei_debug > 1) |
754 | printk(KERN_DEBUG "%s: Couldn't allocate a sk_buff of size %d.\n", | 753 | printk(KERN_DEBUG "%s: Couldn't allocate a sk_buff of size %d.\n", |
755 | dev->name, pkt_len); | 754 | dev->name, pkt_len); |
756 | ei_local->stat.rx_dropped++; | 755 | dev->stats.rx_dropped++; |
757 | break; | 756 | break; |
758 | } | 757 | } |
759 | else | 758 | else |
@@ -764,10 +763,10 @@ static void ei_receive(struct net_device *dev) | |||
764 | skb->protocol=eth_type_trans(skb,dev); | 763 | skb->protocol=eth_type_trans(skb,dev); |
765 | netif_rx(skb); | 764 | netif_rx(skb); |
766 | dev->last_rx = jiffies; | 765 | dev->last_rx = jiffies; |
767 | ei_local->stat.rx_packets++; | 766 | dev->stats.rx_packets++; |
768 | ei_local->stat.rx_bytes += pkt_len; | 767 | dev->stats.rx_bytes += pkt_len; |
769 | if (pkt_stat & ENRSR_PHY) | 768 | if (pkt_stat & ENRSR_PHY) |
770 | ei_local->stat.multicast++; | 769 | dev->stats.multicast++; |
771 | } | 770 | } |
772 | } | 771 | } |
773 | else | 772 | else |
@@ -776,10 +775,10 @@ static void ei_receive(struct net_device *dev) | |||
776 | printk(KERN_DEBUG "%s: bogus packet: status=%#2x nxpg=%#2x size=%d\n", | 775 | printk(KERN_DEBUG "%s: bogus packet: status=%#2x nxpg=%#2x size=%d\n", |
777 | dev->name, rx_frame.status, rx_frame.next, | 776 | dev->name, rx_frame.status, rx_frame.next, |
778 | rx_frame.count); | 777 | rx_frame.count); |
779 | ei_local->stat.rx_errors++; | 778 | dev->stats.rx_errors++; |
780 | /* NB: The NIC counts CRC, frame and missed errors. */ | 779 | /* NB: The NIC counts CRC, frame and missed errors. */ |
781 | if (pkt_stat & ENRSR_FO) | 780 | if (pkt_stat & ENRSR_FO) |
782 | ei_local->stat.rx_fifo_errors++; | 781 | dev->stats.rx_fifo_errors++; |
783 | } | 782 | } |
784 | next_frame = rx_frame.next; | 783 | next_frame = rx_frame.next; |
785 | 784 | ||
@@ -816,7 +815,6 @@ static void ei_rx_overrun(struct net_device *dev) | |||
816 | { | 815 | { |
817 | unsigned long e8390_base = dev->base_addr; | 816 | unsigned long e8390_base = dev->base_addr; |
818 | unsigned char was_txing, must_resend = 0; | 817 | unsigned char was_txing, must_resend = 0; |
819 | struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev); | ||
820 | 818 | ||
821 | /* | 819 | /* |
822 | * Record whether a Tx was in progress and then issue the | 820 | * Record whether a Tx was in progress and then issue the |
@@ -827,7 +825,7 @@ static void ei_rx_overrun(struct net_device *dev) | |||
827 | 825 | ||
828 | if (ei_debug > 1) | 826 | if (ei_debug > 1) |
829 | printk(KERN_DEBUG "%s: Receiver overrun.\n", dev->name); | 827 | printk(KERN_DEBUG "%s: Receiver overrun.\n", dev->name); |
830 | ei_local->stat.rx_over_errors++; | 828 | dev->stats.rx_over_errors++; |
831 | 829 | ||
832 | /* | 830 | /* |
833 | * Wait a full Tx time (1.2ms) + some guard time, NS says 1.6ms total. | 831 | * Wait a full Tx time (1.2ms) + some guard time, NS says 1.6ms total. |
@@ -889,16 +887,16 @@ static struct net_device_stats *get_stats(struct net_device *dev) | |||
889 | 887 | ||
890 | /* If the card is stopped, just return the present stats. */ | 888 | /* If the card is stopped, just return the present stats. */ |
891 | if (!netif_running(dev)) | 889 | if (!netif_running(dev)) |
892 | return &ei_local->stat; | 890 | return &dev->stats; |
893 | 891 | ||
894 | spin_lock_irqsave(&ei_local->page_lock,flags); | 892 | spin_lock_irqsave(&ei_local->page_lock,flags); |
895 | /* Read the counter registers, assuming we are in page 0. */ | 893 | /* Read the counter registers, assuming we are in page 0. */ |
896 | ei_local->stat.rx_frame_errors += ei_inb_p(ioaddr + EN0_COUNTER0); | 894 | dev->stats.rx_frame_errors += ei_inb_p(ioaddr + EN0_COUNTER0); |
897 | ei_local->stat.rx_crc_errors += ei_inb_p(ioaddr + EN0_COUNTER1); | 895 | dev->stats.rx_crc_errors += ei_inb_p(ioaddr + EN0_COUNTER1); |
898 | ei_local->stat.rx_missed_errors+= ei_inb_p(ioaddr + EN0_COUNTER2); | 896 | dev->stats.rx_missed_errors+= ei_inb_p(ioaddr + EN0_COUNTER2); |
899 | spin_unlock_irqrestore(&ei_local->page_lock, flags); | 897 | spin_unlock_irqrestore(&ei_local->page_lock, flags); |
900 | 898 | ||
901 | return &ei_local->stat; | 899 | return &dev->stats; |
902 | } | 900 | } |
903 | 901 | ||
904 | /* | 902 | /* |
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c index 46119bb3770a..b238ed0e8ace 100644 --- a/drivers/net/natsemi.c +++ b/drivers/net/natsemi.c | |||
@@ -664,7 +664,7 @@ static ssize_t natsemi_show_##_name(struct device *dev, \ | |||
664 | NATSEMI_ATTR(dspcfg_workaround); | 664 | NATSEMI_ATTR(dspcfg_workaround); |
665 | 665 | ||
666 | static ssize_t natsemi_show_dspcfg_workaround(struct device *dev, | 666 | static ssize_t natsemi_show_dspcfg_workaround(struct device *dev, |
667 | struct device_attribute *attr, | 667 | struct device_attribute *attr, |
668 | char *buf) | 668 | char *buf) |
669 | { | 669 | { |
670 | struct netdev_private *np = netdev_priv(to_net_dev(dev)); | 670 | struct netdev_private *np = netdev_priv(to_net_dev(dev)); |
@@ -687,7 +687,7 @@ static ssize_t natsemi_set_dspcfg_workaround(struct device *dev, | |||
687 | || !strncmp("0", buf, count - 1)) | 687 | || !strncmp("0", buf, count - 1)) |
688 | new_setting = 0; | 688 | new_setting = 0; |
689 | else | 689 | else |
690 | return count; | 690 | return count; |
691 | 691 | ||
692 | spin_lock_irqsave(&np->lock, flags); | 692 | spin_lock_irqsave(&np->lock, flags); |
693 | 693 | ||
diff --git a/drivers/net/niu.h b/drivers/net/niu.h index 97ffbe137bcb..101a3f1a8ec8 100644 --- a/drivers/net/niu.h +++ b/drivers/net/niu.h | |||
@@ -281,7 +281,7 @@ | |||
281 | #define XMAC_ADDR1 0x000a8UL | 281 | #define XMAC_ADDR1 0x000a8UL |
282 | #define XMAC_ADDR1_ADDR1 0x000000000000ffffULL | 282 | #define XMAC_ADDR1_ADDR1 0x000000000000ffffULL |
283 | 283 | ||
284 | #define XMAC_ADDR2 0x000b0UL | 284 | #define XMAC_ADDR2 0x000b0UL |
285 | #define XMAC_ADDR2_ADDR2 0x000000000000ffffULL | 285 | #define XMAC_ADDR2_ADDR2 0x000000000000ffffULL |
286 | 286 | ||
287 | #define XMAC_ADDR_CMPEN 0x00208UL | 287 | #define XMAC_ADDR_CMPEN 0x00208UL |
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c index 3b78a3819bb3..7112fd5e0e1b 100644 --- a/drivers/net/pcmcia/3c574_cs.c +++ b/drivers/net/pcmcia/3c574_cs.c | |||
@@ -208,7 +208,6 @@ enum Window4 { /* Window 4: Xcvr/media bits. */ | |||
208 | struct el3_private { | 208 | struct el3_private { |
209 | struct pcmcia_device *p_dev; | 209 | struct pcmcia_device *p_dev; |
210 | dev_node_t node; | 210 | dev_node_t node; |
211 | struct net_device_stats stats; | ||
212 | u16 advertising, partner; /* NWay media advertisement */ | 211 | u16 advertising, partner; /* NWay media advertisement */ |
213 | unsigned char phys; /* MII device address */ | 212 | unsigned char phys; /* MII device address */ |
214 | unsigned int autoselect:1, default_media:3; /* Read from the EEPROM/Wn3_Config. */ | 213 | unsigned int autoselect:1, default_media:3; /* Read from the EEPROM/Wn3_Config. */ |
@@ -741,12 +740,11 @@ static int el3_open(struct net_device *dev) | |||
741 | 740 | ||
742 | static void el3_tx_timeout(struct net_device *dev) | 741 | static void el3_tx_timeout(struct net_device *dev) |
743 | { | 742 | { |
744 | struct el3_private *lp = netdev_priv(dev); | ||
745 | unsigned int ioaddr = dev->base_addr; | 743 | unsigned int ioaddr = dev->base_addr; |
746 | 744 | ||
747 | printk(KERN_NOTICE "%s: Transmit timed out!\n", dev->name); | 745 | printk(KERN_NOTICE "%s: Transmit timed out!\n", dev->name); |
748 | dump_status(dev); | 746 | dump_status(dev); |
749 | lp->stats.tx_errors++; | 747 | dev->stats.tx_errors++; |
750 | dev->trans_start = jiffies; | 748 | dev->trans_start = jiffies; |
751 | /* Issue TX_RESET and TX_START commands. */ | 749 | /* Issue TX_RESET and TX_START commands. */ |
752 | tc574_wait_for_completion(dev, TxReset); | 750 | tc574_wait_for_completion(dev, TxReset); |
@@ -756,7 +754,6 @@ static void el3_tx_timeout(struct net_device *dev) | |||
756 | 754 | ||
757 | static void pop_tx_status(struct net_device *dev) | 755 | static void pop_tx_status(struct net_device *dev) |
758 | { | 756 | { |
759 | struct el3_private *lp = netdev_priv(dev); | ||
760 | unsigned int ioaddr = dev->base_addr; | 757 | unsigned int ioaddr = dev->base_addr; |
761 | int i; | 758 | int i; |
762 | 759 | ||
@@ -772,7 +769,7 @@ static void pop_tx_status(struct net_device *dev) | |||
772 | DEBUG(1, "%s: transmit error: status 0x%02x\n", | 769 | DEBUG(1, "%s: transmit error: status 0x%02x\n", |
773 | dev->name, tx_status); | 770 | dev->name, tx_status); |
774 | outw(TxEnable, ioaddr + EL3_CMD); | 771 | outw(TxEnable, ioaddr + EL3_CMD); |
775 | lp->stats.tx_aborted_errors++; | 772 | dev->stats.tx_aborted_errors++; |
776 | } | 773 | } |
777 | outb(0x00, ioaddr + TxStatus); /* Pop the status stack. */ | 774 | outb(0x00, ioaddr + TxStatus); /* Pop the status stack. */ |
778 | } | 775 | } |
@@ -987,7 +984,7 @@ static struct net_device_stats *el3_get_stats(struct net_device *dev) | |||
987 | update_stats(dev); | 984 | update_stats(dev); |
988 | spin_unlock_irqrestore(&lp->window_lock, flags); | 985 | spin_unlock_irqrestore(&lp->window_lock, flags); |
989 | } | 986 | } |
990 | return &lp->stats; | 987 | return &dev->stats; |
991 | } | 988 | } |
992 | 989 | ||
993 | /* Update statistics. | 990 | /* Update statistics. |
@@ -996,7 +993,6 @@ static struct net_device_stats *el3_get_stats(struct net_device *dev) | |||
996 | */ | 993 | */ |
997 | static void update_stats(struct net_device *dev) | 994 | static void update_stats(struct net_device *dev) |
998 | { | 995 | { |
999 | struct el3_private *lp = netdev_priv(dev); | ||
1000 | unsigned int ioaddr = dev->base_addr; | 996 | unsigned int ioaddr = dev->base_addr; |
1001 | u8 rx, tx, up; | 997 | u8 rx, tx, up; |
1002 | 998 | ||
@@ -1008,15 +1004,15 @@ static void update_stats(struct net_device *dev) | |||
1008 | /* Unlike the 3c509 we need not turn off stats updates while reading. */ | 1004 | /* Unlike the 3c509 we need not turn off stats updates while reading. */ |
1009 | /* Switch to the stats window, and read everything. */ | 1005 | /* Switch to the stats window, and read everything. */ |
1010 | EL3WINDOW(6); | 1006 | EL3WINDOW(6); |
1011 | lp->stats.tx_carrier_errors += inb(ioaddr + 0); | 1007 | dev->stats.tx_carrier_errors += inb(ioaddr + 0); |
1012 | lp->stats.tx_heartbeat_errors += inb(ioaddr + 1); | 1008 | dev->stats.tx_heartbeat_errors += inb(ioaddr + 1); |
1013 | /* Multiple collisions. */ inb(ioaddr + 2); | 1009 | /* Multiple collisions. */ inb(ioaddr + 2); |
1014 | lp->stats.collisions += inb(ioaddr + 3); | 1010 | dev->stats.collisions += inb(ioaddr + 3); |
1015 | lp->stats.tx_window_errors += inb(ioaddr + 4); | 1011 | dev->stats.tx_window_errors += inb(ioaddr + 4); |
1016 | lp->stats.rx_fifo_errors += inb(ioaddr + 5); | 1012 | dev->stats.rx_fifo_errors += inb(ioaddr + 5); |
1017 | lp->stats.tx_packets += inb(ioaddr + 6); | 1013 | dev->stats.tx_packets += inb(ioaddr + 6); |
1018 | up = inb(ioaddr + 9); | 1014 | up = inb(ioaddr + 9); |
1019 | lp->stats.tx_packets += (up&0x30) << 4; | 1015 | dev->stats.tx_packets += (up&0x30) << 4; |
1020 | /* Rx packets */ inb(ioaddr + 7); | 1016 | /* Rx packets */ inb(ioaddr + 7); |
1021 | /* Tx deferrals */ inb(ioaddr + 8); | 1017 | /* Tx deferrals */ inb(ioaddr + 8); |
1022 | rx = inw(ioaddr + 10); | 1018 | rx = inw(ioaddr + 10); |
@@ -1026,14 +1022,13 @@ static void update_stats(struct net_device *dev) | |||
1026 | /* BadSSD */ inb(ioaddr + 12); | 1022 | /* BadSSD */ inb(ioaddr + 12); |
1027 | up = inb(ioaddr + 13); | 1023 | up = inb(ioaddr + 13); |
1028 | 1024 | ||
1029 | lp->stats.tx_bytes += tx + ((up & 0xf0) << 12); | 1025 | dev->stats.tx_bytes += tx + ((up & 0xf0) << 12); |
1030 | 1026 | ||
1031 | EL3WINDOW(1); | 1027 | EL3WINDOW(1); |
1032 | } | 1028 | } |
1033 | 1029 | ||
1034 | static int el3_rx(struct net_device *dev, int worklimit) | 1030 | static int el3_rx(struct net_device *dev, int worklimit) |
1035 | { | 1031 | { |
1036 | struct el3_private *lp = netdev_priv(dev); | ||
1037 | unsigned int ioaddr = dev->base_addr; | 1032 | unsigned int ioaddr = dev->base_addr; |
1038 | short rx_status; | 1033 | short rx_status; |
1039 | 1034 | ||
@@ -1043,14 +1038,14 @@ static int el3_rx(struct net_device *dev, int worklimit) | |||
1043 | (--worklimit >= 0)) { | 1038 | (--worklimit >= 0)) { |
1044 | if (rx_status & 0x4000) { /* Error, update stats. */ | 1039 | if (rx_status & 0x4000) { /* Error, update stats. */ |
1045 | short error = rx_status & 0x3800; | 1040 | short error = rx_status & 0x3800; |
1046 | lp->stats.rx_errors++; | 1041 | dev->stats.rx_errors++; |
1047 | switch (error) { | 1042 | switch (error) { |
1048 | case 0x0000: lp->stats.rx_over_errors++; break; | 1043 | case 0x0000: dev->stats.rx_over_errors++; break; |
1049 | case 0x0800: lp->stats.rx_length_errors++; break; | 1044 | case 0x0800: dev->stats.rx_length_errors++; break; |
1050 | case 0x1000: lp->stats.rx_frame_errors++; break; | 1045 | case 0x1000: dev->stats.rx_frame_errors++; break; |
1051 | case 0x1800: lp->stats.rx_length_errors++; break; | 1046 | case 0x1800: dev->stats.rx_length_errors++; break; |
1052 | case 0x2000: lp->stats.rx_frame_errors++; break; | 1047 | case 0x2000: dev->stats.rx_frame_errors++; break; |
1053 | case 0x2800: lp->stats.rx_crc_errors++; break; | 1048 | case 0x2800: dev->stats.rx_crc_errors++; break; |
1054 | } | 1049 | } |
1055 | } else { | 1050 | } else { |
1056 | short pkt_len = rx_status & 0x7ff; | 1051 | short pkt_len = rx_status & 0x7ff; |
@@ -1067,12 +1062,12 @@ static int el3_rx(struct net_device *dev, int worklimit) | |||
1067 | skb->protocol = eth_type_trans(skb, dev); | 1062 | skb->protocol = eth_type_trans(skb, dev); |
1068 | netif_rx(skb); | 1063 | netif_rx(skb); |
1069 | dev->last_rx = jiffies; | 1064 | dev->last_rx = jiffies; |
1070 | lp->stats.rx_packets++; | 1065 | dev->stats.rx_packets++; |
1071 | lp->stats.rx_bytes += pkt_len; | 1066 | dev->stats.rx_bytes += pkt_len; |
1072 | } else { | 1067 | } else { |
1073 | DEBUG(1, "%s: couldn't allocate a sk_buff of" | 1068 | DEBUG(1, "%s: couldn't allocate a sk_buff of" |
1074 | " size %d.\n", dev->name, pkt_len); | 1069 | " size %d.\n", dev->name, pkt_len); |
1075 | lp->stats.rx_dropped++; | 1070 | dev->stats.rx_dropped++; |
1076 | } | 1071 | } |
1077 | } | 1072 | } |
1078 | tc574_wait_for_completion(dev, RxDiscard); | 1073 | tc574_wait_for_completion(dev, RxDiscard); |
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c index 1b1abb19c911..549a64558420 100644 --- a/drivers/net/pcmcia/3c589_cs.c +++ b/drivers/net/pcmcia/3c589_cs.c | |||
@@ -107,7 +107,6 @@ enum RxFilter { | |||
107 | struct el3_private { | 107 | struct el3_private { |
108 | struct pcmcia_device *p_dev; | 108 | struct pcmcia_device *p_dev; |
109 | dev_node_t node; | 109 | dev_node_t node; |
110 | struct net_device_stats stats; | ||
111 | /* For transceiver monitoring */ | 110 | /* For transceiver monitoring */ |
112 | struct timer_list media; | 111 | struct timer_list media; |
113 | u16 media_status; | 112 | u16 media_status; |
@@ -566,12 +565,11 @@ static int el3_open(struct net_device *dev) | |||
566 | 565 | ||
567 | static void el3_tx_timeout(struct net_device *dev) | 566 | static void el3_tx_timeout(struct net_device *dev) |
568 | { | 567 | { |
569 | struct el3_private *lp = netdev_priv(dev); | ||
570 | unsigned int ioaddr = dev->base_addr; | 568 | unsigned int ioaddr = dev->base_addr; |
571 | 569 | ||
572 | printk(KERN_WARNING "%s: Transmit timed out!\n", dev->name); | 570 | printk(KERN_WARNING "%s: Transmit timed out!\n", dev->name); |
573 | dump_status(dev); | 571 | dump_status(dev); |
574 | lp->stats.tx_errors++; | 572 | dev->stats.tx_errors++; |
575 | dev->trans_start = jiffies; | 573 | dev->trans_start = jiffies; |
576 | /* Issue TX_RESET and TX_START commands. */ | 574 | /* Issue TX_RESET and TX_START commands. */ |
577 | tc589_wait_for_completion(dev, TxReset); | 575 | tc589_wait_for_completion(dev, TxReset); |
@@ -581,7 +579,6 @@ static void el3_tx_timeout(struct net_device *dev) | |||
581 | 579 | ||
582 | static void pop_tx_status(struct net_device *dev) | 580 | static void pop_tx_status(struct net_device *dev) |
583 | { | 581 | { |
584 | struct el3_private *lp = netdev_priv(dev); | ||
585 | unsigned int ioaddr = dev->base_addr; | 582 | unsigned int ioaddr = dev->base_addr; |
586 | int i; | 583 | int i; |
587 | 584 | ||
@@ -596,7 +593,7 @@ static void pop_tx_status(struct net_device *dev) | |||
596 | DEBUG(1, "%s: transmit error: status 0x%02x\n", | 593 | DEBUG(1, "%s: transmit error: status 0x%02x\n", |
597 | dev->name, tx_status); | 594 | dev->name, tx_status); |
598 | outw(TxEnable, ioaddr + EL3_CMD); | 595 | outw(TxEnable, ioaddr + EL3_CMD); |
599 | lp->stats.tx_aborted_errors++; | 596 | dev->stats.tx_aborted_errors++; |
600 | } | 597 | } |
601 | outb(0x00, ioaddr + TX_STATUS); /* Pop the status stack. */ | 598 | outb(0x00, ioaddr + TX_STATUS); /* Pop the status stack. */ |
602 | } | 599 | } |
@@ -614,7 +611,7 @@ static int el3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
614 | 611 | ||
615 | spin_lock_irqsave(&priv->lock, flags); | 612 | spin_lock_irqsave(&priv->lock, flags); |
616 | 613 | ||
617 | priv->stats.tx_bytes += skb->len; | 614 | dev->stats.tx_bytes += skb->len; |
618 | 615 | ||
619 | /* Put out the doubleword header... */ | 616 | /* Put out the doubleword header... */ |
620 | outw(skb->len, ioaddr + TX_FIFO); | 617 | outw(skb->len, ioaddr + TX_FIFO); |
@@ -764,7 +761,7 @@ static void media_check(unsigned long arg) | |||
764 | outw(StatsDisable, ioaddr + EL3_CMD); | 761 | outw(StatsDisable, ioaddr + EL3_CMD); |
765 | errs = inb(ioaddr + 0); | 762 | errs = inb(ioaddr + 0); |
766 | outw(StatsEnable, ioaddr + EL3_CMD); | 763 | outw(StatsEnable, ioaddr + EL3_CMD); |
767 | lp->stats.tx_carrier_errors += errs; | 764 | dev->stats.tx_carrier_errors += errs; |
768 | if (errs || (lp->media_status & 0x0010)) media |= 0x0010; | 765 | if (errs || (lp->media_status & 0x0010)) media |= 0x0010; |
769 | } | 766 | } |
770 | 767 | ||
@@ -814,7 +811,7 @@ static struct net_device_stats *el3_get_stats(struct net_device *dev) | |||
814 | update_stats(dev); | 811 | update_stats(dev); |
815 | spin_unlock_irqrestore(&lp->lock, flags); | 812 | spin_unlock_irqrestore(&lp->lock, flags); |
816 | } | 813 | } |
817 | return &lp->stats; | 814 | return &dev->stats; |
818 | } | 815 | } |
819 | 816 | ||
820 | /* | 817 | /* |
@@ -827,7 +824,6 @@ static struct net_device_stats *el3_get_stats(struct net_device *dev) | |||
827 | */ | 824 | */ |
828 | static void update_stats(struct net_device *dev) | 825 | static void update_stats(struct net_device *dev) |
829 | { | 826 | { |
830 | struct el3_private *lp = netdev_priv(dev); | ||
831 | unsigned int ioaddr = dev->base_addr; | 827 | unsigned int ioaddr = dev->base_addr; |
832 | 828 | ||
833 | DEBUG(2, "%s: updating the statistics.\n", dev->name); | 829 | DEBUG(2, "%s: updating the statistics.\n", dev->name); |
@@ -835,13 +831,13 @@ static void update_stats(struct net_device *dev) | |||
835 | outw(StatsDisable, ioaddr + EL3_CMD); | 831 | outw(StatsDisable, ioaddr + EL3_CMD); |
836 | /* Switch to the stats window, and read everything. */ | 832 | /* Switch to the stats window, and read everything. */ |
837 | EL3WINDOW(6); | 833 | EL3WINDOW(6); |
838 | lp->stats.tx_carrier_errors += inb(ioaddr + 0); | 834 | dev->stats.tx_carrier_errors += inb(ioaddr + 0); |
839 | lp->stats.tx_heartbeat_errors += inb(ioaddr + 1); | 835 | dev->stats.tx_heartbeat_errors += inb(ioaddr + 1); |
840 | /* Multiple collisions. */ inb(ioaddr + 2); | 836 | /* Multiple collisions. */ inb(ioaddr + 2); |
841 | lp->stats.collisions += inb(ioaddr + 3); | 837 | dev->stats.collisions += inb(ioaddr + 3); |
842 | lp->stats.tx_window_errors += inb(ioaddr + 4); | 838 | dev->stats.tx_window_errors += inb(ioaddr + 4); |
843 | lp->stats.rx_fifo_errors += inb(ioaddr + 5); | 839 | dev->stats.rx_fifo_errors += inb(ioaddr + 5); |
844 | lp->stats.tx_packets += inb(ioaddr + 6); | 840 | dev->stats.tx_packets += inb(ioaddr + 6); |
845 | /* Rx packets */ inb(ioaddr + 7); | 841 | /* Rx packets */ inb(ioaddr + 7); |
846 | /* Tx deferrals */ inb(ioaddr + 8); | 842 | /* Tx deferrals */ inb(ioaddr + 8); |
847 | /* Rx octets */ inw(ioaddr + 10); | 843 | /* Rx octets */ inw(ioaddr + 10); |
@@ -854,7 +850,6 @@ static void update_stats(struct net_device *dev) | |||
854 | 850 | ||
855 | static int el3_rx(struct net_device *dev) | 851 | static int el3_rx(struct net_device *dev) |
856 | { | 852 | { |
857 | struct el3_private *lp = netdev_priv(dev); | ||
858 | unsigned int ioaddr = dev->base_addr; | 853 | unsigned int ioaddr = dev->base_addr; |
859 | int worklimit = 32; | 854 | int worklimit = 32; |
860 | short rx_status; | 855 | short rx_status; |
@@ -865,14 +860,14 @@ static int el3_rx(struct net_device *dev) | |||
865 | (--worklimit >= 0)) { | 860 | (--worklimit >= 0)) { |
866 | if (rx_status & 0x4000) { /* Error, update stats. */ | 861 | if (rx_status & 0x4000) { /* Error, update stats. */ |
867 | short error = rx_status & 0x3800; | 862 | short error = rx_status & 0x3800; |
868 | lp->stats.rx_errors++; | 863 | dev->stats.rx_errors++; |
869 | switch (error) { | 864 | switch (error) { |
870 | case 0x0000: lp->stats.rx_over_errors++; break; | 865 | case 0x0000: dev->stats.rx_over_errors++; break; |
871 | case 0x0800: lp->stats.rx_length_errors++; break; | 866 | case 0x0800: dev->stats.rx_length_errors++; break; |
872 | case 0x1000: lp->stats.rx_frame_errors++; break; | 867 | case 0x1000: dev->stats.rx_frame_errors++; break; |
873 | case 0x1800: lp->stats.rx_length_errors++; break; | 868 | case 0x1800: dev->stats.rx_length_errors++; break; |
874 | case 0x2000: lp->stats.rx_frame_errors++; break; | 869 | case 0x2000: dev->stats.rx_frame_errors++; break; |
875 | case 0x2800: lp->stats.rx_crc_errors++; break; | 870 | case 0x2800: dev->stats.rx_crc_errors++; break; |
876 | } | 871 | } |
877 | } else { | 872 | } else { |
878 | short pkt_len = rx_status & 0x7ff; | 873 | short pkt_len = rx_status & 0x7ff; |
@@ -889,12 +884,12 @@ static int el3_rx(struct net_device *dev) | |||
889 | skb->protocol = eth_type_trans(skb, dev); | 884 | skb->protocol = eth_type_trans(skb, dev); |
890 | netif_rx(skb); | 885 | netif_rx(skb); |
891 | dev->last_rx = jiffies; | 886 | dev->last_rx = jiffies; |
892 | lp->stats.rx_packets++; | 887 | dev->stats.rx_packets++; |
893 | lp->stats.rx_bytes += pkt_len; | 888 | dev->stats.rx_bytes += pkt_len; |
894 | } else { | 889 | } else { |
895 | DEBUG(1, "%s: couldn't allocate a sk_buff of" | 890 | DEBUG(1, "%s: couldn't allocate a sk_buff of" |
896 | " size %d.\n", dev->name, pkt_len); | 891 | " size %d.\n", dev->name, pkt_len); |
897 | lp->stats.rx_dropped++; | 892 | dev->stats.rx_dropped++; |
898 | } | 893 | } |
899 | } | 894 | } |
900 | /* Pop the top of the Rx FIFO */ | 895 | /* Pop the top of the Rx FIFO */ |
@@ -929,7 +924,7 @@ static int el3_close(struct net_device *dev) | |||
929 | DEBUG(1, "%s: shutting down ethercard.\n", dev->name); | 924 | DEBUG(1, "%s: shutting down ethercard.\n", dev->name); |
930 | 925 | ||
931 | if (pcmcia_dev_present(link)) { | 926 | if (pcmcia_dev_present(link)) { |
932 | /* Turn off statistics ASAP. We update lp->stats below. */ | 927 | /* Turn off statistics ASAP. We update dev->stats below. */ |
933 | outw(StatsDisable, ioaddr + EL3_CMD); | 928 | outw(StatsDisable, ioaddr + EL3_CMD); |
934 | 929 | ||
935 | /* Disable the receiver and transmitter. */ | 930 | /* Disable the receiver and transmitter. */ |
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index ce95c5d168fe..d7018ff9e171 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c | |||
@@ -1021,7 +1021,7 @@ static void ei_tx_timeout(struct net_device *dev) | |||
1021 | int txsr, isr, tickssofar = jiffies - dev->trans_start; | 1021 | int txsr, isr, tickssofar = jiffies - dev->trans_start; |
1022 | unsigned long flags; | 1022 | unsigned long flags; |
1023 | 1023 | ||
1024 | ei_local->stat.tx_errors++; | 1024 | dev->stats.tx_errors++; |
1025 | 1025 | ||
1026 | spin_lock_irqsave(&ei_local->page_lock, flags); | 1026 | spin_lock_irqsave(&ei_local->page_lock, flags); |
1027 | txsr = inb(e8390_base+EN0_TSR); | 1027 | txsr = inb(e8390_base+EN0_TSR); |
@@ -1032,7 +1032,7 @@ static void ei_tx_timeout(struct net_device *dev) | |||
1032 | dev->name, (txsr & ENTSR_ABT) ? "excess collisions." : | 1032 | dev->name, (txsr & ENTSR_ABT) ? "excess collisions." : |
1033 | (isr) ? "lost interrupt?" : "cable problem?", txsr, isr, tickssofar); | 1033 | (isr) ? "lost interrupt?" : "cable problem?", txsr, isr, tickssofar); |
1034 | 1034 | ||
1035 | if (!isr && !ei_local->stat.tx_packets) | 1035 | if (!isr && !dev->stats.tx_packets) |
1036 | { | 1036 | { |
1037 | /* The 8390 probably hasn't gotten on the cable yet. */ | 1037 | /* The 8390 probably hasn't gotten on the cable yet. */ |
1038 | ei_local->interface_num ^= 1; /* Try a different xcvr. */ | 1038 | ei_local->interface_num ^= 1; /* Try a different xcvr. */ |
@@ -1122,7 +1122,7 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1122 | netif_stop_queue(dev); | 1122 | netif_stop_queue(dev); |
1123 | outb_p(ENISR_ALL, e8390_base + EN0_IMR); | 1123 | outb_p(ENISR_ALL, e8390_base + EN0_IMR); |
1124 | spin_unlock_irqrestore(&ei_local->page_lock, flags); | 1124 | spin_unlock_irqrestore(&ei_local->page_lock, flags); |
1125 | ei_local->stat.tx_errors++; | 1125 | dev->stats.tx_errors++; |
1126 | return 1; | 1126 | return 1; |
1127 | } | 1127 | } |
1128 | 1128 | ||
@@ -1170,7 +1170,7 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1170 | spin_unlock_irqrestore(&ei_local->page_lock, flags); | 1170 | spin_unlock_irqrestore(&ei_local->page_lock, flags); |
1171 | 1171 | ||
1172 | dev_kfree_skb (skb); | 1172 | dev_kfree_skb (skb); |
1173 | ei_local->stat.tx_bytes += send_length; | 1173 | dev->stats.tx_bytes += send_length; |
1174 | 1174 | ||
1175 | return 0; | 1175 | return 0; |
1176 | } | 1176 | } |
@@ -1262,9 +1262,9 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id) | |||
1262 | 1262 | ||
1263 | if (interrupts & ENISR_COUNTERS) | 1263 | if (interrupts & ENISR_COUNTERS) |
1264 | { | 1264 | { |
1265 | ei_local->stat.rx_frame_errors += inb_p(e8390_base + EN0_COUNTER0); | 1265 | dev->stats.rx_frame_errors += inb_p(e8390_base + EN0_COUNTER0); |
1266 | ei_local->stat.rx_crc_errors += inb_p(e8390_base + EN0_COUNTER1); | 1266 | dev->stats.rx_crc_errors += inb_p(e8390_base + EN0_COUNTER1); |
1267 | ei_local->stat.rx_missed_errors+= inb_p(e8390_base + EN0_COUNTER2); | 1267 | dev->stats.rx_missed_errors+= inb_p(e8390_base + EN0_COUNTER2); |
1268 | } | 1268 | } |
1269 | } | 1269 | } |
1270 | 1270 | ||
@@ -1309,7 +1309,6 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id) | |||
1309 | static void ei_tx_err(struct net_device *dev) | 1309 | static void ei_tx_err(struct net_device *dev) |
1310 | { | 1310 | { |
1311 | long e8390_base = dev->base_addr; | 1311 | long e8390_base = dev->base_addr; |
1312 | struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev); | ||
1313 | unsigned char txsr = inb_p(e8390_base+EN0_TSR); | 1312 | unsigned char txsr = inb_p(e8390_base+EN0_TSR); |
1314 | unsigned char tx_was_aborted = txsr & (ENTSR_ABT+ENTSR_FU); | 1313 | unsigned char tx_was_aborted = txsr & (ENTSR_ABT+ENTSR_FU); |
1315 | 1314 | ||
@@ -1332,10 +1331,10 @@ static void ei_tx_err(struct net_device *dev) | |||
1332 | ei_tx_intr(dev); | 1331 | ei_tx_intr(dev); |
1333 | else | 1332 | else |
1334 | { | 1333 | { |
1335 | ei_local->stat.tx_errors++; | 1334 | dev->stats.tx_errors++; |
1336 | if (txsr & ENTSR_CRS) ei_local->stat.tx_carrier_errors++; | 1335 | if (txsr & ENTSR_CRS) dev->stats.tx_carrier_errors++; |
1337 | if (txsr & ENTSR_CDH) ei_local->stat.tx_heartbeat_errors++; | 1336 | if (txsr & ENTSR_CDH) dev->stats.tx_heartbeat_errors++; |
1338 | if (txsr & ENTSR_OWC) ei_local->stat.tx_window_errors++; | 1337 | if (txsr & ENTSR_OWC) dev->stats.tx_window_errors++; |
1339 | } | 1338 | } |
1340 | } | 1339 | } |
1341 | 1340 | ||
@@ -1397,25 +1396,25 @@ static void ei_tx_intr(struct net_device *dev) | |||
1397 | 1396 | ||
1398 | /* Minimize Tx latency: update the statistics after we restart TXing. */ | 1397 | /* Minimize Tx latency: update the statistics after we restart TXing. */ |
1399 | if (status & ENTSR_COL) | 1398 | if (status & ENTSR_COL) |
1400 | ei_local->stat.collisions++; | 1399 | dev->stats.collisions++; |
1401 | if (status & ENTSR_PTX) | 1400 | if (status & ENTSR_PTX) |
1402 | ei_local->stat.tx_packets++; | 1401 | dev->stats.tx_packets++; |
1403 | else | 1402 | else |
1404 | { | 1403 | { |
1405 | ei_local->stat.tx_errors++; | 1404 | dev->stats.tx_errors++; |
1406 | if (status & ENTSR_ABT) | 1405 | if (status & ENTSR_ABT) |
1407 | { | 1406 | { |
1408 | ei_local->stat.tx_aborted_errors++; | 1407 | dev->stats.tx_aborted_errors++; |
1409 | ei_local->stat.collisions += 16; | 1408 | dev->stats.collisions += 16; |
1410 | } | 1409 | } |
1411 | if (status & ENTSR_CRS) | 1410 | if (status & ENTSR_CRS) |
1412 | ei_local->stat.tx_carrier_errors++; | 1411 | dev->stats.tx_carrier_errors++; |
1413 | if (status & ENTSR_FU) | 1412 | if (status & ENTSR_FU) |
1414 | ei_local->stat.tx_fifo_errors++; | 1413 | dev->stats.tx_fifo_errors++; |
1415 | if (status & ENTSR_CDH) | 1414 | if (status & ENTSR_CDH) |
1416 | ei_local->stat.tx_heartbeat_errors++; | 1415 | dev->stats.tx_heartbeat_errors++; |
1417 | if (status & ENTSR_OWC) | 1416 | if (status & ENTSR_OWC) |
1418 | ei_local->stat.tx_window_errors++; | 1417 | dev->stats.tx_window_errors++; |
1419 | } | 1418 | } |
1420 | netif_wake_queue(dev); | 1419 | netif_wake_queue(dev); |
1421 | } | 1420 | } |
@@ -1476,8 +1475,8 @@ static void ei_receive(struct net_device *dev) | |||
1476 | printk(KERN_DEBUG "%s: bogus packet size: %d, status=%#2x nxpg=%#2x.\n", | 1475 | printk(KERN_DEBUG "%s: bogus packet size: %d, status=%#2x nxpg=%#2x.\n", |
1477 | dev->name, rx_frame.count, rx_frame.status, | 1476 | dev->name, rx_frame.count, rx_frame.status, |
1478 | rx_frame.next); | 1477 | rx_frame.next); |
1479 | ei_local->stat.rx_errors++; | 1478 | dev->stats.rx_errors++; |
1480 | ei_local->stat.rx_length_errors++; | 1479 | dev->stats.rx_length_errors++; |
1481 | } | 1480 | } |
1482 | else if ((pkt_stat & 0x0F) == ENRSR_RXOK) | 1481 | else if ((pkt_stat & 0x0F) == ENRSR_RXOK) |
1483 | { | 1482 | { |
@@ -1489,7 +1488,7 @@ static void ei_receive(struct net_device *dev) | |||
1489 | if (ei_debug > 1) | 1488 | if (ei_debug > 1) |
1490 | printk(KERN_DEBUG "%s: Couldn't allocate a sk_buff of size %d.\n", | 1489 | printk(KERN_DEBUG "%s: Couldn't allocate a sk_buff of size %d.\n", |
1491 | dev->name, pkt_len); | 1490 | dev->name, pkt_len); |
1492 | ei_local->stat.rx_dropped++; | 1491 | dev->stats.rx_dropped++; |
1493 | break; | 1492 | break; |
1494 | } | 1493 | } |
1495 | else | 1494 | else |
@@ -1500,10 +1499,10 @@ static void ei_receive(struct net_device *dev) | |||
1500 | skb->protocol=eth_type_trans(skb,dev); | 1499 | skb->protocol=eth_type_trans(skb,dev); |
1501 | netif_rx(skb); | 1500 | netif_rx(skb); |
1502 | dev->last_rx = jiffies; | 1501 | dev->last_rx = jiffies; |
1503 | ei_local->stat.rx_packets++; | 1502 | dev->stats.rx_packets++; |
1504 | ei_local->stat.rx_bytes += pkt_len; | 1503 | dev->stats.rx_bytes += pkt_len; |
1505 | if (pkt_stat & ENRSR_PHY) | 1504 | if (pkt_stat & ENRSR_PHY) |
1506 | ei_local->stat.multicast++; | 1505 | dev->stats.multicast++; |
1507 | } | 1506 | } |
1508 | } | 1507 | } |
1509 | else | 1508 | else |
@@ -1512,10 +1511,10 @@ static void ei_receive(struct net_device *dev) | |||
1512 | printk(KERN_DEBUG "%s: bogus packet: status=%#2x nxpg=%#2x size=%d\n", | 1511 | printk(KERN_DEBUG "%s: bogus packet: status=%#2x nxpg=%#2x size=%d\n", |
1513 | dev->name, rx_frame.status, rx_frame.next, | 1512 | dev->name, rx_frame.status, rx_frame.next, |
1514 | rx_frame.count); | 1513 | rx_frame.count); |
1515 | ei_local->stat.rx_errors++; | 1514 | dev->stats.rx_errors++; |
1516 | /* NB: The NIC counts CRC, frame and missed errors. */ | 1515 | /* NB: The NIC counts CRC, frame and missed errors. */ |
1517 | if (pkt_stat & ENRSR_FO) | 1516 | if (pkt_stat & ENRSR_FO) |
1518 | ei_local->stat.rx_fifo_errors++; | 1517 | dev->stats.rx_fifo_errors++; |
1519 | } | 1518 | } |
1520 | next_frame = rx_frame.next; | 1519 | next_frame = rx_frame.next; |
1521 | 1520 | ||
@@ -1550,7 +1549,6 @@ static void ei_rx_overrun(struct net_device *dev) | |||
1550 | axnet_dev_t *info = PRIV(dev); | 1549 | axnet_dev_t *info = PRIV(dev); |
1551 | long e8390_base = dev->base_addr; | 1550 | long e8390_base = dev->base_addr; |
1552 | unsigned char was_txing, must_resend = 0; | 1551 | unsigned char was_txing, must_resend = 0; |
1553 | struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev); | ||
1554 | 1552 | ||
1555 | /* | 1553 | /* |
1556 | * Record whether a Tx was in progress and then issue the | 1554 | * Record whether a Tx was in progress and then issue the |
@@ -1561,7 +1559,7 @@ static void ei_rx_overrun(struct net_device *dev) | |||
1561 | 1559 | ||
1562 | if (ei_debug > 1) | 1560 | if (ei_debug > 1) |
1563 | printk(KERN_DEBUG "%s: Receiver overrun.\n", dev->name); | 1561 | printk(KERN_DEBUG "%s: Receiver overrun.\n", dev->name); |
1564 | ei_local->stat.rx_over_errors++; | 1562 | dev->stats.rx_over_errors++; |
1565 | 1563 | ||
1566 | /* | 1564 | /* |
1567 | * Wait a full Tx time (1.2ms) + some guard time, NS says 1.6ms total. | 1565 | * Wait a full Tx time (1.2ms) + some guard time, NS says 1.6ms total. |
@@ -1622,16 +1620,16 @@ static struct net_device_stats *get_stats(struct net_device *dev) | |||
1622 | 1620 | ||
1623 | /* If the card is stopped, just return the present stats. */ | 1621 | /* If the card is stopped, just return the present stats. */ |
1624 | if (!netif_running(dev)) | 1622 | if (!netif_running(dev)) |
1625 | return &ei_local->stat; | 1623 | return &dev->stats; |
1626 | 1624 | ||
1627 | spin_lock_irqsave(&ei_local->page_lock,flags); | 1625 | spin_lock_irqsave(&ei_local->page_lock,flags); |
1628 | /* Read the counter registers, assuming we are in page 0. */ | 1626 | /* Read the counter registers, assuming we are in page 0. */ |
1629 | ei_local->stat.rx_frame_errors += inb_p(ioaddr + EN0_COUNTER0); | 1627 | dev->stats.rx_frame_errors += inb_p(ioaddr + EN0_COUNTER0); |
1630 | ei_local->stat.rx_crc_errors += inb_p(ioaddr + EN0_COUNTER1); | 1628 | dev->stats.rx_crc_errors += inb_p(ioaddr + EN0_COUNTER1); |
1631 | ei_local->stat.rx_missed_errors+= inb_p(ioaddr + EN0_COUNTER2); | 1629 | dev->stats.rx_missed_errors+= inb_p(ioaddr + EN0_COUNTER2); |
1632 | spin_unlock_irqrestore(&ei_local->page_lock, flags); | 1630 | spin_unlock_irqrestore(&ei_local->page_lock, flags); |
1633 | 1631 | ||
1634 | return &ei_local->stat; | 1632 | return &dev->stats; |
1635 | } | 1633 | } |
1636 | 1634 | ||
1637 | /* | 1635 | /* |
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c index 4eb322e5273d..d0d5585114b0 100644 --- a/drivers/net/pcnet32.c +++ b/drivers/net/pcnet32.c | |||
@@ -2006,7 +2006,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) | |||
2006 | err_free_ring: | 2006 | err_free_ring: |
2007 | pcnet32_free_ring(dev); | 2007 | pcnet32_free_ring(dev); |
2008 | err_free_consistent: | 2008 | err_free_consistent: |
2009 | pci_free_consistent(lp->pci_dev, sizeof(*lp->init_block), | 2009 | pci_free_consistent(lp->pci_dev, sizeof(*lp->init_block), |
2010 | lp->init_block, lp->init_dma_addr); | 2010 | lp->init_block, lp->init_dma_addr); |
2011 | err_free_netdev: | 2011 | err_free_netdev: |
2012 | free_netdev(dev); | 2012 | free_netdev(dev); |
@@ -3006,7 +3006,7 @@ static void __devexit pcnet32_remove_one(struct pci_dev *pdev) | |||
3006 | unregister_netdev(dev); | 3006 | unregister_netdev(dev); |
3007 | pcnet32_free_ring(dev); | 3007 | pcnet32_free_ring(dev); |
3008 | release_region(dev->base_addr, PCNET32_TOTAL_SIZE); | 3008 | release_region(dev->base_addr, PCNET32_TOTAL_SIZE); |
3009 | pci_free_consistent(lp->pci_dev, sizeof(*lp->init_block), | 3009 | pci_free_consistent(lp->pci_dev, sizeof(*lp->init_block), |
3010 | lp->init_block, lp->init_dma_addr); | 3010 | lp->init_block, lp->init_dma_addr); |
3011 | free_netdev(dev); | 3011 | free_netdev(dev); |
3012 | pci_disable_device(pdev); | 3012 | pci_disable_device(pdev); |
@@ -3089,7 +3089,7 @@ static void __exit pcnet32_cleanup_module(void) | |||
3089 | unregister_netdev(pcnet32_dev); | 3089 | unregister_netdev(pcnet32_dev); |
3090 | pcnet32_free_ring(pcnet32_dev); | 3090 | pcnet32_free_ring(pcnet32_dev); |
3091 | release_region(pcnet32_dev->base_addr, PCNET32_TOTAL_SIZE); | 3091 | release_region(pcnet32_dev->base_addr, PCNET32_TOTAL_SIZE); |
3092 | pci_free_consistent(lp->pci_dev, sizeof(*lp->init_block), | 3092 | pci_free_consistent(lp->pci_dev, sizeof(*lp->init_block), |
3093 | lp->init_block, lp->init_dma_addr); | 3093 | lp->init_block, lp->init_dma_addr); |
3094 | free_netdev(pcnet32_dev); | 3094 | free_netdev(pcnet32_dev); |
3095 | pcnet32_dev = next_dev; | 3095 | pcnet32_dev = next_dev; |
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index b7f7b2227d56..5f608780c3e8 100644 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c | |||
@@ -1437,9 +1437,9 @@ static void ql_phy_start_neg_ex(struct ql3_adapter *qdev) | |||
1437 | reg &= ~PHY_GIG_ALL_PARAMS; | 1437 | reg &= ~PHY_GIG_ALL_PARAMS; |
1438 | 1438 | ||
1439 | if(portConfiguration & PORT_CONFIG_1000MB_SPEED) { | 1439 | if(portConfiguration & PORT_CONFIG_1000MB_SPEED) { |
1440 | if(portConfiguration & PORT_CONFIG_FULL_DUPLEX_ENABLED) | 1440 | if(portConfiguration & PORT_CONFIG_FULL_DUPLEX_ENABLED) |
1441 | reg |= PHY_GIG_ADV_1000F; | 1441 | reg |= PHY_GIG_ADV_1000F; |
1442 | else | 1442 | else |
1443 | reg |= PHY_GIG_ADV_1000H; | 1443 | reg |= PHY_GIG_ADV_1000H; |
1444 | } | 1444 | } |
1445 | 1445 | ||
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 523478ebfd69..75bde6475832 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c | |||
@@ -2547,7 +2547,7 @@ static int fill_rx_buffers(struct ring_info *ring) | |||
2547 | if (block_no) | 2547 | if (block_no) |
2548 | rxd_index += (block_no * ring->rxd_count); | 2548 | rxd_index += (block_no * ring->rxd_count); |
2549 | 2549 | ||
2550 | if ((block_no == block_no1) && | 2550 | if ((block_no == block_no1) && |
2551 | (off == ring->rx_curr_get_info.offset) && | 2551 | (off == ring->rx_curr_get_info.offset) && |
2552 | (rxdp->Host_Control)) { | 2552 | (rxdp->Host_Control)) { |
2553 | DBG_PRINT(INTR_DBG, "%s: Get and Put", | 2553 | DBG_PRINT(INTR_DBG, "%s: Get and Put", |
@@ -2593,7 +2593,7 @@ static int fill_rx_buffers(struct ring_info *ring) | |||
2593 | first_rxdp->Control_1 |= RXD_OWN_XENA; | 2593 | first_rxdp->Control_1 |= RXD_OWN_XENA; |
2594 | } | 2594 | } |
2595 | stats->mem_alloc_fail_cnt++; | 2595 | stats->mem_alloc_fail_cnt++; |
2596 | 2596 | ||
2597 | return -ENOMEM ; | 2597 | return -ENOMEM ; |
2598 | } | 2598 | } |
2599 | stats->mem_allocated += skb->truesize; | 2599 | stats->mem_allocated += skb->truesize; |
diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h index 0709ebae9139..58229dcbf5ec 100644 --- a/drivers/net/s2io.h +++ b/drivers/net/s2io.h | |||
@@ -747,7 +747,7 @@ struct ring_info { | |||
747 | 747 | ||
748 | /* interface MTU value */ | 748 | /* interface MTU value */ |
749 | unsigned mtu; | 749 | unsigned mtu; |
750 | 750 | ||
751 | /* Buffer Address store. */ | 751 | /* Buffer Address store. */ |
752 | struct buffAdd **ba; | 752 | struct buffAdd **ba; |
753 | 753 | ||
diff --git a/drivers/net/sb1250-mac.c b/drivers/net/sb1250-mac.c index 888b7dec9866..295199025173 100644 --- a/drivers/net/sb1250-mac.c +++ b/drivers/net/sb1250-mac.c | |||
@@ -1063,7 +1063,7 @@ static void sbmac_netpoll(struct net_device *netdev) | |||
1063 | ((M_MAC_INT_EOP_COUNT | M_MAC_INT_EOP_TIMER) << S_MAC_RX_CH0), | 1063 | ((M_MAC_INT_EOP_COUNT | M_MAC_INT_EOP_TIMER) << S_MAC_RX_CH0), |
1064 | sc->sbm_imr); | 1064 | sc->sbm_imr); |
1065 | #else | 1065 | #else |
1066 | __raw_writeq((M_MAC_INT_CHANNEL << S_MAC_TX_CH0) | | 1066 | __raw_writeq((M_MAC_INT_CHANNEL << S_MAC_TX_CH0) | |
1067 | (M_MAC_INT_CHANNEL << S_MAC_RX_CH0), sc->sbm_imr); | 1067 | (M_MAC_INT_CHANNEL << S_MAC_RX_CH0), sc->sbm_imr); |
1068 | #endif | 1068 | #endif |
1069 | } | 1069 | } |
diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c index abc63b0663be..3fe01763760e 100644 --- a/drivers/net/sis190.c +++ b/drivers/net/sis190.c | |||
@@ -1656,7 +1656,7 @@ static inline void sis190_init_rxfilter(struct net_device *dev) | |||
1656 | SIS_PCI_COMMIT(); | 1656 | SIS_PCI_COMMIT(); |
1657 | } | 1657 | } |
1658 | 1658 | ||
1659 | static int __devinit sis190_get_mac_addr(struct pci_dev *pdev, | 1659 | static int __devinit sis190_get_mac_addr(struct pci_dev *pdev, |
1660 | struct net_device *dev) | 1660 | struct net_device *dev) |
1661 | { | 1661 | { |
1662 | int rc; | 1662 | int rc; |
diff --git a/drivers/net/sis900.c b/drivers/net/sis900.c index ec95e493ac1c..fa3a460f8e2f 100644 --- a/drivers/net/sis900.c +++ b/drivers/net/sis900.c | |||
@@ -1766,7 +1766,7 @@ static int sis900_rx(struct net_device *net_dev) | |||
1766 | skb = sis_priv->rx_skbuff[entry]; | 1766 | skb = sis_priv->rx_skbuff[entry]; |
1767 | net_dev->stats.rx_dropped++; | 1767 | net_dev->stats.rx_dropped++; |
1768 | goto refill_rx_ring; | 1768 | goto refill_rx_ring; |
1769 | } | 1769 | } |
1770 | 1770 | ||
1771 | /* This situation should never happen, but due to | 1771 | /* This situation should never happen, but due to |
1772 | some unknow bugs, it is possible that | 1772 | some unknow bugs, it is possible that |
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index f226bcac7d17..4b0f03358777 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -3369,7 +3369,7 @@ static void sky2_led(struct sky2_port *sky2, enum led_mode mode) | |||
3369 | 3369 | ||
3370 | gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg); | 3370 | gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg); |
3371 | } else | 3371 | } else |
3372 | gm_phy_write(hw, port, PHY_MARV_LED_OVER, | 3372 | gm_phy_write(hw, port, PHY_MARV_LED_OVER, |
3373 | PHY_M_LED_MO_DUP(mode) | | 3373 | PHY_M_LED_MO_DUP(mode) | |
3374 | PHY_M_LED_MO_10(mode) | | 3374 | PHY_M_LED_MO_10(mode) | |
3375 | PHY_M_LED_MO_100(mode) | | 3375 | PHY_M_LED_MO_100(mode) | |
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c index 477671606273..00aa0b108cb9 100644 --- a/drivers/net/spider_net.c +++ b/drivers/net/spider_net.c | |||
@@ -1704,7 +1704,7 @@ spider_net_poll_controller(struct net_device *netdev) | |||
1704 | * | 1704 | * |
1705 | * spider_net_enable_interrupt enables several interrupts | 1705 | * spider_net_enable_interrupt enables several interrupts |
1706 | */ | 1706 | */ |
1707 | static void | 1707 | static void |
1708 | spider_net_enable_interrupts(struct spider_net_card *card) | 1708 | spider_net_enable_interrupts(struct spider_net_card *card) |
1709 | { | 1709 | { |
1710 | spider_net_write_reg(card, SPIDER_NET_GHIINT0MSK, | 1710 | spider_net_write_reg(card, SPIDER_NET_GHIINT0MSK, |
@@ -1721,7 +1721,7 @@ spider_net_enable_interrupts(struct spider_net_card *card) | |||
1721 | * | 1721 | * |
1722 | * spider_net_disable_interrupts disables all the interrupts | 1722 | * spider_net_disable_interrupts disables all the interrupts |
1723 | */ | 1723 | */ |
1724 | static void | 1724 | static void |
1725 | spider_net_disable_interrupts(struct spider_net_card *card) | 1725 | spider_net_disable_interrupts(struct spider_net_card *card) |
1726 | { | 1726 | { |
1727 | spider_net_write_reg(card, SPIDER_NET_GHIINT0MSK, 0); | 1727 | spider_net_write_reg(card, SPIDER_NET_GHIINT0MSK, 0); |
diff --git a/drivers/net/tokenring/3c359.c b/drivers/net/tokenring/3c359.c index 45208a0e69a0..7766cde0d63d 100644 --- a/drivers/net/tokenring/3c359.c +++ b/drivers/net/tokenring/3c359.c | |||
@@ -132,7 +132,6 @@ static void xl_dn_comp(struct net_device *dev); | |||
132 | static int xl_close(struct net_device *dev); | 132 | static int xl_close(struct net_device *dev); |
133 | static void xl_set_rx_mode(struct net_device *dev); | 133 | static void xl_set_rx_mode(struct net_device *dev); |
134 | static irqreturn_t xl_interrupt(int irq, void *dev_id); | 134 | static irqreturn_t xl_interrupt(int irq, void *dev_id); |
135 | static struct net_device_stats * xl_get_stats(struct net_device *dev); | ||
136 | static int xl_set_mac_address(struct net_device *dev, void *addr) ; | 135 | static int xl_set_mac_address(struct net_device *dev, void *addr) ; |
137 | static void xl_arb_cmd(struct net_device *dev); | 136 | static void xl_arb_cmd(struct net_device *dev); |
138 | static void xl_asb_cmd(struct net_device *dev) ; | 137 | static void xl_asb_cmd(struct net_device *dev) ; |
@@ -343,7 +342,6 @@ static int __devinit xl_probe(struct pci_dev *pdev, | |||
343 | dev->stop=&xl_close; | 342 | dev->stop=&xl_close; |
344 | dev->do_ioctl=NULL; | 343 | dev->do_ioctl=NULL; |
345 | dev->set_multicast_list=&xl_set_rx_mode; | 344 | dev->set_multicast_list=&xl_set_rx_mode; |
346 | dev->get_stats=&xl_get_stats ; | ||
347 | dev->set_mac_address=&xl_set_mac_address ; | 345 | dev->set_mac_address=&xl_set_mac_address ; |
348 | SET_NETDEV_DEV(dev, &pdev->dev); | 346 | SET_NETDEV_DEV(dev, &pdev->dev); |
349 | 347 | ||
@@ -921,7 +919,7 @@ static void xl_rx(struct net_device *dev) | |||
921 | adv_rx_ring(dev) ; | 919 | adv_rx_ring(dev) ; |
922 | 920 | ||
923 | adv_rx_ring(dev) ; /* One more time just for luck :) */ | 921 | adv_rx_ring(dev) ; /* One more time just for luck :) */ |
924 | xl_priv->xl_stats.rx_dropped++ ; | 922 | dev->stats.rx_dropped++ ; |
925 | 923 | ||
926 | writel(ACK_INTERRUPT | UPCOMPACK | LATCH_ACK , xl_mmio + MMIO_COMMAND) ; | 924 | writel(ACK_INTERRUPT | UPCOMPACK | LATCH_ACK , xl_mmio + MMIO_COMMAND) ; |
927 | return ; | 925 | return ; |
@@ -957,7 +955,7 @@ static void xl_rx(struct net_device *dev) | |||
957 | if (skb==NULL) { /* Still need to fix the rx ring */ | 955 | if (skb==NULL) { /* Still need to fix the rx ring */ |
958 | printk(KERN_WARNING "%s: dev_alloc_skb failed in rx, single buffer \n",dev->name) ; | 956 | printk(KERN_WARNING "%s: dev_alloc_skb failed in rx, single buffer \n",dev->name) ; |
959 | adv_rx_ring(dev) ; | 957 | adv_rx_ring(dev) ; |
960 | xl_priv->xl_stats.rx_dropped++ ; | 958 | dev->stats.rx_dropped++ ; |
961 | writel(ACK_INTERRUPT | UPCOMPACK | LATCH_ACK , xl_mmio + MMIO_COMMAND) ; | 959 | writel(ACK_INTERRUPT | UPCOMPACK | LATCH_ACK , xl_mmio + MMIO_COMMAND) ; |
962 | return ; | 960 | return ; |
963 | } | 961 | } |
@@ -971,8 +969,8 @@ static void xl_rx(struct net_device *dev) | |||
971 | xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr = cpu_to_le32(pci_map_single(xl_priv->pdev,skb->data,xl_priv->pkt_buf_sz, PCI_DMA_FROMDEVICE)); | 969 | xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr = cpu_to_le32(pci_map_single(xl_priv->pdev,skb->data,xl_priv->pkt_buf_sz, PCI_DMA_FROMDEVICE)); |
972 | xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfraglen = cpu_to_le32(xl_priv->pkt_buf_sz) | RXUPLASTFRAG; | 970 | xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfraglen = cpu_to_le32(xl_priv->pkt_buf_sz) | RXUPLASTFRAG; |
973 | adv_rx_ring(dev) ; | 971 | adv_rx_ring(dev) ; |
974 | xl_priv->xl_stats.rx_packets++ ; | 972 | dev->stats.rx_packets++ ; |
975 | xl_priv->xl_stats.rx_bytes += frame_length ; | 973 | dev->stats.rx_bytes += frame_length ; |
976 | 974 | ||
977 | netif_rx(skb2) ; | 975 | netif_rx(skb2) ; |
978 | } /* if multiple buffers */ | 976 | } /* if multiple buffers */ |
@@ -1182,8 +1180,8 @@ static int xl_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1182 | txd->buffer = cpu_to_le32(pci_map_single(xl_priv->pdev, skb->data, skb->len, PCI_DMA_TODEVICE)); | 1180 | txd->buffer = cpu_to_le32(pci_map_single(xl_priv->pdev, skb->data, skb->len, PCI_DMA_TODEVICE)); |
1183 | txd->buffer_length = cpu_to_le32(skb->len) | TXDNFRAGLAST; | 1181 | txd->buffer_length = cpu_to_le32(skb->len) | TXDNFRAGLAST; |
1184 | xl_priv->tx_ring_skb[tx_head] = skb ; | 1182 | xl_priv->tx_ring_skb[tx_head] = skb ; |
1185 | xl_priv->xl_stats.tx_packets++ ; | 1183 | dev->stats.tx_packets++ ; |
1186 | xl_priv->xl_stats.tx_bytes += skb->len ; | 1184 | dev->stats.tx_bytes += skb->len ; |
1187 | 1185 | ||
1188 | /* | 1186 | /* |
1189 | * Set the nextptr of the previous descriptor equal to this descriptor, add XL_TX_RING_SIZE -1 | 1187 | * Set the nextptr of the previous descriptor equal to this descriptor, add XL_TX_RING_SIZE -1 |
@@ -1463,12 +1461,6 @@ static void xl_srb_bh(struct net_device *dev) | |||
1463 | return ; | 1461 | return ; |
1464 | } | 1462 | } |
1465 | 1463 | ||
1466 | static struct net_device_stats * xl_get_stats(struct net_device *dev) | ||
1467 | { | ||
1468 | struct xl_private *xl_priv = netdev_priv(dev); | ||
1469 | return (struct net_device_stats *) &xl_priv->xl_stats; | ||
1470 | } | ||
1471 | |||
1472 | static int xl_set_mac_address (struct net_device *dev, void *addr) | 1464 | static int xl_set_mac_address (struct net_device *dev, void *addr) |
1473 | { | 1465 | { |
1474 | struct sockaddr *saddr = addr ; | 1466 | struct sockaddr *saddr = addr ; |
diff --git a/drivers/net/tokenring/3c359.h b/drivers/net/tokenring/3c359.h index b880cba0f6fd..0f8b4ec8695a 100644 --- a/drivers/net/tokenring/3c359.h +++ b/drivers/net/tokenring/3c359.h | |||
@@ -273,8 +273,6 @@ struct xl_private { | |||
273 | struct wait_queue *srb_wait; | 273 | struct wait_queue *srb_wait; |
274 | volatile int asb_queued; | 274 | volatile int asb_queued; |
275 | 275 | ||
276 | struct net_device_stats xl_stats ; | ||
277 | |||
278 | u16 mac_buffer ; | 276 | u16 mac_buffer ; |
279 | u16 xl_lan_status ; | 277 | u16 xl_lan_status ; |
280 | u8 xl_ring_speed ; | 278 | u8 xl_ring_speed ; |
diff --git a/drivers/net/tsi108_eth.c b/drivers/net/tsi108_eth.c index 6017d5267d08..c028facd9346 100644 --- a/drivers/net/tsi108_eth.c +++ b/drivers/net/tsi108_eth.c | |||
@@ -1526,7 +1526,7 @@ static int tsi108_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
1526 | struct tsi108_prv_data *data = netdev_priv(dev); | 1526 | struct tsi108_prv_data *data = netdev_priv(dev); |
1527 | unsigned long flags; | 1527 | unsigned long flags; |
1528 | int rc; | 1528 | int rc; |
1529 | 1529 | ||
1530 | spin_lock_irqsave(&data->txlock, flags); | 1530 | spin_lock_irqsave(&data->txlock, flags); |
1531 | rc = mii_ethtool_gset(&data->mii_if, cmd); | 1531 | rc = mii_ethtool_gset(&data->mii_if, cmd); |
1532 | spin_unlock_irqrestore(&data->txlock, flags); | 1532 | spin_unlock_irqrestore(&data->txlock, flags); |
@@ -1543,7 +1543,7 @@ static int tsi108_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
1543 | spin_lock_irqsave(&data->txlock, flags); | 1543 | spin_lock_irqsave(&data->txlock, flags); |
1544 | rc = mii_ethtool_sset(&data->mii_if, cmd); | 1544 | rc = mii_ethtool_sset(&data->mii_if, cmd); |
1545 | spin_unlock_irqrestore(&data->txlock, flags); | 1545 | spin_unlock_irqrestore(&data->txlock, flags); |
1546 | 1546 | ||
1547 | return rc; | 1547 | return rc; |
1548 | } | 1548 | } |
1549 | 1549 | ||
diff --git a/drivers/net/ucc_geth_ethtool.c b/drivers/net/ucc_geth_ethtool.c index 9a9622c13e2b..33200038a14d 100644 --- a/drivers/net/ucc_geth_ethtool.c +++ b/drivers/net/ucc_geth_ethtool.c | |||
@@ -5,7 +5,7 @@ | |||
5 | * | 5 | * |
6 | * Author: Li Yang <leoli@freescale.com> | 6 | * Author: Li Yang <leoli@freescale.com> |
7 | * | 7 | * |
8 | * Limitation: | 8 | * Limitation: |
9 | * Can only get/set setttings of the first queue. | 9 | * Can only get/set setttings of the first queue. |
10 | * Need to re-open the interface manually after changing some paramters. | 10 | * Need to re-open the interface manually after changing some paramters. |
11 | * | 11 | * |
@@ -165,7 +165,7 @@ uec_set_pauseparam(struct net_device *netdev, | |||
165 | 165 | ||
166 | ugeth->ug_info->receiveFlowControl = pause->rx_pause; | 166 | ugeth->ug_info->receiveFlowControl = pause->rx_pause; |
167 | ugeth->ug_info->transmitFlowControl = pause->tx_pause; | 167 | ugeth->ug_info->transmitFlowControl = pause->tx_pause; |
168 | 168 | ||
169 | if (ugeth->phydev->autoneg) { | 169 | if (ugeth->phydev->autoneg) { |
170 | if (netif_running(netdev)) { | 170 | if (netif_running(netdev)) { |
171 | /* FIXME: automatically restart */ | 171 | /* FIXME: automatically restart */ |