diff options
author | Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | 2008-04-29 05:44:20 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-05-13 01:35:25 -0400 |
commit | 94f9d298ce215dada7ceaeb03e62f61d754d5705 (patch) | |
tree | bd67b74214a1870df8df3b372dfd94b833f9acbc /drivers/net/tokenring/3c359.c | |
parent | 4711c841e4547a41f596bcf6c97473bc6a15126d (diff) |
3c359: use netstats in net_device structure
Use net_device_stats from net_device structure instead of local.
Kill xl_get_stats function, because by default it is used identical
internal_stats function from net/core/dev.c
Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/tokenring/3c359.c')
-rw-r--r-- | drivers/net/tokenring/3c359.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/drivers/net/tokenring/3c359.c b/drivers/net/tokenring/3c359.c index 45208a0e69a0..7766cde0d63d 100644 --- a/drivers/net/tokenring/3c359.c +++ b/drivers/net/tokenring/3c359.c | |||
@@ -132,7 +132,6 @@ static void xl_dn_comp(struct net_device *dev); | |||
132 | static int xl_close(struct net_device *dev); | 132 | static int xl_close(struct net_device *dev); |
133 | static void xl_set_rx_mode(struct net_device *dev); | 133 | static void xl_set_rx_mode(struct net_device *dev); |
134 | static irqreturn_t xl_interrupt(int irq, void *dev_id); | 134 | static irqreturn_t xl_interrupt(int irq, void *dev_id); |
135 | static struct net_device_stats * xl_get_stats(struct net_device *dev); | ||
136 | static int xl_set_mac_address(struct net_device *dev, void *addr) ; | 135 | static int xl_set_mac_address(struct net_device *dev, void *addr) ; |
137 | static void xl_arb_cmd(struct net_device *dev); | 136 | static void xl_arb_cmd(struct net_device *dev); |
138 | static void xl_asb_cmd(struct net_device *dev) ; | 137 | static void xl_asb_cmd(struct net_device *dev) ; |
@@ -343,7 +342,6 @@ static int __devinit xl_probe(struct pci_dev *pdev, | |||
343 | dev->stop=&xl_close; | 342 | dev->stop=&xl_close; |
344 | dev->do_ioctl=NULL; | 343 | dev->do_ioctl=NULL; |
345 | dev->set_multicast_list=&xl_set_rx_mode; | 344 | dev->set_multicast_list=&xl_set_rx_mode; |
346 | dev->get_stats=&xl_get_stats ; | ||
347 | dev->set_mac_address=&xl_set_mac_address ; | 345 | dev->set_mac_address=&xl_set_mac_address ; |
348 | SET_NETDEV_DEV(dev, &pdev->dev); | 346 | SET_NETDEV_DEV(dev, &pdev->dev); |
349 | 347 | ||
@@ -921,7 +919,7 @@ static void xl_rx(struct net_device *dev) | |||
921 | adv_rx_ring(dev) ; | 919 | adv_rx_ring(dev) ; |
922 | 920 | ||
923 | adv_rx_ring(dev) ; /* One more time just for luck :) */ | 921 | adv_rx_ring(dev) ; /* One more time just for luck :) */ |
924 | xl_priv->xl_stats.rx_dropped++ ; | 922 | dev->stats.rx_dropped++ ; |
925 | 923 | ||
926 | writel(ACK_INTERRUPT | UPCOMPACK | LATCH_ACK , xl_mmio + MMIO_COMMAND) ; | 924 | writel(ACK_INTERRUPT | UPCOMPACK | LATCH_ACK , xl_mmio + MMIO_COMMAND) ; |
927 | return ; | 925 | return ; |
@@ -957,7 +955,7 @@ static void xl_rx(struct net_device *dev) | |||
957 | if (skb==NULL) { /* Still need to fix the rx ring */ | 955 | if (skb==NULL) { /* Still need to fix the rx ring */ |
958 | printk(KERN_WARNING "%s: dev_alloc_skb failed in rx, single buffer \n",dev->name) ; | 956 | printk(KERN_WARNING "%s: dev_alloc_skb failed in rx, single buffer \n",dev->name) ; |
959 | adv_rx_ring(dev) ; | 957 | adv_rx_ring(dev) ; |
960 | xl_priv->xl_stats.rx_dropped++ ; | 958 | dev->stats.rx_dropped++ ; |
961 | writel(ACK_INTERRUPT | UPCOMPACK | LATCH_ACK , xl_mmio + MMIO_COMMAND) ; | 959 | writel(ACK_INTERRUPT | UPCOMPACK | LATCH_ACK , xl_mmio + MMIO_COMMAND) ; |
962 | return ; | 960 | return ; |
963 | } | 961 | } |
@@ -971,8 +969,8 @@ static void xl_rx(struct net_device *dev) | |||
971 | xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr = cpu_to_le32(pci_map_single(xl_priv->pdev,skb->data,xl_priv->pkt_buf_sz, PCI_DMA_FROMDEVICE)); | 969 | xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr = cpu_to_le32(pci_map_single(xl_priv->pdev,skb->data,xl_priv->pkt_buf_sz, PCI_DMA_FROMDEVICE)); |
972 | xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfraglen = cpu_to_le32(xl_priv->pkt_buf_sz) | RXUPLASTFRAG; | 970 | xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfraglen = cpu_to_le32(xl_priv->pkt_buf_sz) | RXUPLASTFRAG; |
973 | adv_rx_ring(dev) ; | 971 | adv_rx_ring(dev) ; |
974 | xl_priv->xl_stats.rx_packets++ ; | 972 | dev->stats.rx_packets++ ; |
975 | xl_priv->xl_stats.rx_bytes += frame_length ; | 973 | dev->stats.rx_bytes += frame_length ; |
976 | 974 | ||
977 | netif_rx(skb2) ; | 975 | netif_rx(skb2) ; |
978 | } /* if multiple buffers */ | 976 | } /* if multiple buffers */ |
@@ -1182,8 +1180,8 @@ static int xl_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1182 | txd->buffer = cpu_to_le32(pci_map_single(xl_priv->pdev, skb->data, skb->len, PCI_DMA_TODEVICE)); | 1180 | txd->buffer = cpu_to_le32(pci_map_single(xl_priv->pdev, skb->data, skb->len, PCI_DMA_TODEVICE)); |
1183 | txd->buffer_length = cpu_to_le32(skb->len) | TXDNFRAGLAST; | 1181 | txd->buffer_length = cpu_to_le32(skb->len) | TXDNFRAGLAST; |
1184 | xl_priv->tx_ring_skb[tx_head] = skb ; | 1182 | xl_priv->tx_ring_skb[tx_head] = skb ; |
1185 | xl_priv->xl_stats.tx_packets++ ; | 1183 | dev->stats.tx_packets++ ; |
1186 | xl_priv->xl_stats.tx_bytes += skb->len ; | 1184 | dev->stats.tx_bytes += skb->len ; |
1187 | 1185 | ||
1188 | /* | 1186 | /* |
1189 | * Set the nextptr of the previous descriptor equal to this descriptor, add XL_TX_RING_SIZE -1 | 1187 | * Set the nextptr of the previous descriptor equal to this descriptor, add XL_TX_RING_SIZE -1 |
@@ -1463,12 +1461,6 @@ static void xl_srb_bh(struct net_device *dev) | |||
1463 | return ; | 1461 | return ; |
1464 | } | 1462 | } |
1465 | 1463 | ||
1466 | static struct net_device_stats * xl_get_stats(struct net_device *dev) | ||
1467 | { | ||
1468 | struct xl_private *xl_priv = netdev_priv(dev); | ||
1469 | return (struct net_device_stats *) &xl_priv->xl_stats; | ||
1470 | } | ||
1471 | |||
1472 | static int xl_set_mac_address (struct net_device *dev, void *addr) | 1464 | static int xl_set_mac_address (struct net_device *dev, void *addr) |
1473 | { | 1465 | { |
1474 | struct sockaddr *saddr = addr ; | 1466 | struct sockaddr *saddr = addr ; |