aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ni52.c
diff options
context:
space:
mode:
authorKulikov Vasiliy <segooon@gmail.com>2010-07-04 22:14:23 -0400
committerDavid S. Miller <davem@davemloft.net>2010-07-05 22:41:19 -0400
commit4265e669ccafec0246f0bc45b7f461ff18da5acd (patch)
treefdd006bfd0d9573b89e1ca997d999ee554bd7a22 /drivers/net/ni52.c
parente929bc330d4820559091a8ce32fea60848751297 (diff)
ni52: Use the instance of net_device_stats from net_device.
Since net_device has an instance of net_device_stats, we can remove the instance of this from the adapter structure. Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ni52.c')
-rw-r--r--drivers/net/ni52.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/drivers/net/ni52.c b/drivers/net/ni52.c
index 9bddb5fa7a96..33618edc61f9 100644
--- a/drivers/net/ni52.c
+++ b/drivers/net/ni52.c
@@ -185,7 +185,6 @@ static void ni52_xmt_int(struct net_device *dev);
185static void ni52_rnr_int(struct net_device *dev); 185static void ni52_rnr_int(struct net_device *dev);
186 186
187struct priv { 187struct priv {
188 struct net_device_stats stats;
189 char __iomem *base; 188 char __iomem *base;
190 char __iomem *mapped; 189 char __iomem *mapped;
191 char __iomem *memtop; 190 char __iomem *memtop;
@@ -972,10 +971,10 @@ static void ni52_rcv_int(struct net_device *dev)
972 memcpy_fromio(skb->data, p->base + readl(&rbd->buffer), totlen); 971 memcpy_fromio(skb->data, p->base + readl(&rbd->buffer), totlen);
973 skb->protocol = eth_type_trans(skb, dev); 972 skb->protocol = eth_type_trans(skb, dev);
974 netif_rx(skb); 973 netif_rx(skb);
975 p->stats.rx_packets++; 974 dev->stats.rx_packets++;
976 p->stats.rx_bytes += totlen; 975 dev->stats.rx_bytes += totlen;
977 } else 976 } else
978 p->stats.rx_dropped++; 977 dev->stats.rx_dropped++;
979 } else { 978 } else {
980 int rstat; 979 int rstat;
981 /* free all RBD's until RBD_LAST is set */ 980 /* free all RBD's until RBD_LAST is set */
@@ -993,12 +992,12 @@ static void ni52_rcv_int(struct net_device *dev)
993 writew(0, &rbd->status); 992 writew(0, &rbd->status);
994 printk(KERN_ERR "%s: received oversized frame! length: %d\n", 993 printk(KERN_ERR "%s: received oversized frame! length: %d\n",
995 dev->name, totlen); 994 dev->name, totlen);
996 p->stats.rx_dropped++; 995 dev->stats.rx_dropped++;
997 } 996 }
998 } else {/* frame !(ok), only with 'save-bad-frames' */ 997 } else {/* frame !(ok), only with 'save-bad-frames' */
999 printk(KERN_ERR "%s: oops! rfd-error-status: %04x\n", 998 printk(KERN_ERR "%s: oops! rfd-error-status: %04x\n",
1000 dev->name, status); 999 dev->name, status);
1001 p->stats.rx_errors++; 1000 dev->stats.rx_errors++;
1002 } 1001 }
1003 writeb(0, &p->rfd_top->stat_high); 1002 writeb(0, &p->rfd_top->stat_high);
1004 writeb(RFD_SUSP, &p->rfd_top->last); /* maybe exchange by RFD_LAST */ 1003 writeb(RFD_SUSP, &p->rfd_top->last); /* maybe exchange by RFD_LAST */
@@ -1043,7 +1042,7 @@ static void ni52_rnr_int(struct net_device *dev)
1043{ 1042{
1044 struct priv *p = netdev_priv(dev); 1043 struct priv *p = netdev_priv(dev);
1045 1044
1046 p->stats.rx_errors++; 1045 dev->stats.rx_errors++;
1047 1046
1048 wait_for_scb_cmd(dev); /* wait for the last cmd, WAIT_4_FULLSTAT?? */ 1047 wait_for_scb_cmd(dev); /* wait for the last cmd, WAIT_4_FULLSTAT?? */
1049 writeb(RUC_ABORT, &p->scb->cmd_ruc); /* usually the RU is in the 'no resource'-state .. abort it now. */ 1048 writeb(RUC_ABORT, &p->scb->cmd_ruc); /* usually the RU is in the 'no resource'-state .. abort it now. */
@@ -1076,29 +1075,29 @@ static void ni52_xmt_int(struct net_device *dev)
1076 printk(KERN_ERR "%s: strange .. xmit-int without a 'COMPLETE'\n", dev->name); 1075 printk(KERN_ERR "%s: strange .. xmit-int without a 'COMPLETE'\n", dev->name);
1077 1076
1078 if (status & STAT_OK) { 1077 if (status & STAT_OK) {
1079 p->stats.tx_packets++; 1078 dev->stats.tx_packets++;
1080 p->stats.collisions += (status & TCMD_MAXCOLLMASK); 1079 dev->stats.collisions += (status & TCMD_MAXCOLLMASK);
1081 } else { 1080 } else {
1082 p->stats.tx_errors++; 1081 dev->stats.tx_errors++;
1083 if (status & TCMD_LATECOLL) { 1082 if (status & TCMD_LATECOLL) {
1084 printk(KERN_ERR "%s: late collision detected.\n", 1083 printk(KERN_ERR "%s: late collision detected.\n",
1085 dev->name); 1084 dev->name);
1086 p->stats.collisions++; 1085 dev->stats.collisions++;
1087 } else if (status & TCMD_NOCARRIER) { 1086 } else if (status & TCMD_NOCARRIER) {
1088 p->stats.tx_carrier_errors++; 1087 dev->stats.tx_carrier_errors++;
1089 printk(KERN_ERR "%s: no carrier detected.\n", 1088 printk(KERN_ERR "%s: no carrier detected.\n",
1090 dev->name); 1089 dev->name);
1091 } else if (status & TCMD_LOSTCTS) 1090 } else if (status & TCMD_LOSTCTS)
1092 printk(KERN_ERR "%s: loss of CTS detected.\n", 1091 printk(KERN_ERR "%s: loss of CTS detected.\n",
1093 dev->name); 1092 dev->name);
1094 else if (status & TCMD_UNDERRUN) { 1093 else if (status & TCMD_UNDERRUN) {
1095 p->stats.tx_fifo_errors++; 1094 dev->stats.tx_fifo_errors++;
1096 printk(KERN_ERR "%s: DMA underrun detected.\n", 1095 printk(KERN_ERR "%s: DMA underrun detected.\n",
1097 dev->name); 1096 dev->name);
1098 } else if (status & TCMD_MAXCOLL) { 1097 } else if (status & TCMD_MAXCOLL) {
1099 printk(KERN_ERR "%s: Max. collisions exceeded.\n", 1098 printk(KERN_ERR "%s: Max. collisions exceeded.\n",
1100 dev->name); 1099 dev->name);
1101 p->stats.collisions += 16; 1100 dev->stats.collisions += 16;
1102 } 1101 }
1103 } 1102 }
1104#if (NUM_XMIT_BUFFS > 1) 1103#if (NUM_XMIT_BUFFS > 1)
@@ -1286,12 +1285,12 @@ static struct net_device_stats *ni52_get_stats(struct net_device *dev)
1286 ovrn = readw(&p->scb->ovrn_errs); 1285 ovrn = readw(&p->scb->ovrn_errs);
1287 writew(0, &p->scb->ovrn_errs); 1286 writew(0, &p->scb->ovrn_errs);
1288 1287
1289 p->stats.rx_crc_errors += crc; 1288 dev->stats.rx_crc_errors += crc;
1290 p->stats.rx_fifo_errors += ovrn; 1289 dev->stats.rx_fifo_errors += ovrn;
1291 p->stats.rx_frame_errors += aln; 1290 dev->stats.rx_frame_errors += aln;
1292 p->stats.rx_dropped += rsc; 1291 dev->stats.rx_dropped += rsc;
1293 1292
1294 return &p->stats; 1293 return &dev->stats;
1295} 1294}
1296 1295
1297/******************************************************** 1296/********************************************************