freebsd-nq/sys/dev/ath
Adrian Chadd ef27340c5b Flesh out some slightly dirty reset/channel change serialisation code
for the ath(4) driver.

Currently, there's nothing stopping reset, channel change and general
TX/RX from overlapping with each other. This wasn't a big deal with
pre-11n traffic as it just results in some dropped frames.
It's possible this may have also caused some inconsistencies and
badly-setup hardware.

Since locks can't be held across all of this (the Linux solution)
due to LORs with the network stack locks, some state counter
variables are used to track what parts of the code the driver is
currently in.

When the hardware is being reset, it disables the taskqueue and
waits for pending interrupts, tx, rx and tx completion before
it begins the reset or channel change.

TX and RX both abort if called during an active reset or channel
change.

Finally, the reset path now doesn't flush frames if ATH_RESET_NOLOSS
is set. Instead, completed TX and RX frames are passed back up to
net80211 before the reset occurs.

This is not without problems:

* Raw frame xmit are just dropped, rather than placed on a queue.
  The net80211 stack should be the one which queues these frames
  rather than the driver.

* It's all very messy. It'd be better if these hardware operations
  were serialised on some kind of work queue, rather than hoping
  they can be run in parallel.

* The taskqueue block/unblock may occur in parallel with the
  newstate() function - which shuts down the taskqueue and restarts
  it once the new state is known. It's likely these operations should
  be refcounted so the taskqueue is restored once no other areas
  in the code wish to suspend operations.

* .. interrupt disable/enable should likely be refcounted as well.

With this work, the driver does not drop frames during stuck beacon
or fatal errors and thus 11n traffic continues to run correctly.
Default and full resets however do still drop frames and it's possible
this may occur, causing traffic loss and session stalls.

Sponsored by:	Hobnob, Inc.
2011-11-18 05:06:30 +00:00
..
ath_dfs/null - change "is is" to "is" or "it is" 2011-10-16 14:30:28 +00:00
ath_hal Disable writing to the extension CYCPWR1 register. 2011-11-12 16:47:23 +00:00
ath_rate Fix the compile to work when IEEE80211_DEBUG isn't defined. 2011-11-09 04:08:01 +00:00
ah_osdep.c Introduce a work-around for issues with the AR5416 based MAC on SMP devices. 2011-11-09 22:39:44 +00:00
ah_osdep.h Fix AR5416 and later parts when building with AH_DEBUG or similar defined: 2009-07-06 20:51:54 +00:00
if_ath_ahb.c Begin merging in some of my 802.11n TX aggregation driver changes. 2011-11-08 02:12:11 +00:00
if_ath_debug.c Add support to the TX descriptor printing code to follow ath_buf 2011-11-08 22:01:03 +00:00
if_ath_debug.h Add some new ath(4) debugging bits, from my if_ath_tx 11n TX branch. 2011-10-29 07:17:47 +00:00
if_ath_keycache.c Add a 'vap' to ath_keyset(). 2011-11-08 19:25:52 +00:00
if_ath_keycache.h Add a 'vap' to ath_keyset(). 2011-11-08 19:25:52 +00:00
if_ath_misc.h Introduce TX aggregation and software TX queue management 2011-11-08 22:43:13 +00:00
if_ath_pci.c Conditionally compile the PCI latency workaround; I think it's 2011-11-08 18:37:52 +00:00
if_ath_sysctl.c Introduce a work-around for issues with the AR5416 based MAC on SMP devices. 2011-11-09 22:39:44 +00:00
if_ath_sysctl.h Break out most of the HAL related tweaks into a per-HAL instance, 2011-06-23 02:38:36 +00:00
if_ath_tx_ht.c Introduce TX aggregation and software TX queue management 2011-11-08 22:43:13 +00:00
if_ath_tx_ht.h Introduce TX aggregation and software TX queue management 2011-11-08 22:43:13 +00:00
if_ath_tx.c Flesh out some slightly dirty reset/channel change serialisation code 2011-11-18 05:06:30 +00:00
if_ath_tx.h Introduce TX aggregation and software TX queue management 2011-11-08 22:43:13 +00:00
if_ath.c Flesh out some slightly dirty reset/channel change serialisation code 2011-11-18 05:06:30 +00:00
if_athdfs.h Remove the now unneeded references to these DFS methods. 2011-08-09 15:46:52 +00:00
if_athioctl.h Bring over the 11n aggregation statistics struct from the if_ath_tx branch. 2011-11-08 01:35:44 +00:00
if_athrate.h Introduce TX aggregation and software TX queue management 2011-11-08 22:43:13 +00:00
if_athvar.h Flesh out some slightly dirty reset/channel change serialisation code 2011-11-18 05:06:30 +00:00