Commit dcc59a97 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

olympic: convert to internal network device stats

Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent be188278
...@@ -187,7 +187,6 @@ static int olympic_close(struct net_device *dev); ...@@ -187,7 +187,6 @@ static int olympic_close(struct net_device *dev);
static void olympic_set_rx_mode(struct net_device *dev); static void olympic_set_rx_mode(struct net_device *dev);
static void olympic_freemem(struct net_device *dev) ; static void olympic_freemem(struct net_device *dev) ;
static irqreturn_t olympic_interrupt(int irq, void *dev_id); static irqreturn_t olympic_interrupt(int irq, void *dev_id);
static struct net_device_stats * olympic_get_stats(struct net_device *dev);
static int olympic_set_mac_address(struct net_device *dev, void *addr) ; static int olympic_set_mac_address(struct net_device *dev, void *addr) ;
static void olympic_arb_cmd(struct net_device *dev); static void olympic_arb_cmd(struct net_device *dev);
static int olympic_change_mtu(struct net_device *dev, int mtu); static int olympic_change_mtu(struct net_device *dev, int mtu);
...@@ -259,7 +258,6 @@ static int __devinit olympic_probe(struct pci_dev *pdev, const struct pci_device ...@@ -259,7 +258,6 @@ static int __devinit olympic_probe(struct pci_dev *pdev, const struct pci_device
dev->stop=&olympic_close; dev->stop=&olympic_close;
dev->do_ioctl=NULL; dev->do_ioctl=NULL;
dev->set_multicast_list=&olympic_set_rx_mode; dev->set_multicast_list=&olympic_set_rx_mode;
dev->get_stats=&olympic_get_stats ;
dev->set_mac_address=&olympic_set_mac_address ; dev->set_mac_address=&olympic_set_mac_address ;
SET_NETDEV_DEV(dev, &pdev->dev); SET_NETDEV_DEV(dev, &pdev->dev);
...@@ -785,7 +783,7 @@ static void olympic_rx(struct net_device *dev) ...@@ -785,7 +783,7 @@ static void olympic_rx(struct net_device *dev)
} }
olympic_priv->rx_ring_last_received += i ; olympic_priv->rx_ring_last_received += i ;
olympic_priv->rx_ring_last_received &= (OLYMPIC_RX_RING_SIZE -1) ; olympic_priv->rx_ring_last_received &= (OLYMPIC_RX_RING_SIZE -1) ;
olympic_priv->olympic_stats.rx_errors++; dev->stats.rx_errors++;
} else { } else {
if (buffer_cnt == 1) { if (buffer_cnt == 1) {
...@@ -796,7 +794,7 @@ static void olympic_rx(struct net_device *dev) ...@@ -796,7 +794,7 @@ static void olympic_rx(struct net_device *dev)
if (skb == NULL) { if (skb == NULL) {
printk(KERN_WARNING "%s: Not enough memory to copy packet to upper layers. \n",dev->name) ; printk(KERN_WARNING "%s: Not enough memory to copy packet to upper layers. \n",dev->name) ;
olympic_priv->olympic_stats.rx_dropped++ ; dev->stats.rx_dropped++;
/* Update counters even though we don't transfer the frame */ /* Update counters even though we don't transfer the frame */
olympic_priv->rx_ring_last_received += i ; olympic_priv->rx_ring_last_received += i ;
olympic_priv->rx_ring_last_received &= (OLYMPIC_RX_RING_SIZE -1) ; olympic_priv->rx_ring_last_received &= (OLYMPIC_RX_RING_SIZE -1) ;
...@@ -862,8 +860,8 @@ static void olympic_rx(struct net_device *dev) ...@@ -862,8 +860,8 @@ static void olympic_rx(struct net_device *dev)
skb->protocol = tr_type_trans(skb,dev); skb->protocol = tr_type_trans(skb,dev);
netif_rx(skb) ; netif_rx(skb) ;
} }
olympic_priv->olympic_stats.rx_packets++ ; dev->stats.rx_packets++ ;
olympic_priv->olympic_stats.rx_bytes += length ; dev->stats.rx_bytes += length ;
} /* if skb == null */ } /* if skb == null */
} /* If status & 0x3b */ } /* If status & 0x3b */
...@@ -971,8 +969,8 @@ static irqreturn_t olympic_interrupt(int irq, void *dev_id) ...@@ -971,8 +969,8 @@ static irqreturn_t olympic_interrupt(int irq, void *dev_id)
olympic_priv->tx_ring_last_status++; olympic_priv->tx_ring_last_status++;
olympic_priv->tx_ring_last_status &= (OLYMPIC_TX_RING_SIZE-1); olympic_priv->tx_ring_last_status &= (OLYMPIC_TX_RING_SIZE-1);
olympic_priv->free_tx_ring_entries++; olympic_priv->free_tx_ring_entries++;
olympic_priv->olympic_stats.tx_bytes += olympic_priv->tx_ring_skb[olympic_priv->tx_ring_last_status]->len; dev->stats.tx_bytes += olympic_priv->tx_ring_skb[olympic_priv->tx_ring_last_status]->len;
olympic_priv->olympic_stats.tx_packets++ ; dev->stats.tx_packets++ ;
pci_unmap_single(olympic_priv->pdev, pci_unmap_single(olympic_priv->pdev,
le32_to_cpu(olympic_priv->olympic_tx_ring[olympic_priv->tx_ring_last_status].buffer), le32_to_cpu(olympic_priv->olympic_tx_ring[olympic_priv->tx_ring_last_status].buffer),
olympic_priv->tx_ring_skb[olympic_priv->tx_ring_last_status]->len,PCI_DMA_TODEVICE); olympic_priv->tx_ring_skb[olympic_priv->tx_ring_last_status]->len,PCI_DMA_TODEVICE);
...@@ -1344,13 +1342,6 @@ static void olympic_srb_bh(struct net_device *dev) ...@@ -1344,13 +1342,6 @@ static void olympic_srb_bh(struct net_device *dev)
} }
static struct net_device_stats * olympic_get_stats(struct net_device *dev)
{
struct olympic_private *olympic_priv ;
olympic_priv=netdev_priv(dev);
return (struct net_device_stats *) &olympic_priv->olympic_stats;
}
static int olympic_set_mac_address (struct net_device *dev, void *addr) static int olympic_set_mac_address (struct net_device *dev, void *addr)
{ {
struct sockaddr *saddr = addr ; struct sockaddr *saddr = addr ;
......
...@@ -275,7 +275,6 @@ struct olympic_private { ...@@ -275,7 +275,6 @@ struct olympic_private {
struct sk_buff *tx_ring_skb[OLYMPIC_TX_RING_SIZE], *rx_ring_skb[OLYMPIC_RX_RING_SIZE]; struct sk_buff *tx_ring_skb[OLYMPIC_TX_RING_SIZE], *rx_ring_skb[OLYMPIC_RX_RING_SIZE];
int tx_ring_free, tx_ring_last_status, rx_ring_last_received,rx_status_last_received, free_tx_ring_entries; int tx_ring_free, tx_ring_last_status, rx_ring_last_received,rx_status_last_received, free_tx_ring_entries;
struct net_device_stats olympic_stats ;
u16 olympic_lan_status ; u16 olympic_lan_status ;
u8 olympic_ring_speed ; u8 olympic_ring_speed ;
u16 pkt_buf_sz ; u16 pkt_buf_sz ;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment