freebsd-dev/sys/dev/ath/ath_hal/ar5416
Adrian Chadd 91046e9c5f Setup needed tables for TPC on AR5416->AR9287 chips.
* Add ah_ratesArray[] to the ar5416 HAL state - this stores the maximum
  values permissable per rate.
* Since different chip EEPROM formats store this value in a different place,
  store the HT40 power detector increment value in the ar5416 HAL state.
* Modify the target power setup code to store the maximum values in the
  ar5416 HAL state rather than using a local variable.
* Add ar5416RateToRateTable() - to convert a hardware rate code to the
  ratesArray enum / index.
* Add ar5416GetTxRatePower() - which goes through the gymnastics required
  to correctly calculate the target TX power:
  + Add the power detector increment for ht40;
  + Take the power offset into account for AR9280 and later;
  + Offset the TX power correctly when doing open-loop TX power control;
  + Enforce the per-rate maximum value allowable.

Note - setting a TPC value of 0x0 in the TX descriptor on (at least)
the AR9160 resulted in the TX power being very high indeed.  This didn't
happen on the AR9220.  I'm guessing it's a chip bug that was fixed at
some point.  So for now, just assume the AR5416/AR5418 and AR9130 are
also suspect and clamp the minimum value here at 1.

Tested:

* AR5416, AR9160, AR9220 hostap, verified using (2GHz) spectrum analyser
* Looked at target TX power in TX descriptor (using athalq) as well as TX
  power on the spectrum analyser.

TODO:

* The TX descriptor code sets the target TX power to 0 for AR9285 chips.
  I'm not yet sure why.  Disable this for TPC and ensure that the TPC
  TX power is set.
* AR9280, AR9285, AR9227, AR9287 testing!
* 5GHz testing!

Quirks:

* The per-packet TPC code is only exercised when the tpc sysctl is set
  to 1. (dev.ath.X.tpc=1.) This needs to be done before you bring the
  interface up.
* When TPC is enabled, setting the TX power doesn't end up with a call
  through to the HAL to update the maximum TX power.  So ensure that
  you set the TPC sysctl before you bring the interface up and configure
  a lower TX power or the hardware will be clamped by the lower TX
  power (at least until the next channel change.)

Thanks to Qualcomm Atheros for all the hardware, and Sam Leffler for use
of his spectrum analyser to verify the TX channel power.
2013-04-17 07:31:53 +00:00
..
ar2133.c Implement the quarter rate fractional channel programming for the 2012-10-04 15:42:45 +00:00
ar5416_ani.c Track the last ANI TX/RX sample correctly. 2012-09-27 06:05:54 +00:00
ar5416_attach.c add a method to set/clear the VMF field in the TX descriptor. 2013-03-04 07:40:49 +00:00
ar5416_beacon.c The AR5212 setup path (also used by the AR5416 code) configures a 2011-09-28 03:03:23 +00:00
ar5416_btcoex.c Now that the register definitions are in -HEAD, enable this. 2013-04-15 17:59:06 +00:00
ar5416_btcoex.h Remove duplicate entries. 2012-06-27 03:00:29 +00:00
ar5416_cal_adcdc.c
ar5416_cal_adcgain.c
ar5416_cal_iq.c Fix the calibration logic to correctly clamp the calculated coefficient. 2010-08-14 15:28:15 +00:00
ar5416_cal.c Bump this up to where it used to be. 2011-11-09 23:28:47 +00:00
ar5416_cal.h Introduce methods for the initial calibration and the new PA calibration 2011-03-11 11:35:36 +00:00
ar5416_eeprom.c
ar5416_gpio.c Bring over the initial 802.11n bluetooth coexistence support code. 2012-06-26 22:16:53 +00:00
ar5416_interrupts.c If any of the TX queues have underrun reporting enabled, enable 2013-02-20 11:24:11 +00:00
ar5416_keycache.c
ar5416_misc.c Begin adding support to explicitly set the current chainmask. 2013-02-25 22:42:43 +00:00
ar5416_phy.c Modify the AR5416 11na rate table to use 24mb OFDM 11a for control traffic, 2011-02-21 05:10:34 +00:00
ar5416_power.c Both linux ath9k and the reference driver initialises the PLL here 2012-04-14 04:40:11 +00:00
ar5416_radar.c Implement an API to fetch the default DFS parameters for the given chip. 2012-08-24 01:29:46 +00:00
ar5416_recv.c Fix a subtle corner case surrounding the handling of OFDM restart along 2012-06-27 05:23:33 +00:00
ar5416_reset.c Setup needed tables for TPC on AR5416->AR9287 chips. 2013-04-17 07:31:53 +00:00
ar5416_spectral.c Fix the short repeat option code to not flip the option to 0 when 2013-01-02 03:56:20 +00:00
ar5416_xmit.c Setup needed tables for TPC on AR5416->AR9287 chips. 2013-04-17 07:31:53 +00:00
ar5416.h Setup needed tables for TPC on AR5416->AR9287 chips. 2013-04-17 07:31:53 +00:00
ar5416.ini Fix the addac serial load register write for AR5416. 2011-09-06 10:49:05 +00:00
ar5416desc.h I'm not sure why ah_desc.h was required here, but it doesn't _need_ 2012-11-16 20:04:45 +00:00
ar5416phy.h Bring over the basic spectral scan framework code from Qualcomm Atheros. 2013-01-02 00:38:01 +00:00
ar5416reg.h Bring over some AR9271 register definitions from the QCA HAL. 2013-04-15 17:58:11 +00:00