Date: Mon, 9 May 2005 04:33:57 GMT From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 76727 for review Message-ID: <200505090433.j494XvHW026624@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=76727 Change 76727 by sam@sam_ebb on 2005/05/09 04:33:19 o add dynamic turbo base/boost switching based on beacon when operating in station mode o don't futz with the count of sta's in power save mode when operating in station mode; this insures drivers can use it to decide when to queue multicast frames (just started doing pwr-save stuff in station mode for background scanning) Affected files ... .. //depot/projects/vap/sys/net80211/ieee80211_input.c#9 edit .. //depot/projects/vap/sys/net80211/ieee80211_node.c#6 edit .. //depot/projects/vap/sys/net80211/ieee80211_node.h#6 edit Differences ... ==== //depot/projects/vap/sys/net80211/ieee80211_input.c#9 (text+ko) ==== @@ -533,7 +533,7 @@ IEEE80211_NODE_STAT_ADD(ni, rx_bytes, m->m_pkthdr.len); #define FF_LLC_SIZE (sizeof(struct ether_header) + sizeof(struct llc)) - if ((ni->ni_flags & IEEE80211_NODE_FF) && + if (IEEE80211_ATH_CAP(vap, ni, FF) && m->m_pkthdr.len >= 3*FF_LLC_SIZE) { struct llc *llc; @@ -1920,14 +1920,16 @@ caps |= IEEE80211_NODE_TURBOP; if (ath->ath_capability & ATHEROS_CAP_FAST_FRAME) caps |= IEEE80211_NODE_FF; + if (ath->ath_capability & ATHEROS_CAP_BOOST) + caps |= IEEE80211_NODE_BOOST; if ((ni->ni_flags ^ caps) & IEEE80211_NODE_ATH) { IEEE80211_NOTE(vap, IEEE80211_MSG_SUPERG, ni, - "ath ie: caps 0x%x defkeyix 0x%x, use 0x%x\n", + "ath ie: caps 0x%x defkeyix 0x%x, use 0x%x", ath->ath_capability, LE_READ_2(ath->ath_defkeyix), caps); ni->ni_flags = (ni->ni_flags &~ IEEE80211_NODE_ATH) | caps; return 1; } else - return 0; /* NB: no change */ + return 0; } void @@ -2298,8 +2300,22 @@ ieee80211_wme_updateparams(vap); } else ni->ni_flags &= ~IEEE80211_NODE_QOS; - if (scan.ath != NULL) - ieee80211_parse_athparams(ni, scan.ath, wh); + if (scan.ath != NULL && + ieee80211_parse_athparams(ni, scan.ath, wh) > 0 && + IEEE80211_ATH_CAP(vap, ni, TURBOP)) { + u_int16_t curflags, newflags; + /* + * Check for turbo mode switch. Calculate flags + * for the new mode and effect the switch. + */ + newflags = curflags = ic->ic_bsschan->ic_flags; + if (ni->ni_flags & IEEE80211_NODE_BOOST) + newflags |= IEEE80211_CHAN_TURBO; + else + newflags &= ~IEEE80211_CHAN_TURBO; + if (newflags != curflags) + ieee80211_dturbo_switch(ic, newflags); + } if (scan.doth != NULL) ieee80211_parse_dothparams(vap, scan.doth, wh); /* NB: don't need the rest of this */ @@ -2894,7 +2910,8 @@ struct mbuf *m; if (enable) { - if ((ni->ni_flags & IEEE80211_NODE_PWR_MGT) == 0) + if (vap->iv_opmode != IEEE80211_M_STA && + (ni->ni_flags & IEEE80211_NODE_PWR_MGT) == 0) vap->iv_ps_sta++; ni->ni_flags |= IEEE80211_NODE_PWR_MGT; IEEE80211_NOTE(vap, IEEE80211_MSG_POWER, ni, @@ -2902,7 +2919,8 @@ return; } - if (ni->ni_flags & IEEE80211_NODE_PWR_MGT) + if (vap->iv_opmode != IEEE80211_M_STA && + (ni->ni_flags & IEEE80211_NODE_PWR_MGT)) vap->iv_ps_sta--; ni->ni_flags &= ~IEEE80211_NODE_PWR_MGT; IEEE80211_NOTE(vap, IEEE80211_MSG_POWER, ni, ==== //depot/projects/vap/sys/net80211/ieee80211_node.c#6 (text+ko) ==== @@ -522,7 +522,8 @@ /* NB: preserve ni_table */ if (ni->ni_flags & IEEE80211_NODE_PWR_MGT) { - vap->iv_ps_sta--; + if (vap->iv_opmode != IEEE80211_M_STA) + vap->iv_ps_sta--; ni->ni_flags &= ~IEEE80211_NODE_PWR_MGT; IEEE80211_NOTE(vap, IEEE80211_MSG_POWER, ni, "power save mode off, %u sta's in ps mode", vap->iv_ps_sta); ==== //depot/projects/vap/sys/net80211/ieee80211_node.h#6 (text+ko) ==== @@ -105,6 +105,7 @@ #define IEEE80211_NODE_PWR_MGT 0x0010 /* power save mode enabled */ #define IEEE80211_NODE_FF 0x0020 /* Atheros fast-frames enabled*/ #define IEEE80211_NODE_TURBOP 0x0040 /* Atheros Turbo' enabled */ +#define IEEE80211_NODE_BOOST 0x0080 /* Atheros Turbo' boosted */ u_int16_t ni_associd; /* assoc response */ u_int16_t ni_txpower; /* current transmit power */ u_int16_t ni_vlan; /* vlan tag */ @@ -153,7 +154,8 @@ }; MALLOC_DECLARE(M_80211_NODE); -#define IEEE80211_NODE_ATH (IEEE80211_NODE_FF | IEEE80211_NODE_TURBOP) +#define IEEE80211_NODE_ATH \ + (IEEE80211_NODE_FF | IEEE80211_NODE_TURBOP | IEEE80211_NODE_BOOST) #define IEEE80211_NODE_AID(ni) IEEE80211_AID(ni->ni_associd)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200505090433.j494XvHW026624>