aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2009-03-20 15:36:35 -0400
committerDavid S. Miller <davem@davemloft.net>2009-03-22 01:51:23 -0400
commit6456fffb09a281af2644e73fda26d1eeec325830 (patch)
tree77cb74f5dee5b94952f8b54ae9c53c15f00d0bbd
parent6685254f80cdca085cb1d53c45a6d0d5d01f911e (diff)
prism54: convert to internal net_device_stats
Also, make ethtool_ops const as it should be, and get rid of useless cast. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/wireless/prism54/islpci_dev.c14
-rw-r--r--drivers/net/wireless/prism54/islpci_dev.h3
-rw-r--r--drivers/net/wireless/prism54/islpci_eth.c13
3 files changed, 6 insertions, 24 deletions
diff --git a/drivers/net/wireless/prism54/islpci_dev.c b/drivers/net/wireless/prism54/islpci_dev.c
index 6e7d71c54091..166ed9584601 100644
--- a/drivers/net/wireless/prism54/islpci_dev.c
+++ b/drivers/net/wireless/prism54/islpci_dev.c
@@ -43,7 +43,6 @@
43 43
44static int prism54_bring_down(islpci_private *); 44static int prism54_bring_down(islpci_private *);
45static int islpci_alloc_memory(islpci_private *); 45static int islpci_alloc_memory(islpci_private *);
46static struct net_device_stats *islpci_statistics(struct net_device *);
47 46
48/* Temporary dummy MAC address to use until firmware is loaded. 47/* Temporary dummy MAC address to use until firmware is loaded.
49 * The idea there is that some tools (such as nameif) may query 48 * The idea there is that some tools (such as nameif) may query
@@ -614,18 +613,6 @@ islpci_reset(islpci_private *priv, int reload_firmware)
614 return rc; 613 return rc;
615} 614}
616 615
617static struct net_device_stats *
618islpci_statistics(struct net_device *ndev)
619{
620 islpci_private *priv = netdev_priv(ndev);
621
622#if VERBOSE > SHOW_ERROR_MESSAGES
623 DEBUG(SHOW_FUNCTION_CALLS, "islpci_statistics\n");
624#endif
625
626 return &priv->statistics;
627}
628
629/****************************************************************************** 616/******************************************************************************
630 Network device configuration functions 617 Network device configuration functions
631******************************************************************************/ 618******************************************************************************/
@@ -811,7 +798,6 @@ static const struct ethtool_ops islpci_ethtool_ops = {
811static const struct net_device_ops islpci_netdev_ops = { 798static const struct net_device_ops islpci_netdev_ops = {
812 .ndo_open = islpci_open, 799 .ndo_open = islpci_open,
813 .ndo_stop = islpci_close, 800 .ndo_stop = islpci_close,
814 .ndo_get_stats = islpci_statistics,
815 .ndo_do_ioctl = prism54_ioctl, 801 .ndo_do_ioctl = prism54_ioctl,
816 .ndo_start_xmit = islpci_eth_transmit, 802 .ndo_start_xmit = islpci_eth_transmit,
817 .ndo_tx_timeout = islpci_eth_tx_timeout, 803 .ndo_tx_timeout = islpci_eth_tx_timeout,
diff --git a/drivers/net/wireless/prism54/islpci_dev.h b/drivers/net/wireless/prism54/islpci_dev.h
index 8e55a5fcffae..c4d0f19b7cbc 100644
--- a/drivers/net/wireless/prism54/islpci_dev.h
+++ b/drivers/net/wireless/prism54/islpci_dev.h
@@ -158,9 +158,6 @@ typedef struct {
158 dma_addr_t pci_map_tx_address[ISL38XX_CB_TX_QSIZE]; 158 dma_addr_t pci_map_tx_address[ISL38XX_CB_TX_QSIZE];
159 dma_addr_t pci_map_rx_address[ISL38XX_CB_RX_QSIZE]; 159 dma_addr_t pci_map_rx_address[ISL38XX_CB_RX_QSIZE];
160 160
161 /* driver network interface members */
162 struct net_device_stats statistics;
163
164 /* wait for a reset interrupt */ 161 /* wait for a reset interrupt */
165 wait_queue_head_t reset_done; 162 wait_queue_head_t reset_done;
166 163
diff --git a/drivers/net/wireless/prism54/islpci_eth.c b/drivers/net/wireless/prism54/islpci_eth.c
index 88895bd9e495..ef3ef4551b31 100644
--- a/drivers/net/wireless/prism54/islpci_eth.c
+++ b/drivers/net/wireless/prism54/islpci_eth.c
@@ -231,8 +231,8 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
231 231
232 /* set the transmission time */ 232 /* set the transmission time */
233 ndev->trans_start = jiffies; 233 ndev->trans_start = jiffies;
234 priv->statistics.tx_packets++; 234 ndev->stats.tx_packets++;
235 priv->statistics.tx_bytes += skb->len; 235 ndev->stats.tx_bytes += skb->len;
236 236
237 /* trigger the device */ 237 /* trigger the device */
238 islpci_trigger(priv); 238 islpci_trigger(priv);
@@ -243,7 +243,7 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
243 return 0; 243 return 0;
244 244
245 drop_free: 245 drop_free:
246 priv->statistics.tx_dropped++; 246 ndev->stats.tx_dropped++;
247 spin_unlock_irqrestore(&priv->slock, flags); 247 spin_unlock_irqrestore(&priv->slock, flags);
248 dev_kfree_skb(skb); 248 dev_kfree_skb(skb);
249 return err; 249 return err;
@@ -408,8 +408,8 @@ islpci_eth_receive(islpci_private *priv)
408 skb->protocol = eth_type_trans(skb, ndev); 408 skb->protocol = eth_type_trans(skb, ndev);
409 } 409 }
410 skb->ip_summed = CHECKSUM_NONE; 410 skb->ip_summed = CHECKSUM_NONE;
411 priv->statistics.rx_packets++; 411 ndev->stats.rx_packets++;
412 priv->statistics.rx_bytes += size; 412 ndev->stats.rx_bytes += size;
413 413
414 /* deliver the skb to the network layer */ 414 /* deliver the skb to the network layer */
415#ifdef ISLPCI_ETH_DEBUG 415#ifdef ISLPCI_ETH_DEBUG
@@ -497,10 +497,9 @@ void
497islpci_eth_tx_timeout(struct net_device *ndev) 497islpci_eth_tx_timeout(struct net_device *ndev)
498{ 498{
499 islpci_private *priv = netdev_priv(ndev); 499 islpci_private *priv = netdev_priv(ndev);
500 struct net_device_stats *statistics = &priv->statistics;
501 500
502 /* increment the transmit error counter */ 501 /* increment the transmit error counter */
503 statistics->tx_errors++; 502 ndev->stats.tx_errors++;
504 503
505 if (!priv->reset_task_pending) { 504 if (!priv->reset_task_pending) {
506 printk(KERN_WARNING 505 printk(KERN_WARNING