mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
Merge branch 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
This commit is contained in:
commit
8571a19c4a
100 changed files with 2886 additions and 1030 deletions
|
|
@ -1801,9 +1801,9 @@ void regulatory_hint_disconnect(void)
|
|||
|
||||
static bool freq_is_chan_12_13_14(u16 freq)
|
||||
{
|
||||
if (freq == ieee80211_channel_to_frequency(12) ||
|
||||
freq == ieee80211_channel_to_frequency(13) ||
|
||||
freq == ieee80211_channel_to_frequency(14))
|
||||
if (freq == ieee80211_channel_to_frequency(12, IEEE80211_BAND_2GHZ) ||
|
||||
freq == ieee80211_channel_to_frequency(13, IEEE80211_BAND_2GHZ) ||
|
||||
freq == ieee80211_channel_to_frequency(14, IEEE80211_BAND_2GHZ))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,29 +29,37 @@ ieee80211_get_response_rate(struct ieee80211_supported_band *sband,
|
|||
}
|
||||
EXPORT_SYMBOL(ieee80211_get_response_rate);
|
||||
|
||||
int ieee80211_channel_to_frequency(int chan)
|
||||
int ieee80211_channel_to_frequency(int chan, enum ieee80211_band band)
|
||||
{
|
||||
if (chan < 14)
|
||||
return 2407 + chan * 5;
|
||||
|
||||
if (chan == 14)
|
||||
return 2484;
|
||||
|
||||
/* FIXME: 802.11j 17.3.8.3.2 */
|
||||
return (chan + 1000) * 5;
|
||||
/* see 802.11 17.3.8.3.2 and Annex J
|
||||
* there are overlapping channel numbers in 5GHz and 2GHz bands */
|
||||
if (band == IEEE80211_BAND_5GHZ) {
|
||||
if (chan >= 182 && chan <= 196)
|
||||
return 4000 + chan * 5;
|
||||
else
|
||||
return 5000 + chan * 5;
|
||||
} else { /* IEEE80211_BAND_2GHZ */
|
||||
if (chan == 14)
|
||||
return 2484;
|
||||
else if (chan < 14)
|
||||
return 2407 + chan * 5;
|
||||
else
|
||||
return 0; /* not supported */
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL(ieee80211_channel_to_frequency);
|
||||
|
||||
int ieee80211_frequency_to_channel(int freq)
|
||||
{
|
||||
/* see 802.11 17.3.8.3.2 and Annex J */
|
||||
if (freq == 2484)
|
||||
return 14;
|
||||
|
||||
if (freq < 2484)
|
||||
else if (freq < 2484)
|
||||
return (freq - 2407) / 5;
|
||||
|
||||
/* FIXME: 802.11j 17.3.8.3.2 */
|
||||
return freq/5 - 1000;
|
||||
else if (freq >= 4910 && freq <= 4980)
|
||||
return (freq - 4000) / 5;
|
||||
else
|
||||
return (freq - 5000) / 5;
|
||||
}
|
||||
EXPORT_SYMBOL(ieee80211_frequency_to_channel);
|
||||
|
||||
|
|
|
|||
|
|
@ -267,9 +267,12 @@ int cfg80211_wext_freq(struct wiphy *wiphy, struct iw_freq *freq)
|
|||
* -EINVAL for impossible things.
|
||||
*/
|
||||
if (freq->e == 0) {
|
||||
enum ieee80211_band band = IEEE80211_BAND_2GHZ;
|
||||
if (freq->m < 0)
|
||||
return 0;
|
||||
return ieee80211_channel_to_frequency(freq->m);
|
||||
if (freq->m > 14)
|
||||
band = IEEE80211_BAND_5GHZ;
|
||||
return ieee80211_channel_to_frequency(freq->m, band);
|
||||
} else {
|
||||
int i, div = 1000000;
|
||||
for (i = 0; i < freq->e; i++)
|
||||
|
|
|
|||
Loading…
Reference in a new issue