ath9k: Reintroduce modparam to enable btcoex
authorVasanthakumar Thiagarajan <vasanth@atheros.com>
Fri, 26 Nov 2010 14:10:06 +0000 (06:10 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 29 Nov 2010 20:24:36 +0000 (15:24 -0500)
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.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath.h
drivers/net/wireless/ath/ath9k/hw.c
drivers/net/wireless/ath/ath9k/init.c

index 20ea68c59f7b9dbdb6ac1503660ee197d1a39497..26bdbeee424f6d905ec744ee38715d2b3551c1ac 100644 (file)
@@ -168,6 +168,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,
index ce9e59f4cd3dbf9cae16e2086bc419a1a150da47..883f6cc7b82c7efa89b9fbf55b0394db86ba4889 100644 (file)
@@ -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;
 
index 7eef1faee668787fed775db0a1f751c24c44597f..d11e6da4d892c76d01a20c0e42c335771cc86205 100644 (file)
@@ -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);