freebsd-dev/sys
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
..
amd64 Assert that interrupts are enabled in the trap handlers on x86 before 2013-06-03 17:40:05 +00:00
arm Fix the passing of time on Armada XP. 2013-06-04 09:33:03 +00:00
boot Convert old make variable modifiers :U and :L to bmake :tu and :tl. 2013-06-02 11:44:23 +00:00
bsm Implement chflagsat(2) system call, similar to fchmodat(2), but operates on 2013-03-21 22:59:01 +00:00
cam Simplify the checking of flags for cam_periph_mapmem(). This gets rid of 2013-06-07 00:22:38 +00:00
cddl MFV r251474: 2013-06-06 23:21:41 +00:00
compat Relax the vm object locking. Use a read lock. 2013-06-05 17:00:10 +00:00
conf Bring over the initial static bluetooth coexistence configuration 2013-06-07 09:02:02 +00:00
contrib Fix a false -> AH_FALSE. 2013-05-29 04:21:42 +00:00
crypto When porting XTS-related code from OpenBSD I forgot to update copyright (only 2013-02-20 22:59:53 +00:00
ddb
dev Bring over the initial static bluetooth coexistence configuration 2013-06-07 09:02:02 +00:00
fs Don't busy the page unless we are likely to release the object lock. 2013-06-06 06:17:20 +00:00
gdb
geom MFP4 @222836 2013-05-30 01:19:02 +00:00
gnu/fs/reiserfs Garbage collect XFS bits which are now already completely disconnected 2013-03-02 15:33:54 +00:00
i386 Assert that interrupts are enabled in the trap handlers on x86 before 2013-06-03 17:40:05 +00:00
ia64 Driver 'aacraid' added. Supports Adaptec by PMC RAID controller families Series 6, 7, 8 and upcoming products. Older Adaptec RAID controller families are supported by the 'aac' driver. 2013-05-24 09:22:43 +00:00
isa
kern Do not compare the existing mask of a cpuset with a new mask when changing 2013-06-06 14:43:19 +00:00
kgssapi Isilon reported that sec=krb5p NFS mounts had a problem when m_len == 0 2013-05-01 22:07:55 +00:00
libkern Attempt to mitigate poor initialization of arc4 by one-shot 2013-04-19 00:30:52 +00:00
mips Don't assign the copyright to the FreeBSD foundation for the years 2013-05-29 16:51:03 +00:00
modules Bring over the initial static bluetooth coexistence configuration 2013-06-07 09:02:02 +00:00
net Fix build with both INET and INET6 disabled. 2013-06-04 20:40:16 +00:00
net80211 Fix net80211 fragment creation. 2013-05-25 06:28:30 +00:00
netatalk Add const qualifier to the dst parameter of the ifnet if_output method. 2013-04-26 12:50:32 +00:00
netgraph Fix several typos 2013-05-12 16:43:26 +00:00
netinet Allow drivers to specify a maximum TSO length in bytes if they are 2013-06-03 12:55:13 +00:00
netinet6 Really fix netmask address family this time. 2013-05-19 19:42:46 +00:00
netipsec Use IP6STAT_INC/IP6STAT_DEC macros to update ip6 stats. 2013-04-09 07:11:22 +00:00
netipx
netnatm
netpfil Return meaningful error code from pf_state_key_attach() and 2013-05-11 18:06:51 +00:00
netsmb If the kernel is compiled with VMIMAGE support, the first attempt of 2013-05-04 16:55:48 +00:00
nfs Move the NFS FHA (File Handle Affinity) code from sys/nfsserver to 2013-04-17 22:42:43 +00:00
nfsclient - Convert the bufobj lock to rwlock. 2013-05-31 00:43:41 +00:00
nfsserver - Convert the bufobj lock to rwlock. 2013-05-31 00:43:41 +00:00
nlm
ofed Fxi a bunch of typos. 2013-05-10 16:41:26 +00:00
opencrypto When porting XTS-related code from OpenBSD I forgot to update copyright (only 2013-02-20 22:59:53 +00:00
pc98 MFi386: revision 251039 2013-06-01 12:21:59 +00:00
pci - Corrrect mispellings of word useful 2013-04-17 11:45:15 +00:00
powerpc Pad the PCPU MD struct, to satisfy an assert added with the projects/counters 2013-06-04 00:40:26 +00:00
rpc Fix a potential socket leak in the NFS server. If a client closes its 2013-04-08 19:03:01 +00:00
security Relax the vm object locking in mac_proc_vm_revoke_recurse(). A read lock 2013-06-04 17:23:09 +00:00
sparc64 o Relax locking assertions for vm_page_find_least() 2013-05-21 20:38:19 +00:00
sys Add ATOMIC_*_LOCK_FREE constants. 2013-06-03 20:52:20 +00:00
teken
tools Further refine the handling of stop signals in the NFS client. The 2013-02-21 19:02:50 +00:00
ufs - Convert the bufobj lock to rwlock. 2013-05-31 00:43:41 +00:00
vm Complete r251452: 2013-06-06 18:19:26 +00:00
x86 Add basic support for FDT to i386 & amd64. This change includes: 2013-05-21 03:05:49 +00:00
xdr Use m_get() and m_getcl() instead of compat macros. 2013-03-15 10:21:18 +00:00
xen Fix loss of the emulated keyboard on Xen PV HVM domains. 2013-05-22 19:22:44 +00:00
Makefile Remove netncp cscope entry missed in r248097 2013-03-12 14:21:52 +00:00