summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/bcm43xx/bcm43xx_main.h
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2006-05-05 17:23:51 +0200
committerJohn W. Linville <linville@tuxdriver.com>2006-05-05 16:55:23 -0400
commit869aaab1812c4212e65fb181e94b824cf49f9509 (patch)
tree224829a8847e7aff4bd001de972123f4cd0fbeb0 /drivers/net/wireless/bcm43xx/bcm43xx_main.h
parentf9f7b9602ecb66f55718d6d1afa3e2b1e721b22d (diff)
downloadblackbird-obmc-linux-869aaab1812c4212e65fb181e94b824cf49f9509.tar.gz
blackbird-obmc-linux-869aaab1812c4212e65fb181e94b824cf49f9509.zip
[PATCH] bcm43xx: Fix array overrun in bcm43xx_geo_init
The problem here is that the bcm34xx driver and the ieee80211 stack do not agree on what channels are possible for 802.11a. The ieee80211 stack only wants channels between 34 and 165, while the bcm43xx driver accepts anything from 0 to 200. I made the bcm43xx driver comply with the ieee80211 stack expectations, by using the proper constants. Signed-off-by: Jean Delvare <jdelvare@suse.de> [mb]: Reduce stack usage by kzalloc-ing ieee80211_geo Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/bcm43xx/bcm43xx_main.h')
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_main.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.h b/drivers/net/wireless/bcm43xx/bcm43xx_main.h
index eca79a38594a..30a202b258b5 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_main.h
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.h
@@ -118,12 +118,14 @@ int bcm43xx_channel_to_freq(struct bcm43xx_private *bcm,
static inline
int bcm43xx_is_valid_channel_a(u8 channel)
{
- return (channel <= 200);
+ return (channel >= IEEE80211_52GHZ_MIN_CHANNEL
+ && channel <= IEEE80211_52GHZ_MAX_CHANNEL);
}
static inline
int bcm43xx_is_valid_channel_bg(u8 channel)
{
- return (channel >= 1 && channel <= 14);
+ return (channel >= IEEE80211_24GHZ_MIN_CHANNEL
+ && channel <= IEEE80211_24GHZ_MAX_CHANNEL);
}
static inline
int bcm43xx_is_valid_channel(struct bcm43xx_private *bcm,
OpenPOWER on IntegriCloud