diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2009-03-20 15:36:29 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-22 01:51:19 -0400 |
commit | 4255d411452f1fe4dbcb2de4de35a7a028c5415a (patch) | |
tree | 28d931f4d8f171d052f009640e2a9559d4ec5f7a /drivers/net/wireless/wl3501_cs.c | |
parent | 32f5a330090fdf7d4d663ff5bd979e186fe6aab6 (diff) |
wl3501: convert to internal net_device_stats
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/wl3501_cs.c')
-rw-r--r-- | drivers/net/wireless/wl3501_cs.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c index c8d5c34e8ddf..433ff5bcabf0 100644 --- a/drivers/net/wireless/wl3501_cs.c +++ b/drivers/net/wireless/wl3501_cs.c | |||
@@ -1000,7 +1000,7 @@ static inline void wl3501_md_ind_interrupt(struct net_device *dev, | |||
1000 | if (!skb) { | 1000 | if (!skb) { |
1001 | printk(KERN_WARNING "%s: Can't alloc a sk_buff of size %d.\n", | 1001 | printk(KERN_WARNING "%s: Can't alloc a sk_buff of size %d.\n", |
1002 | dev->name, pkt_len); | 1002 | dev->name, pkt_len); |
1003 | this->stats.rx_dropped++; | 1003 | dev->stats.rx_dropped++; |
1004 | } else { | 1004 | } else { |
1005 | skb->dev = dev; | 1005 | skb->dev = dev; |
1006 | skb_reserve(skb, 2); /* IP headers on 16 bytes boundaries */ | 1006 | skb_reserve(skb, 2); /* IP headers on 16 bytes boundaries */ |
@@ -1008,8 +1008,8 @@ static inline void wl3501_md_ind_interrupt(struct net_device *dev, | |||
1008 | wl3501_receive(this, skb->data, pkt_len); | 1008 | wl3501_receive(this, skb->data, pkt_len); |
1009 | skb_put(skb, pkt_len); | 1009 | skb_put(skb, pkt_len); |
1010 | skb->protocol = eth_type_trans(skb, dev); | 1010 | skb->protocol = eth_type_trans(skb, dev); |
1011 | this->stats.rx_packets++; | 1011 | dev->stats.rx_packets++; |
1012 | this->stats.rx_bytes += skb->len; | 1012 | dev->stats.rx_bytes += skb->len; |
1013 | netif_rx(skb); | 1013 | netif_rx(skb); |
1014 | } | 1014 | } |
1015 | } | 1015 | } |
@@ -1311,7 +1311,7 @@ out: | |||
1311 | static void wl3501_tx_timeout(struct net_device *dev) | 1311 | static void wl3501_tx_timeout(struct net_device *dev) |
1312 | { | 1312 | { |
1313 | struct wl3501_card *this = netdev_priv(dev); | 1313 | struct wl3501_card *this = netdev_priv(dev); |
1314 | struct net_device_stats *stats = &this->stats; | 1314 | struct net_device_stats *stats = &dev->stats; |
1315 | unsigned long flags; | 1315 | unsigned long flags; |
1316 | int rc; | 1316 | int rc; |
1317 | 1317 | ||
@@ -1346,11 +1346,11 @@ static int wl3501_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1346 | if (enabled) | 1346 | if (enabled) |
1347 | wl3501_unblock_interrupt(this); | 1347 | wl3501_unblock_interrupt(this); |
1348 | if (rc) { | 1348 | if (rc) { |
1349 | ++this->stats.tx_dropped; | 1349 | ++dev->stats.tx_dropped; |
1350 | netif_stop_queue(dev); | 1350 | netif_stop_queue(dev); |
1351 | } else { | 1351 | } else { |
1352 | ++this->stats.tx_packets; | 1352 | ++dev->stats.tx_packets; |
1353 | this->stats.tx_bytes += skb->len; | 1353 | dev->stats.tx_bytes += skb->len; |
1354 | kfree_skb(skb); | 1354 | kfree_skb(skb); |
1355 | 1355 | ||
1356 | if (this->tx_buffer_cnt < 2) | 1356 | if (this->tx_buffer_cnt < 2) |
@@ -1400,13 +1400,6 @@ fail: | |||
1400 | goto out; | 1400 | goto out; |
1401 | } | 1401 | } |
1402 | 1402 | ||
1403 | static struct net_device_stats *wl3501_get_stats(struct net_device *dev) | ||
1404 | { | ||
1405 | struct wl3501_card *this = netdev_priv(dev); | ||
1406 | |||
1407 | return &this->stats; | ||
1408 | } | ||
1409 | |||
1410 | static struct iw_statistics *wl3501_get_wireless_stats(struct net_device *dev) | 1403 | static struct iw_statistics *wl3501_get_wireless_stats(struct net_device *dev) |
1411 | { | 1404 | { |
1412 | struct wl3501_card *this = netdev_priv(dev); | 1405 | struct wl3501_card *this = netdev_priv(dev); |
@@ -1922,12 +1915,14 @@ static int wl3501_probe(struct pcmcia_device *p_dev) | |||
1922 | dev = alloc_etherdev(sizeof(struct wl3501_card)); | 1915 | dev = alloc_etherdev(sizeof(struct wl3501_card)); |
1923 | if (!dev) | 1916 | if (!dev) |
1924 | goto out_link; | 1917 | goto out_link; |
1918 | |||
1919 | |||
1925 | dev->open = wl3501_open; | 1920 | dev->open = wl3501_open; |
1926 | dev->stop = wl3501_close; | 1921 | dev->stop = wl3501_close; |
1927 | dev->hard_start_xmit = wl3501_hard_start_xmit; | 1922 | dev->hard_start_xmit = wl3501_hard_start_xmit; |
1928 | dev->tx_timeout = wl3501_tx_timeout; | 1923 | dev->tx_timeout = wl3501_tx_timeout; |
1929 | dev->watchdog_timeo = 5 * HZ; | 1924 | dev->watchdog_timeo = 5 * HZ; |
1930 | dev->get_stats = wl3501_get_stats; | 1925 | |
1931 | this = netdev_priv(dev); | 1926 | this = netdev_priv(dev); |
1932 | this->wireless_data.spy_data = &this->spy_data; | 1927 | this->wireless_data.spy_data = &this->spy_data; |
1933 | this->p_dev = p_dev; | 1928 | this->p_dev = p_dev; |