From: wwguy <wey-yi.w.guy@intel.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: John Linville <linville@tuxdriver.com>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
Daniel Halperin <dhalperi@cs.washington.edu>,
Swati Rallapalli <swati@cs.utexas.edu>
Subject: Re: [PATCH 2/2] iwlagn: fix iwlagn_check_needed_chains
Date: Fri, 25 Feb 2011 07:36:06 -0800 [thread overview]
Message-ID: <1298648166.2603.11.camel@wwguy-ubuntu> (raw)
In-Reply-To: <20110225112620.515442527@sipsolutions.net>
Hi Johannes,
On Fri, 2011-02-25 at 03:24 -0800, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> This function was intended to calculate the
> number of RX chains needed, but could only
> work where the AP's streams were asymmetric,
> i.e. 2 TX and 3 RX or similar. In the case
> where IEEE80211_HT_MCS_TX_RX_DIFF was not
> set, this function would calculate the wrong
> information.
>
> Additionally, mac80211 didn't pass through
> the required values at all, so it couldn't
> work anyway.
>
> Rewrite the logic in this function and add
> appropriate comments to make it readable.
>
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
> drivers/net/wireless/iwlwifi/iwl-agn-rxon.c | 58 +++++++++++++++++++---------
> 1 file changed, 41 insertions(+), 17 deletions(-)
>
> --- wireless-testing.orig/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c 2011-02-25 11:03:37.000000000 +0100
> +++ wireless-testing/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c 2011-02-25 12:21:18.000000000 +0100
> @@ -471,6 +471,7 @@ static void iwlagn_check_needed_chains(s
> struct iwl_rxon_context *tmp;
> struct ieee80211_sta *sta;
> struct iwl_ht_config *ht_conf = &priv->current_ht_config;
> + struct ieee80211_sta_ht_cap *ht_cap;
> bool need_multiple;
>
> lockdep_assert_held(&priv->mutex);
> @@ -479,23 +480,7 @@ static void iwlagn_check_needed_chains(s
> case NL80211_IFTYPE_STATION:
> rcu_read_lock();
> sta = ieee80211_find_sta(vif, bss_conf->bssid);
> - if (sta) {
> - struct ieee80211_sta_ht_cap *ht_cap = &sta->ht_cap;
> - int maxstreams;
> -
> - maxstreams = (ht_cap->mcs.tx_params &
> - IEEE80211_HT_MCS_TX_MAX_STREAMS_MASK)
> - >> IEEE80211_HT_MCS_TX_MAX_STREAMS_SHIFT;
> - maxstreams += 1;
> -
> - need_multiple = true;
> -
> - if ((ht_cap->mcs.rx_mask[1] == 0) &&
> - (ht_cap->mcs.rx_mask[2] == 0))
> - need_multiple = false;
> - if (maxstreams <= 1)
> - need_multiple = false;
> - } else {
> + if (!sta) {
> /*
> * If at all, this can only happen through a race
> * when the AP disconnects us while we're still
> @@ -503,7 +488,46 @@ static void iwlagn_check_needed_chains(s
> * will soon tell us about that.
> */
> need_multiple = false;
> + rcu_read_unlock();
> + break;
why unlock and break here instead stay do it later like before?
Wey
next prev parent reply other threads:[~2011-02-25 15:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-25 11:24 [PATCH 0/2] fix iwlwifi needed RX chains Johannes Berg
2011-02-25 11:24 ` [PATCH 1/2] mac80211: copy peer MCS TX parameters Johannes Berg
2011-02-25 11:24 ` [PATCH 2/2] iwlagn: fix iwlagn_check_needed_chains Johannes Berg
2011-02-25 15:36 ` wwguy [this message]
2011-02-25 15:39 ` Johannes Berg
2011-02-25 15:31 ` Guy, Wey-Yi
2011-02-25 15:49 ` Johannes Berg
2011-02-26 17:59 ` Daniel Halperin
2011-02-26 18:50 ` Johannes Berg
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=1298648166.2603.11.camel@wwguy-ubuntu \
--to=wey-yi.w.guy@intel.com \
--cc=dhalperi@cs.washington.edu \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=swati@cs.utexas.edu \
/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.