Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90313
b: refs/heads/master
c: 906c730
h: refs/heads/master
i:
  90311: 442d972
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Mar 25, 2008
1 parent ba7dd28 commit 442647f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 857485c0c46ceee5c658c1761bba4d9a5ddf433f
refs/heads/master: 906c730a2db950b7bce4ef17d65399acd791c360
6 changes: 6 additions & 0 deletions trunk/include/net/wireless.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,4 +304,10 @@ extern int ieee80211_channel_to_frequency(int chan);
*/
extern int ieee80211_frequency_to_channel(int freq);

/**
* ieee80211_get_channel - get channel struct from wiphy for specified frequency
*/
extern struct ieee80211_channel *ieee80211_get_channel(struct wiphy *wiphy,
int freq);

#endif /* __NET_WIRELESS_H */
23 changes: 23 additions & 0 deletions trunk/net/wireless/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 442647f

Please sign in to comment.