PERFORCE change 46327 for review
Sam Leffler
sam at FreeBSD.org
Sun Feb 1 14:17:27 PST 2004
http://perforce.freebsd.org/chv.cgi?CH=46327
Change 46327 by sam at sam_ebb on 2004/02/01 14:16:29
o correct short slot time handling: enable it only for 11g
when not operating in ibss mode and when the driver says
it can do it
o move short slot time handling into ieee80211_reset_erp where
it can be shared
o move ieee80211_reset_erp call in the state machine from
the transition assoc->init to run->init; it's not clear
what the original patch was intended to do and/or if this
reset logic is even needed
Affected files ...
.. //depot/projects/netperf+sockets/sys/net80211/ieee80211.c#11 edit
.. //depot/projects/netperf+sockets/sys/net80211/ieee80211_proto.c#7 edit
Differences ...
==== //depot/projects/netperf+sockets/sys/net80211/ieee80211.c#11 (text+ko) ====
@@ -769,19 +769,20 @@
ic->ic_des_chan = IEEE80211_CHAN_ANYC;
/*
- * Do 11b/11g mixed-mode state setup.
+ * Do mode-specific rate setup.
*/
if (mode == IEEE80211_MODE_11G) {
- /* use mixed 11b/11g rate set */
+ /*
+ * Use a mixed 11b/11g rate set.
+ */
ieee80211_set11gbasicrates(&ic->ic_sup_rates[mode],
IEEE80211_MODE_11G);
} else if (mode == IEEE80211_MODE_11B) {
- /* force pure 11b rate set */
+ /*
+ * Force pure 11b rate set.
+ */
ieee80211_set11gbasicrates(&ic->ic_sup_rates[mode],
IEEE80211_MODE_11B);
- ic->ic_flags &= ~IEEE80211_F_SHSLOT;
- } else {
- ic->ic_flags &= ~IEEE80211_F_SHSLOT;
}
ieee80211_reset_erp(ic, mode); /* reset ERP state */
@@ -808,7 +809,17 @@
ic->ic_flags &= ~IEEE80211_F_USEPROT;
ic->ic_nonerpsta = 0;
ic->ic_longslotsta = 0;
- if (mode == IEEE80211_MODE_11G && (ic->ic_caps & IEEE80211_C_SHSLOT))
+ /*
+ * Short slot time is enabled only when operating in 11g
+ * and not in an IBSS. We must also honor whether or not
+ * the driver is capable of doing it.
+ */
+ /* XXX what about auto? */
+ if (mode == IEEE80211_MODE_11G &&
+ ic->ic_opmode != IEEE80211_M_IBSS &&
+ (ic->ic_caps & IEEE80211_C_SHSLOT))
+ ic->ic_flags |= IEEE80211_F_SHSLOT;
+ else
ic->ic_flags &= ~IEEE80211_F_SHSLOT;
/*
* Set short preamble and ERP barker-preamble flags.
==== //depot/projects/netperf+sockets/sys/net80211/ieee80211_proto.c#7 (text+ko) ====
@@ -347,8 +347,13 @@
ic->ic_longslotsta--;
if (ic->ic_longslotsta == 0 &&
ic->ic_curmode == IEEE80211_MODE_11G) {
- /* XXX check capability */
- ic->ic_flags |= IEEE80211_F_SHSLOT;
+ /*
+ * Re-enable use of short slot time if supported
+ * and not operating in IBSS mode (per spec).
+ */
+ if ((ic->ic_caps & IEEE80211_C_SHSLOT) &&
+ ic->ic_opmode != IEEE80211_M_IBSS)
+ ic->ic_flags |= IEEE80211_F_SHSLOT;
}
}
/*
@@ -403,6 +408,7 @@
IEEE80211_REASON_ASSOC_LEAVE);
}
IEEE80211_NODE_UNLOCK(ic);
+ ieee80211_reset_erp(ic, ic->ic_curmode);
break;
default:
break;
@@ -423,8 +429,6 @@
IEEE80211_REASON_AUTH_LEAVE);
}
IEEE80211_NODE_UNLOCK(ic);
- /* XXX??? */
- ieee80211_reset_erp(ic, ic->ic_curmode);
break;
default:
break;
More information about the p4-projects
mailing list