Commit Graph

1251 Commits

Author SHA1 Message Date
Adrian Chadd
d94f2d7f34 Rename AH_MIMO_MAX_CHAINS to AH_MAX_CHAINS, for compatibility with
internal atheros HAL code.
2012-09-17 23:24:45 +00:00
Adrian Chadd
c6e9cee205 Take credit for the work I've done in this source file. 2012-09-17 03:17:42 +00:00
Adrian Chadd
de8e4d6436 Add a per-TID filter queue and filter state bits.
These are intended for software TX filtering support, where the NIC
decides there has been too many successive failues to a destination
and will filter it.

Although the filtering is done per-destination (via the keycache),
the state and queue is kept per-TID for now.  It simplifies the overall
architecture design and locking.

Whilst here, add ATH_TID_UNLOCK_ASSERT().
2012-09-17 01:21:55 +00:00
Adrian Chadd
355cae39e9 Add a debug bit for TX destination filtering. 2012-09-17 01:18:47 +00:00
Adrian Chadd
e69db8df7d Improve performance of the Sample rate algorithm on 802.11n networks.
* Don't treat high percentage failures as "sucessive failures" - high
  MCS rates are very picky and will quite happily "fade" from low
  to high failure % and back again within a few seconds.  If they really
  don't work, the aggregate will just plain fail.

* Only sample MCS rates +/- 3 from the current MCS.  Sample will back off
  quite quickly, so there's no need to sample _all_ MCS rates between
  a high MCS rate and MCS0; there may be a lot of them.

* Modify the smoothing rate to be 75% rather than 95% - it's more adaptive
  but it comes with a cost of being slightly less stable at times.
  A per-node, hysterisis behaviour would be nicer.
2012-09-17 01:09:17 +00:00
Adrian Chadd
9b967f5d12 Don't use AR_PHY_MODE to setup half/quarter rate.
I'm not sure where in the deep, distant past I found the AR_PHY_MODE
registers for half/quarter rate mode, but unfortunately that doesn't
seem to work "right" for non-AR9280 chips.

Specifically:

* don't touch AR_PHY_MODE
* set the PLL bits when configuring half/quarter rate

I've verified this on the AR9280 (5ghz fast clock) and the AR5416.

The AR9280 works in both half/quarter rate; the AR5416 unfortunately
only currently works at half rate.  It fails to calibrate on quarter rate.
2012-09-13 18:24:13 +00:00
Adrian Chadd
03a51ef8f4 Enable fractional 5G mode on half/quarter rate channels.
Obtained from:	Linux ath9k
2012-09-13 07:25:41 +00:00
Adrian Chadd
77ffc4c1fc Flip on half/quarter rate support.
No, this isn't HT/5 and HT/10 support.  This is the 11a half/quarter
rate support primarily used by the 4.9GHz and GSM band regulatory
domains.

This is definitely a work in progress.

TODO:

* everything in the last commit;
* lots more interoperability testing with the AR5212 half/quarter rate
  support for the relevant chips;
* Do some interop testing on half/quarter rate support between _all_
  the 11n chips - AR5416, AR9160, AR9280 (and AR9285/AR9287 when 2GHz
  half/quarter rate support is coded up.)
2012-09-13 07:24:14 +00:00
Adrian Chadd
ce801478d2 Introduce an AR5416 flavour of the IFS and mac usec/timing configuration
used when running the chips in half/quarter rate.

This sets up some default parameters which are then overridden by the
driver (which manually configures things like slot timing at interface
start time.)

Although this is a copy-and-modify from the AR5212 HAL, I did peek
at the reference HAL and the ath9k driver to see what they did.
Ath9k in particular doesn't hard-code this - instead, their version
of ar5416InitUserSettings() does all of the relevant math.

TODO:

* do the math, not hard code things!
* fix the mac clock calculation for the AR9287; since it runs the
  MAC clock at a higher rate, requiring all the duration calculations
  to change;
* Do a whole lot more validation for half/quarter rates.

Obtained from:	Qualcomm Atheros, Linux ath9k
2012-09-13 07:22:40 +00:00
Adrian Chadd
41b53a9aaf Call the ar5212SetCoverageClass() function for now.
Some of the math is a little wrong thanks to clocks in 11a mode running
at 44MHz when in fast clock mode (rather than 40MHz, which the chips
before AR9280 ran 11a in).  That'll have to be addressed in a future commit.
2012-09-13 07:19:53 +00:00
Adrian Chadd
c19a7918f3 Add register defintions for the AR5416 TX/RX latency fields.
Obtained from:	Qualcomm Atheros
2012-09-13 07:17:58 +00:00
Adrian Chadd
1690edb32c Compensate for half/quarter rate differences in MAC clock speed.
This fixes the incorrect slot (and likely ACK/RTS timeout) values
which I see when enabling half/quarter rate support on the AR9280.

The resulting math matches the expected calculated default values.
2012-09-13 07:17:29 +00:00
Adrian Chadd
5d9b19f731 Clear the correct descriptor when going through the chained together
gather DMA descriptor list.

Pointy hat to: adrian@, for even USING bf->bf_desc here instead of 'ds'.
2012-09-11 04:11:42 +00:00
Adrian Chadd
21840808c8 Make sure the aggregate fields are properly cleared - both in the
ath_buf and when forming a non-aggregate frame.

The non-11n setds function is called when TXing aggregate frames (and
yes, I should fix this!) and the non-11n TX aggregation code doesn't clear
the delimiter field.  I figure it's nicer to do that.
2012-09-09 05:06:16 +00:00
Adrian Chadd
a71362cec6 Remove TDMA #define entries from if_ath.c; they now exist in if_ath_tdma.h. 2012-09-09 04:53:10 +00:00
Adrian Chadd
76af1a93c9 Correctly mask out the RTS/CTS flags when forming aggregates.
This had the side effect of clearing HAL_TXDESC_CLRDMASK for a bunch of
frames, meaning they'd end up being potentially filtered if there were
an error.  This is fine in the previous world as they'd just be
software retried but now that I'm working on filtered frames, these
descriptors would be endlessly retried until another valid frame would
come along that had CLRDMASK set.
2012-09-08 02:56:09 +00:00
Adrian Chadd
2a9f83af64 Ensure that single-frame aggregate session frames are retransmitted
with the correct configuration.

Occasionally an aggregate TX would fail and the first frame would be
retransmitted as a non-AMPDU frame.  Since bfs_aggr=1 and bfs_nframes > 1
(from the previous AMPDU attempt), the aggr completion function would be
called and be very confused about what's going on.

Noticed by:	Kim <w8hdkim@gmail.com>
PR:		kern/171394
2012-09-07 00:24:27 +00:00
Adrian Chadd
be7f7a955b Disable strong signal diversity when enabling radar pulse detection
for the AR5212 era NICs.
2012-09-02 05:01:10 +00:00
Adrian Chadd
11f0fa784e AR5212 radar pulse fixes.
Fix the strong signal diversity capability setting - I had totally
messed up the indentation.

Set the default values to match what's in the .ini for now, rather than
what values I had previously gleaned from places.  This seems to work
quite well for the early AR5212 NICs I have.  Of course, later NICs
have different PHYs and the radar configuration is very card/board
dependent..

Tested:

 * ath1: AR5212 mac 5.3 RF5111 phy 4.1
   ath1: 2GHz radio: 0x0023; 5GHz radio: 0x0017

This detects 1, 5, 25, 50, 75, 100uS pulses reliably (with no interference.)

However, 10uS pulses don't detect reliably. That may be around the
transition between short and long pulses so some further tuning may
improve things.
2012-09-02 04:56:29 +00:00
Adrian Chadd
9c1b997551 Fix the PHY / CRC error bug in the AR5212 HAL, which apparently also pops
up on (at least) the AR5413.

The 30 second summary - if a CRC error frame comes in during PHY error
processing, that CRC bit will be set for all subsequent frames until
a non-CRC error frame is processed.

So to allow for accurate PHY error processing (Radar, and ANI on the AR5212
HAL chips) just tag the frame as being both CRC and PHY - let the driver
decide what to do with it.

PR:		kern/169362
2012-09-01 05:43:30 +00:00
Adrian Chadd
dae1b5d00a Migrate the AR9285 diversity configuration LNA configuration to use
some HAL definitions rather than local definitions.

The original source (ath9k) pulled this stuff from the QCA driver and
removed the HAL_* prefix.  I'm just restoring the correct order of things.

Obtained from:	Qualcomm Atheros
2012-08-30 06:55:47 +00:00
Adrian Chadd
fb20fd244e There's no nede to allocate a DMA map just before calling bus_dmamem_alloc().
In fact, bus_dmamem_alloc() happily NULLs the dmat pointer passed in,
before replacing it with its own.

This fixes a MIPS crash when kldload'ing if_ath/if_ath_pci -
bus_dmamap_destroy() was passed in a NULL dmat pointer and was doing
all kinds of very bad things.

Reviewed by:	scottl
2012-08-29 16:58:51 +00:00
Adrian Chadd
28bb46617d Set the HAL combined antenna diversity capability if the AR9285
EEPROM settings allow it.
2012-08-29 04:11:00 +00:00
Adrian Chadd
46e2649633 Add a new capability bit - whether the hardware supports AR9285 style
combined diversity.
2012-08-29 04:09:54 +00:00
Adrian Chadd
d6af4e0f06 Add AR5413 radar parameters and strong signal diversity capability.
This is a re-implementation based on the reference carrier code
for the AR5413.

Tested:
 * Pulse detection for AR5212 and AR5413, to ensure the
   correct behaviour for both chips

PR:		kern/170904
Obtained from:	Qualcomm Atheros
2012-08-29 03:58:13 +00:00
Adrian Chadd
0146ef1ae2 Add a (temporarily located) definition. 2012-08-29 03:50:59 +00:00
Adrian Chadd
21cb20bb94 Remove - not needed. 2012-08-29 00:53:58 +00:00
Adrian Chadd
b5c5592d2b Remove extra debugging - there's no longer any need. 2012-08-29 00:53:41 +00:00
Adrian Chadd
bb1bf7ed0a Only print the descriptor contents!
Found by:	magical CLANG build environments

Submitted by:	Sevan <venture37@gmail.com>
2012-08-27 23:27:41 +00:00
Adrian Chadd
f6fd8c7af8 Improve the sample rate logging. 2012-08-27 20:30:07 +00:00
Adrian Chadd
5b0c1ea0c9 Ensure that all firstep values are available in ANI.
The comparison assumes maxFirstepLevel is a count, rather than a maximum
value.  The array is 3 entries in size however 'maxFirstepLevel' is 2.

This bug also exists in the AR5212 HAL.
2012-08-27 20:10:38 +00:00
Adrian Chadd
810f2a9cbc Fix the debugging output to correctly log CCK errors. 2012-08-27 20:03:08 +00:00
Adrian Chadd
222d73f11d Move this magic check to only occur if no eeprom data is given.
Tested on:

	* AP99 (AR7241+AR9287)
2012-08-26 04:26:49 +00:00
Adrian Chadd
e12a307eff Add EEPROM data hooks for the AR9287.
Tested:
	* AP99 Reference board (AR7241 + AR9287)
2012-08-26 04:26:25 +00:00
Adrian Chadd
b7005313dd Remove the hard-coded AR5416-series parameters and instead use the
DFS parameters fetched from the HAL.

Check whether the specific chipset supports RADAR reporting before
enabling DFS; or some of the (unset) DFS methods may fail.

Tested:

* AR5210 (correctly didn't enable radar PHY reporting)
* AR5212 (correctly enabled radar PHY reporting w/ the correct default
  parameters.)

TODO:

* Now that I have this capability check in place, I could remove the
  (empty) DFS methods from AR5210/AR5211.
* Test on AR5416, AR9160, AR9280.

PR:		kern/170904
2012-08-24 17:39:57 +00:00
Adrian Chadd
51816abcd0 Correctly handle the "pe_enabled" flag - both when configuring DFS and
fetching the current DFS configuration.

PR:		kern/170904
2012-08-24 17:37:51 +00:00
Adrian Chadd
7d6b932c44 Add an accessor macro for getting access to the default DFS parameters.
PR:		kern/170904
2012-08-24 17:37:12 +00:00
Adrian Chadd
217ad7d2a5 Add default values for the NumTxMaps capability. 2012-08-24 07:35:18 +00:00
Adrian Chadd
47152caed8 Add the method to fetch the default DFS parameters for the AR5212 PHY.
I need to check whether new parameters were added for the AR5413 NIC.

PR:		kern/170904
2012-08-24 07:32:35 +00:00
Adrian Chadd
54798be082 Implement an API to fetch the default DFS parameters for the given chip.
The only chip this is currently implemented for is the AR5416 HAL family.
A follow-up commit will add AR5212 support.

PR:		kern/170904
2012-08-24 01:29:46 +00:00
Adrian Chadd
e0c214d1bb Bring over some new EEPROM regulatory domain flags.
Obtained from:	Qualcomm Atheros
2012-08-24 01:14:00 +00:00
Adrian Chadd
41466eb9a6 Oops, another copy/paste issue. 2012-08-24 00:54:31 +00:00
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