summaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-03-16 18:35:56 +0100
committerJohn W. Linville <linville@tuxdriver.com>2008-03-25 21:41:55 +0100
commite048c6e4fdac9be0dbcb7e0c5d518737c867ef09 (patch)
tree15ca04d56fd475ce0a843209a198822962f47521 /net/mac80211
parentwireless: add wiphy channel freq to channel struct lookup helper (diff)
downloadlinux-e048c6e4fdac9be0dbcb7e0c5d518737c867ef09.tar.xz
linux-e048c6e4fdac9be0dbcb7e0c5d518737c867ef09.zip
mac80211: use ieee80211_get_channel
Use the new ieee80211_get_channel() function instead of open-coding it. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/ieee80211_ioctl.c29
1 files changed, 4 insertions, 25 deletions
diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c
index 1d91575a0fe9..8e8e5a19d893 100644
--- a/net/mac80211/ieee80211_ioctl.c
+++ b/net/mac80211/ieee80211_ioctl.c
@@ -279,35 +279,14 @@ static int ieee80211_ioctl_giwmode(struct net_device *dev,
int ieee80211_set_freq(struct ieee80211_local *local, int freqMHz)
{
- int set = 0;
int ret = -EINVAL;
- enum ieee80211_band band;
- struct ieee80211_supported_band *sband;
- int i;
-
- for (band = 0; band < IEEE80211_NUM_BANDS; band ++) {
- sband = local->hw.wiphy->bands[band];
+ struct ieee80211_channel *chan;
- if (!sband)
- continue;
+ chan = ieee80211_get_channel(local->hw.wiphy, freqMHz);
- for (i = 0; i < sband->n_channels; i++) {
- struct ieee80211_channel *chan = &sband->channels[i];
-
- if (chan->flags & IEEE80211_CHAN_DISABLED)
- continue;
-
- if (chan->center_freq == freqMHz) {
- set = 1;
- local->oper_channel = chan;
- break;
- }
- }
- if (set)
- break;
- }
+ if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) {
+ local->oper_channel = chan;
- if (set) {
if (local->sta_sw_scanning)
ret = 0;
else