From: Johannes Berg Date: Sun, 16 Mar 2008 17:35:56 +0000 (+0100) Subject: mac80211: use ieee80211_get_channel X-Git-Tag: v2.6.26-rc1~1138^2~350^2~13 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e048c6e4fdac9be0dbcb7e0c5d518737c867ef09;p=linux-2.6 mac80211: use ieee80211_get_channel Use the new ieee80211_get_channel() function instead of open-coding it. Signed-off-by: Johannes Berg Signed-off-by: John W. Linville --- diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c index 1d91575a0f..8e8e5a19d8 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