summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/zd1201.c
diff options
context:
space:
mode:
authorDavid Kilroy <kilroyd@googlemail.com>2008-12-23 14:03:38 +0000
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 15:58:46 -0500
commit9ee677c2276bfcbcf68042ec2718a504af0c5fd7 (patch)
tree0b5528241690e143c60832d319ddbb2ad1c5d7f1 /drivers/net/wireless/zd1201.c
parenteaee7cc2c180c291084a1c1f49cd2bf13002b3e1 (diff)
downloadop-kernel-dev-9ee677c2276bfcbcf68042ec2718a504af0c5fd7.zip
op-kernel-dev-9ee677c2276bfcbcf68042ec2718a504af0c5fd7.tar.gz
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/zd1201.c')
-rw-r--r--drivers/net/wireless/zd1201.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/wireless/zd1201.c b/drivers/net/wireless/zd1201.c
index b45c27d..6226ac2 100644
--- a/drivers/net/wireless/zd1201.c
+++ b/drivers/net/wireless/zd1201.c
@@ -919,10 +919,9 @@ static int zd1201_set_freq(struct net_device *dev,
if (freq->e == 0)
channel = freq->m;
else {
- if (freq->m >= 2482)
- channel = 14;
- if (freq->m >= 2407)
- channel = (freq->m-2407)/5;
+ channel = ieee80211_freq_to_dsss_chan(freq->m);
+ if (channel < 0)
+ channel = 0;
}
err = zd1201_setconfig16(zd, ZD1201_RID_CNFOWNCHANNEL, channel);
OpenPOWER on IntegriCloud