K 10 svn:author V 6 adrian K 8 svn:date V 27 2011-08-12T09:18:02.267715Z K 7 svn:log V 1327 Commit some (very untested) initial code to clean up after a DELBA. Once a DELBA is received, there may be: * packets in the software TX TID queue * packets in the hardware queue (aggregate or individual frames) The software TX queue is fine - those packets don't yet have a personality as they haven't been "scheduled". The packets in the hardware TX queues need to be completed or deleted. So the logic here is: * packets in the SWQ which are retries are discarded; * packets in the SWQ which aren't retries are modified to have their completion handler be the default, non-aggregate one * if there are any packets left in the hardware queue, mark the TID as "cleanup" and keep track of how many are outstanding * if the TID is "cleanup", pause the TID so no further traffic is scheduled. Then, when the packets are completed, the "incomplete" packet count is updated and when it hits 0 (ie, all packets on the hardware queue) it'll be unpaused and will begin running as a non-aggregate TID. To avoid races, pause the TID in the addba handler before disabling the addba state and calling ath_tx_cleanup(). Since the TXQ lock is held for the duration of queue operations, any packets that snuck in before the TID was paused will be downgraded to non-aggregate status by ath_tx_cleanup(). Obtained from: Atheros END