ath9k bluetooth coexistence

ath9k supports Bluetooth coexistence under the 2-wire and 3-wire scheme. This section documents how this is supported and under what chipsets.

Contents

  1. ath9k bluetooth coexistence
  2. GPIO pin setup and configuration
  3. Bluetooth coexistence code
  4. 2-wire Bluetooth coexistence
  5. 3-wire Bluetooth coexistence
  6. Enabling bluetooth coexistence

GPIO pin setup and configuration

Bluetooth coexistence on ath9k requires configuring the GPIO pins accordingly and setting up the coexistence scheme. The driver does this automatically upon module load as follows:

        if (AR_SREV_9280_10_OR_LATER(ah) &&
            ath9k_hw_btcoex_supported(ah)) {
                btcoex_hw->btactive_gpio = ATH_BTACTIVE_GPIO;
                btcoex_hw->wlanactive_gpio = ATH_WLANACTIVE_GPIO;

                if (AR_SREV_9285(ah)) {
                        btcoex_hw->scheme = ATH_BTCOEX_CFG_3WIRE;
                        btcoex_hw->btpriority_gpio = ATH_BTPRIORITY_GPIO;
                } else {
                        btcoex_hw->scheme = ATH_BTCOEX_CFG_2WIRE;
                }
        } else {
                btcoex_hw->scheme = ATH_BTCOEX_CFG_NONE;
        }

The ath9k_hw_btcoex_supported() check above enables BT coex only for specific subsystem IDs which we know have the GPIO pins connected for 2-wire or 3-wire coexistence. The details are listed below.

Chipset

BT-coex-scheme

Subsystem device ID

AR9280

2-wire

0x309b

AR9285

3-wire

0x30aa

AR9285

3-wire

0x30ab

Prior to enabling Bluetooth coexistence ASPM is disabled for PCI devices via ath_pci_bt_coex_prep(), a bus specific call. IfUSB or other bus requires bus specific changes prior to enabling bt-coexyou can add the respective callback for the bus (USB or AHB, for example).

Bluetooth coexistence code

The code for Bluetooth coexistence is in the file btcoex.c

2-wire Bluetooth coexistence

This is supported and enabled on all devices >= AR9280 except AR9285. This is initialized via ath9k_hw_btcoex_init_2wire().

3-wire Bluetooth coexistence

This is supported and enabled on all AR9285 devices. This is initialized via ath9k_hw_btcoex_init_3wire().

Enabling bluetooth coexistence

Bluetooth coexistence is automatically detected and enabled as of 2.6.32 so youdo not have to do anything for it. For kernels older than 2.6.32 you can can enable bluetooth coexistence on ath9k by using thebtcoex_enable module parameter, but you should not enable it unless you know you have one of the devices listed above.

modprobe ath9k btcoex_enable=1

你可能感兴趣的:(WIFI,bt,callback,file,module,up)