aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/main.c
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2009-11-27 06:01:35 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-12-04 14:16:23 -0500
commita9a29ce674ac62e7bfcb6c1404ca86cda4782988 (patch)
tree45aad580765aba12a3283418227383a07cf53080 /drivers/net/wireless/ath/ath9k/main.c
parent1f351e3840dcf25aaddec2d908c3ab06ae105ee6 (diff)
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 Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/main.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index b9598148767b..c48743452515 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1793,13 +1793,15 @@ static int ath_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid,
1793 1793
1794 /* setup channels and rates */ 1794 /* setup channels and rates */
1795 1795
1796 sc->sbands[IEEE80211_BAND_2GHZ].channels = ath9k_2ghz_chantable; 1796 if (test_bit(ATH9K_MODE_11G, sc->sc_ah->caps.wireless_modes)) {
1797 sc->sbands[IEEE80211_BAND_2GHZ].band = IEEE80211_BAND_2GHZ; 1797 sc->sbands[IEEE80211_BAND_2GHZ].channels = ath9k_2ghz_chantable;
1798 sc->sbands[IEEE80211_BAND_2GHZ].n_channels = 1798 sc->sbands[IEEE80211_BAND_2GHZ].band = IEEE80211_BAND_2GHZ;
1799 ARRAY_SIZE(ath9k_2ghz_chantable); 1799 sc->sbands[IEEE80211_BAND_2GHZ].n_channels =
1800 sc->sbands[IEEE80211_BAND_2GHZ].bitrates = ath9k_legacy_rates; 1800 ARRAY_SIZE(ath9k_2ghz_chantable);
1801 sc->sbands[IEEE80211_BAND_2GHZ].n_bitrates = 1801 sc->sbands[IEEE80211_BAND_2GHZ].bitrates = ath9k_legacy_rates;
1802 ARRAY_SIZE(ath9k_legacy_rates); 1802 sc->sbands[IEEE80211_BAND_2GHZ].n_bitrates =
1803 ARRAY_SIZE(ath9k_legacy_rates);
1804 }
1803 1805
1804 if (test_bit(ATH9K_MODE_11A, sc->sc_ah->caps.wireless_modes)) { 1806 if (test_bit(ATH9K_MODE_11A, sc->sc_ah->caps.wireless_modes)) {
1805 sc->sbands[IEEE80211_BAND_5GHZ].channels = ath9k_5ghz_chantable; 1807 sc->sbands[IEEE80211_BAND_5GHZ].channels = ath9k_5ghz_chantable;
@@ -1876,8 +1878,9 @@ void ath_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
1876 1878
1877 hw->rate_control_algorithm = "ath9k_rate_control"; 1879 hw->rate_control_algorithm = "ath9k_rate_control";
1878 1880
1879 hw->wiphy->bands[IEEE80211_BAND_2GHZ] = 1881 if (test_bit(ATH9K_MODE_11G, sc->sc_ah->caps.wireless_modes))
1880 &sc->sbands[IEEE80211_BAND_2GHZ]; 1882 hw->wiphy->bands[IEEE80211_BAND_2GHZ] =
1883 &sc->sbands[IEEE80211_BAND_2GHZ];
1881 if (test_bit(ATH9K_MODE_11A, sc->sc_ah->caps.wireless_modes)) 1884 if (test_bit(ATH9K_MODE_11A, sc->sc_ah->caps.wireless_modes))
1882 hw->wiphy->bands[IEEE80211_BAND_5GHZ] = 1885 hw->wiphy->bands[IEEE80211_BAND_5GHZ] =
1883 &sc->sbands[IEEE80211_BAND_5GHZ]; 1886 &sc->sbands[IEEE80211_BAND_5GHZ];
@@ -1916,9 +1919,12 @@ int ath_init_device(u16 devid, struct ath_softc *sc, u16 subsysid,
1916 reg = &common->regulatory; 1919 reg = &common->regulatory;
1917 1920
1918 if (ah->caps.hw_caps & ATH9K_HW_CAP_HT) { 1921 if (ah->caps.hw_caps & ATH9K_HW_CAP_HT) {
1919 setup_ht_cap(sc, &sc->sbands[IEEE80211_BAND_2GHZ].ht_cap); 1922 if (test_bit(ATH9K_MODE_11G, ah->caps.wireless_modes))
1923 setup_ht_cap(sc,
1924 &sc->sbands[IEEE80211_BAND_2GHZ].ht_cap);
1920 if (test_bit(ATH9K_MODE_11A, ah->caps.wireless_modes)) 1925 if (test_bit(ATH9K_MODE_11A, ah->caps.wireless_modes))
1921 setup_ht_cap(sc, &sc->sbands[IEEE80211_BAND_5GHZ].ht_cap); 1926 setup_ht_cap(sc,
1927 &sc->sbands[IEEE80211_BAND_5GHZ].ht_cap);
1922 } 1928 }
1923 1929
1924 /* initialize tx/rx engine */ 1930 /* initialize tx/rx engine */