aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2009-03-20 15:36:38 -0400
committerDavid S. Miller <davem@davemloft.net>2009-03-22 01:55:31 -0400
commitce55cbaf3a4498719bdb5a022a45d256b84749f5 (patch)
tree601a6ee55bb364a4e8769291e689f00659f003cb
parentf02abf1010dfb9fa7f56788fb28bc63b0ea34968 (diff)
ipw2x00: convert to internal net_device_stats
Replace struct in ieee with current net_device_stats, so no longer need get_stats hook Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/wireless/ipw2x00/ieee80211.h1
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2100.c36
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2200.c52
-rw-r--r--drivers/net/wireless/ipw2x00/libipw_module.c11
-rw-r--r--drivers/net/wireless/ipw2x00/libipw_rx.c17
-rw-r--r--drivers/net/wireless/ipw2x00/libipw_tx.c9
6 files changed, 49 insertions, 77 deletions
diff --git a/drivers/net/wireless/ipw2x00/ieee80211.h b/drivers/net/wireless/ipw2x00/ieee80211.h
index f82435eae49d..1978fcd833dc 100644
--- a/drivers/net/wireless/ipw2x00/ieee80211.h
+++ b/drivers/net/wireless/ipw2x00/ieee80211.h
@@ -786,7 +786,6 @@ struct ieee80211_device {
786 struct ieee80211_security sec; 786 struct ieee80211_security sec;
787 787
788 /* Bookkeeping structures */ 788 /* Bookkeeping structures */
789 struct net_device_stats stats;
790 struct ieee80211_stats ieee_stats; 789 struct ieee80211_stats ieee_stats;
791 790
792 struct ieee80211_geo geo; 791 struct ieee80211_geo geo;
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index 3a6d810a7608..425ba8b0b0f1 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -2391,13 +2391,14 @@ static void ipw2100_corruption_detected(struct ipw2100_priv *priv, int i)
2391#endif 2391#endif
2392 2392
2393 priv->fatal_error = IPW2100_ERR_C3_CORRUPTION; 2393 priv->fatal_error = IPW2100_ERR_C3_CORRUPTION;
2394 priv->ieee->stats.rx_errors++; 2394 priv->net_dev->stats.rx_errors++;
2395 schedule_reset(priv); 2395 schedule_reset(priv);
2396} 2396}
2397 2397
2398static void isr_rx(struct ipw2100_priv *priv, int i, 2398static void isr_rx(struct ipw2100_priv *priv, int i,
2399 struct ieee80211_rx_stats *stats) 2399 struct ieee80211_rx_stats *stats)
2400{ 2400{
2401 struct net_device *dev = priv->net_dev;
2401 struct ipw2100_status *status = &priv->status_queue.drv[i]; 2402 struct ipw2100_status *status = &priv->status_queue.drv[i];
2402 struct ipw2100_rx_packet *packet = &priv->rx_buffers[i]; 2403 struct ipw2100_rx_packet *packet = &priv->rx_buffers[i];
2403 2404
@@ -2406,14 +2407,14 @@ static void isr_rx(struct ipw2100_priv *priv, int i,
2406 if (unlikely(status->frame_size > skb_tailroom(packet->skb))) { 2407 if (unlikely(status->frame_size > skb_tailroom(packet->skb))) {
2407 IPW_DEBUG_INFO("%s: frame_size (%u) > skb_tailroom (%u)!" 2408 IPW_DEBUG_INFO("%s: frame_size (%u) > skb_tailroom (%u)!"
2408 " Dropping.\n", 2409 " Dropping.\n",
2409 priv->net_dev->name, 2410 dev->name,
2410 status->frame_size, skb_tailroom(packet->skb)); 2411 status->frame_size, skb_tailroom(packet->skb));
2411 priv->ieee->stats.rx_errors++; 2412 dev->stats.rx_errors++;
2412 return; 2413 return;
2413 } 2414 }
2414 2415
2415 if (unlikely(!netif_running(priv->net_dev))) { 2416 if (unlikely(!netif_running(dev))) {
2416 priv->ieee->stats.rx_errors++; 2417 dev->stats.rx_errors++;
2417 priv->wstats.discard.misc++; 2418 priv->wstats.discard.misc++;
2418 IPW_DEBUG_DROP("Dropping packet while interface is not up.\n"); 2419 IPW_DEBUG_DROP("Dropping packet while interface is not up.\n");
2419 return; 2420 return;
@@ -2443,10 +2444,10 @@ static void isr_rx(struct ipw2100_priv *priv, int i,
2443 if (!ieee80211_rx(priv->ieee, packet->skb, stats)) { 2444 if (!ieee80211_rx(priv->ieee, packet->skb, stats)) {
2444#ifdef IPW2100_RX_DEBUG 2445#ifdef IPW2100_RX_DEBUG
2445 IPW_DEBUG_DROP("%s: Non consumed packet:\n", 2446 IPW_DEBUG_DROP("%s: Non consumed packet:\n",
2446 priv->net_dev->name); 2447 dev->name);
2447 printk_buf(IPW_DL_DROP, packet_data, status->frame_size); 2448 printk_buf(IPW_DL_DROP, packet_data, status->frame_size);
2448#endif 2449#endif
2449 priv->ieee->stats.rx_errors++; 2450 dev->stats.rx_errors++;
2450 2451
2451 /* ieee80211_rx failed, so it didn't free the SKB */ 2452 /* ieee80211_rx failed, so it didn't free the SKB */
2452 dev_kfree_skb_any(packet->skb); 2453 dev_kfree_skb_any(packet->skb);
@@ -2457,7 +2458,7 @@ static void isr_rx(struct ipw2100_priv *priv, int i,
2457 if (unlikely(ipw2100_alloc_skb(priv, packet))) { 2458 if (unlikely(ipw2100_alloc_skb(priv, packet))) {
2458 printk(KERN_WARNING DRV_NAME ": " 2459 printk(KERN_WARNING DRV_NAME ": "
2459 "%s: Unable to allocate SKB onto RBD ring - disabling " 2460 "%s: Unable to allocate SKB onto RBD ring - disabling "
2460 "adapter.\n", priv->net_dev->name); 2461 "adapter.\n", dev->name);
2461 /* TODO: schedule adapter shutdown */ 2462 /* TODO: schedule adapter shutdown */
2462 IPW_DEBUG_INFO("TODO: Shutdown adapter...\n"); 2463 IPW_DEBUG_INFO("TODO: Shutdown adapter...\n");
2463 } 2464 }
@@ -2471,6 +2472,7 @@ static void isr_rx(struct ipw2100_priv *priv, int i,
2471static void isr_rx_monitor(struct ipw2100_priv *priv, int i, 2472static void isr_rx_monitor(struct ipw2100_priv *priv, int i,
2472 struct ieee80211_rx_stats *stats) 2473 struct ieee80211_rx_stats *stats)
2473{ 2474{
2475 struct net_device *dev = priv->net_dev;
2474 struct ipw2100_status *status = &priv->status_queue.drv[i]; 2476 struct ipw2100_status *status = &priv->status_queue.drv[i];
2475 struct ipw2100_rx_packet *packet = &priv->rx_buffers[i]; 2477 struct ipw2100_rx_packet *packet = &priv->rx_buffers[i];
2476 2478
@@ -2488,15 +2490,15 @@ static void isr_rx_monitor(struct ipw2100_priv *priv, int i,
2488 sizeof(struct ipw_rt_hdr))) { 2490 sizeof(struct ipw_rt_hdr))) {
2489 IPW_DEBUG_INFO("%s: frame_size (%u) > skb_tailroom (%u)!" 2491 IPW_DEBUG_INFO("%s: frame_size (%u) > skb_tailroom (%u)!"
2490 " Dropping.\n", 2492 " Dropping.\n",
2491 priv->net_dev->name, 2493 dev->name,
2492 status->frame_size, 2494 status->frame_size,
2493 skb_tailroom(packet->skb)); 2495 skb_tailroom(packet->skb));
2494 priv->ieee->stats.rx_errors++; 2496 dev->stats.rx_errors++;
2495 return; 2497 return;
2496 } 2498 }
2497 2499
2498 if (unlikely(!netif_running(priv->net_dev))) { 2500 if (unlikely(!netif_running(dev))) {
2499 priv->ieee->stats.rx_errors++; 2501 dev->stats.rx_errors++;
2500 priv->wstats.discard.misc++; 2502 priv->wstats.discard.misc++;
2501 IPW_DEBUG_DROP("Dropping packet while interface is not up.\n"); 2503 IPW_DEBUG_DROP("Dropping packet while interface is not up.\n");
2502 return; 2504 return;
@@ -2505,7 +2507,7 @@ static void isr_rx_monitor(struct ipw2100_priv *priv, int i,
2505 if (unlikely(priv->config & CFG_CRC_CHECK && 2507 if (unlikely(priv->config & CFG_CRC_CHECK &&
2506 status->flags & IPW_STATUS_FLAG_CRC_ERROR)) { 2508 status->flags & IPW_STATUS_FLAG_CRC_ERROR)) {
2507 IPW_DEBUG_RX("CRC error in packet. Dropping.\n"); 2509 IPW_DEBUG_RX("CRC error in packet. Dropping.\n");
2508 priv->ieee->stats.rx_errors++; 2510 dev->stats.rx_errors++;
2509 return; 2511 return;
2510 } 2512 }
2511 2513
@@ -2527,7 +2529,7 @@ static void isr_rx_monitor(struct ipw2100_priv *priv, int i,
2527 skb_put(packet->skb, status->frame_size + sizeof(struct ipw_rt_hdr)); 2529 skb_put(packet->skb, status->frame_size + sizeof(struct ipw_rt_hdr));
2528 2530
2529 if (!ieee80211_rx(priv->ieee, packet->skb, stats)) { 2531 if (!ieee80211_rx(priv->ieee, packet->skb, stats)) {
2530 priv->ieee->stats.rx_errors++; 2532 dev->stats.rx_errors++;
2531 2533
2532 /* ieee80211_rx failed, so it didn't free the SKB */ 2534 /* ieee80211_rx failed, so it didn't free the SKB */
2533 dev_kfree_skb_any(packet->skb); 2535 dev_kfree_skb_any(packet->skb);
@@ -2538,7 +2540,7 @@ static void isr_rx_monitor(struct ipw2100_priv *priv, int i,
2538 if (unlikely(ipw2100_alloc_skb(priv, packet))) { 2540 if (unlikely(ipw2100_alloc_skb(priv, packet))) {
2539 IPW_DEBUG_WARNING( 2541 IPW_DEBUG_WARNING(
2540 "%s: Unable to allocate SKB onto RBD ring - disabling " 2542 "%s: Unable to allocate SKB onto RBD ring - disabling "
2541 "adapter.\n", priv->net_dev->name); 2543 "adapter.\n", dev->name);
2542 /* TODO: schedule adapter shutdown */ 2544 /* TODO: schedule adapter shutdown */
2543 IPW_DEBUG_INFO("TODO: Shutdown adapter...\n"); 2545 IPW_DEBUG_INFO("TODO: Shutdown adapter...\n");
2544 } 2546 }
@@ -3340,7 +3342,7 @@ static int ipw2100_tx(struct ieee80211_txb *txb, struct net_device *dev,
3340 3342
3341 if (!(priv->status & STATUS_ASSOCIATED)) { 3343 if (!(priv->status & STATUS_ASSOCIATED)) {
3342 IPW_DEBUG_INFO("Can not transmit when not connected.\n"); 3344 IPW_DEBUG_INFO("Can not transmit when not connected.\n");
3343 priv->ieee->stats.tx_carrier_errors++; 3345 priv->net_dev->stats.tx_carrier_errors++;
3344 netif_stop_queue(dev); 3346 netif_stop_queue(dev);
3345 goto fail_unlock; 3347 goto fail_unlock;
3346 } 3348 }
@@ -5836,7 +5838,7 @@ static void ipw2100_tx_timeout(struct net_device *dev)
5836{ 5838{
5837 struct ipw2100_priv *priv = ieee80211_priv(dev); 5839 struct ipw2100_priv *priv = ieee80211_priv(dev);
5838 5840
5839 priv->ieee->stats.tx_errors++; 5841 dev->stats.tx_errors++;
5840 5842
5841#ifdef CONFIG_IPW2100_MONITOR 5843#ifdef CONFIG_IPW2100_MONITOR
5842 if (priv->ieee->iw_mode == IW_MODE_MONITOR) 5844 if (priv->ieee->iw_mode == IW_MODE_MONITOR)
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index a7fb08aecf3f..08b42948f2b5 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -7731,22 +7731,23 @@ static void ipw_handle_data_packet(struct ipw_priv *priv,
7731 struct ipw_rx_mem_buffer *rxb, 7731 struct ipw_rx_mem_buffer *rxb,
7732 struct ieee80211_rx_stats *stats) 7732 struct ieee80211_rx_stats *stats)
7733{ 7733{
7734 struct net_device *dev = priv->net_dev;
7734 struct ieee80211_hdr_4addr *hdr; 7735 struct ieee80211_hdr_4addr *hdr;
7735 struct ipw_rx_packet *pkt = (struct ipw_rx_packet *)rxb->skb->data; 7736 struct ipw_rx_packet *pkt = (struct ipw_rx_packet *)rxb->skb->data;
7736 7737
7737 /* We received data from the HW, so stop the watchdog */ 7738 /* We received data from the HW, so stop the watchdog */
7738 priv->net_dev->trans_start = jiffies; 7739 dev->trans_start = jiffies;
7739 7740
7740 /* We only process data packets if the 7741 /* We only process data packets if the
7741 * interface is open */ 7742 * interface is open */
7742 if (unlikely((le16_to_cpu(pkt->u.frame.length) + IPW_RX_FRAME_SIZE) > 7743 if (unlikely((le16_to_cpu(pkt->u.frame.length) + IPW_RX_FRAME_SIZE) >
7743 skb_tailroom(rxb->skb))) { 7744 skb_tailroom(rxb->skb))) {
7744 priv->ieee->stats.rx_errors++; 7745 dev->stats.rx_errors++;
7745 priv->wstats.discard.misc++; 7746 priv->wstats.discard.misc++;
7746 IPW_DEBUG_DROP("Corruption detected! Oh no!\n"); 7747 IPW_DEBUG_DROP("Corruption detected! Oh no!\n");
7747 return; 7748 return;
7748 } else if (unlikely(!netif_running(priv->net_dev))) { 7749 } else if (unlikely(!netif_running(priv->net_dev))) {
7749 priv->ieee->stats.rx_dropped++; 7750 dev->stats.rx_dropped++;
7750 priv->wstats.discard.misc++; 7751 priv->wstats.discard.misc++;
7751 IPW_DEBUG_DROP("Dropping packet while interface is not up.\n"); 7752 IPW_DEBUG_DROP("Dropping packet while interface is not up.\n");
7752 return; 7753 return;
@@ -7768,7 +7769,7 @@ static void ipw_handle_data_packet(struct ipw_priv *priv,
7768 ipw_rebuild_decrypted_skb(priv, rxb->skb); 7769 ipw_rebuild_decrypted_skb(priv, rxb->skb);
7769 7770
7770 if (!ieee80211_rx(priv->ieee, rxb->skb, stats)) 7771 if (!ieee80211_rx(priv->ieee, rxb->skb, stats))
7771 priv->ieee->stats.rx_errors++; 7772 dev->stats.rx_errors++;
7772 else { /* ieee80211_rx succeeded, so it now owns the SKB */ 7773 else { /* ieee80211_rx succeeded, so it now owns the SKB */
7773 rxb->skb = NULL; 7774 rxb->skb = NULL;
7774 __ipw_led_activity_on(priv); 7775 __ipw_led_activity_on(priv);
@@ -7780,6 +7781,7 @@ static void ipw_handle_data_packet_monitor(struct ipw_priv *priv,
7780 struct ipw_rx_mem_buffer *rxb, 7781 struct ipw_rx_mem_buffer *rxb,
7781 struct ieee80211_rx_stats *stats) 7782 struct ieee80211_rx_stats *stats)
7782{ 7783{
7784 struct net_device *dev = priv->net_dev;
7783 struct ipw_rx_packet *pkt = (struct ipw_rx_packet *)rxb->skb->data; 7785 struct ipw_rx_packet *pkt = (struct ipw_rx_packet *)rxb->skb->data;
7784 struct ipw_rx_frame *frame = &pkt->u.frame; 7786 struct ipw_rx_frame *frame = &pkt->u.frame;
7785 7787
@@ -7797,18 +7799,18 @@ static void ipw_handle_data_packet_monitor(struct ipw_priv *priv,
7797 short len = le16_to_cpu(pkt->u.frame.length); 7799 short len = le16_to_cpu(pkt->u.frame.length);
7798 7800
7799 /* We received data from the HW, so stop the watchdog */ 7801 /* We received data from the HW, so stop the watchdog */
7800 priv->net_dev->trans_start = jiffies; 7802 dev->trans_start = jiffies;
7801 7803
7802 /* We only process data packets if the 7804 /* We only process data packets if the
7803 * interface is open */ 7805 * interface is open */
7804 if (unlikely((le16_to_cpu(pkt->u.frame.length) + IPW_RX_FRAME_SIZE) > 7806 if (unlikely((le16_to_cpu(pkt->u.frame.length) + IPW_RX_FRAME_SIZE) >
7805 skb_tailroom(rxb->skb))) { 7807 skb_tailroom(rxb->skb))) {
7806 priv->ieee->stats.rx_errors++; 7808 dev->stats.rx_errors++;
7807 priv->wstats.discard.misc++; 7809 priv->wstats.discard.misc++;
7808 IPW_DEBUG_DROP("Corruption detected! Oh no!\n"); 7810 IPW_DEBUG_DROP("Corruption detected! Oh no!\n");
7809 return; 7811 return;
7810 } else if (unlikely(!netif_running(priv->net_dev))) { 7812 } else if (unlikely(!netif_running(priv->net_dev))) {
7811 priv->ieee->stats.rx_dropped++; 7813 dev->stats.rx_dropped++;
7812 priv->wstats.discard.misc++; 7814 priv->wstats.discard.misc++;
7813 IPW_DEBUG_DROP("Dropping packet while interface is not up.\n"); 7815 IPW_DEBUG_DROP("Dropping packet while interface is not up.\n");
7814 return; 7816 return;
@@ -7818,7 +7820,7 @@ static void ipw_handle_data_packet_monitor(struct ipw_priv *priv,
7818 * that now */ 7820 * that now */
7819 if (len > IPW_RX_BUF_SIZE - sizeof(struct ipw_rt_hdr)) { 7821 if (len > IPW_RX_BUF_SIZE - sizeof(struct ipw_rt_hdr)) {
7820 /* FIXME: Should alloc bigger skb instead */ 7822 /* FIXME: Should alloc bigger skb instead */
7821 priv->ieee->stats.rx_dropped++; 7823 dev->stats.rx_dropped++;
7822 priv->wstats.discard.misc++; 7824 priv->wstats.discard.misc++;
7823 IPW_DEBUG_DROP("Dropping too large packet in monitor\n"); 7825 IPW_DEBUG_DROP("Dropping too large packet in monitor\n");
7824 return; 7826 return;
@@ -7924,7 +7926,7 @@ static void ipw_handle_data_packet_monitor(struct ipw_priv *priv,
7924 IPW_DEBUG_RX("Rx packet of %d bytes.\n", rxb->skb->len); 7926 IPW_DEBUG_RX("Rx packet of %d bytes.\n", rxb->skb->len);
7925 7927
7926 if (!ieee80211_rx(priv->ieee, rxb->skb, stats)) 7928 if (!ieee80211_rx(priv->ieee, rxb->skb, stats))
7927 priv->ieee->stats.rx_errors++; 7929 dev->stats.rx_errors++;
7928 else { /* ieee80211_rx succeeded, so it now owns the SKB */ 7930 else { /* ieee80211_rx succeeded, so it now owns the SKB */
7929 rxb->skb = NULL; 7931 rxb->skb = NULL;
7930 /* no LED during capture */ 7932 /* no LED during capture */
@@ -7956,6 +7958,7 @@ static void ipw_handle_promiscuous_rx(struct ipw_priv *priv,
7956 struct ipw_rx_mem_buffer *rxb, 7958 struct ipw_rx_mem_buffer *rxb,
7957 struct ieee80211_rx_stats *stats) 7959 struct ieee80211_rx_stats *stats)
7958{ 7960{
7961 struct net_device *dev = priv->prom_net_dev;
7959 struct ipw_rx_packet *pkt = (struct ipw_rx_packet *)rxb->skb->data; 7962 struct ipw_rx_packet *pkt = (struct ipw_rx_packet *)rxb->skb->data;
7960 struct ipw_rx_frame *frame = &pkt->u.frame; 7963 struct ipw_rx_frame *frame = &pkt->u.frame;
7961 struct ipw_rt_hdr *ipw_rt; 7964 struct ipw_rt_hdr *ipw_rt;
@@ -7978,17 +7981,17 @@ static void ipw_handle_promiscuous_rx(struct ipw_priv *priv,
7978 return; 7981 return;
7979 7982
7980 /* We received data from the HW, so stop the watchdog */ 7983 /* We received data from the HW, so stop the watchdog */
7981 priv->prom_net_dev->trans_start = jiffies; 7984 dev->trans_start = jiffies;
7982 7985
7983 if (unlikely((len + IPW_RX_FRAME_SIZE) > skb_tailroom(rxb->skb))) { 7986 if (unlikely((len + IPW_RX_FRAME_SIZE) > skb_tailroom(rxb->skb))) {
7984 priv->prom_priv->ieee->stats.rx_errors++; 7987 dev->stats.rx_errors++;
7985 IPW_DEBUG_DROP("Corruption detected! Oh no!\n"); 7988 IPW_DEBUG_DROP("Corruption detected! Oh no!\n");
7986 return; 7989 return;
7987 } 7990 }
7988 7991
7989 /* We only process data packets if the interface is open */ 7992 /* We only process data packets if the interface is open */
7990 if (unlikely(!netif_running(priv->prom_net_dev))) { 7993 if (unlikely(!netif_running(dev))) {
7991 priv->prom_priv->ieee->stats.rx_dropped++; 7994 dev->stats.rx_dropped++;
7992 IPW_DEBUG_DROP("Dropping packet while interface is not up.\n"); 7995 IPW_DEBUG_DROP("Dropping packet while interface is not up.\n");
7993 return; 7996 return;
7994 } 7997 }
@@ -7997,7 +8000,7 @@ static void ipw_handle_promiscuous_rx(struct ipw_priv *priv,
7997 * that now */ 8000 * that now */
7998 if (len > IPW_RX_BUF_SIZE - sizeof(struct ipw_rt_hdr)) { 8001 if (len > IPW_RX_BUF_SIZE - sizeof(struct ipw_rt_hdr)) {
7999 /* FIXME: Should alloc bigger skb instead */ 8002 /* FIXME: Should alloc bigger skb instead */
8000 priv->prom_priv->ieee->stats.rx_dropped++; 8003 dev->stats.rx_dropped++;
8001 IPW_DEBUG_DROP("Dropping too large packet in monitor\n"); 8004 IPW_DEBUG_DROP("Dropping too large packet in monitor\n");
8002 return; 8005 return;
8003 } 8006 }
@@ -8129,7 +8132,7 @@ static void ipw_handle_promiscuous_rx(struct ipw_priv *priv,
8129 IPW_DEBUG_RX("Rx packet of %d bytes.\n", skb->len); 8132 IPW_DEBUG_RX("Rx packet of %d bytes.\n", skb->len);
8130 8133
8131 if (!ieee80211_rx(priv->prom_priv->ieee, skb, stats)) { 8134 if (!ieee80211_rx(priv->prom_priv->ieee, skb, stats)) {
8132 priv->prom_priv->ieee->stats.rx_errors++; 8135 dev->stats.rx_errors++;
8133 dev_kfree_skb_any(skb); 8136 dev_kfree_skb_any(skb);
8134 } 8137 }
8135} 8138}
@@ -8413,7 +8416,7 @@ static void ipw_rx(struct ipw_priv *priv)
8413 IPW_DEBUG_DROP 8416 IPW_DEBUG_DROP
8414 ("Received packet is too small. " 8417 ("Received packet is too small. "
8415 "Dropping.\n"); 8418 "Dropping.\n");
8416 priv->ieee->stats.rx_errors++; 8419 priv->net_dev->stats.rx_errors++;
8417 priv->wstats.discard.misc++; 8420 priv->wstats.discard.misc++;
8418 break; 8421 break;
8419 } 8422 }
@@ -10484,15 +10487,6 @@ static int ipw_net_hard_start_xmit(struct ieee80211_txb *txb,
10484 return ret; 10487 return ret;
10485} 10488}
10486 10489
10487static struct net_device_stats *ipw_net_get_stats(struct net_device *dev)
10488{
10489 struct ipw_priv *priv = ieee80211_priv(dev);
10490
10491 priv->ieee->stats.tx_packets = priv->tx_packets;
10492 priv->ieee->stats.rx_packets = priv->rx_packets;
10493 return &priv->ieee->stats;
10494}
10495
10496static void ipw_net_set_multicast_list(struct net_device *dev) 10490static void ipw_net_set_multicast_list(struct net_device *dev)
10497{ 10491{
10498 10492
@@ -11535,12 +11529,6 @@ static int ipw_prom_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
11535 return -EOPNOTSUPP; 11529 return -EOPNOTSUPP;
11536} 11530}
11537 11531
11538static struct net_device_stats *ipw_prom_get_stats(struct net_device *dev)
11539{
11540 struct ipw_prom_priv *prom_priv = ieee80211_priv(dev);
11541 return &prom_priv->ieee->stats;
11542}
11543
11544static int ipw_prom_alloc(struct ipw_priv *priv) 11532static int ipw_prom_alloc(struct ipw_priv *priv)
11545{ 11533{
11546 int rc = 0; 11534 int rc = 0;
@@ -11562,7 +11550,6 @@ static int ipw_prom_alloc(struct ipw_priv *priv)
11562 priv->prom_net_dev->type = ARPHRD_IEEE80211_RADIOTAP; 11550 priv->prom_net_dev->type = ARPHRD_IEEE80211_RADIOTAP;
11563 priv->prom_net_dev->open = ipw_prom_open; 11551 priv->prom_net_dev->open = ipw_prom_open;
11564 priv->prom_net_dev->stop = ipw_prom_stop; 11552 priv->prom_net_dev->stop = ipw_prom_stop;
11565 priv->prom_net_dev->get_stats = ipw_prom_get_stats;
11566 priv->prom_net_dev->hard_start_xmit = ipw_prom_hard_start_xmit; 11553 priv->prom_net_dev->hard_start_xmit = ipw_prom_hard_start_xmit;
11567 11554
11568 priv->prom_priv->ieee->iw_mode = IW_MODE_MONITOR; 11555 priv->prom_priv->ieee->iw_mode = IW_MODE_MONITOR;
@@ -11695,7 +11682,6 @@ static int __devinit ipw_pci_probe(struct pci_dev *pdev,
11695 net_dev->open = ipw_net_open; 11682 net_dev->open = ipw_net_open;
11696 net_dev->stop = ipw_net_stop; 11683 net_dev->stop = ipw_net_stop;
11697 net_dev->init = ipw_net_init; 11684 net_dev->init = ipw_net_init;
11698 net_dev->get_stats = ipw_net_get_stats;
11699 net_dev->set_multicast_list = ipw_net_set_multicast_list; 11685 net_dev->set_multicast_list = ipw_net_set_multicast_list;
11700 net_dev->set_mac_address = ipw_net_set_mac_address; 11686 net_dev->set_mac_address = ipw_net_set_mac_address;
11701 priv->wireless_data.spy_data = &priv->ieee->spy_data; 11687 priv->wireless_data.spy_data = &priv->ieee->spy_data;
diff --git a/drivers/net/wireless/ipw2x00/libipw_module.c b/drivers/net/wireless/ipw2x00/libipw_module.c
index f4803fc05413..b81df1ad190d 100644
--- a/drivers/net/wireless/ipw2x00/libipw_module.c
+++ b/drivers/net/wireless/ipw2x00/libipw_module.c
@@ -139,13 +139,6 @@ static int ieee80211_change_mtu(struct net_device *dev, int new_mtu)
139 return 0; 139 return 0;
140} 140}
141 141
142static struct net_device_stats *ieee80211_generic_get_stats(
143 struct net_device *dev)
144{
145 struct ieee80211_device *ieee = netdev_priv(dev);
146 return &ieee->stats;
147}
148
149struct net_device *alloc_ieee80211(int sizeof_priv) 142struct net_device *alloc_ieee80211(int sizeof_priv)
150{ 143{
151 struct ieee80211_device *ieee; 144 struct ieee80211_device *ieee;
@@ -163,10 +156,6 @@ struct net_device *alloc_ieee80211(int sizeof_priv)
163 dev->hard_start_xmit = ieee80211_xmit; 156 dev->hard_start_xmit = ieee80211_xmit;
164 dev->change_mtu = ieee80211_change_mtu; 157 dev->change_mtu = ieee80211_change_mtu;
165 158
166 /* Drivers are free to override this if the generic implementation
167 * does not meet their needs. */
168 dev->get_stats = ieee80211_generic_get_stats;
169
170 ieee->dev = dev; 159 ieee->dev = dev;
171 160
172 err = ieee80211_networks_allocate(ieee); 161 err = ieee80211_networks_allocate(ieee);
diff --git a/drivers/net/wireless/ipw2x00/libipw_rx.c b/drivers/net/wireless/ipw2x00/libipw_rx.c
index 079007936d8a..dae4b8e4d8e9 100644
--- a/drivers/net/wireless/ipw2x00/libipw_rx.c
+++ b/drivers/net/wireless/ipw2x00/libipw_rx.c
@@ -335,7 +335,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
335 struct ieee80211_hdr_4addr *hdr; 335 struct ieee80211_hdr_4addr *hdr;
336 size_t hdrlen; 336 size_t hdrlen;
337 u16 fc, type, stype, sc; 337 u16 fc, type, stype, sc;
338 struct net_device_stats *stats;
339 unsigned int frag; 338 unsigned int frag;
340 u8 *payload; 339 u8 *payload;
341 u16 ethertype; 340 u16 ethertype;
@@ -354,8 +353,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
354 int can_be_decrypted = 0; 353 int can_be_decrypted = 0;
355 354
356 hdr = (struct ieee80211_hdr_4addr *)skb->data; 355 hdr = (struct ieee80211_hdr_4addr *)skb->data;
357 stats = &ieee->stats;
358
359 if (skb->len < 10) { 356 if (skb->len < 10) {
360 printk(KERN_INFO "%s: SKB length < 10\n", dev->name); 357 printk(KERN_INFO "%s: SKB length < 10\n", dev->name);
361 goto rx_dropped; 358 goto rx_dropped;
@@ -412,8 +409,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
412#endif 409#endif
413 410
414 if (ieee->iw_mode == IW_MODE_MONITOR) { 411 if (ieee->iw_mode == IW_MODE_MONITOR) {
415 stats->rx_packets++; 412 dev->stats.rx_packets++;
416 stats->rx_bytes += skb->len; 413 dev->stats.rx_bytes += skb->len;
417 ieee80211_monitor_rx(ieee, skb, rx_stats); 414 ieee80211_monitor_rx(ieee, skb, rx_stats);
418 return 1; 415 return 1;
419 } 416 }
@@ -769,8 +766,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
769 } 766 }
770#endif 767#endif
771 768
772 stats->rx_packets++; 769 dev->stats.rx_packets++;
773 stats->rx_bytes += skb->len; 770 dev->stats.rx_bytes += skb->len;
774 771
775#ifdef NOT_YET 772#ifdef NOT_YET
776 if (ieee->iw_mode == IW_MODE_MASTER && !wds && ieee->ap->bridge_packets) { 773 if (ieee->iw_mode == IW_MODE_MASTER && !wds && ieee->ap->bridge_packets) {
@@ -812,7 +809,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
812 * in our stats. */ 809 * in our stats. */
813 IEEE80211_DEBUG_DROP 810 IEEE80211_DEBUG_DROP
814 ("RX: netif_rx dropped the packet\n"); 811 ("RX: netif_rx dropped the packet\n");
815 stats->rx_dropped++; 812 dev->stats.rx_dropped++;
816 } 813 }
817 } 814 }
818 815
@@ -824,7 +821,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
824 return 1; 821 return 1;
825 822
826 rx_dropped: 823 rx_dropped:
827 stats->rx_dropped++; 824 dev->stats.rx_dropped++;
828 825
829 /* Returning 0 indicates to caller that we have not handled the SKB-- 826 /* Returning 0 indicates to caller that we have not handled the SKB--
830 * so it is still allocated and can be used again by underlying 827 * so it is still allocated and can be used again by underlying
@@ -919,7 +916,7 @@ void ieee80211_rx_any(struct ieee80211_device *ieee,
919 916
920drop_free: 917drop_free:
921 dev_kfree_skb_irq(skb); 918 dev_kfree_skb_irq(skb);
922 ieee->stats.rx_dropped++; 919 ieee->dev->stats.rx_dropped++;
923 return; 920 return;
924} 921}
925 922
diff --git a/drivers/net/wireless/ipw2x00/libipw_tx.c b/drivers/net/wireless/ipw2x00/libipw_tx.c
index a874e9091919..0da4a0a73a4a 100644
--- a/drivers/net/wireless/ipw2x00/libipw_tx.c
+++ b/drivers/net/wireless/ipw2x00/libipw_tx.c
@@ -260,7 +260,6 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
260 int i, bytes_per_frag, nr_frags, bytes_last_frag, frag_size, 260 int i, bytes_per_frag, nr_frags, bytes_last_frag, frag_size,
261 rts_required; 261 rts_required;
262 unsigned long flags; 262 unsigned long flags;
263 struct net_device_stats *stats = &ieee->stats;
264 int encrypt, host_encrypt, host_encrypt_msdu, host_build_iv; 263 int encrypt, host_encrypt, host_encrypt_msdu, host_build_iv;
265 __be16 ether_type; 264 __be16 ether_type;
266 int bytes, fc, hdr_len; 265 int bytes, fc, hdr_len;
@@ -306,7 +305,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
306 305
307 if (!encrypt && ieee->ieee802_1x && 306 if (!encrypt && ieee->ieee802_1x &&
308 ieee->drop_unencrypted && ether_type != htons(ETH_P_PAE)) { 307 ieee->drop_unencrypted && ether_type != htons(ETH_P_PAE)) {
309 stats->tx_dropped++; 308 dev->stats.tx_dropped++;
310 goto success; 309 goto success;
311 } 310 }
312 311
@@ -526,8 +525,8 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
526 if (txb) { 525 if (txb) {
527 int ret = (*ieee->hard_start_xmit) (txb, dev, priority); 526 int ret = (*ieee->hard_start_xmit) (txb, dev, priority);
528 if (ret == 0) { 527 if (ret == 0) {
529 stats->tx_packets++; 528 dev->stats.tx_packets++;
530 stats->tx_bytes += txb->payload_size; 529 dev->stats.tx_bytes += txb->payload_size;
531 return 0; 530 return 0;
532 } 531 }
533 532
@@ -539,7 +538,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
539 failed: 538 failed:
540 spin_unlock_irqrestore(&ieee->lock, flags); 539 spin_unlock_irqrestore(&ieee->lock, flags);
541 netif_stop_queue(dev); 540 netif_stop_queue(dev);
542 stats->tx_errors++; 541 dev->stats.tx_errors++;
543 return 1; 542 return 1;
544} 543}
545 544