From: Sujith <m.sujith@gmail.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
Mats Johannesson <spamcan1@abrasax.se>,
Tomas Winkler <tomasw@gmail.com>,
Jouni.Malinen@Atheros.com
Subject: [RFT] mac80211: fix HT channel selection
Date: Sun, 7 Dec 2008 22:16:32 +0530 [thread overview]
Message-ID: <18747.65000.953959.335010@localhost.localdomain> (raw)
In-Reply-To: <1228667447.22164.46.camel@johannes.berg>
Johannes Berg wrote:
> @@ -2151,7 +2086,8 @@ static int ath9k_config(struct ieee80211
> struct ath_softc *sc = hw->priv;
> struct ieee80211_conf *conf = &hw->conf;
>
> - if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
> + if (changed & (IEEE80211_CONF_CHANGE_CHANNEL |
> + IEEE80211_CONF_CHANGE_HT)) {
> struct ieee80211_channel *curchan = hw->conf.channel;
> int pos;
>
The check for AP mode should be removed. The patch below applies on top of your
patch and should handle the new changes properly.
But I'll test it tomorrow by switching like crazy among ht20/ht40/legacy,
in both STA and AP mode. :)
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c
index 3f3d75f..dc2adfd 100644
--- a/drivers/net/wireless/ath9k/main.c
+++ b/drivers/net/wireless/ath9k/main.c
@@ -2089,6 +2089,8 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
DPRINTF(sc, ATH_DBG_CONFIG, "Set channel: %d MHz\n",
curchan->center_freq);
+ ath_update_chainmask(sc, conf->ht.enabled);
+
pos = ath_get_channel(sc, curchan);
if (pos == -1) {
DPRINTF(sc, ATH_DBG_FATAL, "Invalid channel: %d\n",
@@ -2101,8 +2103,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
(curchan->band == IEEE80211_BAND_2GHZ) ?
CHANNEL_G : CHANNEL_A;
- if ((sc->sc_ah->ah_opmode == NL80211_IFTYPE_AP) &&
- (conf->ht.enabled)) {
+ if (conf->ht.enabled) {
sc->tx_chan_width = (!!conf->ht.sec_chan_offset) ?
ATH9K_HT_MACMODE_2040 : ATH9K_HT_MACMODE_20;
@@ -2118,9 +2119,6 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
}
}
- if (changed & IEEE80211_CONF_CHANGE_HT)
- ath_update_chainmask(sc, conf->ht.enabled);
-
if (changed & IEEE80211_CONF_CHANGE_POWER)
sc->sc_config.txpowlimit = 2 * conf->power_level;
next prev parent reply other threads:[~2008-12-07 16:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-07 16:30 [RFT] mac80211: fix HT channel selection Johannes Berg
2008-12-07 16:41 ` Ivo van Doorn
2008-12-07 16:46 ` Sujith [this message]
2008-12-07 17:44 ` Johannes Berg
2008-12-07 18:38 ` Mats Johannesson
2008-12-07 18:43 ` 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=18747.65000.953959.335010@localhost.localdomain \
--to=m.sujith@gmail.com \
--cc=Jouni.Malinen@Atheros.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=spamcan1@abrasax.se \
--cc=tomasw@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).