@@ -359,7 +359,6 @@ typedef struct _mace_statistics {
359359
360360typedef struct _mace_private {
361361 struct pcmcia_device * p_dev ;
362- struct net_device_stats linux_stats ; /* Linux statistics counters */
363362 mace_statistics mace_stats ; /* MACE chip statistics counters */
364363
365364 /* restore_multicast_list() state variables */
@@ -879,7 +878,7 @@ static netdev_tx_t mace_start_xmit(struct sk_buff *skb,
879878 service a transmit interrupt while we are in here.
880879 */
881880
882- lp -> linux_stats .tx_bytes += skb -> len ;
881+ dev -> stats .tx_bytes += skb -> len ;
883882 lp -> tx_free_frames -- ;
884883
885884 /* WARNING: Write the _exact_ number of bytes written in the header! */
@@ -967,7 +966,7 @@ static irqreturn_t mace_interrupt(int irq, void *dev_id)
967966
968967 fifofc = inb (ioaddr + AM2150_MACE_BASE + MACE_FIFOFC );
969968 if ((fifofc & MACE_FIFOFC_XMTFC )== 0 ) {
970- lp -> linux_stats .tx_errors ++ ;
969+ dev -> stats .tx_errors ++ ;
971970 outb (0xFF , ioaddr + AM2150_XMT_SKIP );
972971 }
973972
@@ -1016,7 +1015,7 @@ static irqreturn_t mace_interrupt(int irq, void *dev_id)
10161015
10171016 } /* if (xmtfs & MACE_XMTFS_XMTSV) */
10181017
1019- lp -> linux_stats .tx_packets ++ ;
1018+ dev -> stats .tx_packets ++ ;
10201019 lp -> tx_free_frames ++ ;
10211020 netif_wake_queue (dev );
10221021 } /* if (status & MACE_IR_XMTINT) */
@@ -1077,7 +1076,7 @@ static int mace_rx(struct net_device *dev, unsigned char RxCnt)
10771076 " 0x%X.\n" , dev -> name , rx_framecnt , rx_status );
10781077
10791078 if (rx_status & MACE_RCVFS_RCVSTS ) { /* Error, update stats. */
1080- lp -> linux_stats .rx_errors ++ ;
1079+ dev -> stats .rx_errors ++ ;
10811080 if (rx_status & MACE_RCVFS_OFLO ) {
10821081 lp -> mace_stats .oflo ++ ;
10831082 }
@@ -1114,14 +1113,14 @@ static int mace_rx(struct net_device *dev, unsigned char RxCnt)
11141113
11151114 netif_rx (skb ); /* Send the packet to the upper (protocol) layers. */
11161115
1117- lp -> linux_stats .rx_packets ++ ;
1118- lp -> linux_stats .rx_bytes += pkt_len ;
1116+ dev -> stats .rx_packets ++ ;
1117+ dev -> stats .rx_bytes += pkt_len ;
11191118 outb (0xFF , ioaddr + AM2150_RCV_NEXT ); /* skip to next frame */
11201119 continue ;
11211120 } else {
11221121 pr_debug ("%s: couldn't allocate a sk_buff of size"
11231122 " %d.\n" , dev -> name , pkt_len );
1124- lp -> linux_stats .rx_dropped ++ ;
1123+ dev -> stats .rx_dropped ++ ;
11251124 }
11261125 }
11271126 outb (0xFF , ioaddr + AM2150_RCV_NEXT ); /* skip to next frame */
@@ -1231,36 +1230,36 @@ static void update_stats(unsigned int ioaddr, struct net_device *dev)
12311230 lp -> mace_stats .rntpc += mace_read (lp , ioaddr , MACE_RNTPC );
12321231 lp -> mace_stats .mpc += mace_read (lp , ioaddr , MACE_MPC );
12331232 /* At this point, mace_stats is fully updated for this call.
1234- We may now update the linux_stats . */
1233+ We may now update the netdev stats . */
12351234
1236- /* The MACE has no equivalent for linux_stats field which are commented
1235+ /* The MACE has no equivalent for netdev stats field which are commented
12371236 out. */
12381237
1239- /* lp->linux_stats .multicast; */
1240- lp -> linux_stats .collisions =
1238+ /* dev->stats .multicast; */
1239+ dev -> stats .collisions =
12411240 lp -> mace_stats .rcvcco * 256 + lp -> mace_stats .rcvcc ;
12421241 /* Collision: The MACE may retry sending a packet 15 times
12431242 before giving up. The retry count is in XMTRC.
12441243 Does each retry constitute a collision?
12451244 If so, why doesn't the RCVCC record these collisions? */
12461245
12471246 /* detailed rx_errors: */
1248- lp -> linux_stats .rx_length_errors =
1247+ dev -> stats .rx_length_errors =
12491248 lp -> mace_stats .rntpco * 256 + lp -> mace_stats .rntpc ;
1250- /* lp->linux_stats .rx_over_errors */
1251- lp -> linux_stats .rx_crc_errors = lp -> mace_stats .fcs ;
1252- lp -> linux_stats .rx_frame_errors = lp -> mace_stats .fram ;
1253- lp -> linux_stats .rx_fifo_errors = lp -> mace_stats .oflo ;
1254- lp -> linux_stats .rx_missed_errors =
1249+ /* dev->stats .rx_over_errors */
1250+ dev -> stats .rx_crc_errors = lp -> mace_stats .fcs ;
1251+ dev -> stats .rx_frame_errors = lp -> mace_stats .fram ;
1252+ dev -> stats .rx_fifo_errors = lp -> mace_stats .oflo ;
1253+ dev -> stats .rx_missed_errors =
12551254 lp -> mace_stats .mpco * 256 + lp -> mace_stats .mpc ;
12561255
12571256 /* detailed tx_errors */
1258- lp -> linux_stats .tx_aborted_errors = lp -> mace_stats .rtry ;
1259- lp -> linux_stats .tx_carrier_errors = lp -> mace_stats .lcar ;
1257+ dev -> stats .tx_aborted_errors = lp -> mace_stats .rtry ;
1258+ dev -> stats .tx_carrier_errors = lp -> mace_stats .lcar ;
12601259 /* LCAR usually results from bad cabling. */
1261- lp -> linux_stats .tx_fifo_errors = lp -> mace_stats .uflo ;
1262- lp -> linux_stats .tx_heartbeat_errors = lp -> mace_stats .cerr ;
1263- /* lp->linux_stats .tx_window_errors; */
1260+ dev -> stats .tx_fifo_errors = lp -> mace_stats .uflo ;
1261+ dev -> stats .tx_heartbeat_errors = lp -> mace_stats .cerr ;
1262+ /* dev->stats .tx_window_errors; */
12641263} /* update_stats */
12651264
12661265/* ----------------------------------------------------------------------------
@@ -1274,10 +1273,10 @@ static struct net_device_stats *mace_get_stats(struct net_device *dev)
12741273 update_stats (dev -> base_addr , dev );
12751274
12761275 pr_debug ("%s: updating the statistics.\n" , dev -> name );
1277- pr_linux_stats (& lp -> linux_stats );
1276+ pr_linux_stats (& dev -> stats );
12781277 pr_mace_stats (& lp -> mace_stats );
12791278
1280- return & lp -> linux_stats ;
1279+ return & dev -> stats ;
12811280} /* net_device_stats */
12821281
12831282/* ----------------------------------------------------------------------------
0 commit comments