1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-04 09:09:56 +00:00

back out public safety-specific channel number mapping; we can't do

it until we know it should be applied as otherwise we can map 11a
channels into the 2.4G range and choose the wrong item from the
chanenl array
This commit is contained in:
Sam Leffler 2006-04-26 16:00:37 +00:00
parent 1d82b39143
commit 9cab5ba3f9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=158044

View File

@ -236,7 +236,6 @@ ieee80211_ifdetach(struct ieee80211com *ic)
int
ieee80211_mhz2ieee(u_int freq, u_int flags)
{
#define IS_CHAN_IN_PUBLIC_SAFETY_BAND(_c) ((_c) > 4940 && (_c) < 4990)
if (flags & IEEE80211_CHAN_2GHZ) { /* 2GHz band */
if (freq == 2484)
return 14;
@ -245,9 +244,6 @@ ieee80211_mhz2ieee(u_int freq, u_int flags)
else
return 15 + ((freq - 2512) / 20);
} else if (flags & IEEE80211_CHAN_5GHZ) { /* 5Ghz band */
if (IS_CHAN_IN_PUBLIC_SAFETY_BAND(freq))
return ((freq * 10) +
(((freq % 5) == 2) ? 5 : 0) - 49400) / 5;
if (freq <= 5000)
return (freq - 4000) / 5;
else
@ -258,17 +254,13 @@ ieee80211_mhz2ieee(u_int freq, u_int flags)
if (freq < 2484)
return ((int) freq - 2407) / 5;
if (freq < 5000) {
if (IS_CHAN_IN_PUBLIC_SAFETY_BAND(freq))
return ((freq * 10) +
(((freq % 5) == 2) ? 5 : 0) - 49400)/5;
else if (freq > 4900)
if (freq > 4900)
return (freq - 4000) / 5;
else
return 15 + ((freq - 2512) / 20);
}
return (freq - 5000) / 5;
}
#undef IS_CHAN_IN_PUBLIC_SAFETY_BAND
}
/*