aboutsummaryrefslogtreecommitdiff
path: root/sys/net80211/ieee80211_ht.h
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2015-09-28 00:17:51 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2015-09-28 00:17:51 +0000
commitd7621b8c800785ae3a74756c213c17f05552887f (patch)
tree3297d5634455e0d63f8177bbc55b1c42816ecb5a /sys/net80211/ieee80211_ht.h
parent62a1a5f751691604c9de9725954419abb6f028e0 (diff)
downloadsrc-d7621b8c800785ae3a74756c213c17f05552887f.tar.gz
src-d7621b8c800785ae3a74756c213c17f05552887f.zip
Abstract out the ampdu TX pps initialisation code so it can be reused
in the superg fast-frames code. This harks back to an earlier commit (r280349) where I found that initialising the pps code with ticks=0 would cause hilariously bad hz ticks wraparound failures, leading to never actually aggregating traffic. This is still true for the superg path and so I have to do the same thing there. This is a big no-op; a subsequent commit will flip this on so it works with the fast-frames transmit path. Tested: * AR9170, otus(4) - STA mode, 11bg operation * AR9331, AP mode
Notes
Notes: svn path=/head/; revision=288315
Diffstat (limited to 'sys/net80211/ieee80211_ht.h')
-rw-r--r--sys/net80211/ieee80211_ht.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/net80211/ieee80211_ht.h b/sys/net80211/ieee80211_ht.h
index f099ffe77464..e2b331854dff 100644
--- a/sys/net80211/ieee80211_ht.h
+++ b/sys/net80211/ieee80211_ht.h
@@ -84,8 +84,19 @@ struct ieee80211_tx_ampdu {
*/
static __inline void
+ieee80211_txampdu_init_pps(struct ieee80211_tx_ampdu *tap)
+{
+ /*
+ * Reset packet estimate.
+ */
+ tap->txa_lastsample = ticks;
+ tap->txa_avgpps = 0;
+}
+
+static __inline void
ieee80211_txampdu_update_pps(struct ieee80211_tx_ampdu *tap)
{
+
/* NB: scale factor of 2 was picked heuristically */
tap->txa_avgpps = ((tap->txa_avgpps << 2) -
tap->txa_avgpps + tap->txa_pkts) >> 2;
@@ -97,6 +108,7 @@ ieee80211_txampdu_update_pps(struct ieee80211_tx_ampdu *tap)
static __inline void
ieee80211_txampdu_count_packet(struct ieee80211_tx_ampdu *tap)
{
+
/* XXX bound loop/do more crude estimate? */
while (ticks - tap->txa_lastsample >= hz) {
ieee80211_txampdu_update_pps(tap);