summaryrefslogtreecommitdiff
path: root/drivers/staging/wlan-ng/p80211netdev.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2014-07-08 10:37:00 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-07-09 22:59:51 +0400
commit9630f6b97a5918c7a14803954ae2ff5ff3f9fb3c (patch)
tree83f36275bf423ebd9f7e4e2747dbd6961087c5aa /drivers/staging/wlan-ng/p80211netdev.c
parentcd687a4073d58b5763ed085b942302714f0fa73d (diff)
downloadlinux-9630f6b97a5918c7a14803954ae2ff5ff3f9fb3c.tar.xz
staging: wlan-ng: Use net_device_stats from struct net_device
Instead of using an own copy of struct net_device_stats in struct wlandevice, use stats from struct net_device. Also remove the thus unnecessary .ndo_get_stats function, as it would now just return netdev->stats, which is the default in dev_get_stats(). Furthermore, convert prefix increment of stats counters to the more common postfix increment idiom. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wlan-ng/p80211netdev.c')
-rw-r--r--drivers/staging/wlan-ng/p80211netdev.c40
1 files changed, 7 insertions, 33 deletions
diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers/staging/wlan-ng/p80211netdev.c
index 00b186c59725..29afa573cc99 100644
--- a/drivers/staging/wlan-ng/p80211netdev.c
+++ b/drivers/staging/wlan-ng/p80211netdev.c
@@ -92,7 +92,6 @@
/* netdevice method functions */
static int p80211knetdev_init(netdevice_t *netdev);
-static struct net_device_stats *p80211knetdev_get_stats(netdevice_t *netdev);
static int p80211knetdev_open(netdevice_t *netdev);
static int p80211knetdev_stop(netdevice_t *netdev);
static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
@@ -134,30 +133,6 @@ static int p80211knetdev_init(netdevice_t *netdev)
}
/*----------------------------------------------------------------
-* p80211knetdev_get_stats
-*
-* Statistics retrieval for linux netdevices. Here we're reporting
-* the Linux i/f level statistics. Hence, for the primary numbers,
-* we don't want to report the numbers from the MIB. Eventually,
-* it might be useful to collect some of the error counters though.
-*
-* Arguments:
-* netdev Linux netdevice
-*
-* Returns:
-* the address of the statistics structure
-----------------------------------------------------------------*/
-static struct net_device_stats *p80211knetdev_get_stats(netdevice_t *netdev)
-{
- wlandevice_t *wlandev = netdev->ml_priv;
-
- /* TODO: review the MIB stats for items that correspond to
- linux stats */
-
- return &(wlandev->linux_stats);
-}
-
-/*----------------------------------------------------------------
* p80211knetdev_open
*
* Linux netdevice open method. Following a successful call here,
@@ -273,8 +248,8 @@ static int p80211_convert_to_ether(wlandevice_t *wlandev, struct sk_buff *skb)
if (skb_p80211_to_ether(wlandev, wlandev->ethconv, skb) == 0) {
skb->dev->last_rx = jiffies;
- wlandev->linux_stats.rx_packets++;
- wlandev->linux_stats.rx_bytes += skb->len;
+ wlandev->netdev->stats.rx_packets++;
+ wlandev->netdev->stats.rx_bytes += skb->len;
netif_rx_ni(skb);
return 0;
}
@@ -310,8 +285,8 @@ static void p80211netdev_rx_bh(unsigned long arg)
skb->protocol = htons(ETH_P_80211_RAW);
dev->last_rx = jiffies;
- wlandev->linux_stats.rx_packets++;
- wlandev->linux_stats.rx_bytes += skb->len;
+ dev->stats.rx_packets++;
+ dev->stats.rx_bytes += skb->len;
netif_rx_ni(skb);
continue;
} else {
@@ -386,7 +361,7 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
if (skb->protocol != ETH_P_80211_RAW) {
netif_start_queue(wlandev->netdev);
netdev_notice(netdev, "Tx attempt prior to association, frame dropped.\n");
- wlandev->linux_stats.tx_dropped++;
+ netdev->stats.tx_dropped++;
result = 0;
goto failed;
}
@@ -420,9 +395,9 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
netdev->trans_start = jiffies;
- wlandev->linux_stats.tx_packets++;
+ netdev->stats.tx_packets++;
/* count only the packet payload */
- wlandev->linux_stats.tx_bytes += skb->len;
+ netdev->stats.tx_bytes += skb->len;
txresult = wlandev->txframe(wlandev, skb, &p80211_hdr, &p80211_wep);
@@ -710,7 +685,6 @@ static const struct net_device_ops p80211_netdev_ops = {
.ndo_init = p80211knetdev_init,
.ndo_open = p80211knetdev_open,
.ndo_stop = p80211knetdev_stop,
- .ndo_get_stats = p80211knetdev_get_stats,
.ndo_start_xmit = p80211knetdev_hard_start_xmit,
.ndo_set_rx_mode = p80211knetdev_set_multicast_list,
.ndo_do_ioctl = p80211knetdev_do_ioctl,