diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2009-03-20 15:36:38 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-22 01:55:31 -0400 |
commit | ce55cbaf3a4498719bdb5a022a45d256b84749f5 (patch) | |
tree | 601a6ee55bb364a4e8769291e689f00659f003cb /drivers/net/wireless/ipw2x00/ipw2200.c | |
parent | f02abf1010dfb9fa7f56788fb28bc63b0ea34968 (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>
Diffstat (limited to 'drivers/net/wireless/ipw2x00/ipw2200.c')
-rw-r--r-- | drivers/net/wireless/ipw2x00/ipw2200.c | 52 |
1 files changed, 19 insertions, 33 deletions
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 | ||
10487 | static 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 | |||
10496 | static void ipw_net_set_multicast_list(struct net_device *dev) | 10490 | static 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 | ||
11538 | static 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 | |||
11544 | static int ipw_prom_alloc(struct ipw_priv *priv) | 11532 | static 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; |