aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/zd1201.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/zd1201.c')
-rw-r--r--drivers/net/wireless/zd1201.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/drivers/net/wireless/zd1201.c b/drivers/net/wireless/zd1201.c
index 6226ac2357f8..4d5f143cd586 100644
--- a/drivers/net/wireless/zd1201.c
+++ b/drivers/net/wireless/zd1201.c
@@ -328,8 +328,8 @@ static void zd1201_usbrx(struct urb *urb)
328 memcpy(skb_put(skb, 2), &data[datalen-24], 2); 328 memcpy(skb_put(skb, 2), &data[datalen-24], 2);
329 memcpy(skb_put(skb, len), data, len); 329 memcpy(skb_put(skb, len), data, len);
330 skb->protocol = eth_type_trans(skb, zd->dev); 330 skb->protocol = eth_type_trans(skb, zd->dev);
331 zd->stats.rx_packets++; 331 zd->dev->stats.rx_packets++;
332 zd->stats.rx_bytes += skb->len; 332 zd->dev->stats.rx_bytes += skb->len;
333 netif_rx(skb); 333 netif_rx(skb);
334 goto resubmit; 334 goto resubmit;
335 } 335 }
@@ -384,8 +384,8 @@ static void zd1201_usbrx(struct urb *urb)
384 memcpy(skb_put(skb, len), data+8, len); 384 memcpy(skb_put(skb, len), data+8, len);
385 } 385 }
386 skb->protocol = eth_type_trans(skb, zd->dev); 386 skb->protocol = eth_type_trans(skb, zd->dev);
387 zd->stats.rx_packets++; 387 zd->dev->stats.rx_packets++;
388 zd->stats.rx_bytes += skb->len; 388 zd->dev->stats.rx_bytes += skb->len;
389 netif_rx(skb); 389 netif_rx(skb);
390 } 390 }
391resubmit: 391resubmit:
@@ -787,7 +787,7 @@ static int zd1201_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
787 struct urb *urb = zd->tx_urb; 787 struct urb *urb = zd->tx_urb;
788 788
789 if (!zd->mac_enabled || zd->monitor) { 789 if (!zd->mac_enabled || zd->monitor) {
790 zd->stats.tx_dropped++; 790 dev->stats.tx_dropped++;
791 kfree_skb(skb); 791 kfree_skb(skb);
792 return 0; 792 return 0;
793 } 793 }
@@ -817,12 +817,12 @@ static int zd1201_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
817 817
818 err = usb_submit_urb(zd->tx_urb, GFP_ATOMIC); 818 err = usb_submit_urb(zd->tx_urb, GFP_ATOMIC);
819 if (err) { 819 if (err) {
820 zd->stats.tx_errors++; 820 dev->stats.tx_errors++;
821 netif_start_queue(dev); 821 netif_start_queue(dev);
822 return err; 822 return err;
823 } 823 }
824 zd->stats.tx_packets++; 824 dev->stats.tx_packets++;
825 zd->stats.tx_bytes += skb->len; 825 dev->stats.tx_bytes += skb->len;
826 dev->trans_start = jiffies; 826 dev->trans_start = jiffies;
827 kfree_skb(skb); 827 kfree_skb(skb);
828 828
@@ -838,7 +838,7 @@ static void zd1201_tx_timeout(struct net_device *dev)
838 dev_warn(&zd->usb->dev, "%s: TX timeout, shooting down urb\n", 838 dev_warn(&zd->usb->dev, "%s: TX timeout, shooting down urb\n",
839 dev->name); 839 dev->name);
840 usb_unlink_urb(zd->tx_urb); 840 usb_unlink_urb(zd->tx_urb);
841 zd->stats.tx_errors++; 841 dev->stats.tx_errors++;
842 /* Restart the timeout to quiet the watchdog: */ 842 /* Restart the timeout to quiet the watchdog: */
843 dev->trans_start = jiffies; 843 dev->trans_start = jiffies;
844} 844}
@@ -861,13 +861,6 @@ static int zd1201_set_mac_address(struct net_device *dev, void *p)
861 return zd1201_mac_reset(zd); 861 return zd1201_mac_reset(zd);
862} 862}
863 863
864static struct net_device_stats *zd1201_get_stats(struct net_device *dev)
865{
866 struct zd1201 *zd = netdev_priv(dev);
867
868 return &zd->stats;
869}
870
871static struct iw_statistics *zd1201_get_wireless_stats(struct net_device *dev) 864static struct iw_statistics *zd1201_get_wireless_stats(struct net_device *dev)
872{ 865{
873 struct zd1201 *zd = netdev_priv(dev); 866 struct zd1201 *zd = netdev_priv(dev);
@@ -1778,9 +1771,7 @@ static int zd1201_probe(struct usb_interface *interface,
1778 1771
1779 dev->open = zd1201_net_open; 1772 dev->open = zd1201_net_open;
1780 dev->stop = zd1201_net_stop; 1773 dev->stop = zd1201_net_stop;
1781 dev->get_stats = zd1201_get_stats; 1774 dev->wireless_handlers = &zd1201_iw_handlers;
1782 dev->wireless_handlers =
1783 (struct iw_handler_def *)&zd1201_iw_handlers;
1784 dev->hard_start_xmit = zd1201_hard_start_xmit; 1775 dev->hard_start_xmit = zd1201_hard_start_xmit;
1785 dev->watchdog_timeo = ZD1201_TX_TIMEOUT; 1776 dev->watchdog_timeo = ZD1201_TX_TIMEOUT;
1786 dev->tx_timeout = zd1201_tx_timeout; 1777 dev->tx_timeout = zd1201_tx_timeout;