PERFORCE change 77478 for review

Sam Leffler sam at FreeBSD.org
Wed May 25 18:42:02 GMT 2005


http://perforce.freebsd.org/chv.cgi?CH=77478

Change 77478 by sam at sam_ebb on 2005/05/25 18:41:38

	add sta-mode dtim support

Affected files ...

.. //depot/projects/vap/sys/net80211/ieee80211_input.c#17 edit
.. //depot/projects/vap/sys/net80211/ieee80211_node.c#11 edit
.. //depot/projects/vap/sys/net80211/ieee80211_var.h#17 edit

Differences ...

==== //depot/projects/vap/sys/net80211/ieee80211_input.c#17 (text+ko) ====

@@ -2108,7 +2108,6 @@
 	u_int8_t *frm, *efrm;
 	u_int8_t *ssid, *rates, *xrates, *wpa, *wme, *ath;
 	int reassoc, resp, allocbs;
-	struct ieee80211_tim_ie *tim;
 
 	wh = mtod(m0, struct ieee80211_frame *);
 	frm = (u_int8_t *)&wh[1];
@@ -2154,7 +2153,6 @@
 		scan.capinfo = le16toh(*(u_int16_t *)frm);	frm += 2;
 		scan.bchan = ieee80211_chan2ieee(ic, ic->ic_curchan);
 		scan.chan = scan.bchan;
-		tim = NULL;
 
 		while (frm < efrm) {
 			switch (*frm) {
@@ -2184,8 +2182,8 @@
 				break;
 			case IEEE80211_ELEMID_TIM:
 				/* XXX ATIM? */
+				scan.tim = frm;
 				scan.timoff = frm - mtod(m0, u_int8_t *);
-				tim = (struct ieee80211_tim_ie *) frm;
 				break;
 			case IEEE80211_ELEMID_IBSSPARMS:
 				break;
@@ -2327,11 +2325,13 @@
 			}
 			if (scan.doth != NULL)
 				ieee80211_parse_dothparams(vap, scan.doth, wh);
-			if (tim != NULL) {
+			if (scan.tim != NULL) {
 				/*
 				 * Check the TIM. For now we drop out of
 				 * power save mode for any reason.
 				 */
+				struct ieee80211_tim_ie *tim =
+				    (struct ieee80211_tim_ie *) scan.tim;
 				int aid = IEEE80211_AID(ni->ni_associd);
 				int ix = aid / NBBY;
 				int min = tim->tim_bitctl &~ 1;
@@ -2340,6 +2340,8 @@
 				    (min <= ix && ix <= max &&
 				     isset(tim->tim_bitmap - min, aid)))
 					ieee80211_sta_pwrsave(vap, 0);
+
+				vap->iv_dtim_count = tim->tim_count;
 			}
 			/*
 			 * If scanning, pass the info to the scan module.

==== //depot/projects/vap/sys/net80211/ieee80211_node.c#11 (text+ko) ====

@@ -549,6 +549,9 @@
 	if (se->se_ath_ie != NULL)
 		ieee80211_saveath(ni, se->se_ath_ie);
 
+	vap->iv_dtim_period = se->se_dtimperiod;
+	vap->iv_dtim_count = 0;
+
 	/* NB: must be after ni_chan is setup */
 	ieee80211_setup_rates(ni, se->se_rates, se->se_xrates,
 		IEEE80211_F_DOSORT);

==== //depot/projects/vap/sys/net80211/ieee80211_var.h#17 (text+ko) ====

@@ -268,7 +268,8 @@
 	u_int16_t		iv_ps_pending;	/* ps sta's w/ pending frames */
 	u_int8_t		*iv_tim_bitmap;	/* power-save stations w/ data*/
 	u_int16_t		iv_tim_len;	/* ic_tim_bitmap size (bytes) */
-	u_int16_t		iv_dtim_period;	/* DTIM period */
+	u_int8_t		iv_dtim_period;	/* DTIM period */
+	u_int8_t		iv_dtim_count;	/* DTIM count from last bcn */
 						/* set/unset aid pwrsav state */
 	void			(*iv_set_tim)(struct ieee80211_node *, int);
 	struct ieee80211_node	*iv_bss;	/* information for this node */


More information about the p4-projects mailing list