diff options
author | Stephen Hemminger <shemminger@linux-foundation.org> | 2007-08-24 14:29:34 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:49:31 -0400 |
commit | 68aae11674b9d6598b660d1148ffba9eef3f895f (patch) | |
tree | d5213c5b624e9908b948f2642b7e15721021b4ee /net/mac80211/ieee80211.c | |
parent | 24338793eea9dcc0865826e1115af86a19af8d18 (diff) |
[MAC80211]: use internal network device stats
Stats are now available for device usage inside network_device
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mac80211/ieee80211.c')
-rw-r--r-- | net/mac80211/ieee80211.c | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c index 0e8a70f408e2..0c1f7b2e157c 100644 --- a/net/mac80211/ieee80211.c +++ b/net/mac80211/ieee80211.c | |||
@@ -47,13 +47,6 @@ struct ieee80211_tx_status_rtap_hdr { | |||
47 | 47 | ||
48 | /* common interface routines */ | 48 | /* common interface routines */ |
49 | 49 | ||
50 | static struct net_device_stats *ieee80211_get_stats(struct net_device *dev) | ||
51 | { | ||
52 | struct ieee80211_sub_if_data *sdata; | ||
53 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | ||
54 | return &(sdata->stats); | ||
55 | } | ||
56 | |||
57 | static int header_parse_80211(struct sk_buff *skb, unsigned char *haddr) | 50 | static int header_parse_80211(struct sk_buff *skb, unsigned char *haddr) |
58 | { | 51 | { |
59 | memcpy(haddr, skb_mac_header(skb) + 10, ETH_ALEN); /* addr2 */ | 52 | memcpy(haddr, skb_mac_header(skb) + 10, ETH_ALEN); /* addr2 */ |
@@ -168,11 +161,9 @@ ieee80211_rx_mgmt(struct ieee80211_local *local, struct sk_buff *skb, | |||
168 | { | 161 | { |
169 | struct ieee80211_frame_info *fi; | 162 | struct ieee80211_frame_info *fi; |
170 | const size_t hlen = sizeof(struct ieee80211_frame_info); | 163 | const size_t hlen = sizeof(struct ieee80211_frame_info); |
171 | struct ieee80211_sub_if_data *sdata; | 164 | struct net_device *dev = local->apdev; |
172 | 165 | ||
173 | skb->dev = local->apdev; | 166 | skb->dev = dev; |
174 | |||
175 | sdata = IEEE80211_DEV_TO_SUB_IF(local->apdev); | ||
176 | 167 | ||
177 | if (skb_headroom(skb) < hlen) { | 168 | if (skb_headroom(skb) < hlen) { |
178 | I802_DEBUG_INC(local->rx_expand_skb_head); | 169 | I802_DEBUG_INC(local->rx_expand_skb_head); |
@@ -187,8 +178,8 @@ ieee80211_rx_mgmt(struct ieee80211_local *local, struct sk_buff *skb, | |||
187 | ieee80211_fill_frame_info(local, fi, status); | 178 | ieee80211_fill_frame_info(local, fi, status); |
188 | fi->msg_type = htonl(msg_type); | 179 | fi->msg_type = htonl(msg_type); |
189 | 180 | ||
190 | sdata->stats.rx_packets++; | 181 | dev->stats.rx_packets++; |
191 | sdata->stats.rx_bytes += skb->len; | 182 | dev->stats.rx_bytes += skb->len; |
192 | 183 | ||
193 | skb_set_mac_header(skb, 0); | 184 | skb_set_mac_header(skb, 0); |
194 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 185 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
@@ -269,7 +260,6 @@ void ieee80211_if_mgmt_setup(struct net_device *dev) | |||
269 | ether_setup(dev); | 260 | ether_setup(dev); |
270 | dev->hard_start_xmit = ieee80211_mgmt_start_xmit; | 261 | dev->hard_start_xmit = ieee80211_mgmt_start_xmit; |
271 | dev->change_mtu = ieee80211_change_mtu_apdev; | 262 | dev->change_mtu = ieee80211_change_mtu_apdev; |
272 | dev->get_stats = ieee80211_get_stats; | ||
273 | dev->open = ieee80211_mgmt_open; | 263 | dev->open = ieee80211_mgmt_open; |
274 | dev->stop = ieee80211_mgmt_stop; | 264 | dev->stop = ieee80211_mgmt_stop; |
275 | dev->type = ARPHRD_IEEE80211_PRISM; | 265 | dev->type = ARPHRD_IEEE80211_PRISM; |
@@ -599,7 +589,6 @@ void ieee80211_if_setup(struct net_device *dev) | |||
599 | dev->wireless_handlers = &ieee80211_iw_handler_def; | 589 | dev->wireless_handlers = &ieee80211_iw_handler_def; |
600 | dev->set_multicast_list = ieee80211_set_multicast_list; | 590 | dev->set_multicast_list = ieee80211_set_multicast_list; |
601 | dev->change_mtu = ieee80211_change_mtu; | 591 | dev->change_mtu = ieee80211_change_mtu; |
602 | dev->get_stats = ieee80211_get_stats; | ||
603 | dev->open = ieee80211_open; | 592 | dev->open = ieee80211_open; |
604 | dev->stop = ieee80211_stop; | 593 | dev->stop = ieee80211_stop; |
605 | dev->uninit = ieee80211_if_reinit; | 594 | dev->uninit = ieee80211_if_reinit; |
@@ -1461,13 +1450,6 @@ void ieee80211_free_hw(struct ieee80211_hw *hw) | |||
1461 | } | 1450 | } |
1462 | EXPORT_SYMBOL(ieee80211_free_hw); | 1451 | EXPORT_SYMBOL(ieee80211_free_hw); |
1463 | 1452 | ||
1464 | struct net_device_stats *ieee80211_dev_stats(struct net_device *dev) | ||
1465 | { | ||
1466 | struct ieee80211_sub_if_data *sdata; | ||
1467 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | ||
1468 | return &sdata->stats; | ||
1469 | } | ||
1470 | |||
1471 | static int __init ieee80211_init(void) | 1453 | static int __init ieee80211_init(void) |
1472 | { | 1454 | { |
1473 | struct sk_buff *skb; | 1455 | struct sk_buff *skb; |