freebsd-skq/sys/dev/ath/ath_hal/ar5211
Adrian Chadd 46634305f4 Migrate the ath_hal_filltxdesc() API to take a list of buffer/seglen values.
The existing API only exposes 'seglen' (the current buffer (segment) length)
with the data buffer pointer set in 'ds_data'.  This is fine for the legacy
DMA engine but it won't work for the EDMA engines.

The EDMA engine has a significantly different TX descriptor layout.

* The legacy DMA engine had a ds_data pointer at the same offset in the
  descriptor for both TX and RX buffers;
* The EDMA engine has no ds_data for RX - the data is DMAed after the
  descriptor;
* The EDMA engine has support for 4 TX buffer/segment pairs in the TX
  DMA descriptor;
* The EDMA TX completion is in a different FIFO, and the driver will
  'link' the status completion entry to a QCU by a "QCU ID".
  I don't know why it's just not filled in by the hardware, alas.

So given that, here are the changes:

* Instead of directly fondling 'ds_data' in ath_desc, change the
  ath_hal_filltxdesc() to take an array of buffer pointers as well
  as segment len pointers;
* The EDMA TX completion status wants a descriptor and queue id.
  This (for now) uses bf_state.bfs_txq and will extract the hardware QCU
  ID from that.
* .. and this is ugly and wasteful; it should change to just store
  the QCU in the bf_state and save 3/7 bytes in the process.

Now, the weird crap:

* The aggregate TX path was using bf_state->bfs_txq for the TXQ, rather than
  taking a function argument.  I've tidied that up.
* The multicast queue frames get put on a software TXQ and then that is
  appended to the hardware CABQ when appropriate.  So for now, make sure
  that bf_state->bfs_txq points at the CABQ when adding frames to the
  multicast queue.
* .. but the multicast queue TX path for now doesn't use the software
  queue and instead
  (a) directly sets up the descriptor contents at that point;
  (b) the frames on the vap->avp_mcastq are then just appended wholesale
      to the CABQ.
  So for now, I don't have to worry about making the multicast path
  work with aggregation or the per-TID software queue. Phew.

What's left to do:

* I need to modify the 11n ath_hal_chaintxdesc() API to do the same.
  I'll do that in a subsequent commit.
* Remove bf_state.bfs_txq entirely and store the QCU as appropriate.
* .. then do the runtime "is this going on the right HWQ?" checks using
  that, rather than comparing pointer values.

Tested on:

* AR9280 STA/AP
* AR5416 STA/AP
2012-08-05 10:12:27 +00:00
..
ar5211_attach.c Flesh out the multi-rate retry capability. 2012-07-28 07:28:08 +00:00
ar5211_beacon.c Update the TSF and next-TBTT methods to work for the AR5416 and later NICs. 2011-09-08 01:23:05 +00:00
ar5211_interrupts.c
ar5211_keycache.c Replace Id keyword with FreeBSD keyword and set the svn props correctly. 2010-03-03 17:32:32 +00:00
ar5211_misc.c Add some empty DFS methods for AR5210/AR5211 for now, if DFS is enabled 2012-05-09 18:17:01 +00:00
ar5211_phy.c
ar5211_power.c Replace Id keyword with FreeBSD keyword and set the svn props correctly. 2010-03-03 17:32:32 +00:00
ar5211_recv.c Extend the RX HAL API to include the RX queue identifier. 2012-07-09 07:19:11 +00:00
ar5211_reset.c Stop using the hardware register value byte order swapping for now, 2012-04-19 03:26:21 +00:00
ar5211_xmit.c Migrate the ath_hal_filltxdesc() API to take a list of buffer/seglen values. 2012-08-05 10:12:27 +00:00
ar5211.h Migrate the ath_hal_filltxdesc() API to take a list of buffer/seglen values. 2012-08-05 10:12:27 +00:00
ar5211desc.h Replace Id keyword with FreeBSD keyword and set the svn props correctly. 2010-03-03 17:32:32 +00:00
ar5211phy.h Replace Id keyword with FreeBSD keyword and set the svn props correctly. 2010-03-03 17:32:32 +00:00
ar5211reg.h Reapply r228785 now it has been tested by Adrian. Also add comments 2011-12-30 02:58:37 +00:00
boss.ini Replace Id keyword with FreeBSD keyword and set the svn props correctly. 2010-03-03 17:32:32 +00:00