diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2007-07-27 09:43:22 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:47:32 -0400 |
commit | 52865dfd520ddd3d1176947106759ff944f0f8af (patch) | |
tree | 5cc2a9953e0eb33f5b219476fe08e9624dbadeb7 /net/mac80211 | |
parent | 23a24defa0da567eac615828563935c195fb48dc (diff) |
[MAC80211]: fix bug for per-sta stats
pre_rx handlers can't really touch sta since for IBSS it might not be
assigned yet, it can create sta info structs on-the-fly.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Jiri Benc <jbenc@suse.cz>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/rx.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 21d401523d13..f255579dc564 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -28,6 +28,8 @@ | |||
28 | /* pre-rx handlers | 28 | /* pre-rx handlers |
29 | * | 29 | * |
30 | * these don't have dev/sdata fields in the rx data | 30 | * these don't have dev/sdata fields in the rx data |
31 | * The sta value should also not be used because it may | ||
32 | * be NULL even though a STA (in IBSS mode) will be added. | ||
31 | */ | 33 | */ |
32 | 34 | ||
33 | static ieee80211_txrx_result | 35 | static ieee80211_txrx_result |
@@ -50,12 +52,11 @@ ieee80211_rx_h_parse_qos(struct ieee80211_txrx_data *rx) | |||
50 | tid = 0; /* 802.1d - Best Effort */ | 52 | tid = 0; /* 802.1d - Best Effort */ |
51 | } | 53 | } |
52 | } | 54 | } |
53 | #ifdef CONFIG_MAC80211_DEBUG_COUNTERS | 55 | |
54 | I802_DEBUG_INC(rx->local->wme_rx_queue[tid]); | 56 | I802_DEBUG_INC(rx->local->wme_rx_queue[tid]); |
55 | if (rx->sta) { | 57 | /* only a debug counter, sta might not be assigned properly yet */ |
58 | if (rx->sta) | ||
56 | I802_DEBUG_INC(rx->sta->wme_rx_queue[tid]); | 59 | I802_DEBUG_INC(rx->sta->wme_rx_queue[tid]); |
57 | } | ||
58 | #endif /* CONFIG_MAC80211_DEBUG_COUNTERS */ | ||
59 | 60 | ||
60 | rx->u.rx.queue = tid; | 61 | rx->u.rx.queue = tid; |
61 | /* Set skb->priority to 1d tag if highest order bit of TID is not set. | 62 | /* Set skb->priority to 1d tag if highest order bit of TID is not set. |
@@ -110,8 +111,6 @@ ieee80211_rx_h_load_stats(struct ieee80211_txrx_data *rx) | |||
110 | /* Divide channel_use by 8 to avoid wrapping around the counter */ | 111 | /* Divide channel_use by 8 to avoid wrapping around the counter */ |
111 | load >>= CHAN_UTIL_SHIFT; | 112 | load >>= CHAN_UTIL_SHIFT; |
112 | local->channel_use_raw += load; | 113 | local->channel_use_raw += load; |
113 | if (rx->sta) | ||
114 | rx->sta->channel_use_raw += load; | ||
115 | rx->u.rx.load = load; | 114 | rx->u.rx.load = load; |
116 | 115 | ||
117 | return TXRX_CONTINUE; | 116 | return TXRX_CONTINUE; |
@@ -129,6 +128,8 @@ ieee80211_rx_handler ieee80211_rx_pre_handlers[] = | |||
129 | static ieee80211_txrx_result | 128 | static ieee80211_txrx_result |
130 | ieee80211_rx_h_if_stats(struct ieee80211_txrx_data *rx) | 129 | ieee80211_rx_h_if_stats(struct ieee80211_txrx_data *rx) |
131 | { | 130 | { |
131 | if (rx->sta) | ||
132 | rx->sta->channel_use_raw += rx->u.rx.load; | ||
132 | rx->sdata->channel_use_raw += rx->u.rx.load; | 133 | rx->sdata->channel_use_raw += rx->u.rx.load; |
133 | return TXRX_CONTINUE; | 134 | return TXRX_CONTINUE; |
134 | } | 135 | } |