diff options
author | Vasanthakumar Thiagarajan <vasanth@atheros.com> | 2009-08-26 11:38:47 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-28 14:40:50 -0400 |
commit | 22f25d0d5e146112d4ec464564ebb49a5b8a547b (patch) | |
tree | 31145930a77a642673dcebdf1b0c3f09485fed4c /drivers/net | |
parent | f14462c6661c6b9e91d436f7ab66b35ed52ea703 (diff) |
ath9k: Determine btcoex scheme type based on chip version
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/btcoex.h | 7 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/main.c | 4 |
3 files changed, 20 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/ath9k/btcoex.h b/drivers/net/wireless/ath/ath9k/btcoex.h index c80492bac768..cdfa80d0eb4d 100644 --- a/drivers/net/wireless/ath/ath9k/btcoex.h +++ b/drivers/net/wireless/ath/ath9k/btcoex.h | |||
@@ -20,7 +20,14 @@ | |||
20 | #define ATH_WLANACTIVE_GPIO 5 | 20 | #define ATH_WLANACTIVE_GPIO 5 |
21 | #define ATH_BTACTIVE_GPIO 6 | 21 | #define ATH_BTACTIVE_GPIO 6 |
22 | 22 | ||
23 | enum ath_btcoex_scheme { | ||
24 | ATH_BTCOEX_CFG_NONE, | ||
25 | ATH_BTCOEX_CFG_2WIRE, | ||
26 | ATH_BTCOEX_CFG_3WIRE, | ||
27 | }; | ||
28 | |||
23 | struct ath_btcoex_info { | 29 | struct ath_btcoex_info { |
30 | enum ath_btcoex_scheme btcoex_scheme; | ||
24 | u8 wlanactive_gpio; | 31 | u8 wlanactive_gpio; |
25 | u8 btactive_gpio; | 32 | u8 btactive_gpio; |
26 | }; | 33 | }; |
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 3bb6abd7b2b6..7b4bc8b74bb8 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -3489,6 +3489,7 @@ void ath9k_hw_fill_cap_info(struct ath_hw *ah) | |||
3489 | { | 3489 | { |
3490 | struct ath9k_hw_capabilities *pCap = &ah->caps; | 3490 | struct ath9k_hw_capabilities *pCap = &ah->caps; |
3491 | struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah); | 3491 | struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah); |
3492 | struct ath_btcoex_info *btcoex_info = &ah->ah_sc->btcoex_info; | ||
3492 | 3493 | ||
3493 | u16 capField = 0, eeval; | 3494 | u16 capField = 0, eeval; |
3494 | 3495 | ||
@@ -3666,8 +3667,15 @@ void ath9k_hw_fill_cap_info(struct ath_hw *ah) | |||
3666 | 3667 | ||
3667 | if (AR_SREV_9280_10_OR_LATER(ah) && btcoex_enable) { | 3668 | if (AR_SREV_9280_10_OR_LATER(ah) && btcoex_enable) { |
3668 | pCap->hw_caps |= ATH9K_HW_CAP_BT_COEX; | 3669 | pCap->hw_caps |= ATH9K_HW_CAP_BT_COEX; |
3669 | ah->ah_sc->btcoex_info.btactive_gpio = ATH_BTACTIVE_GPIO; | 3670 | btcoex_info->btactive_gpio = ATH_BTACTIVE_GPIO; |
3670 | ah->ah_sc->btcoex_info.wlanactive_gpio = ATH_WLANACTIVE_GPIO; | 3671 | btcoex_info->wlanactive_gpio = ATH_WLANACTIVE_GPIO; |
3672 | |||
3673 | if (AR_SREV_9285(ah)) | ||
3674 | btcoex_info->btcoex_scheme = ATH_BTCOEX_CFG_3WIRE; | ||
3675 | else | ||
3676 | btcoex_info->btcoex_scheme = ATH_BTCOEX_CFG_2WIRE; | ||
3677 | } else { | ||
3678 | btcoex_info->btcoex_scheme = ATH_BTCOEX_CFG_NONE; | ||
3671 | } | 3679 | } |
3672 | } | 3680 | } |
3673 | 3681 | ||
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 878d3be7c717..8a2f000274b5 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -1509,7 +1509,8 @@ static int ath_init_softc(u16 devid, struct ath_softc *sc) | |||
1509 | ARRAY_SIZE(ath9k_5ghz_chantable); | 1509 | ARRAY_SIZE(ath9k_5ghz_chantable); |
1510 | } | 1510 | } |
1511 | 1511 | ||
1512 | if (ah->caps.hw_caps & ATH9K_HW_CAP_BT_COEX) | 1512 | if ((ah->caps.hw_caps & ATH9K_HW_CAP_BT_COEX) && |
1513 | (sc->btcoex_info.btcoex_scheme == ATH_BTCOEX_CFG_2WIRE)) | ||
1513 | ath9k_hw_btcoex_init(ah); | 1514 | ath9k_hw_btcoex_init(ah); |
1514 | 1515 | ||
1515 | return 0; | 1516 | return 0; |
@@ -1993,6 +1994,7 @@ static int ath9k_start(struct ieee80211_hw *hw) | |||
1993 | ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, 0); | 1994 | ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, 0); |
1994 | 1995 | ||
1995 | if ((sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_BT_COEX) && | 1996 | if ((sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_BT_COEX) && |
1997 | (sc->btcoex_info.btcoex_scheme == ATH_BTCOEX_CFG_2WIRE) && | ||
1996 | !(sc->sc_flags & SC_OP_BTCOEX_ENABLED)) | 1998 | !(sc->sc_flags & SC_OP_BTCOEX_ENABLED)) |
1997 | ath9k_hw_btcoex_enable(sc->sc_ah); | 1999 | ath9k_hw_btcoex_enable(sc->sc_ah); |
1998 | 2000 | ||