svn commit: r187868 - projects/vap7/sys/net80211
Sam Leffler
sam at FreeBSD.org
Wed Jan 28 13:20:01 PST 2009
Author: sam
Date: Wed Jan 28 21:19:59 2009
New Revision: 187868
URL: http://svn.freebsd.org/changeset/base/187868
Log:
merge r187796: fill in ieee channel #'s and max tx power
Modified:
projects/vap7/sys/net80211/ieee80211.c
Modified: projects/vap7/sys/net80211/ieee80211.c
==============================================================================
--- projects/vap7/sys/net80211/ieee80211.c Wed Jan 28 20:35:16 2009 (r187867)
+++ projects/vap7/sys/net80211/ieee80211.c Wed Jan 28 21:19:59 2009 (r187868)
@@ -126,6 +126,21 @@ ieee80211_chan_init(struct ieee80211com
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.
More information about the svn-src-projects
mailing list