X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=net%2Fwireless%2Futil.c;h=f54424693a38a378bd5e7cdc25326907b5fbb983;hb=00e9028a95fb8a4d79f2fb695a853f33ea7d3b57;hp=77336c22fcf2e618a7838fd666adbe519f1708e4;hpb=06802a819a0a2d31c952c0624cea6cd00e4e50da;p=linux-2.6 diff --git a/net/wireless/util.c b/net/wireless/util.c index 77336c22fc..f54424693a 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c @@ -33,6 +33,29 @@ int ieee80211_frequency_to_channel(int freq) } EXPORT_SYMBOL(ieee80211_frequency_to_channel); +struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy, + int freq) +{ + enum ieee80211_band band; + struct ieee80211_supported_band *sband; + int i; + + for (band = 0; band < IEEE80211_NUM_BANDS; band++) { + sband = wiphy->bands[band]; + + if (!sband) + continue; + + for (i = 0; i < sband->n_channels; i++) { + if (sband->channels[i].center_freq == freq) + return &sband->channels[i]; + } + } + + return NULL; +} +EXPORT_SYMBOL(__ieee80211_get_channel); + static void set_mandatory_flags_band(struct ieee80211_supported_band *sband, enum ieee80211_band band) {