aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/init.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/init.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index d76003c06fe4..bc6c4df9712c 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -481,7 +481,11 @@ static int ath9k_init_channels_rates(struct ath_softc *sc)
481{ 481{
482 void *channels; 482 void *channels;
483 483
484 if (test_bit(ATH9K_MODE_11G, sc->sc_ah->caps.wireless_modes)) { 484 BUILD_BUG_ON(ARRAY_SIZE(ath9k_2ghz_chantable) +
485 ARRAY_SIZE(ath9k_5ghz_chantable) !=
486 ATH9K_NUM_CHANNELS);
487
488 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_2GHZ) {
485 channels = kmemdup(ath9k_2ghz_chantable, 489 channels = kmemdup(ath9k_2ghz_chantable,
486 sizeof(ath9k_2ghz_chantable), GFP_KERNEL); 490 sizeof(ath9k_2ghz_chantable), GFP_KERNEL);
487 if (!channels) 491 if (!channels)
@@ -496,7 +500,7 @@ static int ath9k_init_channels_rates(struct ath_softc *sc)
496 ARRAY_SIZE(ath9k_legacy_rates); 500 ARRAY_SIZE(ath9k_legacy_rates);
497 } 501 }
498 502
499 if (test_bit(ATH9K_MODE_11A, sc->sc_ah->caps.wireless_modes)) { 503 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_5GHZ) {
500 channels = kmemdup(ath9k_5ghz_chantable, 504 channels = kmemdup(ath9k_5ghz_chantable,
501 sizeof(ath9k_5ghz_chantable), GFP_KERNEL); 505 sizeof(ath9k_5ghz_chantable), GFP_KERNEL);
502 if (!channels) { 506 if (!channels) {
@@ -677,17 +681,17 @@ void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
677 hw->rate_control_algorithm = "ath9k_rate_control"; 681 hw->rate_control_algorithm = "ath9k_rate_control";
678#endif 682#endif
679 683
680 if (test_bit(ATH9K_MODE_11G, sc->sc_ah->caps.wireless_modes)) 684 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_2GHZ)
681 hw->wiphy->bands[IEEE80211_BAND_2GHZ] = 685 hw->wiphy->bands[IEEE80211_BAND_2GHZ] =
682 &sc->sbands[IEEE80211_BAND_2GHZ]; 686 &sc->sbands[IEEE80211_BAND_2GHZ];
683 if (test_bit(ATH9K_MODE_11A, sc->sc_ah->caps.wireless_modes)) 687 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_5GHZ)
684 hw->wiphy->bands[IEEE80211_BAND_5GHZ] = 688 hw->wiphy->bands[IEEE80211_BAND_5GHZ] =
685 &sc->sbands[IEEE80211_BAND_5GHZ]; 689 &sc->sbands[IEEE80211_BAND_5GHZ];
686 690
687 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT) { 691 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT) {
688 if (test_bit(ATH9K_MODE_11G, sc->sc_ah->caps.wireless_modes)) 692 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_2GHZ)
689 setup_ht_cap(sc, &sc->sbands[IEEE80211_BAND_2GHZ].ht_cap); 693 setup_ht_cap(sc, &sc->sbands[IEEE80211_BAND_2GHZ].ht_cap);
690 if (test_bit(ATH9K_MODE_11A, sc->sc_ah->caps.wireless_modes)) 694 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_5GHZ)
691 setup_ht_cap(sc, &sc->sbands[IEEE80211_BAND_5GHZ].ht_cap); 695 setup_ht_cap(sc, &sc->sbands[IEEE80211_BAND_5GHZ].ht_cap);
692 } 696 }
693 697