K 10 svn:author V 6 adrian K 8 svn:date V 27 2011-10-18T15:37:59.756407Z K 7 svn:log V 2095 Begin fleshing out the "Don't drop frames during an interface reset" code. * Add sc->sc_in_reset, which is protected by the ATH_LOCK and is >0 when the interface is being reset. * Don't call draintxq on a recoverable interface reset - ie, one where there's no operational state change. If a channel change is needed, or a channel width change occurs, then yes frames are dropped for now. But if a stuck beacon occurs, just process the frames in the queue and queue subsequent frames being sent to the hardware. Instead, just process the queue normally via ath_tx_processq(), but don't reschedule the software TXQs. * Add a new function - ath_tx_restart_hw() - which restarts all currently configured hardware queues. This takes care of clearing the ATH_TXQ_PUTPENDING flag, reprograms the TXQ pointer, fixes up the axq_link pointer and finally tickles the TXQ enable bit. I don't quite like this solution - I'd prefer to have some local flag which is propagated down from ath_tx_processq() down to the completion callbacks, to ensure that nothing enqueues a frame to the hardware. In the ADDBA case, nothing should be going directly to the hardware - any software retried frame is pushed onto the head of the software TXQ and then retried when the TXQ is next scheduled. In the non-ADDBA case, frames aren't retried. The trouble is that there may be some callbacks invoked via net80211 which immediately tries scheduling another frame. Since the hardware is currently being reset, no new frame should be queued. But since ATH_LOCK is being held (and is recursive, sigh), it'll just be grabbed again and happily continue along its merry way. This way, frames are TX'ed but they won't hit the hardware queue until the reset path completes. Any TX'ing from other contexts will block on the ATH_LOCK. TODO: * Check that the node software TXQ's are being rescheduled correctly! I bet they're not. Note: In order to correctly handle ADDBA session TX, frames that are dropped due an interface reset must have a BAR TX'ed for the session. That still isn't being done. END