freebsd-dev/sys/dev/ath
Adrian Chadd b70f530bc7 Bring over the initial static bluetooth coexistence configuration
for the WB195 combo NIC - an AR9285 w/ an AR3011 USB bluetooth NIC.

The AR3011 is wired up using a 3-wire coexistence scheme to the AR9285.

The code in if_ath_btcoex.c sets up the initial hardware mapping
and coexistence configuration.  There's nothing special about it -
it's static; it doesn't try to configure bluetooth / MAC traffic priorities
or try to figure out what's actually going on.  It's enough to stop basic
bluetooth traffic from causing traffic stalls and diassociation from
the wireless network.

To use this code, you must have the above NIC.  No, it won't work
for the AR9287+AR3012, nor the AR9485, AR9462 or AR955x combo cards.

Then you set a kernel hint before boot or before kldload, where 'X'
is the unit number of your AR9285 NIC:

# kenv hint.ath.X.btcoex_profile=wb195

This will then appear in your boot messages:

[100482] athX: Enabling WB195 BTCOEX

This code is going to evolve pretty quickly (well, depending upon my
spare time) so don't assume the btcoex API is going to stay stable.

In order to use the bluetooth side, you must also load in firmware using
ath3kfw and the binary firmware file (ath3k-1.fw in my case.)

Tested:

* AR9280, no interference
* WB195 - AR9285 + AR3011 combo; STA mode; basic bluetooth inquiries
  were enough to cause traffic stalls and disassociations.  This has
  stopped with the btcoex profile code.

TODO:

* Importantly - the AR9285 needs ASPM disabled if bluetooth coexistence
  is enabled.  No, I don't know why.  It's likely some kind of bug to do
  with the AR3011 sending bluetooth coexistence signals whilst the device
  is asleep.  Since we don't actually sleep the MAC just yet, it shouldn't
  be a problem.  That said, to be totally correct:

  + ASPM should be disabled - upon attach and wakeup
  + The PCIe powersave HAL code should never be called

  Look at what the ath9k driver does for inspiration.

* Add WB197 (AR9287+AR3012) support
* Add support for the AR9485, which is another combo like the AR9285
* The later NICs have a different signaling mechanism between the MAC
  and the bluetooth device; I haven't even begun to experiment with
  making that HAL code work.  But it should be a lot more automatic.

* The hardware can do much more interesting traffic weighting with
  bluetooth and wifi traffic.  None of this is currently used.
  Ideally someone would code up something to watch the bluetooth traffic
  GPIO (via an interrupt) and then watch it go high/low; then figure out
  what the bluetooth traffic is and adjust things appropriately.

* If I get the time I may add in some code to at least track this stuff
  and expose statistics.  But it's up to someone else to experiment with
  the bluetooth coexistence support and add the interesting stuff (like
  "real" detection of bulk, audio, etc bluetooth traffic patterns and
  change wifi parameters appropriately - eg, maximum aggregate length,
  transmit power, using quiet time to control TX duty cycle, etc.)
2013-06-07 09:02:02 +00:00
..
ath_dfs/null Add a method to explicitly disable radar reporting if required. 2013-01-02 01:36:10 +00:00
ath_hal Add bluetooth fixes to the AR5416/AR92xx HAL: 2013-06-07 05:17:58 +00:00
ath_rate I give up - just throw the EWMA update into the normal update_stats() 2013-02-27 04:33:06 +00:00
ah_osdep.c Fix the HAL debugging to only use one bit to mark a message as unmaskable. 2012-07-01 02:34:32 +00:00
ah_osdep.h Migrate the ath_hal_filltxdesc() API to take a list of buffer/seglen values. 2012-08-05 10:12:27 +00:00
if_ath_ahb.c Create a new TX lock specifically for queuing frames. 2013-02-07 07:50:16 +00:00
if_ath_alq.c Support sending ATH_ALQ messages with no payload. 2013-05-13 21:17:27 +00:00
if_ath_alq.h Add ALQ beacon debugging. 2013-05-13 21:18:00 +00:00
if_ath_beacon.c Be (very) careful about how to add more TX DMA work. 2013-05-18 18:27:53 +00:00
if_ath_beacon.h Overhaul the TXQ locking (again!) as part of some beacon/cabq timing 2013-03-24 00:03:12 +00:00
if_ath_btcoex.c Bring over the initial static bluetooth coexistence configuration 2013-06-07 09:02:02 +00:00
if_ath_btcoex.h Bring over the initial static bluetooth coexistence configuration 2013-06-07 09:02:02 +00:00
if_ath_debug.c TX EDMA debugging fixes: 2012-11-05 07:08:45 +00:00
if_ath_debug.h Add a debug method to dump the EDMA TX status descriptor contents out. 2012-11-03 04:53:44 +00:00
if_ath_keycache.c Don't allocate or program a key for the AR5210. 2012-11-19 23:54:05 +00:00
if_ath_keycache.h Add a 'vap' to ath_keyset(). 2011-11-08 19:25:52 +00:00
if_ath_led.c Bring over the initial 802.11n bluetooth coexistence support code. 2012-06-26 22:16:53 +00:00
if_ath_led.h Refactor out the software LED config code into a common function, called 2011-12-26 05:46:22 +00:00
if_ath_misc.h Migrate ath(4) to now use if_transmit instead of the legacy if_start 2013-05-26 22:23:39 +00:00
if_ath_pci.c Create a new TX lock specifically for queuing frames. 2013-02-07 07:50:16 +00:00
if_ath_rx_edma.c Use a per-RX-queue deferred list, rather than a single deferred list for 2013-04-16 20:21:02 +00:00
if_ath_rx_edma.h Begin abstracting out the RX path in preparation for RX EDMA support. 2012-07-03 06:59:12 +00:00
if_ath_rx.c Implement a bit of a hack to store the AR9285/AR9485 RX LNA configuration in 2013-06-05 00:45:19 +00:00
if_ath_rx.h Fix the busdma logic to work with EDMA chipsets when using bounce 2013-04-04 08:21:56 +00:00
if_ath_spectral.c Fix format size. 2013-01-08 22:42:15 +00:00
if_ath_spectral.h Add a new (skeleton) spectral mode manager module. 2013-01-02 03:59:02 +00:00
if_ath_sysctl.c Implement a separate hardware queue threshold for aggregate and non-aggr 2013-05-21 18:13:57 +00:00
if_ath_sysctl.h Break out most of the HAL related tweaks into a per-HAL instance, 2011-06-23 02:38:36 +00:00
if_ath_tdma.c Enable the use of TDMA on an 802.11n channel (with aggregation disabled, 2013-05-21 18:02:54 +00:00
if_ath_tdma.h Migrate the TDMA management functions out of if_ath.c into if_ath_tdma.c. 2012-05-20 02:49:42 +00:00
if_ath_tsf.h Migrate the bulk of the RX routines out from if_ath.c to if_ath_rx.[ch]. 2012-05-20 02:05:10 +00:00
if_ath_tx_edma.c Make sure the holding descriptor and link pointer are both freed during 2013-05-10 10:06:45 +00:00
if_ath_tx_edma.h Begin separating out the TX DMA setup in preparation for TX EDMA support. 2012-07-23 03:52:18 +00:00
if_ath_tx_ht.c Implement my first cut at "correct" node power-save and 2013-05-15 18:33:05 +00:00
if_ath_tx_ht.h Implement my first cut at "correct" node power-save and 2013-05-15 18:33:05 +00:00
if_ath_tx.c Shuffle around the cleanup unpause calls a bit. 2013-05-29 01:40:13 +00:00
if_ath_tx.h Implement a separate hardware queue threshold for aggregate and non-aggr 2013-05-21 18:13:57 +00:00
if_ath.c Bring over the initial static bluetooth coexistence configuration 2013-06-07 09:02:02 +00:00
if_athdfs.h Add a method to explicitly disable radar reporting if required. 2013-01-02 01:36:10 +00:00
if_athioctl.h Implement my first cut at "correct" node power-save and 2013-05-15 18:33:05 +00:00
if_athrate.h Update the rate series setup code to use the decisions already made in 2013-04-17 07:21:30 +00:00
if_athvar.h Add accessor macros for the bluetooth coexistence routines. 2013-06-07 05:18:07 +00:00