aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless/zd1201.c
diff options
context:
space:
mode:
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 b45c27d42fd..6226ac2357f 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);