aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rndis_wlan.c
diff options
context:
space:
mode:
authorDavid Kilroy <kilroyd@googlemail.com>2008-12-23 09:03:38 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 15:58:46 -0500
commit9ee677c2276bfcbcf68042ec2718a504af0c5fd7 (patch)
tree0b5528241690e143c60832d319ddbb2ad1c5d7f1 /drivers/net/wireless/rndis_wlan.c
parenteaee7cc2c180c291084a1c1f49cd2bf13002b3e1 (diff)
wireless: Add channel/frequency conversions to ieee80211.h
Added mappings for FHSS, DSSS and OFDM channels - with macros to point HR DSSS and ERP to the DSSS mappings. Currently just static inline functions. Use the new functions in the older fullmac drivers. This eliminates a number of const static buffers and removes a couple of range checks that are now redundant. Signed-off-by: David Kilroy <kilroyd@googlemail.com> Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com> Acked-by: Richard Farina <sidhayn@gmail.com> Acked-by: Jeroen Vreeken <pe1rxq@amsat.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rndis_wlan.c')
-rw-r--r--drivers/net/wireless/rndis_wlan.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index ed93ac41297f..105f214e21f4 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -369,9 +369,6 @@ struct rndis_wext_private {
369}; 369};
370 370
371 371
372static const int freq_chan[] = { 2412, 2417, 2422, 2427, 2432, 2437, 2442,
373 2447, 2452, 2457, 2462, 2467, 2472, 2484 };
374
375static const int rates_80211g[8] = { 6, 9, 12, 18, 24, 36, 48, 54 }; 372static const int rates_80211g[8] = { 6, 9, 12, 18, 24, 36, 48, 54 };
376 373
377static const int bcm4320_power_output[4] = { 25, 50, 75, 100 }; 374static const int bcm4320_power_output[4] = { 25, 50, 75, 100 };
@@ -640,8 +637,8 @@ static void dsconfig_to_freq(unsigned int dsconfig, struct iw_freq *freq)
640static int freq_to_dsconfig(struct iw_freq *freq, unsigned int *dsconfig) 637static int freq_to_dsconfig(struct iw_freq *freq, unsigned int *dsconfig)
641{ 638{
642 if (freq->m < 1000 && freq->e == 0) { 639 if (freq->m < 1000 && freq->e == 0) {
643 if (freq->m >= 1 && freq->m <= ARRAY_SIZE(freq_chan)) 640 if (freq->m >= 1 && freq->m <= 14)
644 *dsconfig = freq_chan[freq->m - 1] * 1000; 641 *dsconfig = ieee80211_dsss_chan_to_freq(freq->m) * 1000;
645 else 642 else
646 return -1; 643 return -1;
647 } else { 644 } else {
@@ -1178,11 +1175,11 @@ static int rndis_iw_get_range(struct net_device *dev,
1178 range->throughput = 11 * 1000 * 1000 / 2; 1175 range->throughput = 11 * 1000 * 1000 / 2;
1179 } 1176 }
1180 1177
1181 range->num_channels = ARRAY_SIZE(freq_chan); 1178 range->num_channels = 14;
1182 1179
1183 for (i = 0; i < ARRAY_SIZE(freq_chan) && i < IW_MAX_FREQUENCIES; i++) { 1180 for (i = 0; (i < 14) && (i < IW_MAX_FREQUENCIES); i++) {
1184 range->freq[i].i = i + 1; 1181 range->freq[i].i = i + 1;
1185 range->freq[i].m = freq_chan[i] * 100000; 1182 range->freq[i].m = ieee80211_dsss_chan_to_freq(i + 1) * 100000;
1186 range->freq[i].e = 1; 1183 range->freq[i].e = 1;
1187 } 1184 }
1188 range->num_frequency = i; 1185 range->num_frequency = i;