freebsd-dev/sys/dev/ath/ath_hal/ar5416
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
..
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 Flip on half/quarter rate support. 2012-09-13 07:24:14 +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 Bring over the initial 802.11n bluetooth coexistence support code. 2012-06-26 22:16:53 +00:00
ar5416_btcoex.h Remove duplicate entries. 2012-06-27 03:00:29 +00:00
ar5416_cal_adcdc.c Replace Id keyword with the FreeBSD keyword. 2010-01-29 10:07:17 +00:00
ar5416_cal_adcgain.c Replace Id keyword with the FreeBSD keyword. 2010-01-29 10:07:17 +00:00
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 Replace Id keyword with the FreeBSD keyword. 2010-01-29 10:07:17 +00:00
ar5416_gpio.c Bring over the initial 802.11n bluetooth coexistence support code. 2012-06-26 22:16:53 +00:00
ar5416_interrupts.c Squirrel away the SYNC interrupt in case we're doing interrupt debugging. 2012-04-10 07:11:33 +00:00
ar5416_keycache.c Replace Id keyword with the FreeBSD keyword. 2010-01-29 10:07:17 +00:00
ar5416_misc.c Call the ar5212SetCoverageClass() function for now. 2012-09-13 07:19:53 +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 Don't use AR_PHY_MODE to setup half/quarter rate. 2012-09-13 18:24:13 +00:00
ar5416_xmit.c Migrate the 802.11n ath_hal_chaintxdesc() API to use a buffer/segment 2012-08-05 11:24:21 +00:00
ar5416.h Implement an API to fetch the default DFS parameters for the given chip. 2012-08-24 01:29:46 +00:00
ar5416.ini Fix the addac serial load register write for AR5416. 2011-09-06 10:49:05 +00:00
ar5416desc.h Add some 11n bits from the if_ath_tx 11n branch: 2011-10-25 23:09:07 +00:00
ar5416phy.h Add the BT register definitions for AR9285/AR9287 BT coexistence. 2012-04-26 02:03:16 +00:00
ar5416reg.h Add register defintions for the AR5416 TX/RX latency fields. 2012-09-13 07:17:58 +00:00