Commit Graph

531 Commits

Author SHA1 Message Date
Adrian Chadd
85ca341a79 Add ath_hal_get_curmode() - this is used by the Osprey HAL.
Obtained from:	Qualcomm Atheros
2012-08-24 00:52:37 +00:00
Adrian Chadd
9b13447210 Add rfkill HAL accessor methods. 2012-08-24 00:43:10 +00:00
Adrian Chadd
8edfeb1264 Oops, fix copy/paste silliness. 2012-08-24 00:40:01 +00:00
Adrian Chadd
7148a61d16 Add some more capabilities (unused at the present.)
Obtained from:	Qualcomm Atheros
2012-08-24 00:36:47 +00:00
Adrian Chadd
b042e6a3e0 Add the MFP capability to ath_hal_getcapability().
Obtained from:	Qualcomm Atheros
2012-08-24 00:33:25 +00:00
Adrian Chadd
9f24e32b4a Add some more diagnostic codes.
Obtained from:	Qualcomm Atheros
2012-08-24 00:17:39 +00:00
Adrian Chadd
830c1c46f3 Wrap this a little so it's slightly easier on the eyes. 2012-08-24 00:15:26 +00:00
Adrian Chadd
c84b4ebb24 Add some new flags:
* mfp support;
* 4.9ghz support in the HAL;
* device type - specifically, the bus type and whether it's a HB63
  NIC (which requires some subtle chainmask handling differences
  in the AR5416 HAL.)

Obtained from:	Qualcomm Atheros
2012-08-24 00:09:49 +00:00
Adrian Chadd
38c0190699 Add a placeholder and typedefs for MFP (management frame protection.)
Obtained from:	Qualcomm Atheros
2012-08-23 03:37:01 +00:00
Adrian Chadd
353cf342f4 Add some more interrupt handling bits.
Obtained from:	Qualcomm Atheros
2012-08-23 03:25:09 +00:00
Adrian Chadd
a3611b5984 Add AR9380 devid HAL definitions and probe/attach strings.
Obtained from:	Device IDs are from Qualcomm Atheros
2012-08-23 03:03:00 +00:00
Adrian Chadd
168c1a30e8 Add chipset names. 2012-08-23 02:58:06 +00:00
Adrian Chadd
e913fcda9d Extend the TX descriptor debug printing to be properly aware of
EDMA code.

* create a new TX EDMA descriptor struct to represent TX EDMA descriptors
  when doing debugging;
* implement an EDMA printing function which:
  + hardcodes the TX map size to 4 for now;
  + correctly prints out the number of segments - there's one descriptor
    for up to 4 buffers (segments), not one for each segment;
  + print out 4 DS buffer and len pointers;
  + print out the correct number of DWORDs in the TX descriptor.

TODO:

* Remove all of the hard-coded stuff. Ew.
2012-08-19 02:22:16 +00:00
Adrian Chadd
b74e3fbae4 Bump up the rate control table size to incorporate 3 stream entries. 2012-08-15 08:06:06 +00:00
Adrian Chadd
5000c38d44 Remove this comment, it's no longer relevant. 2012-08-15 07:56:48 +00:00
Adrian Chadd
6c03eb4c31 Extend the duration calculations to work with three and four stream
rates.
2012-08-15 07:52:49 +00:00
Adrian Chadd
0a1a3230b6 Commit device IDs for the (eventually upcoming) AR9380 HAL.
Obtained from:	Qualcomm Atheros, Linux ath9k
2012-08-07 23:45:43 +00:00
Adrian Chadd
fffbec8618 Migrate the 802.11n ath_hal_chaintxdesc() API to use a buffer/segment
array, similar to what filltxdesc() uses.

This removes the last reference to ds_data in the TX path outside of
debugging statements.  These need to be adjusted/fixed.

Tested:

* AR9280 STA/AP with iperf TCP traffic
2012-08-05 11:24:21 +00:00
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
Adrian Chadd
ee3e4df90c Flesh out the multi-rate retry capability.
The existing method for testing for MRR is to call the "SetupXTXDesc"
HAL method and see if it returns AH_TRUE or AH_FALSE.  This capability
explicitly lists what number of multi-rate attempts are possible.

"1" means "one rate attempt supported".
2012-07-28 07:28:08 +00:00
Adrian Chadd
8443512a77 Commit missing #define from a previous check-in.
The AR9300 and later have an 8-deep TX FIFO for each hardware queue.
2012-07-28 07:25:00 +00:00
Adrian Chadd
2f22eb1c0d Tidy up the TX status fields a little and add a couple new flags.
* shuffle things around so things fall on natural padding boundaries;
* add a couple of new flags to specify LDPC and whether to switch to the
  low power RX chain configuration after this TX has completed.

Obtained from:	Qualcomm Atheros
2012-07-27 12:08:49 +00:00
Adrian Chadd
ea75088478 Add STBC TX support for AR5416 HAL chips.
Specifically, however:

* AR9280 and later support 1-stream STBC RX;
* AR9280 and AR9287 support 1-stream STBC TX.

The STBC support isn't announced (yet) via net80211 and it isn't at all
chosen by the rate control code, so there's no real consumer of this
yet.

Obtained from:	Qualcomm Atheros
2012-07-27 11:54:05 +00:00
Adrian Chadd
9eba6394bd Add a STBC TX flag.
Obtained from:	Qualcomm Atheros
2012-07-27 11:45:57 +00:00
Adrian Chadd
8a17bf6787 Add some comments about what the two fields mean. 2012-07-27 11:44:48 +00:00
Adrian Chadd
3e647f1cb4 Introduce a couple more fields in the rate scenario setup as part of
(future) TPC support in the AR9300 HAL.

This is effectively a no-op for the moment as (a) TPC isn't really
supported, (b) the AR9300 HAL isn't yet public, and (c) the existing
HAL code doesn't use these fields.

Obtained from:	Qualcomm Atheros
2012-07-27 11:43:10 +00:00
Adrian Chadd
26463136ac Bring this API in line with what the reference driver and Linux ath9k
was doing.

Obtained from:	Qualcomm Atheros, Linux ath9k
2012-07-27 11:23:24 +00:00
Adrian Chadd
59a7572437 Add a new HAL method - the AR93xx and later NICs have a separate
TX descriptor ring for TX status completion. This API call will pass
the allocated buffer details to the HAL.
2012-07-24 01:18:19 +00:00
Adrian Chadd
ad3e6dcd37 Break out the TX descriptor link field into HAL methods.
The DMA FIFO chips (AR93xx and later) differ slightly to th elegacy
chips:

* The RX DMA descriptors don't have a ds_link field;
* The TX DMA descriptors have a ds_link field however at a different
  offset.

This is a reimplementation based on what the reference driver and ath9k
does.

A subsequent commit will enable it in the TX and beacon paths.

Obtained from:	Linux ath9k, Qualcomm Atheros
2012-07-19 02:25:14 +00:00
Adrian Chadd
be4a8356bc Commit missing flags for the high/low priority (HP/LP) RX queues.
Noticed by:	everyone
2012-07-10 18:30:20 +00:00
Adrian Chadd
f8649041a1 Reorder these so they match the capability enum order. 2012-07-10 03:48:07 +00:00
Adrian Chadd
3e5e995640 Add some AR9300 HAL descriptor definition changes.
* Add a couple of RX errors;
* Add the spectral scan PHY error code;
* extend the RX flags to be a 16 bit field, rather than an 8 bit field;
* Add a new RX flag.

Obtained from:	Qualcomm Atheros
2012-07-09 23:58:22 +00:00
Adrian Chadd
0a6b6951b2 Introduce the EDMA related HAL capabilities.
Whilst here, fix a typo in a previous commit.

Obtained from:	Qualcomm Atheros
2012-07-09 07:31:26 +00:00
Adrian Chadd
d60a0680ba Extend the RX HAL API to include the RX queue identifier.
The AR93xx and later chips support two RX FIFO queues - a high and low
priority queue.

For legacy chips, just assume the queues are high priority.

This is inspired by the reference driver but is a reimplementation of
the API and code.
2012-07-09 07:19:11 +00:00
Adrian Chadd
ba7de9be0d Extend the debugging flags to include some AR9300 HAL related options.
Obtained from:	Qualcomm Atheros
2012-07-09 06:41:18 +00:00
Adrian Chadd
f9c15ba003 .. And fix another typo. Grr. 2012-07-02 06:07:46 +00:00
Adrian Chadd
5cc9e9aef6 Fix another typo. 2012-07-02 06:06:27 +00:00
Adrian Chadd
69bc6f4f0c Fix typo. 2012-07-02 06:05:25 +00:00
Adrian Chadd
577cd9a9b2 Bring over some further HAL capabilities from the Atheros HAL, as well
as an EDMA check function.

For the AR9003 and later NICs, different TX/RX DMA and descriptor handling
code will be conditional on the EDMA check.

Obtained from:	Qualcomm Atheros
2012-07-02 06:02:12 +00:00
Adrian Chadd
c9914f098f Add in some further changes from the AR9300 HAL:
* Add a new ANI variable, for AR9003 and later chips;
* The AR9003 and later series chips support two RX queues now, so start
  down the road of supporting that;
* Add some new TX queue types - uAPSD is possible on earlier chips,
  but PAPRD is relevant to AR9003 and later.

Obtained from:	Qualcomm Atheros, Linux ath9k
2012-07-01 05:14:24 +00:00
Adrian Chadd
df91468216 Migrate the MAC/BB hang structures out from ar5416_misc.h into the HAL.
The ar9300 HAL also uses these types, so it makes no sense to duplicate
them.
2012-07-01 03:15:18 +00:00
Adrian Chadd
7eee712c27 Bring over capabilities for the AR9300 and later HAL. 2012-07-01 02:44:36 +00:00
Adrian Chadd
020841a28e Fix the HAL debugging to only use one bit to mark a message as unmaskable.
Whilst I'm here, remove the duplication of the #define.
2012-07-01 02:34:32 +00:00
Adrian Chadd
df5ea0d85b Fix a subtle corner case surrounding the handling of OFDM restart along
with AMPDU aggregate delimiters.

If there's an OFDM restart during an aggregate, the hardware ACKs
the previous frame, but communicates the RXed frame to the hardware
as having had CRC delimiter error + OFDM_RESTART phy error.
The frame however didn't have a CRC error and since the hardware ACKed
the aggregate to the sender, it thinks the frame was received.

Since I have no idea how often this occurs in the real world, add a
debug statement so trigger whenever this occurs.  I'd appreciate an
email if someone finds this particular situation is triggered.
2012-06-27 05:23:33 +00:00
Adrian Chadd
37003d2fc3 Bring over some new typedefs as part of the AR9300 HAL import. 2012-06-27 03:24:27 +00:00
Adrian Chadd
a6f801b608 Remove duplicate entries. 2012-06-27 03:00:29 +00:00
Adrian Chadd
6479ef780d Bring over the initial 802.11n bluetooth coexistence support code.
The Linux ath9k btcoex code is based off of this code.

Note this doesn't actually implement functional btcoex; there's some
driver glue and a whole lot of verification that is required.

On the other hand, I do have the AR9285+BT and AR9287+BT NICs which
this code supports..

Obtained from:	Qualcomm Atheros, Linux ath9k
2012-06-26 22:16:53 +00:00
Adrian Chadd
a183985e6f On second thought, let's just set both CRC and PHY errors together on
frames that have it and let the upper layer sort it out.

PR:		kern/169362
2012-06-24 06:37:28 +00:00
Adrian Chadd
efb44bb8ca Sometimes the AR5416 sends back radar PHY errors with both the PHY error
and the CRC error bits set.  The radar payload is correct.

When this happens, the stack doesn't see them PHY error frames and
isn't interpreted as a PHY error.  So, no radar detection and no radiotap
PHY error handling.

Now, this may introduce some weird issues if the MAC sends up some other
combination of CRC error + PHY error frames; this commit would break that
and mark them as PHY errors instead of CRC errors.

I may tinker with this a little more to pass radar/early radar/spectral
frames up as PHY errors if the CRC bit is set, to restore the previous
behaviour (where if CRC is set on a PHY error frame, it's marked as a CRC
error rather than PHY error.)

Tested on:	AR5416, over the air, to a USRP N200 which is generating a
		large number of a variety of radar pulses.
TODO:		Test on AR9130, AR9160, AR9280 (and maybe radar pulses on
		2GHz on AR9285/AR9287.)

PR:		kern/169362
2012-06-24 05:59:32 +00:00
Adrian Chadd
3acbfe72fc AR9287 tidyups:
* Add an OS_A_REG_WRITE() routine - analog writes require a 100usec delay
  on AR9280 and later, so create a method to do it.

* Use it for the AR9287 analog writes.

* Re-indent and style(9) the code.
2012-06-17 05:56:27 +00:00