K 10 svn:author V 6 adrian K 8 svn:date V 27 2011-09-18T07:20:59.744480Z K 7 svn:log V 1350 Begin an overhaul of the TXQ locking to avoid recursive locking. The linux and atheros reference driver keep the hardware TXQ locked for the duration of both the TXQ completion processing and TXQ drain. This unfortunately means the TXQ lock is held during completion callbacks and during ieee80211_free_node(). When the last node reference is removed, net80211 will free the node - which calls back into the driver and in this code, it flushes the node state and removes it from various lists. Unfortunately access to these lists is locked by the TXQ lock and trying to grab it whilst it's already being held causes a panic. The solution is to go back to how FreeBSD did the locking - hold the lock whilst doing TXQ manipulation (add/remove/state changes) and then reacquire it whilst fiddling with the per-TID state. The lock isn't to be held across TX buffer completion. This commit partially implements this: * the non-aggregation pathway doesn't hold the lock across the completion handler * the aggregation pathway for single packets doesn't hold the lock across the completion handler * the aggregation pathway for aggregate frames now delays calling the completion handler until the TID state (BAW, etc) has been updated; it's done at the end of the function. The error and cleanup pathways will be fixed in a subsequent commit. END