Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 150259
b: refs/heads/master
c: 0b25858
h: refs/heads/master
i:
  150257: f7ec94c
  150255: df9b95e
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed May 11, 2009
1 parent 21f11b6 commit 51ae268
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: aa837e1d6bd1a71b3c30c7738b6c29d41512fe7d
refs/heads/master: 0b258582fef3a9b15b2372d99164859361faa8db
24 changes: 18 additions & 6 deletions trunk/net/wireless/wext-compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,22 +296,34 @@ EXPORT_SYMBOL_GPL(cfg80211_wext_siwmlme);
struct ieee80211_channel *cfg80211_wext_freq(struct wiphy *wiphy,
struct iw_freq *freq)
{
struct ieee80211_channel *chan;
int f;

/*
* Parse frequency - return NULL for auto and
* -EINVAL for impossible things.
*/
if (freq->e == 0) {
if (freq->m < 0)
return NULL;
else
return ieee80211_get_channel(wiphy,
ieee80211_channel_to_frequency(freq->m));
f = ieee80211_channel_to_frequency(freq->m);
} else {
int i, div = 1000000;
for (i = 0; i < freq->e; i++)
div /= 10;
if (div > 0)
return ieee80211_get_channel(wiphy, freq->m / div);
else
if (div <= 0)
return ERR_PTR(-EINVAL);
f = freq->m / div;
}

/*
* Look up channel struct and return -EINVAL when
* it cannot be found.
*/
chan = ieee80211_get_channel(wiphy, f);
if (!chan)
return ERR_PTR(-EINVAL);
return chan;
}
EXPORT_SYMBOL_GPL(cfg80211_wext_freq);

Expand Down

0 comments on commit 51ae268

Please sign in to comment.