From owner-p4-projects@FreeBSD.ORG Tue Nov 30 18:17:27 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2AD4B16A4D0; Tue, 30 Nov 2004 18:17:27 +0000 (GMT) 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 E189516A4CE for ; Tue, 30 Nov 2004 18:17:26 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B3C6A43D39 for ; Tue, 30 Nov 2004 18:17:26 +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 iAUIHQ3v012081 for ; Tue, 30 Nov 2004 18:17:26 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id iAUIHQbx012078 for perforce@freebsd.org; Tue, 30 Nov 2004 18:17:26 GMT (envelope-from sam@freebsd.org) Date: Tue, 30 Nov 2004 18:17:26 GMT Message-Id: <200411301817.iAUIHQbx012078@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 Subject: PERFORCE change 66121 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Nov 2004 18:17:27 -0000 http://perforce.freebsd.org/chv.cgi?CH=66121 Change 66121 by sam@sam_ebb on 2004/11/30 18:16:45 o replace explicit ps queue manipulations with portability shims o no need to mark management frame with M_PWR_SAV any more; the driver no longer intercepts them o mark frames placed on the power save queue with an age so they can be reaped if they sit too long (need to recheck calc) Affected files ... .. //depot/projects/wifi/sys/net80211/ieee80211_output.c#16 edit Differences ... ==== //depot/projects/wifi/sys/net80211/ieee80211_output.c#16 (text+ko) ==== @@ -1127,15 +1127,6 @@ IEEE80211_NODE_STAT_SET(ni, tx_deauth_code, arg); ieee80211_node_unauthorize(ic, ni); /* port closed */ - /* - * If station is in power-save state mark the frame - * so it goes out immediately. The station is likely - * to ignore it but the alternative is to defer reclaiming - * station state until it wakes up and polls for the - * frame which leads to possible DOS. - */ - if (ni->ni_flags & IEEE80211_NODE_PWR_MGT) - m->m_flags |= M_PWR_SAV; break; case IEEE80211_FC0_SUBTYPE_ASSOC_REQ: @@ -1537,8 +1528,8 @@ ic->ic_flags &= ~IEEE80211_F_TIMUPDATE; IEEE80211_DPRINTF(ic, IEEE80211_MSG_POWER, - "%s: TIM updated, off %u, len %u\n", - __func__, timoff, timlen); + "%s: TIM updated, pending %u, off %u, len %u\n", + __func__, ic->ic_ps_pending, timoff, timlen); } /* update TIM state regarding buffered multicast frames */ if (mcast) @@ -1560,12 +1551,12 @@ ieee80211_pwrsave(struct ieee80211com *ic, struct ieee80211_node *ni, struct mbuf *m) { - int qlen; + int qlen, age; - IF_LOCK(&ni->ni_savedq); + IEEE80211_NODE_SAVEQ_LOCK(ni); if (_IF_QFULL(&ni->ni_savedq)) { _IF_DROP(&ni->ni_savedq); - IF_UNLOCK(&ni->ni_savedq); + IEEE80211_NODE_SAVEQ_UNLOCK(ni); IEEE80211_DPRINTF(ic, IEEE80211_MSG_ANY, "[%s] pwr save q overflow, drops %d (size %d)\n", ether_sprintf(ni->ni_macaddr), @@ -1575,9 +1566,17 @@ m_freem(m); return; } - _IF_ENQUEUE(&ni->ni_savedq, m); - qlen = _IF_QLEN(&ni->ni_savedq); - IF_UNLOCK(&ni->ni_savedq); + /* + * Tag the frame with it's expiry time and insert + * it in the queue. The aging interval is 4 times + * the listen interval specified by the station. + * Frames that sit around too long are reclaimed + * using this information. + */ + /* XXX handle overflow? */ + age = ((ni->ni_intval * ic->ic_lintval) << 2) / 1024; /* TU -> secs */ + _IEEE80211_NODE_SAVEQ_ENQUEUE(ni, m, qlen, age); + IEEE80211_NODE_SAVEQ_UNLOCK(ni); IEEE80211_DPRINTF(ic, IEEE80211_MSG_POWER, "[%s] save frame, %u now queued\n",