diff options
author | David S. Miller <davem@davemloft.net> | 2008-03-25 17:20:03 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-03-25 17:20:03 -0700 |
commit | f89e6e3834035c6e8203042f3527931aa7f52496 (patch) | |
tree | a82677254fe4511679d5690606ac75f4300fefe1 /net/wireless | |
parent | 7cbca67c073263c179f605bdbbdc565ab29d801d (diff) | |
parent | 3a643d244f09fa1fdd25d48a56a073c1a69583ee (diff) | |
download | linux-3.10-f89e6e3834035c6e8203042f3527931aa7f52496.tar.gz linux-3.10-f89e6e3834035c6e8203042f3527931aa7f52496.tar.bz2 linux-3.10-f89e6e3834035c6e8203042f3527931aa7f52496.zip |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.26
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/util.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/net/wireless/util.c b/net/wireless/util.c index 77336c22fcf..f3e623df351 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) { |