Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hostap: convert to internal net_device_stats

Use pre-existing net_device_stats in network_device struct.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Stephen Hemminger and committed by
David S. Miller
4cfa8e45 44e9ad0b

+11 -33
+6 -13
drivers/net/wireless/hostap/hostap_80211_rx.c
··· 207 207 static void monitor_rx(struct net_device *dev, struct sk_buff *skb, 208 208 struct hostap_80211_rx_status *rx_stats) 209 209 { 210 - struct net_device_stats *stats; 211 210 int len; 212 211 213 212 len = prism2_rx_80211(dev, skb, rx_stats, PRISM2_RX_MONITOR); 214 - stats = hostap_get_stats(dev); 215 - stats->rx_packets++; 216 - stats->rx_bytes += len; 213 + dev->stats.rx_packets++; 214 + dev->stats.rx_bytes += len; 217 215 } 218 216 219 217 ··· 722 724 size_t hdrlen; 723 725 u16 fc, type, stype, sc; 724 726 struct net_device *wds = NULL; 725 - struct net_device_stats *stats; 726 727 unsigned int frag; 727 728 u8 *payload; 728 729 struct sk_buff *skb2 = NULL; ··· 745 748 iface = netdev_priv(dev); 746 749 747 750 hdr = (struct ieee80211_hdr *) skb->data; 748 - stats = hostap_get_stats(dev); 749 751 750 752 if (skb->len < 10) 751 753 goto rx_dropped; ··· 862 866 863 867 if (hostap_rx_frame_wds(local, hdr, fc, &wds)) 864 868 goto rx_dropped; 865 - if (wds) { 869 + if (wds) 866 870 skb->dev = dev = wds; 867 - stats = hostap_get_stats(dev); 868 - } 869 871 870 872 if (local->iw_mode == IW_MODE_MASTER && !wds && 871 873 (fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) == ··· 872 878 memcmp(hdr->addr2, local->assoc_ap_addr, ETH_ALEN) == 0) { 873 879 /* Frame from BSSID of the AP for which we are a client */ 874 880 skb->dev = dev = local->stadev; 875 - stats = hostap_get_stats(dev); 876 881 from_assoc_ap = 1; 877 882 } 878 883 ··· 1062 1069 skb_trim(skb, skb->len - ETH_ALEN); 1063 1070 } 1064 1071 1065 - stats->rx_packets++; 1066 - stats->rx_bytes += skb->len; 1072 + dev->stats.rx_packets++; 1073 + dev->stats.rx_bytes += skb->len; 1067 1074 1068 1075 if (local->iw_mode == IW_MODE_MASTER && !wds && 1069 1076 local->ap->bridge_packets) { ··· 1108 1115 rx_dropped: 1109 1116 dev_kfree_skb(skb); 1110 1117 1111 - stats->rx_dropped++; 1118 + dev->stats.rx_dropped++; 1112 1119 goto rx_exit; 1113 1120 } 1114 1121
+1 -1
drivers/net/wireless/hostap/hostap_ap.c
··· 2262 2262 if (skb->len < 16) 2263 2263 goto drop; 2264 2264 2265 - local->stats.rx_packets++; 2265 + dev->stats.rx_packets++; 2266 2266 2267 2267 hdr = (struct ieee80211_hdr *) skb->data; 2268 2268
+4 -8
drivers/net/wireless/hostap/hostap_hw.c
··· 1682 1682 1683 1683 PDEBUG(DEBUG_EXTRA2, "prism2_get_txfid_idx: no room in txfid buf: " 1684 1684 "packet dropped\n"); 1685 - local->stats.tx_dropped++; 1685 + local->dev->stats.tx_dropped++; 1686 1686 1687 1687 return -1; 1688 1688 } ··· 1787 1787 prism2_transmit_cb, (long) idx); 1788 1788 1789 1789 if (res) { 1790 - struct net_device_stats *stats; 1791 1790 printk(KERN_DEBUG "%s: prism2_transmit: CMDCODE_TRANSMIT " 1792 1791 "failed (res=%d)\n", dev->name, res); 1793 - stats = hostap_get_stats(dev); 1794 - stats->tx_dropped++; 1792 + dev->stats.tx_dropped++; 1795 1793 netif_wake_queue(dev); 1796 1794 return -1; 1797 1795 } ··· 1937 1939 struct net_device *dev = local->dev; 1938 1940 int res, rx_pending = 0; 1939 1941 u16 len, hdr_len, rxfid, status, macport; 1940 - struct net_device_stats *stats; 1941 1942 struct hfa384x_rx_frame rxdesc; 1942 1943 struct sk_buff *skb = NULL; 1943 1944 1944 1945 prism2_callback(local, PRISM2_CALLBACK_RX_START); 1945 - stats = hostap_get_stats(dev); 1946 1946 1947 1947 rxfid = prism2_read_fid_reg(dev, HFA384X_RXFID_OFF); 1948 1948 #ifndef final_version ··· 2027 2031 return; 2028 2032 2029 2033 rx_dropped: 2030 - stats->rx_dropped++; 2034 + dev->stats.rx_dropped++; 2031 2035 if (skb) 2032 2036 dev_kfree_skb(skb); 2033 2037 goto rx_exit; ··· 2331 2335 struct hfa384x_tx_frame txdesc; 2332 2336 2333 2337 show_dump = local->frame_dump & PRISM2_DUMP_TXEXC_HDR; 2334 - local->stats.tx_errors++; 2338 + dev->stats.tx_errors++; 2335 2339 2336 2340 res = hostap_tx_compl_read(local, 1, &txdesc, &payload); 2337 2341 HFA384X_OUTW(HFA384X_EV_TXEXC, HFA384X_EVACK_OFF);
-10
drivers/net/wireless/hostap/hostap_main.c
··· 607 607 } 608 608 609 609 610 - struct net_device_stats *hostap_get_stats(struct net_device *dev) 611 - { 612 - struct hostap_interface *iface; 613 - iface = netdev_priv(dev); 614 - return &iface->stats; 615 - } 616 - 617 - 618 610 static int prism2_close(struct net_device *dev) 619 611 { 620 612 struct hostap_interface *iface; ··· 824 832 ether_setup(dev); 825 833 826 834 /* kernel callbacks */ 827 - dev->get_stats = hostap_get_stats; 828 835 if (iface) { 829 836 /* Currently, we point to the proper spy_data only on 830 837 * the main_dev. This could be fixed. Jean II */ ··· 1103 1112 EXPORT_SYMBOL(hostap_dump_rx_header); 1104 1113 EXPORT_SYMBOL(hostap_dump_tx_header); 1105 1114 EXPORT_SYMBOL(hostap_80211_get_hdrlen); 1106 - EXPORT_SYMBOL(hostap_get_stats); 1107 1115 EXPORT_SYMBOL(hostap_setup_dev); 1108 1116 EXPORT_SYMBOL(hostap_set_multicast_list_queue); 1109 1117 EXPORT_SYMBOL(hostap_set_hostapd);
-1
drivers/net/wireless/hostap/hostap_wlan.h
··· 684 684 u16 channel_mask; /* mask of allowed channels */ 685 685 u16 scan_channel_mask; /* mask of channels to be scanned */ 686 686 struct comm_tallies_sums comm_tallies; 687 - struct net_device_stats stats; 688 687 struct proc_dir_entry *proc; 689 688 int iw_mode; /* operating mode (IW_MODE_*) */ 690 689 int pseudo_adhoc; /* 0: IW_MODE_ADHOC is real 802.11 compliant IBSS