aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ieee80211_ioctl.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-03-16 13:35:56 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-03-25 16:41:55 -0400
commite048c6e4fdac9be0dbcb7e0c5d518737c867ef09 (patch)
tree15ca04d56fd475ce0a843209a198822962f47521 /net/mac80211/ieee80211_ioctl.c
parent906c730a2db950b7bce4ef17d65399acd791c360 (diff)
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/ieee80211_ioctl.c')
-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,
279 279
280int ieee80211_set_freq(struct ieee80211_local *local, int freqMHz) 280int ieee80211_set_freq(struct ieee80211_local *local, int freqMHz)
281{ 281{
282 int set = 0;
283 int ret = -EINVAL; 282 int ret = -EINVAL;
284 enum ieee80211_band band; 283 struct ieee80211_channel *chan;
285 struct ieee80211_supported_band *sband;
286 int i;
287
288 for (band = 0; band < IEEE80211_NUM_BANDS; band ++) {
289 sband = local->hw.wiphy->bands[band];
290 284
291 if (!sband) 285 chan = ieee80211_get_channel(local->hw.wiphy, freqMHz);
292 continue;
293 286
294 for (i = 0; i < sband->n_channels; i++) { 287 if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) {
295 struct ieee80211_channel *chan = &sband->channels[i]; 288 local->oper_channel = chan;
296
297 if (chan->flags & IEEE80211_CHAN_DISABLED)
298 continue;
299
300 if (chan->center_freq == freqMHz) {
301 set = 1;
302 local->oper_channel = chan;
303 break;
304 }
305 }
306 if (set)
307 break;
308 }
309 289
310 if (set) {
311 if (local->sta_sw_scanning) 290 if (local->sta_sw_scanning)
312 ret = 0; 291 ret = 0;
313 else 292 else