From owner-p4-projects@FreeBSD.ORG Wed May 25 18:42:01 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3547116A458; Wed, 25 May 2005 18:42:01 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D354916A427 for ; Wed, 25 May 2005 18:42:00 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8F17C43D4C for ; Wed, 25 May 2005 18:42:00 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j4PIg0cb007317 for ; Wed, 25 May 2005 18:42:00 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j4PIg0h8007310 for perforce@freebsd.org; Wed, 25 May 2005 18:42:00 GMT (envelope-from sam@freebsd.org) Date: Wed, 25 May 2005 18:42:00 GMT Message-Id: <200505251842.j4PIg0h8007310@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Cc: Subject: PERFORCE change 77478 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 May 2005 18:42:02 -0000 http://perforce.freebsd.org/chv.cgi?CH=77478 Change 77478 by sam@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 */