Skip to contentSkip to conversation

ath9k: Reintroduce modparam to enable btcoex

PATCH New Vasanthakumar Thiagarajan 1 participant 2 messages Nov 26, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ath9k: Reintroduce modparam to enable btcoex

It is not ideal to enable btcoex based on subsys id as it is not unique, they are so random. It is also a pain keeping all of them in a table to enable btcoex for a particular hw. Going back to the old idea.

---
 drivers/net/wireless/ath/ath.h        |    2 ++
 drivers/net/wireless/ath/ath9k/hw.c   |    3 +--
 drivers/net/wireless/ath/ath9k/init.c |    5 +++++
 3 files changed, 8 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath.h +2 -0
index 501050c..3743e3b 100644
@@ -162,6 +162,8 @@ struct ath_common {
 	struct ath_regulatory regulatory;
 	const struct ath_ops *ops;
 	const struct ath_bus_ops *bus_ops;
+
+	bool btcoex_enabled;
 };
 
 struct sk_buff *ath_rxbuf_alloc(struct ath_common *common,
drivers/net/wireless/ath/ath9k/hw.c +1 -2
index ce9e59f..883f6cc 100644
@@ -1925,8 +1925,7 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
 	pCap->num_antcfg_2ghz =
 		ah->eep_ops->get_num_ant_config(ah, ATH9K_HAL_FREQ_BAND_2GHZ);
 
-	if (AR_SREV_9280_20_OR_LATER(ah) &&
-	    ath9k_hw_btcoex_supported(ah)) {
+	if (AR_SREV_9280_20_OR_LATER(ah) && common->btcoex_enabled) {
 		btcoex_hw->btactive_gpio = ATH_BTACTIVE_GPIO;
 		btcoex_hw->wlanactive_gpio = ATH_WLANACTIVE_GPIO;
 
drivers/net/wireless/ath/ath9k/init.c +5 -0
index 7eef1fa..d11e6da 100644
@@ -38,6 +38,10 @@ int led_blink;
 module_param_named(blink, led_blink, int, 0444);
 MODULE_PARM_DESC(blink, "Enable LED blink on activity");
 
+static int ath9k_btcoex_enable;
+module_param_named(btcoex_enable, ath9k_btcoex_enable, int, 0444);
+MODULE_PARM_DESC(btcoex_enable, "Enable wifi-BT coexistence");
+
 /* We use the hw_value as an index into our private channel structure */
 
 #define CHAN2G(_freq, _idx)  { \
@@ -543,6 +547,7 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid,
 	common->hw = sc->hw;
 	common->priv = sc;
 	common->debug_mask = ath9k_debug;
+	common->btcoex_enabled = ath9k_btcoex_enable == 1;
 	spin_lock_init(&common->cc_lock);
 
 	spin_lock_init(&sc->wiphy_lock);
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH 2/2 ath9k: Remove code which enables btcoex based on subsys id

---
 drivers/net/wireless/ath/ath9k/btcoex.c |   23 -----------------------
 drivers/net/wireless/ath/ath9k/btcoex.h |    1 -
 2 files changed, 0 insertions(+), 24 deletions(-)
drivers/net/wireless/ath/ath9k/btcoex.c +0 -23
index 6a92e57..d33bf20 100644
@@ -35,29 +35,6 @@ struct ath_btcoex_config {
 	bool bt_hold_rx_clear;
 };
 
-static const u16 ath_subsysid_tbl[] = {
-	AR9280_COEX2WIRE_SUBSYSID,
-	AT9285_COEX3WIRE_SA_SUBSYSID,
-	AT9285_COEX3WIRE_DA_SUBSYSID
-};
-
-/*
- * Checks the subsystem id of the device to see if it
- * supports btcoex
- */
-bool ath9k_hw_btcoex_supported(struct ath_hw *ah)
-{
-	int i;
-
-	if (!ah->hw_version.subsysid)
-		return false;
-
-	for (i = 0; i < ARRAY_SIZE(ath_subsysid_tbl); i++)
-		if (ah->hw_version.subsysid == ath_subsysid_tbl[i])
-			return true;
-
-	return false;
-}
 
 void ath9k_hw_init_btcoex_hw(struct ath_hw *ah, int qnum)
 {
drivers/net/wireless/ath/ath9k/btcoex.h +0 -1
index 1ee5a15..588dfd4 100644
@@ -49,7 +49,6 @@ struct ath_btcoex_hw {
 	u32 bt_coex_mode2; 	/* Register setting for AR_BT_COEX_MODE2 */
 };
 
-bool ath9k_hw_btcoex_supported(struct ath_hw *ah);
 void ath9k_hw_btcoex_init_2wire(struct ath_hw *ah);
 void ath9k_hw_btcoex_init_3wire(struct ath_hw *ah);
 void ath9k_hw_init_btcoex_hw(struct ath_hw *ah, int qnum);
Signature · 1 line
1.7.0.4