Skip to content

Commit

Permalink
zd1201: replace function ieee80211_{dsss_chan_to_freq, freq_to_dsss_c…
Browse files Browse the repository at this point in the history
…han}

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 <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
  • Loading branch information
zhao-gang authored and linvjw committed Feb 28, 2014
1 parent 3a11af8 commit 3d54b90
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions drivers/net/wireless/zd1201.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/wireless.h>
#include <linux/ieee80211.h>
#include <net/cfg80211.h>
#include <net/iw_handler.h>
#include <linux/string.h>
#include <linux/if_arp.h>
Expand Down Expand Up @@ -914,11 +914,8 @@ static int zd1201_set_freq(struct net_device *dev,

if (freq->e == 0)
channel = freq->m;
else {
channel = ieee80211_freq_to_dsss_chan(freq->m);
if (channel < 0)
channel = 0;
}
else
channel = ieee80211_frequency_to_channel(freq->m);

err = zd1201_setconfig16(zd, ZD1201_RID_CNFOWNCHANNEL, channel);
if (err)
Expand Down

0 comments on commit 3d54b90

Please sign in to comment.