summaryrefslogtreecommitdiffstats
path: root/sys/net80211
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2007-03-11 06:24:26 +0000
committersam <sam@FreeBSD.org>2007-03-11 06:24:26 +0000
commit0ea08cfa346654243d5c3ea9e5907f58342aed0d (patch)
treeb23a36d1e13aeb626034ba4236a3e15ab9f95847 /sys/net80211
parentb03ddb707bfa75419cca3c62c43a52a0e43e11fe (diff)
downloadFreeBSD-src-0ea08cfa346654243d5c3ea9e5907f58342aed0d.zip
FreeBSD-src-0ea08cfa346654243d5c3ea9e5907f58342aed0d.tar.gz
change ieee80211_mhz2ieee to use the PSB mapping when the frequency
falls in the proper place, not when we're handed a 1/2 or 1/4-rate channel MFC after: 2 weeks
Diffstat (limited to 'sys/net80211')
-rw-r--r--sys/net80211/ieee80211.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c
index 803c530..bcef214 100644
--- a/sys/net80211/ieee80211.c
+++ b/sys/net80211/ieee80211.c
@@ -305,6 +305,7 @@ mappsb(u_int freq, u_int flags)
int
ieee80211_mhz2ieee(u_int freq, u_int flags)
{
+#define IS_FREQ_IN_PSB(_freq) ((_freq) > 4940 && (_freq) < 4990)
if (flags & IEEE80211_CHAN_GSM)
return mapgsm(freq, flags);
if (flags & IEEE80211_CHAN_2GHZ) { /* 2GHz band */
@@ -316,7 +317,7 @@ ieee80211_mhz2ieee(u_int freq, u_int flags)
return 15 + ((freq - 2512) / 20);
} else if (flags & IEEE80211_CHAN_5GHZ) { /* 5Ghz band */
if (freq <= 5000) {
- if (flags &(IEEE80211_CHAN_HALF|IEEE80211_CHAN_QUARTER))
+ if (IS_FREQ_IN_PSB(freq))
return mappsb(freq, flags);
return (freq - 4000) / 5;
} else
@@ -330,7 +331,7 @@ ieee80211_mhz2ieee(u_int freq, u_int flags)
return ((int) freq - 2407) / 5;
}
if (freq < 5000) {
- if (flags &(IEEE80211_CHAN_HALF|IEEE80211_CHAN_QUARTER))
+ if (IS_FREQ_IN_PSB(freq))
return mappsb(freq, flags);
else if (freq > 4900)
return (freq - 4000) / 5;
@@ -339,6 +340,7 @@ ieee80211_mhz2ieee(u_int freq, u_int flags)
}
return (freq - 5000) / 5;
}
+#undef IS_FREQ_IN_PSB
}
/*
OpenPOWER on IntegriCloud