From: Johannes Berg <johannes@sipsolutions.net>
To: John Linville <linville@tuxdriver.com>
Cc: Jiri Benc <jbenc@suse.cz>, linux-wireless@vger.kernel.org
Subject: [PATCH 06/14] mac80211: fix bug for per-sta stats
Date: Fri, 22 Jun 2007 00:16:09 +0200 [thread overview]
Message-ID: <20070621221757.805759000@sipsolutions.net> (raw)
In-Reply-To: 20070621221603.778432000@sipsolutions.net
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>
---
net/mac80211/rx.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
--- wireless-dev.orig/net/mac80211/rx.c 2007-06-21 21:40:59.028638003 +0200
+++ wireless-dev/net/mac80211/rx.c 2007-06-21 21:43:01.838638003 +0200
@@ -28,6 +28,8 @@
/* pre-rx handlers
*
* these don't have dev/sdata fields in the rx data
+ * The sta value should also not be used because it may
+ * be NULL even though a STA (in IBSS mode) will be added.
*/
static ieee80211_txrx_result
@@ -57,12 +59,11 @@ ieee80211_rx_h_parse_qos(struct ieee8021
}
rx->u.rx.qos_control = 0;
}
-#ifdef CONFIG_MAC80211_DEBUG_COUNTERS
+
I802_DEBUG_INC(rx->local->wme_rx_queue[tid]);
- if (rx->sta) {
+ /* only a debug counter, sta might not be assigned properly yet */
+ if (rx->sta)
I802_DEBUG_INC(rx->sta->wme_rx_queue[tid]);
- }
-#endif /* CONFIG_MAC80211_DEBUG_COUNTERS */
rx->u.rx.queue = tid;
rx->u.rx.is_agg_frame = is_agg_frame;
@@ -119,8 +120,6 @@ ieee80211_rx_h_load_stats(struct ieee802
/* Divide channel_use by 8 to avoid wrapping around the counter */
load >>= CHAN_UTIL_SHIFT;
local->channel_use_raw += load;
- if (rx->sta)
- rx->sta->channel_use_raw += load;
rx->u.rx.load = load;
return TXRX_CONTINUE;
@@ -140,6 +139,8 @@ ieee80211_rx_handler ieee80211_rx_pre_ha
static ieee80211_txrx_result
ieee80211_rx_h_if_stats(struct ieee80211_txrx_data *rx)
{
+ if (rx->sta)
+ rx->sta->channel_use_raw += rx->u.rx.load;
rx->sdata->channel_use_raw += rx->u.rx.load;
return TXRX_CONTINUE;
}
--
next prev parent reply other threads:[~2007-06-22 8:41 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-21 22:16 [PATCH 00/14] major mac80211 restructuring/cleanups Johannes Berg
2007-06-21 22:16 ` [PATCH 02/14] mac80211: move QoS rx handlers into rx.c Johannes Berg
2007-06-21 22:16 ` [PATCH 03/14] mac80211: rx cleanups (1) Johannes Berg
2007-06-21 22:16 ` [PATCH 04/14] mac80211: split ieee80211_rx_h_check handler Johannes Berg
2007-06-21 22:16 ` [PATCH 05/14] mac80211: split up __ieee80211_rx Johannes Berg
2007-06-21 22:16 ` Johannes Berg [this message]
2007-06-21 22:16 ` [PATCH 07/14] mac80211: rx cleanups (2) Johannes Berg
2007-06-21 22:16 ` [PATCH 09/14] mac80211: remove some unnecessary includes Johannes Berg
2007-06-21 22:16 ` [PATCH 10/14] mac80211: split out some key functions from ieee80211.c Johannes Berg
2007-06-21 22:16 ` [PATCH 11/14] mac80211: regdomain.c needs to include ieee80211_i.h Johannes Berg
2007-06-21 22:16 ` [PATCH 12/14] mac80211: move some rate control functions out of ieee80211.c Johannes Berg
2007-06-21 22:16 ` [PATCH 13/14] mac80211: reorder interface related functions Johannes Berg
2007-06-21 22:16 ` [PATCH 14/14] mac80211: introduce util.c Johannes Berg
2007-06-22 9:09 ` [PATCH 00/14] major mac80211 restructuring/cleanups Johannes Berg
2007-06-28 10:59 ` Johannes Berg
2007-07-10 13:34 ` Jiri Benc
2007-07-10 13:50 ` Johannes Berg
2007-07-10 14:29 ` Jiri Benc
2007-07-10 14:51 ` Johannes Berg
2007-07-10 17:12 ` John W. Linville
2007-07-10 18:35 ` Johannes Berg
2007-07-11 20:20 ` Christoph Hellwig
2007-07-17 13:54 ` Luis R. Rodriguez
2007-07-17 13:57 ` Luis R. Rodriguez
2007-07-11 16:34 ` jketreno
2007-07-11 20:06 ` Joerg Mayer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070621221757.805759000@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=jbenc@suse.cz \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.