提交 4255d411 编写于 作者: S Stephen Hemminger 提交者: David S. Miller

wl3501: convert to internal net_device_stats

Signed-off-by: NStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 32f5a330
...@@ -606,7 +606,7 @@ struct wl3501_card { ...@@ -606,7 +606,7 @@ struct wl3501_card {
u8 reg_domain; u8 reg_domain;
u8 version[2]; u8 version[2];
struct wl3501_scan_confirm bss_set[20]; struct wl3501_scan_confirm bss_set[20];
struct net_device_stats stats;
struct iw_statistics wstats; struct iw_statistics wstats;
struct iw_spy_data spy_data; struct iw_spy_data spy_data;
struct iw_public_data wireless_data; struct iw_public_data wireless_data;
......
...@@ -1000,7 +1000,7 @@ static inline void wl3501_md_ind_interrupt(struct net_device *dev, ...@@ -1000,7 +1000,7 @@ static inline void wl3501_md_ind_interrupt(struct net_device *dev,
if (!skb) { if (!skb) {
printk(KERN_WARNING "%s: Can't alloc a sk_buff of size %d.\n", printk(KERN_WARNING "%s: Can't alloc a sk_buff of size %d.\n",
dev->name, pkt_len); dev->name, pkt_len);
this->stats.rx_dropped++; dev->stats.rx_dropped++;
} else { } else {
skb->dev = dev; skb->dev = dev;
skb_reserve(skb, 2); /* IP headers on 16 bytes boundaries */ 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,8 +1008,8 @@ static inline void wl3501_md_ind_interrupt(struct net_device *dev,
wl3501_receive(this, skb->data, pkt_len); wl3501_receive(this, skb->data, pkt_len);
skb_put(skb, pkt_len); skb_put(skb, pkt_len);
skb->protocol = eth_type_trans(skb, dev); skb->protocol = eth_type_trans(skb, dev);
this->stats.rx_packets++; dev->stats.rx_packets++;
this->stats.rx_bytes += skb->len; dev->stats.rx_bytes += skb->len;
netif_rx(skb); netif_rx(skb);
} }
} }
...@@ -1311,7 +1311,7 @@ static int wl3501_reset(struct net_device *dev) ...@@ -1311,7 +1311,7 @@ static int wl3501_reset(struct net_device *dev)
static void wl3501_tx_timeout(struct net_device *dev) static void wl3501_tx_timeout(struct net_device *dev)
{ {
struct wl3501_card *this = netdev_priv(dev); struct wl3501_card *this = netdev_priv(dev);
struct net_device_stats *stats = &this->stats; struct net_device_stats *stats = &dev->stats;
unsigned long flags; unsigned long flags;
int rc; int rc;
...@@ -1346,11 +1346,11 @@ static int wl3501_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -1346,11 +1346,11 @@ static int wl3501_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
if (enabled) if (enabled)
wl3501_unblock_interrupt(this); wl3501_unblock_interrupt(this);
if (rc) { if (rc) {
++this->stats.tx_dropped; ++dev->stats.tx_dropped;
netif_stop_queue(dev); netif_stop_queue(dev);
} else { } else {
++this->stats.tx_packets; ++dev->stats.tx_packets;
this->stats.tx_bytes += skb->len; dev->stats.tx_bytes += skb->len;
kfree_skb(skb); kfree_skb(skb);
if (this->tx_buffer_cnt < 2) if (this->tx_buffer_cnt < 2)
...@@ -1400,13 +1400,6 @@ static int wl3501_open(struct net_device *dev) ...@@ -1400,13 +1400,6 @@ static int wl3501_open(struct net_device *dev)
goto out; goto out;
} }
static struct net_device_stats *wl3501_get_stats(struct net_device *dev)
{
struct wl3501_card *this = netdev_priv(dev);
return &this->stats;
}
static struct iw_statistics *wl3501_get_wireless_stats(struct net_device *dev) static struct iw_statistics *wl3501_get_wireless_stats(struct net_device *dev)
{ {
struct wl3501_card *this = netdev_priv(dev); struct wl3501_card *this = netdev_priv(dev);
...@@ -1922,12 +1915,14 @@ static int wl3501_probe(struct pcmcia_device *p_dev) ...@@ -1922,12 +1915,14 @@ static int wl3501_probe(struct pcmcia_device *p_dev)
dev = alloc_etherdev(sizeof(struct wl3501_card)); dev = alloc_etherdev(sizeof(struct wl3501_card));
if (!dev) if (!dev)
goto out_link; goto out_link;
dev->open = wl3501_open; dev->open = wl3501_open;
dev->stop = wl3501_close; dev->stop = wl3501_close;
dev->hard_start_xmit = wl3501_hard_start_xmit; dev->hard_start_xmit = wl3501_hard_start_xmit;
dev->tx_timeout = wl3501_tx_timeout; dev->tx_timeout = wl3501_tx_timeout;
dev->watchdog_timeo = 5 * HZ; dev->watchdog_timeo = 5 * HZ;
dev->get_stats = wl3501_get_stats;
this = netdev_priv(dev); this = netdev_priv(dev);
this->wireless_data.spy_data = &this->spy_data; this->wireless_data.spy_data = &this->spy_data;
this->p_dev = p_dev; this->p_dev = p_dev;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册