Date: Tue, 30 Nov 2004 18:17:26 GMT From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 66121 for review Message-ID: <200411301817.iAUIHQbx012078@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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",
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200411301817.iAUIHQbx012078>