aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vasanth@atheros.com>2009-09-09 05:55:50 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-09-09 11:25:26 -0400
commitfe12946e66575677879941a14f75b70ca2d2962a (patch)
tree19934be9ee0097aaad6950ea3e588092cc2a94b4 /drivers/net/wireless
parentaeac355d23fb13a2082a8740ae7cf9408a71ec2c (diff)
ath9k: Enable btcoex based on the subsystem id of the device
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath/ath9k/btcoex.c23
-rw-r--r--drivers/net/wireless/ath/ath9k/btcoex.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c3
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h4
4 files changed, 30 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath9k/btcoex.c b/drivers/net/wireless/ath/ath9k/btcoex.c
index e8bfb01ee78..55f607b7699 100644
--- a/drivers/net/wireless/ath/ath9k/btcoex.c
+++ b/drivers/net/wireless/ath/ath9k/btcoex.c
@@ -19,6 +19,29 @@
19static const struct ath_btcoex_config ath_bt_config = { 0, true, true, 19static const struct ath_btcoex_config ath_bt_config = { 0, true, true,
20 ATH_BT_COEX_MODE_SLOTTED, true, true, 2, 5, true }; 20 ATH_BT_COEX_MODE_SLOTTED, true, true, 2, 5, true };
21 21
22static const u16 ath_subsysid_tbl[] = {
23 AR9280_COEX2WIRE_SUBSYSID,
24 AT9285_COEX3WIRE_SA_SUBSYSID,
25 AT9285_COEX3WIRE_DA_SUBSYSID
26};
27
28/*
29 * Checks the subsystem id of the device to see if it
30 * supports btcoex
31 */
32bool ath_btcoex_supported(u16 subsysid)
33{
34 int i;
35
36 if (!subsysid)
37 return false;
38
39 for (i = 0; i < ARRAY_SIZE(ath_subsysid_tbl); i++)
40 if (subsysid == ath_subsysid_tbl[i])
41 return true;
42
43 return false;
44}
22 45
23/* 46/*
24 * Detects if there is any priority bt traffic 47 * Detects if there is any priority bt traffic
diff --git a/drivers/net/wireless/ath/ath9k/btcoex.h b/drivers/net/wireless/ath/ath9k/btcoex.h
index 45568196c59..f1baf66e2ec 100644
--- a/drivers/net/wireless/ath/ath9k/btcoex.h
+++ b/drivers/net/wireless/ath/ath9k/btcoex.h
@@ -79,6 +79,7 @@ struct ath_btcoex_info {
79 struct ath_gen_timer *no_stomp_timer; /*Timer for no BT stomping*/ 79 struct ath_gen_timer *no_stomp_timer; /*Timer for no BT stomping*/
80}; 80};
81 81
82bool ath_btcoex_supported(u16 subsysid);
82int ath9k_hw_btcoex_init(struct ath_hw *ah); 83int ath9k_hw_btcoex_init(struct ath_hw *ah);
83void ath9k_hw_btcoex_enable(struct ath_hw *ah); 84void ath9k_hw_btcoex_enable(struct ath_hw *ah);
84void ath9k_hw_btcoex_disable(struct ath_hw *ah); 85void ath9k_hw_btcoex_disable(struct ath_hw *ah);
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 97a09dba76d..8d77817f67a 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -3690,7 +3690,8 @@ void ath9k_hw_fill_cap_info(struct ath_hw *ah)
3690 pCap->num_antcfg_2ghz = 3690 pCap->num_antcfg_2ghz =
3691 ah->eep_ops->get_num_ant_config(ah, ATH9K_HAL_FREQ_BAND_2GHZ); 3691 ah->eep_ops->get_num_ant_config(ah, ATH9K_HAL_FREQ_BAND_2GHZ);
3692 3692
3693 if (AR_SREV_9280_10_OR_LATER(ah) && btcoex_enable) { 3693 if (AR_SREV_9280_10_OR_LATER(ah) &&
3694 ath_btcoex_supported(ah->hw_version.subsysid)) {
3694 btcoex_info->btactive_gpio = ATH_BTACTIVE_GPIO; 3695 btcoex_info->btactive_gpio = ATH_BTACTIVE_GPIO;
3695 btcoex_info->wlanactive_gpio = ATH_WLANACTIVE_GPIO; 3696 btcoex_info->wlanactive_gpio = ATH_WLANACTIVE_GPIO;
3696 3697
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 64ea547adef..9106a0b537d 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -45,6 +45,10 @@
45#define AR5416_DEVID_AR9287_PCI 0x002D 45#define AR5416_DEVID_AR9287_PCI 0x002D
46#define AR5416_DEVID_AR9287_PCIE 0x002E 46#define AR5416_DEVID_AR9287_PCIE 0x002E
47 47
48#define AR9280_COEX2WIRE_SUBSYSID 0x309b
49#define AT9285_COEX3WIRE_SA_SUBSYSID 0x30aa
50#define AT9285_COEX3WIRE_DA_SUBSYSID 0x30ab
51
48/* Register read/write primitives */ 52/* Register read/write primitives */
49#define REG_WRITE(_ah, _reg, _val) ath9k_iowrite32((_ah), (_reg), (_val)) 53#define REG_WRITE(_ah, _reg, _val) ath9k_iowrite32((_ah), (_reg), (_val))
50#define REG_READ(_ah, _reg) ath9k_ioread32((_ah), (_reg)) 54#define REG_READ(_ah, _reg) ath9k_ioread32((_ah), (_reg))