freebsd-skq/sys/dev/ath/ath_hal
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
..
ah_regdomain Add new regulatory domain. 2013-03-24 04:42:56 +00:00
ar5210 Begin adding support to explicitly set the current chainmask. 2013-02-25 22:42:43 +00:00
ar5211 Begin adding support to explicitly set the current chainmask. 2013-02-25 22:42:43 +00:00
ar5212 Begin adding support to explicitly set the current chainmask. 2013-02-25 22:42:43 +00:00
ar5312 Stop using the hardware register value byte order swapping for now, 2012-04-19 03:26:21 +00:00
ar5416 Setup needed tables for TPC on AR5416->AR9287 chips. 2013-04-17 07:31:53 +00:00
ar9001 Use the TPC bank by default for AR9160. 2013-04-17 07:22:23 +00:00
ar9002 Setup needed tables for TPC on AR5416->AR9287 chips. 2013-04-17 07:31:53 +00:00
ar9003 Add AR9380 devid HAL definitions and probe/attach strings. 2012-08-23 03:03:00 +00:00
ah_debug.h HAL additions to enable MCI Bluetooth coexistence in the AR9300 HAL. 2013-04-05 07:41:47 +00:00
ah_decode.h Add a threadid to the ah_decode API. 2012-04-04 20:46:20 +00:00
ah_desc.h Extend the TX descriptor debug printing to be properly aware of 2012-08-19 02:22:16 +00:00
ah_devid.h Add the emulation PCI device id - these days, 0xabcd shows up all over 2012-10-31 20:58:24 +00:00
ah_diagcodes.h Add some more diagnostic codes. 2012-08-24 00:17:39 +00:00
ah_eeprom_9287.c Move this magic check to only occur if no eeprom data is given. 2012-08-26 04:26:49 +00:00
ah_eeprom_9287.h Make sure the extended regdomain word is initialised. 2011-06-28 00:01:55 +00:00
ah_eeprom_v1.c Fix the eeprom set API method to return HAL_STATUS. 2011-05-14 15:12:02 +00:00
ah_eeprom_v1.h Replace Id keyword with FreeBSD keyword and set the svn props correctly. 2010-03-03 17:32:32 +00:00
ah_eeprom_v3.c Fix the eeprom set API method to return HAL_STATUS. 2011-05-14 15:12:02 +00:00
ah_eeprom_v3.h Replace Id keyword with FreeBSD keyword and set the svn props correctly. 2010-03-03 17:32:32 +00:00
ah_eeprom_v4k.c "Upgrade" the AR9285 code to support PCI/ART EEPROM on flash. 2012-04-20 21:56:13 +00:00
ah_eeprom_v4k.h Bring over a pdadc calibration fix from ath9k - unused power detector 2011-04-22 10:57:46 +00:00
ah_eeprom_v14.c Introduce the FRAC_5G EEPROM parameter. 2011-07-30 13:45:12 +00:00
ah_eeprom_v14.h Introduce the FRAC_5G EEPROM parameter. 2011-07-30 13:45:12 +00:00
ah_eeprom.h Bring over some new EEPROM regulatory domain flags. 2012-08-24 01:14:00 +00:00
ah_internal.h Add a new TX power field - it's inteded to be used where low TX power 2013-04-05 09:06:39 +00:00
ah_regdomain.c Add XC900 SKU mapping. 2012-12-07 06:38:30 +00:00
ah_regdomain.h Migrate the regulatory database definitions into separate header files 2011-03-10 03:13:56 +00:00
ah_soc.h Replace Id keyword with FreeBSD keyword and set the svn props correctly. 2010-03-03 17:32:32 +00:00
ah.c Add in the STBC TX/RX capability support into the HAL and driver. 2013-02-27 00:25:44 +00:00
ah.h HAL additions to enable MCI Bluetooth coexistence in the AR9300 HAL. 2013-04-05 07:41:47 +00:00