linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: David Miller <davem@davemloft.net>, mcgrof@gmail.com
Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org
Subject: [PATCH 68/77] prism54: convert to internal net_device_stats
Date: Fri, 20 Mar 2009 22:36:35 -0700	[thread overview]
Message-ID: <20090321053717.765575826@vyatta.com> (raw)
In-Reply-To: 20090321053527.316395697@vyatta.com

Also, make ethtool_ops const as it should be, and get rid
of useless cast.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

---
 drivers/net/wireless/prism54/islpci_dev.c |   14 --------------
 drivers/net/wireless/prism54/islpci_dev.h |    3 ---
 drivers/net/wireless/prism54/islpci_eth.c |   13 ++++++-------
 3 files changed, 6 insertions(+), 24 deletions(-)

--- a/drivers/net/wireless/prism54/islpci_dev.c	2009-03-20 18:37:36.129838594 -0700
+++ b/drivers/net/wireless/prism54/islpci_dev.c	2009-03-20 18:37:36.137839156 -0700
@@ -43,7 +43,6 @@
 
 static int prism54_bring_down(islpci_private *);
 static int islpci_alloc_memory(islpci_private *);
-static struct net_device_stats *islpci_statistics(struct net_device *);
 
 /* Temporary dummy MAC address to use until firmware is loaded.
  * The idea there is that some tools (such as nameif) may query
@@ -614,18 +613,6 @@ islpci_reset(islpci_private *priv, int r
 	return rc;
 }
 
-static struct net_device_stats *
-islpci_statistics(struct net_device *ndev)
-{
-	islpci_private *priv = netdev_priv(ndev);
-
-#if VERBOSE > SHOW_ERROR_MESSAGES
-	DEBUG(SHOW_FUNCTION_CALLS, "islpci_statistics\n");
-#endif
-
-	return &priv->statistics;
-}
-
 /******************************************************************************
     Network device configuration functions
 ******************************************************************************/
@@ -811,7 +798,6 @@ static const struct ethtool_ops islpci_e
 static const struct net_device_ops islpci_netdev_ops = {
 	.ndo_open 		= islpci_open,
 	.ndo_stop		= islpci_close,
-	.ndo_get_stats		= islpci_statistics,
 	.ndo_do_ioctl		= prism54_ioctl,
 	.ndo_start_xmit		= islpci_eth_transmit,
 	.ndo_tx_timeout		= islpci_eth_tx_timeout,
--- a/drivers/net/wireless/prism54/islpci_dev.h	2009-03-20 18:36:43.697901654 -0700
+++ b/drivers/net/wireless/prism54/islpci_dev.h	2009-03-20 18:37:36.137839156 -0700
@@ -158,9 +158,6 @@ typedef struct {
 	dma_addr_t pci_map_tx_address[ISL38XX_CB_TX_QSIZE];
 	dma_addr_t pci_map_rx_address[ISL38XX_CB_RX_QSIZE];
 
-	/* driver network interface members */
-	struct net_device_stats statistics;
-
 	/* wait for a reset interrupt */
 	wait_queue_head_t reset_done;
 
--- a/drivers/net/wireless/prism54/islpci_eth.c	2009-03-20 18:37:59.821964445 -0700
+++ b/drivers/net/wireless/prism54/islpci_eth.c	2009-03-20 18:38:59.740714710 -0700
@@ -231,8 +231,8 @@ islpci_eth_transmit(struct sk_buff *skb,
 
 	/* set the transmission time */
 	ndev->trans_start = jiffies;
-	priv->statistics.tx_packets++;
-	priv->statistics.tx_bytes += skb->len;
+	ndev->stats.tx_packets++;
+	ndev->stats.tx_bytes += skb->len;
 
 	/* trigger the device */
 	islpci_trigger(priv);
@@ -243,7 +243,7 @@ islpci_eth_transmit(struct sk_buff *skb,
 	return 0;
 
       drop_free:
-	priv->statistics.tx_dropped++;
+	ndev->stats.tx_dropped++;
 	spin_unlock_irqrestore(&priv->slock, flags);
 	dev_kfree_skb(skb);
 	return err;
@@ -408,8 +408,8 @@ islpci_eth_receive(islpci_private *priv)
 		skb->protocol = eth_type_trans(skb, ndev);
 	}
 	skb->ip_summed = CHECKSUM_NONE;
-	priv->statistics.rx_packets++;
-	priv->statistics.rx_bytes += size;
+	ndev->stats.rx_packets++;
+	ndev->stats.rx_bytes += size;
 
 	/* deliver the skb to the network layer */
 #ifdef ISLPCI_ETH_DEBUG
@@ -497,10 +497,9 @@ void
 islpci_eth_tx_timeout(struct net_device *ndev)
 {
 	islpci_private *priv = netdev_priv(ndev);
-	struct net_device_stats *statistics = &priv->statistics;
 
 	/* increment the transmit error counter */
-	statistics->tx_errors++;
+	ndev->stats.tx_errors++;
 
 	if (!priv->reset_task_pending) {
 		printk(KERN_WARNING

-- 


  parent reply	other threads:[~2009-03-21  5:48 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20090321053527.316395697@vyatta.com>
2009-03-21  5:36 ` [PATCH 54/77] netwave: convert to internal net_device_stats Stephen Hemminger
2009-03-22  5:47   ` David Miller
2009-03-21  5:36 ` [PATCH 55/77] netwave: convert to net_device_ops Stephen Hemminger
2009-03-22  5:48   ` David Miller
2009-03-21  5:36 ` [PATCH 56/77] strip: " Stephen Hemminger
2009-03-22  5:47   ` David Miller
2009-03-21  5:36 ` [PATCH 57/77] wavelan: convert to internal net_device_stats Stephen Hemminger
2009-03-22  5:47   ` David Miller
2009-03-21  5:36 ` [PATCH 58/77] wavelan: convert to net_device_ops Stephen Hemminger
2009-03-22  5:47   ` David Miller
2009-03-21  5:36 ` [PATCH 59/77] airo: " Stephen Hemminger
2009-03-22  5:48   ` David Miller
2009-03-21  5:36 ` [PATCH 60/77] atmel: " Stephen Hemminger
2009-03-22  5:48   ` David Miller
2009-03-21  5:36 ` [PATCH 61/77] raylan: " Stephen Hemminger
2009-03-22  5:53   ` David Miller
2009-03-21  5:36 ` [PATCH 64/77] zd1201: convert to internal net_device_stats Stephen Hemminger
2009-03-22  5:53   ` David Miller
2009-03-21  5:36 ` [PATCH 65/77] zd1201: convert to net_device_ops Stephen Hemminger
2009-03-22  5:53   ` David Miller
2009-03-21  5:36 ` [PATCH 66/77] mac80211_hwsim: convert to internal net_device_stats Stephen Hemminger
2009-03-21 11:08   ` Johannes Berg
2009-03-22  5:49     ` David Miller
2009-03-22  5:53   ` David Miller
2009-03-21  5:36 ` [PATCH 67/77] prism54: convert to net_device_ops Stephen Hemminger
2009-03-22  5:53   ` David Miller
2009-03-21  5:36 ` Stephen Hemminger [this message]
2009-03-22  5:53   ` [PATCH 68/77] prism54: convert to internal net_device_stats David Miller
2009-03-21  5:36 ` [PATCH 69/77] libertas: " Stephen Hemminger
2009-03-22  5:54   ` David Miller
2009-03-21  5:36 ` [PATCH 70/77] libertas: convert to net_device_ops Stephen Hemminger
2009-03-22  5:54   ` David Miller
2009-03-21  5:36 ` [PATCH 71/77] ipw2x00: convert to internal net_device_stats Stephen Hemminger
2009-03-22  5:56   ` David Miller
2009-03-21  5:36 ` [PATCH 72/77] ipw2x00: convert infrastructure for use by net_device_ops Stephen Hemminger
2009-03-22  5:56   ` David Miller
2009-03-21  5:36 ` [PATCH 73/77] ipw2100: convert to net_device_ops Stephen Hemminger
2009-03-22  5:57   ` David Miller
2009-03-21  5:36 ` [PATCH 74/77] ipw2200: " Stephen Hemminger
2009-03-22  5:57   ` David Miller
2009-03-21  5:36 ` [PATCH 75/77] hostap: convert to internal net_device_stats Stephen Hemminger
2009-03-22  5:57   ` David Miller
2009-03-21  5:36 ` [PATCH 76/77] hostap: convert to net_device_ops Stephen Hemminger
2009-03-22  5:57   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090321053717.765575826@vyatta.com \
    --to=shemminger@vyatta.com \
    --cc=davem@davemloft.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mcgrof@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).