aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sun3_82586.c
diff options
context:
space:
mode:
authorKulikov Vasiliy <segooon@gmail.com>2010-07-04 22:13:10 -0400
committerDavid S. Miller <davem@davemloft.net>2010-07-05 22:41:11 -0400
commit4e922723589926214c789df05384483a9530d66d (patch)
tree49ad2333957637dba25bcda64707da7da065873b /drivers/net/sun3_82586.c
parentfe76cda3081b502986f0c8b28b0cf8bfc27d44d5 (diff)
sun3_82586: 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/sun3_82586.c')
-rw-r--r--drivers/net/sun3_82586.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/drivers/net/sun3_82586.c b/drivers/net/sun3_82586.c
index 151312342243..b6ae53bada75 100644
--- a/drivers/net/sun3_82586.c
+++ b/drivers/net/sun3_82586.c
@@ -142,7 +142,6 @@ static void sun3_82586_rnr_int(struct net_device *dev);
142 142
143struct priv 143struct priv
144{ 144{
145 struct net_device_stats stats;
146 unsigned long base; 145 unsigned long base;
147 char *memtop; 146 char *memtop;
148 long int lock; 147 long int lock;
@@ -788,10 +787,10 @@ static void sun3_82586_rcv_int(struct net_device *dev)
788 skb_copy_to_linear_data(skb,(char *) p->base+swab32((unsigned long) rbd->buffer),totlen); 787 skb_copy_to_linear_data(skb,(char *) p->base+swab32((unsigned long) rbd->buffer),totlen);
789 skb->protocol=eth_type_trans(skb,dev); 788 skb->protocol=eth_type_trans(skb,dev);
790 netif_rx(skb); 789 netif_rx(skb);
791 p->stats.rx_packets++; 790 dev->stats.rx_packets++;
792 } 791 }
793 else 792 else
794 p->stats.rx_dropped++; 793 dev->stats.rx_dropped++;
795 } 794 }
796 else 795 else
797 { 796 {
@@ -812,13 +811,13 @@ static void sun3_82586_rcv_int(struct net_device *dev)
812 totlen += rstat & RBD_MASK; 811 totlen += rstat & RBD_MASK;
813 rbd->status = 0; 812 rbd->status = 0;
814 printk("%s: received oversized frame! length: %d\n",dev->name,totlen); 813 printk("%s: received oversized frame! length: %d\n",dev->name,totlen);
815 p->stats.rx_dropped++; 814 dev->stats.rx_dropped++;
816 } 815 }
817 } 816 }
818 else /* frame !(ok), only with 'save-bad-frames' */ 817 else /* frame !(ok), only with 'save-bad-frames' */
819 { 818 {
820 printk("%s: oops! rfd-error-status: %04x\n",dev->name,status); 819 printk("%s: oops! rfd-error-status: %04x\n",dev->name,status);
821 p->stats.rx_errors++; 820 dev->stats.rx_errors++;
822 } 821 }
823 p->rfd_top->stat_high = 0; 822 p->rfd_top->stat_high = 0;
824 p->rfd_top->last = RFD_SUSP; /* maybe exchange by RFD_LAST */ 823 p->rfd_top->last = RFD_SUSP; /* maybe exchange by RFD_LAST */
@@ -885,7 +884,7 @@ static void sun3_82586_rnr_int(struct net_device *dev)
885{ 884{
886 struct priv *p = netdev_priv(dev); 885 struct priv *p = netdev_priv(dev);
887 886
888 p->stats.rx_errors++; 887 dev->stats.rx_errors++;
889 888
890 WAIT_4_SCB_CMD(); /* wait for the last cmd, WAIT_4_FULLSTAT?? */ 889 WAIT_4_SCB_CMD(); /* wait for the last cmd, WAIT_4_FULLSTAT?? */
891 p->scb->cmd_ruc = RUC_ABORT; /* usually the RU is in the 'no resource'-state .. abort it now. */ 890 p->scb->cmd_ruc = RUC_ABORT; /* usually the RU is in the 'no resource'-state .. abort it now. */
@@ -918,29 +917,29 @@ static void sun3_82586_xmt_int(struct net_device *dev)
918 917
919 if(status & STAT_OK) 918 if(status & STAT_OK)
920 { 919 {
921 p->stats.tx_packets++; 920 dev->stats.tx_packets++;
922 p->stats.collisions += (status & TCMD_MAXCOLLMASK); 921 dev->stats.collisions += (status & TCMD_MAXCOLLMASK);
923 } 922 }
924 else 923 else
925 { 924 {
926 p->stats.tx_errors++; 925 dev->stats.tx_errors++;
927 if(status & TCMD_LATECOLL) { 926 if(status & TCMD_LATECOLL) {
928 printk("%s: late collision detected.\n",dev->name); 927 printk("%s: late collision detected.\n",dev->name);
929 p->stats.collisions++; 928 dev->stats.collisions++;
930 } 929 }
931 else if(status & TCMD_NOCARRIER) { 930 else if(status & TCMD_NOCARRIER) {
932 p->stats.tx_carrier_errors++; 931 dev->stats.tx_carrier_errors++;
933 printk("%s: no carrier detected.\n",dev->name); 932 printk("%s: no carrier detected.\n",dev->name);
934 } 933 }
935 else if(status & TCMD_LOSTCTS) 934 else if(status & TCMD_LOSTCTS)
936 printk("%s: loss of CTS detected.\n",dev->name); 935 printk("%s: loss of CTS detected.\n",dev->name);
937 else if(status & TCMD_UNDERRUN) { 936 else if(status & TCMD_UNDERRUN) {
938 p->stats.tx_fifo_errors++; 937 dev->stats.tx_fifo_errors++;
939 printk("%s: DMA underrun detected.\n",dev->name); 938 printk("%s: DMA underrun detected.\n",dev->name);
940 } 939 }
941 else if(status & TCMD_MAXCOLL) { 940 else if(status & TCMD_MAXCOLL) {
942 printk("%s: Max. collisions exceeded.\n",dev->name); 941 printk("%s: Max. collisions exceeded.\n",dev->name);
943 p->stats.collisions += 16; 942 dev->stats.collisions += 16;
944 } 943 }
945 } 944 }
946 945
@@ -1129,12 +1128,12 @@ static struct net_device_stats *sun3_82586_get_stats(struct net_device *dev)
1129 ovrn = swab16(p->scb->ovrn_errs); 1128 ovrn = swab16(p->scb->ovrn_errs);
1130 p->scb->ovrn_errs = 0; 1129 p->scb->ovrn_errs = 0;
1131 1130
1132 p->stats.rx_crc_errors += crc; 1131 dev->stats.rx_crc_errors += crc;
1133 p->stats.rx_fifo_errors += ovrn; 1132 dev->stats.rx_fifo_errors += ovrn;
1134 p->stats.rx_frame_errors += aln; 1133 dev->stats.rx_frame_errors += aln;
1135 p->stats.rx_dropped += rsc; 1134 dev->stats.rx_dropped += rsc;
1136 1135
1137 return &p->stats; 1136 return &dev->stats;
1138} 1137}
1139 1138
1140/******************************************************** 1139/********************************************************