From 21faa5ceff0c8e79ca1b31463979581dea1ad7dc Mon Sep 17 00:00:00 2001 From: Bernhard Schmidt Date: Tue, 7 Feb 2012 18:05:10 +0000 Subject: MFC r230620: On state changes from RUN to anything else the AGGR sessions are cleared/dropped leading to qid2tap[n] being NULL as there no longer is a tap. Now, if there have been lots of frames queued the firmware processes and returns those after the tap is gone. --- sys/dev/iwn/if_iwn.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/dev/iwn/if_iwn.c b/sys/dev/iwn/if_iwn.c index a90d1ad6e089..f51f9a627b88 100644 --- a/sys/dev/iwn/if_iwn.c +++ b/sys/dev/iwn/if_iwn.c @@ -2813,11 +2813,13 @@ iwn_ampdu_tx_done(struct iwn_softc *sc, int qid, int idx, int nframes, bitmap |= 1ULL << bit; } tap = sc->qid2tap[qid]; - tid = WME_AC_TO_TID(tap->txa_ac); - wn = (void *)tap->txa_ni; - wn->agg[tid].bitmap = bitmap; - wn->agg[tid].startidx = start; - wn->agg[tid].nframes = nframes; + if (tap != NULL) { + tid = WME_AC_TO_TID(tap->txa_ac); + wn = (void *)tap->txa_ni; + wn->agg[tid].bitmap = bitmap; + wn->agg[tid].startidx = start; + wn->agg[tid].nframes = nframes; + } seqno = le32toh(*(status + nframes)) & 0xfff; for (lastidx = (seqno & 0xff); ring->read != lastidx;) { -- cgit v1.3