From 4efa8f9859cc14098cf63ac10b0167f2ea3af21e Mon Sep 17 00:00:00 2001 From: Bruno Randolf Date: Wed, 19 Jan 2011 18:20:36 +0900 Subject: [PATCH] --- yaml --- r: 236763 b: refs/heads/master c: 90c02d72ffbec3804f48c517ecfc72f9440a67b3 h: refs/heads/master i: 236761: 21c88a192e45fb778e6e9d2a6307ebb08d77acdf 236759: cb195fa48f706b0b9ed91bd534b8ced5c043e4d5 v: v3 --- [refs] | 2 +- trunk/drivers/net/wireless/ath/ath5k/base.c | 23 +++++++-------------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/[refs] b/[refs] index bf1e594d441d..02f34a49cbc4 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7755bad9ffe56e0faacb13bc9484ccc0194aaa75 +refs/heads/master: 90c02d72ffbec3804f48c517ecfc72f9440a67b3 diff --git a/trunk/drivers/net/wireless/ath/ath5k/base.c b/trunk/drivers/net/wireless/ath/ath5k/base.c index 019a74d533a6..c0177587856b 100644 --- a/trunk/drivers/net/wireless/ath/ath5k/base.c +++ b/trunk/drivers/net/wireless/ath/ath5k/base.c @@ -241,18 +241,6 @@ static int ath5k_reg_notifier(struct wiphy *wiphy, struct regulatory_request *re * Channel/mode setup * \********************/ -/* - * Convert IEEE channel number to MHz frequency. - */ -static inline short -ath5k_ieee2mhz(short chan) -{ - if (chan <= 14 || chan >= 27) - return ieee80211chan2mhz(chan); - else - return 2212 + chan * 20; -} - /* * Returns true for the channel numbers used without all_channels modparam. */ @@ -274,6 +262,7 @@ ath5k_copy_channels(struct ath5k_hw *ah, unsigned int max) { unsigned int i, count, size, chfreq, freq, ch; + enum ieee80211_band band; if (!test_bit(mode, ah->ah_modes)) return 0; @@ -283,11 +272,13 @@ ath5k_copy_channels(struct ath5k_hw *ah, /* 1..220, but 2GHz frequencies are filtered by check_channel */ size = 220 ; chfreq = CHANNEL_5GHZ; + band = IEEE80211_BAND_5GHZ; break; case AR5K_MODE_11B: case AR5K_MODE_11G: size = 26; chfreq = CHANNEL_2GHZ; + band = IEEE80211_BAND_2GHZ; break; default: ATH5K_WARN(ah->ah_sc, "bad mode, not copying channels\n"); @@ -296,7 +287,10 @@ ath5k_copy_channels(struct ath5k_hw *ah, for (i = 0, count = 0; i < size && max > 0; i++) { ch = i + 1 ; - freq = ath5k_ieee2mhz(ch); + freq = ieee80211_channel_to_frequency(ch, band); + + if (freq == 0) /* mapping failed - not a standard channel */ + continue; /* Check if channel is supported by the chipset */ if (!ath5k_channel_ok(ah, freq, chfreq)) @@ -307,8 +301,7 @@ ath5k_copy_channels(struct ath5k_hw *ah, /* Write channel info and increment counter */ channels[count].center_freq = freq; - channels[count].band = (chfreq == CHANNEL_2GHZ) ? - IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ; + channels[count].band = band; switch (mode) { case AR5K_MODE_11A: case AR5K_MODE_11G: