aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2008-05-30 12:49:53 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-05-30 22:17:57 -0400
commitf8f31544bf12e0934acb197889215bdc41762912 (patch)
tree0a0eb16882cbcfc53383cc321ba0c3548ef6c268
parent41873e9aff0632d80c74380d58a89e8d420151bd (diff)
tlan: use netdevice stats
Use new netdevice common stats area. Compile tested only. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
-rw-r--r--drivers/net/tlan.c33
-rw-r--r--drivers/net/tlan.h1
2 files changed, 16 insertions, 18 deletions
diff --git a/drivers/net/tlan.c b/drivers/net/tlan.c
index d1633fbf46ce..c14d2919c48a 100644
--- a/drivers/net/tlan.c
+++ b/drivers/net/tlan.c
@@ -1276,7 +1276,7 @@ static struct net_device_stats *TLan_GetStats( struct net_device *dev )
1276 TLan_PrintList( priv->txList + i, "TX", i ); 1276 TLan_PrintList( priv->txList + i, "TX", i );
1277 } 1277 }
1278 1278
1279 return ( &( (TLanPrivateInfo *) netdev_priv(dev) )->stats ); 1279 return &dev->stats;
1280 1280
1281} /* TLan_GetStats */ 1281} /* TLan_GetStats */
1282 1282
@@ -1434,7 +1434,7 @@ static u32 TLan_HandleTxEOF( struct net_device *dev, u16 host_int )
1434 if ( tmpCStat & TLAN_CSTAT_EOC ) 1434 if ( tmpCStat & TLAN_CSTAT_EOC )
1435 eoc = 1; 1435 eoc = 1;
1436 1436
1437 priv->stats.tx_bytes += head_list->frameSize; 1437 dev->stats.tx_bytes += head_list->frameSize;
1438 1438
1439 head_list->cStat = TLAN_CSTAT_UNUSED; 1439 head_list->cStat = TLAN_CSTAT_UNUSED;
1440 netif_start_queue(dev); 1440 netif_start_queue(dev);
@@ -1564,7 +1564,7 @@ static u32 TLan_HandleRxEOF( struct net_device *dev, u16 host_int )
1564 skb_reserve(skb, 2); 1564 skb_reserve(skb, 2);
1565 t = (void *) skb_put(skb, frameSize); 1565 t = (void *) skb_put(skb, frameSize);
1566 1566
1567 priv->stats.rx_bytes += head_list->frameSize; 1567 dev->stats.rx_bytes += head_list->frameSize;
1568 1568
1569 memcpy( t, head_buffer, frameSize ); 1569 memcpy( t, head_buffer, frameSize );
1570 skb->protocol = eth_type_trans( skb, dev ); 1570 skb->protocol = eth_type_trans( skb, dev );
@@ -1586,7 +1586,7 @@ static u32 TLan_HandleRxEOF( struct net_device *dev, u16 host_int )
1586 pci_unmap_single(priv->pciDev, head_list->buffer[0].address, TLAN_MAX_FRAME_SIZE, PCI_DMA_FROMDEVICE); 1586 pci_unmap_single(priv->pciDev, head_list->buffer[0].address, TLAN_MAX_FRAME_SIZE, PCI_DMA_FROMDEVICE);
1587 skb_trim( skb, frameSize ); 1587 skb_trim( skb, frameSize );
1588 1588
1589 priv->stats.rx_bytes += frameSize; 1589 dev->stats.rx_bytes += frameSize;
1590 1590
1591 skb->protocol = eth_type_trans( skb, dev ); 1591 skb->protocol = eth_type_trans( skb, dev );
1592 netif_rx( skb ); 1592 netif_rx( skb );
@@ -2142,7 +2142,6 @@ static void TLan_PrintList( TLanList *list, char *type, int num)
2142 2142
2143static void TLan_ReadAndClearStats( struct net_device *dev, int record ) 2143static void TLan_ReadAndClearStats( struct net_device *dev, int record )
2144{ 2144{
2145 TLanPrivateInfo *priv = netdev_priv(dev);
2146 u32 tx_good, tx_under; 2145 u32 tx_good, tx_under;
2147 u32 rx_good, rx_over; 2146 u32 rx_good, rx_over;
2148 u32 def_tx, crc, code; 2147 u32 def_tx, crc, code;
@@ -2179,18 +2178,18 @@ static void TLan_ReadAndClearStats( struct net_device *dev, int record )
2179 loss = inb( dev->base_addr + TLAN_DIO_DATA + 2 ); 2178 loss = inb( dev->base_addr + TLAN_DIO_DATA + 2 );
2180 2179
2181 if ( record ) { 2180 if ( record ) {
2182 priv->stats.rx_packets += rx_good; 2181 dev->stats.rx_packets += rx_good;
2183 priv->stats.rx_errors += rx_over + crc + code; 2182 dev->stats.rx_errors += rx_over + crc + code;
2184 priv->stats.tx_packets += tx_good; 2183 dev->stats.tx_packets += tx_good;
2185 priv->stats.tx_errors += tx_under + loss; 2184 dev->stats.tx_errors += tx_under + loss;
2186 priv->stats.collisions += multi_col + single_col + excess_col + late_col; 2185 dev->stats.collisions += multi_col + single_col + excess_col + late_col;
2187 2186
2188 priv->stats.rx_over_errors += rx_over; 2187 dev->stats.rx_over_errors += rx_over;
2189 priv->stats.rx_crc_errors += crc; 2188 dev->stats.rx_crc_errors += crc;
2190 priv->stats.rx_frame_errors += code; 2189 dev->stats.rx_frame_errors += code;
2191 2190
2192 priv->stats.tx_aborted_errors += tx_under; 2191 dev->stats.tx_aborted_errors += tx_under;
2193 priv->stats.tx_carrier_errors += loss; 2192 dev->stats.tx_carrier_errors += loss;
2194 } 2193 }
2195 2194
2196} /* TLan_ReadAndClearStats */ 2195} /* TLan_ReadAndClearStats */
diff --git a/drivers/net/tlan.h b/drivers/net/tlan.h
index 41ce0b665937..f2fd3167be04 100644
--- a/drivers/net/tlan.h
+++ b/drivers/net/tlan.h
@@ -194,7 +194,6 @@ typedef struct tlan_private_tag {
194 u32 timerSetAt; 194 u32 timerSetAt;
195 u32 timerType; 195 u32 timerType;
196 struct timer_list timer; 196 struct timer_list timer;
197 struct net_device_stats stats;
198 struct board *adapter; 197 struct board *adapter;
199 u32 adapterRev; 198 u32 adapterRev;
200 u32 aui; 199 u32 aui;