aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/hw.h
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-10-08 20:39:30 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-10-11 15:04:21 -0400
commitcac4220b2e93e6344f987581d52d5bd71ff2cc0e (patch)
treed089cca561a5fe1237a1f2a80589c7819ed3abe8 /drivers/net/wireless/ath/ath9k/hw.h
parent8610c29a2c9f273886b1c31ae4d92c69d4326262 (diff)
ath9k: add compile time checking for the size of the channel list
This prevents random memory corruption if the number of channels ever gets changed without an update to the internal channel array size. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/hw.h')
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h4
1 files changed, 3 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 {