PERFORCE change 65080 for review
Sam Leffler
sam at FreeBSD.org
Sat Nov 13 22:17:46 PST 2004
http://perforce.freebsd.org/chv.cgi?CH=65080
Change 65080 by sam at sam_ebb on 2004/11/14 06:17:12
Correct ibss setup:
o set current operating mode when starting up so 11g operating
parameters are set correctly
o setup the basic rates when operating in 11g or 11b
o setup ERP operation properly
While here cleanup some harmless cruft (like not marking SIBSS when
operating in hostap mode).
Affected files ...
.. //depot/projects/wifi/sys/net80211/ieee80211_node.c#15 edit
Differences ...
==== //depot/projects/wifi/sys/net80211/ieee80211_node.c#15 (text+ko) ====
@@ -366,26 +366,52 @@
}
ni = ic->ic_bss;
- ic->ic_flags |= IEEE80211_F_SIBSS;
- ieee80211_set_chan(ic, ni, chan);
IEEE80211_ADDR_COPY(ni->ni_macaddr, ic->ic_myaddr);
IEEE80211_ADDR_COPY(ni->ni_bssid, ic->ic_myaddr);
- if (ic->ic_opmode == IEEE80211_M_IBSS)
- ni->ni_bssid[0] |= 0x02; /* local bit for IBSS */
ni->ni_esslen = ic->ic_des_esslen;
memcpy(ni->ni_essid, ic->ic_des_essid, ni->ni_esslen);
ni->ni_rssi = 0;
ni->ni_rstamp = 0;
ni->ni_tstamp.tsf = 0;
ni->ni_intval = ic->ic_lintval;
- ni->ni_capinfo = IEEE80211_CAPINFO_IBSS;
+ ni->ni_capinfo = 0;
+ ni->ni_erp = 0;
if (ic->ic_flags & IEEE80211_F_PRIVACY)
ni->ni_capinfo |= IEEE80211_CAPINFO_PRIVACY;
if (ic->ic_phytype == IEEE80211_T_FH) {
ni->ni_fhdwell = 200; /* XXX */
ni->ni_fhindex = 1;
}
- ni->ni_erp = 0;
+ if (ic->ic_opmode == IEEE80211_M_IBSS) {
+ ic->ic_flags |= IEEE80211_F_SIBSS;
+ ni->ni_capinfo |= IEEE80211_CAPINFO_IBSS; /* XXX */
+ ni->ni_bssid[0] |= 0x02; /* local bit for IBSS */
+ }
+ /*
+ * Fix the channel and related attributes.
+ */
+ ieee80211_set_chan(ic, ni, chan);
+ ic->ic_curmode = ieee80211_chan2mode(ic, chan);
+ /*
+ * Do mode-specific rate setup.
+ */
+ if (ic->ic_curmode == IEEE80211_MODE_11G) {
+ /*
+ * Use a mixed 11b/11g rate set.
+ */
+ ieee80211_set11gbasicrates(&ni->ni_rates, IEEE80211_MODE_11G);
+ } else if (ic->ic_curmode == IEEE80211_MODE_11B) {
+ /*
+ * Force pure 11b rate set.
+ */
+ ieee80211_set11gbasicrates(&ni->ni_rates, IEEE80211_MODE_11B);
+ }
+ /*
+ * Set the erp state (mostly the slot time) to deal with
+ * the auto-select case; this should be redundant if the
+ * mode is locked.
+ */
+ ieee80211_reset_erp(ic);
ieee80211_new_state(ic, IEEE80211_S_RUN, -1);
}
More information about the p4-projects
mailing list