Search Linux Wireless

[RFT] mac80211: fix HT channel selection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;
 
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux