wlan - if_ath driver - Make some adjustments to ath (preliminary)
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 8 Sep 2010 07:20:23 +0000 (00:20 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 8 Sep 2010 07:20:23 +0000 (00:20 -0700)
commit0c208ba482c80073e86a7d8412cdd547fd1a3d82
treea8ecc3c938820520783127972628e51e11b031e3
parent22a4b17240102a57fd681c5723d255bc7c57cce2
wlan - if_ath driver - Make some adjustments to ath (preliminary)

These adjustments correct some chip races and appear to fix issues
related to running the wlan in AP mode with the atheros driver.

* Fix a bug in ath_txqmove().  This bug was hidden due to a queue
  length check in the one place that used the routine but fix it anyway.

* Call stoptxdma() before messing with the beacon linkages rather than
  afterwords (ap mode).  I'm a bit unclear as to whether the previously
  installed beacon should have been allowed to continue to run if no
  new beacons are found.  For now it isn't.

* Redo the qbusy logic.  The old logic had at least 2 chipset/driver
  races related to the link field.  The new logic makes no assumptions
  and only reactivates the txdma if the queue is clearly idle and
  we are adding the first (bf) to it.  Otherwise leave it to the INT_TX
  code to detect where the txdma stopped and restart it at the
  appropriate place.

  This bit of code needs more work as the INT_TX for tx completion may
  be delayed indefinitely (we might need a callout check in there too,
  I'm not sure).

* For the moment use MB_WAIT when loading or replentishing the receive ring.
  There does not appear to be a proper mechanism to deal with stalls that
  might be created if a mbuf fails to allocate.

  What we really need here is proper rx ring mbuf replacement logic where
  the filled mbuf is NOT removed if no new mbuf can be allocated to take
  its place.  Using MB_WAIT is a bad hack.  It isn't entirely trivial
  due to the DMA load and the 32 bit address space restriction.

* Add a few cpu_sfence()s when poking the (bf) link field.  This probably
  isn't correct.

* Cleanup, add some debugging kprintf()s for a few unexpected conditions
sys/dev/netif/ath/ath/if_ath.c
sys/dev/netif/ath/ath/if_ath_pci.c
sys/dev/netif/ath/hal/ath_hal/ar5210/ar5210_xmit.c
sys/dev/netif/ath/hal/ath_hal/ar5211/ar5211_xmit.c
sys/dev/netif/ath/hal/ath_hal/ar5212/ar5212_xmit.c