freebsd-skq/sys/dev/ath/ath_hal
Adrian Chadd e9472a9f88 Implement the quarter rate fractional channel programming for the
AR5416 and AR9280, but leave it disabled by default.

TL;DR: don't enable this code at all unless you go through the process
of getting the NIC re-certified.  This is purely to be used as a
reference and NOT a certified solution by any stretch of the imagination.

The background:

The AR5112 RF synth right up to the AR5133 RF synth (used on the AR5416,
derivative is used for the AR9130/AR9160) only implement down to 2.5MHz
channel spacing in 5GHz.  Ie, the RF synth is programmed in steps of 2.5MHz
(or 5, 10, 20MHz.) So they can't represent the quarter rate channels
in the 4.9GHz PSB (which end in xxx2MHz and xxx7MHz).  They support
fractional spacing in 2GHz (1MHz spacing) (or things wouldn't work,
right?)

So instead of doing this, the RF synth programming for the AR5112 and
later code will round to the nearest available frequency.

If all NICs were RF5112 or later, they'll inter-operate fine - they all
program the same. (And for reference, only the latest revision of the
RF5111 NICs do it, but the driver doesn't yet implement the programming.)

However:

* The AR5416 programming didn't at all implement the fractional synth
  work around as above;
* The AR9280 programming actually programmed the accurate centre frequency
  and thus wouldn't inter-operate with the legacy NICs.

So this patch:

* Implements the 4.9GHz PSB fractional synth workaround, exactly as the
  RF5112 and later code does;
* Adds a very dirty workaround from me to calculate the same channel
  centre "fudge" to the AR9280 code when operating on fractional frequencies
  in 5GHz.

HOWEVER however:

It is disabled by default.  Since the HAL didn't implement this feature,
it's highly unlikely that the AR5416 and AR928x has been tested in these
centre frequencies.  There's a lot of regulatory compliance testing required
before a NIC can have this enabled - checking for centre frequency,
for drift, for synth spurs, for distortion and spectral mask compliance.
There's likely a lot of other things that need testing so please don't
treat this as an exhaustive, authoritative list.  There's a perfectly good
process out there to get a NIC certified by your regulatory domain, please
go and engage someone to do that for you and pay the relevant fees.

If a company wishes to grab this work and certify existing 802.11n NICs
for work in these bands then please be my guest.  The AR9280 works fine
on the correct fractional synth channels (49x2 and 49x7Mhz) so you don't
need to get certification for that. But the 500KHz offset hack may have
the above issues (spur, distortion, accuracy, etc) so you will need to
get the NIC recertified.

Please note that it's also CARD dependent.  Just because the RF synth
will behave correctly doesn't at all mean that the card design will also
behave correctly.  So no, I won't enable this by default if someone
verifies a specific AR5416/AR9280 NIC works.  Please don't ask.

Tested:

I used the following NICs to do basic interoperability testing at
half and quarter rates.  However, I only did very minimal spectrum
analyser testing (mostly "am I about to blow things up" testing;
not "certification ready" testing):

* AR5212 + AR5112 synth
* AR5413 + AR5413 synth
* AR5416 + AR5113 synth
* AR9280
2012-10-04 15:42:45 +00:00
..
ah_regdomain These two are ath_hal regulatory domain updates from the Atheros 2011-07-20 12:46:58 +00:00
ar5210 Add default values for the NumTxMaps capability. 2012-08-24 07:35:18 +00:00
ar5211 Add default values for the NumTxMaps capability. 2012-08-24 07:35:18 +00:00
ar5212 AR5212 radar pulse fixes. 2012-09-02 04:56:29 +00:00
ar5312 Stop using the hardware register value byte order swapping for now, 2012-04-19 03:26:21 +00:00
ar5416 Implement the quarter rate fractional channel programming for the 2012-10-04 15:42:45 +00:00
ar9001 Break out the "memory" EEPROM data read method from being AR9130 specific 2012-01-15 19:22:34 +00:00
ar9002 Implement the quarter rate fractional channel programming for the 2012-10-04 15:42:45 +00:00
ar9003 Add AR9380 devid HAL definitions and probe/attach strings. 2012-08-23 03:03:00 +00:00
ah_debug.h Extend the debugging flags to include some AR9300 HAL related options. 2012-07-09 06:41:18 +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 Commit device IDs for the (eventually upcoming) AR9380 HAL. 2012-08-07 23:45:43 +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 couple of accessor inline functions for state that exists in net80211. 2012-09-18 01:27:24 +00:00
ah_regdomain.c Fix a corner case in the HAL debugging changes, where ah was NULL. 2011-09-30 05:17:57 +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 Rename AH_MIMO_MAX_CHAINS to AH_MAX_CHAINS, for compatibility with 2012-09-17 23:24:45 +00:00
ah.h Rename AH_MIMO_MAX_CHAINS to AH_MAX_CHAINS, for compatibility with 2012-09-17 23:24:45 +00:00