aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhao, Gang <gamerh2o@gmail.com>2014-02-18 08:36:01 -0500
committerJohn W. Linville <linville@tuxdriver.com>2014-02-28 14:12:36 -0500
commit3d54b9052c08a473f56cbed6a0bb4c900c948474 (patch)
tree2e642084f6dda5592511302c036f6668452c3926
parent3a11af8aadc5a7bf9b4cdec6424869b1017b452e (diff)
zd1201: replace function ieee80211_{dsss_chan_to_freq, freq_to_dsss_chan}
Replace ieee80211_{dsss_chan_to_freq, freq_to_dsss_chan} with more generic ieee80211_{channel_to_frequency, frequency_to_channel}. Function ieee80211_frequency_to_channel() will return 0 if frequency is not correctly provided, so no need to set channel to 0 explicitly. Include <net/cfg80211.h> for the defination of IEEE80211_BAND_2GHZ. Because <net/cfg80211.h> includes <linux/ieee80211.h>, so we can replace <linux/ieee80211.h> with <net/cfg80211.h>. This change is a preparation for the removal of function ieee80211_{dsss_chan_to_freq, freq_to_dsss_chan}. Signed-off-by: Zhao, Gang <gamerh2o@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/zd1201.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/net/wireless/zd1201.c b/drivers/net/wireless/zd1201.c
index d39c4178c33a..6f5c793a7855 100644
--- a/drivers/net/wireless/zd1201.c
+++ b/drivers/net/wireless/zd1201.c
@@ -18,7 +18,7 @@
18#include <linux/netdevice.h> 18#include <linux/netdevice.h>
19#include <linux/etherdevice.h> 19#include <linux/etherdevice.h>
20#include <linux/wireless.h> 20#include <linux/wireless.h>
21#include <linux/ieee80211.h> 21#include <net/cfg80211.h>
22#include <net/iw_handler.h> 22#include <net/iw_handler.h>
23#include <linux/string.h> 23#include <linux/string.h>
24#include <linux/if_arp.h> 24#include <linux/if_arp.h>
@@ -914,11 +914,8 @@ static int zd1201_set_freq(struct net_device *dev,
914 914
915 if (freq->e == 0) 915 if (freq->e == 0)
916 channel = freq->m; 916 channel = freq->m;
917 else { 917 else
918 channel = ieee80211_freq_to_dsss_chan(freq->m); 918 channel = ieee80211_frequency_to_channel(freq->m);
919 if (channel < 0)
920 channel = 0;
921 }
922 919
923 err = zd1201_setconfig16(zd, ZD1201_RID_CNFOWNCHANNEL, channel); 920 err = zd1201_setconfig16(zd, ZD1201_RID_CNFOWNCHANNEL, channel);
924 if (err) 921 if (err)