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>
 static void monitor_rx(struct net_device *dev, struct sk_buff *skb,
                       struct hostap_80211_rx_status *rx_stats)
 {
-       struct net_device_stats *stats;
        int len;
 
        len = prism2_rx_80211(dev, skb, rx_stats, PRISM2_RX_MONITOR);
-       stats = hostap_get_stats(dev);
-       stats->rx_packets++;
-       stats->rx_bytes += len;
+       dev->stats.rx_packets++;
+       dev->stats.rx_bytes += len;
 }
 
 
        size_t hdrlen;
        u16 fc, type, stype, sc;
        struct net_device *wds = NULL;
-       struct net_device_stats *stats;
        unsigned int frag;
        u8 *payload;
        struct sk_buff *skb2 = NULL;
        iface = netdev_priv(dev);
 
        hdr = (struct ieee80211_hdr *) skb->data;
-       stats = hostap_get_stats(dev);
 
        if (skb->len < 10)
                goto rx_dropped;
 
        if (hostap_rx_frame_wds(local, hdr, fc, &wds))
                goto rx_dropped;
-       if (wds) {
+       if (wds)
                skb->dev = dev = wds;
-               stats = hostap_get_stats(dev);
-       }
 
        if (local->iw_mode == IW_MODE_MASTER && !wds &&
            (fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) ==
            memcmp(hdr->addr2, local->assoc_ap_addr, ETH_ALEN) == 0) {
                /* Frame from BSSID of the AP for which we are a client */
                skb->dev = dev = local->stadev;
-               stats = hostap_get_stats(dev);
                from_assoc_ap = 1;
        }
 
                skb_trim(skb, skb->len - ETH_ALEN);
        }
 
-       stats->rx_packets++;
-       stats->rx_bytes += skb->len;
+       dev->stats.rx_packets++;
+       dev->stats.rx_bytes += skb->len;
 
        if (local->iw_mode == IW_MODE_MASTER && !wds &&
            local->ap->bridge_packets) {
  rx_dropped:
        dev_kfree_skb(skb);
 
-       stats->rx_dropped++;
+       dev->stats.rx_dropped++;
        goto rx_exit;
 }
 
 
        if (skb->len < 16)
                goto drop;
 
-       local->stats.rx_packets++;
+       dev->stats.rx_packets++;
 
        hdr = (struct ieee80211_hdr *) skb->data;
 
 
 
        PDEBUG(DEBUG_EXTRA2, "prism2_get_txfid_idx: no room in txfid buf: "
               "packet dropped\n");
-       local->stats.tx_dropped++;
+       local->dev->stats.tx_dropped++;
 
        return -1;
 }
                prism2_transmit_cb, (long) idx);
 
        if (res) {
-               struct net_device_stats *stats;
                printk(KERN_DEBUG "%s: prism2_transmit: CMDCODE_TRANSMIT "
                       "failed (res=%d)\n", dev->name, res);
-               stats = hostap_get_stats(dev);
-               stats->tx_dropped++;
+               dev->stats.tx_dropped++;
                netif_wake_queue(dev);
                return -1;
        }
        struct net_device *dev = local->dev;
        int res, rx_pending = 0;
        u16 len, hdr_len, rxfid, status, macport;
-       struct net_device_stats *stats;
        struct hfa384x_rx_frame rxdesc;
        struct sk_buff *skb = NULL;
 
        prism2_callback(local, PRISM2_CALLBACK_RX_START);
-       stats = hostap_get_stats(dev);
 
        rxfid = prism2_read_fid_reg(dev, HFA384X_RXFID_OFF);
 #ifndef final_version
        return;
 
  rx_dropped:
-       stats->rx_dropped++;
+       dev->stats.rx_dropped++;
        if (skb)
                dev_kfree_skb(skb);
        goto rx_exit;
        struct hfa384x_tx_frame txdesc;
 
        show_dump = local->frame_dump & PRISM2_DUMP_TXEXC_HDR;
-       local->stats.tx_errors++;
+       dev->stats.tx_errors++;
 
        res = hostap_tx_compl_read(local, 1, &txdesc, &payload);
        HFA384X_OUTW(HFA384X_EV_TXEXC, HFA384X_EVACK_OFF);
 
 }
 
 
-struct net_device_stats *hostap_get_stats(struct net_device *dev)
-{
-       struct hostap_interface *iface;
-       iface = netdev_priv(dev);
-       return &iface->stats;
-}
-
-
 static int prism2_close(struct net_device *dev)
 {
        struct hostap_interface *iface;
        ether_setup(dev);
 
        /* kernel callbacks */
-       dev->get_stats = hostap_get_stats;
        if (iface) {
                /* Currently, we point to the proper spy_data only on
                 * the main_dev. This could be fixed. Jean II */
 EXPORT_SYMBOL(hostap_dump_rx_header);
 EXPORT_SYMBOL(hostap_dump_tx_header);
 EXPORT_SYMBOL(hostap_80211_get_hdrlen);
-EXPORT_SYMBOL(hostap_get_stats);
 EXPORT_SYMBOL(hostap_setup_dev);
 EXPORT_SYMBOL(hostap_set_multicast_list_queue);
 EXPORT_SYMBOL(hostap_set_hostapd);
 
        u16 channel_mask; /* mask of allowed channels */
        u16 scan_channel_mask; /* mask of channels to be scanned */
        struct comm_tallies_sums comm_tallies;
-       struct net_device_stats stats;
        struct proc_dir_entry *proc;
        int iw_mode; /* operating mode (IW_MODE_*) */
        int pseudo_adhoc; /* 0: IW_MODE_ADHOC is real 802.11 compliant IBSS