ath9k: enable 2GHz band only if the device supports it
PATCH 1/1 ath9k: enable 2GHz band only if the device supports it
Currently, the 2GHz band is enabled unconditionally, even if the device does not support it.
Changes-licensed-under: ISC
--- drivers/net/wireless/ath/ath9k/main.c | 26 ++++++++++++++++---------- 1 files changed, 16 insertions(+), 10 deletions(-)
drivers/net/wireless/ath/ath9k/main.c +16 -10
@@ -1826,12 +1826,14 @@ static int ath_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid,/* setup channels and rates */ - sc->sbands[IEEE80211_BAND_2GHZ ].channels = ath9k_2ghz_chantable; - sc->sbands[IEEE80211_BAND_2GHZ ].bitrates = - sc->rates[IEEE80211_BAND_2GHZ ]; - sc->sbands[IEEE80211_BAND_2GHZ ].band =IEEE80211_BAND_2GHZ ; - sc->sbands[IEEE80211_BAND_2GHZ ].n_channels = -ARRAY_SIZE (ath9k_2ghz_chantable); +if (test_bit (ATH9K_MODE_11G , sc->sc_ah->caps.wireless_modes)) { + sc->sbands[IEEE80211_BAND_2GHZ ].channels = ath9k_2ghz_chantable; + sc->sbands[IEEE80211_BAND_2GHZ ].bitrates = + sc->rates[IEEE80211_BAND_2GHZ ]; + sc->sbands[IEEE80211_BAND_2GHZ ].band =IEEE80211_BAND_2GHZ ; + sc->sbands[IEEE80211_BAND_2GHZ ].n_channels = +ARRAY_SIZE (ath9k_2ghz_chantable); + }if (test_bit (ATH9K_MODE_11A , sc->sc_ah->caps.wireless_modes)) { sc->sbands[IEEE80211_BAND_5GHZ ].channels = ath9k_5ghz_chantable;
@@ -1906,8 +1908,9 @@ void ath_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw) hw->rate_control_algorithm ="ath9k_rate_control" ; - hw->wiphy->bands[IEEE80211_BAND_2GHZ ] = - &sc->sbands[IEEE80211_BAND_2GHZ ]; +if (test_bit (ATH9K_MODE_11G , sc->sc_ah->caps.wireless_modes)) + hw->wiphy->bands[IEEE80211_BAND_2GHZ ] = + &sc->sbands[IEEE80211_BAND_2GHZ ];if (test_bit (ATH9K_MODE_11A , sc->sc_ah->caps.wireless_modes)) hw->wiphy->bands[IEEE80211_BAND_5GHZ ] = &sc->sbands[IEEE80211_BAND_5GHZ ];
@@ -1946,9 +1949,12 @@ int ath_init_device(u16 devid, struct ath_softc *sc, u16 subsysid, reg = &common->regulatory;if (ah->caps.hw_caps &ATH9K_HW_CAP_HT ) { -setup_ht_cap (sc, &sc->sbands[IEEE80211_BAND_2GHZ ].ht_cap); +if (test_bit (ATH9K_MODE_11G , ah->caps.wireless_modes)) +setup_ht_cap (sc, + &sc->sbands[IEEE80211_BAND_2GHZ ].ht_cap);if (test_bit (ATH9K_MODE_11A , ah->caps.wireless_modes)) -setup_ht_cap (sc, &sc->sbands[IEEE80211_BAND_5GHZ ].ht_cap); +setup_ht_cap (sc, + &sc->sbands[IEEE80211_BAND_5GHZ ].ht_cap); }/* initialize tx/rx engine */
Signature · 1 line
1.5.3.2
PATCH 1/1 ath9k: enable 2GHz band only if the device supports it
Quoted 2 lines · Gabor Juhos
Currently, the 2GHz band is enabled unconditionally, even if the device does not support it.
This is true, but we don't have any 11n 5 GHz only devices, The patch is fine too though but it'd be better if you fail with a proper ath_print ATH_DBG_FATAL message if neither band has been marked as supported.
Luis
PATCH 1/1 ath9k: enable 2GHz band only if the device supports it
Quoted 8 lines · Luis R. Rodriguez
Quoted 2 lines · Gabor Juhos
Currently, the 2GHz band is enabled unconditionally, even if the device does not support it.
This is true, but we don't have any 11n 5 GHz only devices, The patch is fine too though but it'd be better if you fail with a proper
ath_printATH_DBG_FATALmessage if neither band has been marked as supported.
We do have some ;)
Ubiquiti Networks has a few Python+Merlin based devices that are 5GHz only, and we're working on supporting them.
- Felix
PATCH 1/1 ath9k: enable 2GHz band only if the device supports it
Quoted 5 lines · Felix Fietkau
Quoted 4 lines · Luis R. Rodriguez
Quoted 2 lines · Gabor Juhos
Currently, the 2GHz band is enabled unconditionally, even if the device does not support it.
Quoted 7 lines
Quoted 4 lines
This is true, but we don't have any 11n 5 GHz only devices, The patch is fine too though but it'd be better if you fail with a proper
ath_printATH_DBG_FATALmessage if neither band has been marked as supported.We do have some ;)
Ubiquiti Networks has a few Python+Merlin based devices that are 5GHz only, and we're working on supporting them.
Sexy!
Luis