summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211.c
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2009-01-27 22:48:46 +0000
committersam <sam@FreeBSD.org>2009-01-27 22:48:46 +0000
commit189648aebebc024f0096453ff810297193234a64 (patch)
tree194e1ce8bb9865134aa5ab4f320ab3e3e097249d /sys/net80211/ieee80211.c
parent884f5ba01a72c6a7a4be4be14d98c72aa76dcdd9 (diff)
downloadFreeBSD-src-189648aebebc024f0096453ff810297193234a64.zip
FreeBSD-src-189648aebebc024f0096453ff810297193234a64.tar.gz
fill in ieee channel #'s and max tx power for drivers that work exclusively
with frequencies; this mimics how ieee80211_setregdomain works
Diffstat (limited to 'sys/net80211/ieee80211.c')
-rw-r--r--sys/net80211/ieee80211.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c
index ae416f8..c7dcd44 100644
--- a/sys/net80211/ieee80211.c
+++ b/sys/net80211/ieee80211.c
@@ -126,6 +126,21 @@ ieee80211_chan_init(struct ieee80211com *ic)
for (i = 0; i < ic->ic_nchans; i++) {
c = &ic->ic_channels[i];
KASSERT(c->ic_flags != 0, ("channel with no flags"));
+ /*
+ * Help drivers that work only with frequencies by filling
+ * in IEEE channel #'s if not already calculated. Note this
+ * mimics similar work done in ieee80211_setregdomain when
+ * changing regulatory state.
+ */
+ if (c->ic_ieee == 0)
+ c->ic_ieee = ieee80211_mhz2ieee(c->ic_freq,c->ic_flags);
+ if (IEEE80211_IS_CHAN_HT40(c) && c->ic_extieee == 0)
+ c->ic_extieee = ieee80211_mhz2ieee(c->ic_freq +
+ (IEEE80211_IS_CHAN_HT40U(c) ? 20 : -20),
+ c->ic_flags);
+ /* default max tx power to max regulatory */
+ if (c->ic_maxpower == 0)
+ c->ic_maxpower = 2*c->ic_maxregpower;
setbit(ic->ic_chan_avail, c->ic_ieee);
/*
* Identify mode capabilities.
OpenPOWER on IntegriCloud