aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h4
-rw-r--r--drivers/net/wireless/ath/ath9k/init.c4
2 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 7f696c82ca0a..6b9233472fbf 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -61,6 +61,8 @@
61 61
62#define ATH9K_RSSI_BAD -128 62#define ATH9K_RSSI_BAD -128
63 63
64#define ATH9K_NUM_CHANNELS 38
65
64/* Register read/write primitives */ 66/* Register read/write primitives */
65#define REG_WRITE(_ah, _reg, _val) \ 67#define REG_WRITE(_ah, _reg, _val) \
66 ath9k_hw_common(_ah)->ops->write((_ah), (_val), (_reg)) 68 ath9k_hw_common(_ah)->ops->write((_ah), (_val), (_reg))
@@ -618,7 +620,7 @@ struct ath_hw {
618 struct ath9k_hw_version hw_version; 620 struct ath9k_hw_version hw_version;
619 struct ath9k_ops_config config; 621 struct ath9k_ops_config config;
620 struct ath9k_hw_capabilities caps; 622 struct ath9k_hw_capabilities caps;
621 struct ath9k_channel channels[38]; 623 struct ath9k_channel channels[ATH9K_NUM_CHANNELS];
622 struct ath9k_channel *curchan; 624 struct ath9k_channel *curchan;
623 625
624 union { 626 union {
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index d76003c06fe4..a4c5ed41b176 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -481,6 +481,10 @@ static int ath9k_init_channels_rates(struct ath_softc *sc)
481{ 481{
482 void *channels; 482 void *channels;
483 483
484 BUILD_BUG_ON(ARRAY_SIZE(ath9k_2ghz_chantable) +
485 ARRAY_SIZE(ath9k_5ghz_chantable) !=
486 ATH9K_NUM_CHANNELS);
487
484 if (test_bit(ATH9K_MODE_11G, sc->sc_ah->caps.wireless_modes)) { 488 if (test_bit(ATH9K_MODE_11G, sc->sc_ah->caps.wireless_modes)) {
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);