diff options
author | Vivek Natarajan <vnatarajan@atheros.com> | 2010-08-18 10:27:49 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-08-24 16:32:05 -0400 |
commit | 21cb987914cb5334af78378141efed77505ea987 (patch) | |
tree | 73d725ef440e84a5880ddf648d66dfea811dae71 /drivers/net/wireless/ath/ath9k/htc_drv_init.c | |
parent | d99eeb87420a6da1f87064c7fa70bdf299699d90 (diff) |
ath9k_htc: Add support for bluetooth coexistence.
Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/htc_drv_init.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_init.c | 42 |
1 files changed, 37 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c index 2d4279191d7a..695e2b088d10 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c | |||
@@ -41,6 +41,8 @@ MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption"); | |||
41 | .max_power = 20, \ | 41 | .max_power = 20, \ |
42 | } | 42 | } |
43 | 43 | ||
44 | #define ATH_HTC_BTCOEX_PRODUCT_ID "wb193" | ||
45 | |||
44 | static struct ieee80211_channel ath9k_2ghz_channels[] = { | 46 | static struct ieee80211_channel ath9k_2ghz_channels[] = { |
45 | CHAN2G(2412, 0), /* Channel 1 */ | 47 | CHAN2G(2412, 0), /* Channel 1 */ |
46 | CHAN2G(2417, 1), /* Channel 2 */ | 48 | CHAN2G(2417, 1), /* Channel 2 */ |
@@ -605,7 +607,31 @@ static void ath9k_init_misc(struct ath9k_htc_priv *priv) | |||
605 | priv->ah->opmode = NL80211_IFTYPE_STATION; | 607 | priv->ah->opmode = NL80211_IFTYPE_STATION; |
606 | } | 608 | } |
607 | 609 | ||
608 | static int ath9k_init_priv(struct ath9k_htc_priv *priv, u16 devid) | 610 | static void ath9k_init_btcoex(struct ath9k_htc_priv *priv) |
611 | { | ||
612 | int qnum; | ||
613 | |||
614 | switch (priv->ah->btcoex_hw.scheme) { | ||
615 | case ATH_BTCOEX_CFG_NONE: | ||
616 | break; | ||
617 | case ATH_BTCOEX_CFG_3WIRE: | ||
618 | priv->ah->btcoex_hw.btactive_gpio = 7; | ||
619 | priv->ah->btcoex_hw.btpriority_gpio = 6; | ||
620 | priv->ah->btcoex_hw.wlanactive_gpio = 8; | ||
621 | priv->btcoex.bt_stomp_type = ATH_BTCOEX_STOMP_LOW; | ||
622 | ath9k_hw_btcoex_init_3wire(priv->ah); | ||
623 | ath_htc_init_btcoex_work(priv); | ||
624 | qnum = priv->hwq_map[WME_AC_BE]; | ||
625 | ath9k_hw_init_btcoex_hw(priv->ah, qnum); | ||
626 | break; | ||
627 | default: | ||
628 | WARN_ON(1); | ||
629 | break; | ||
630 | } | ||
631 | } | ||
632 | |||
633 | static int ath9k_init_priv(struct ath9k_htc_priv *priv, | ||
634 | u16 devid, char *product) | ||
609 | { | 635 | { |
610 | struct ath_hw *ah = NULL; | 636 | struct ath_hw *ah = NULL; |
611 | struct ath_common *common; | 637 | struct ath_common *common; |
@@ -672,6 +698,11 @@ static int ath9k_init_priv(struct ath9k_htc_priv *priv, u16 devid) | |||
672 | ath9k_init_channels_rates(priv); | 698 | ath9k_init_channels_rates(priv); |
673 | ath9k_init_misc(priv); | 699 | ath9k_init_misc(priv); |
674 | 700 | ||
701 | if (product && strncmp(product, ATH_HTC_BTCOEX_PRODUCT_ID, 5) == 0) { | ||
702 | ah->btcoex_hw.scheme = ATH_BTCOEX_CFG_3WIRE; | ||
703 | ath9k_init_btcoex(priv); | ||
704 | } | ||
705 | |||
675 | return 0; | 706 | return 0; |
676 | 707 | ||
677 | err_queues: | 708 | err_queues: |
@@ -734,7 +765,8 @@ static void ath9k_set_hw_capab(struct ath9k_htc_priv *priv, | |||
734 | SET_IEEE80211_PERM_ADDR(hw, common->macaddr); | 765 | SET_IEEE80211_PERM_ADDR(hw, common->macaddr); |
735 | } | 766 | } |
736 | 767 | ||
737 | static int ath9k_init_device(struct ath9k_htc_priv *priv, u16 devid) | 768 | static int ath9k_init_device(struct ath9k_htc_priv *priv, |
769 | u16 devid, char *product) | ||
738 | { | 770 | { |
739 | struct ieee80211_hw *hw = priv->hw; | 771 | struct ieee80211_hw *hw = priv->hw; |
740 | struct ath_common *common; | 772 | struct ath_common *common; |
@@ -743,7 +775,7 @@ static int ath9k_init_device(struct ath9k_htc_priv *priv, u16 devid) | |||
743 | struct ath_regulatory *reg; | 775 | struct ath_regulatory *reg; |
744 | 776 | ||
745 | /* Bring up device */ | 777 | /* Bring up device */ |
746 | error = ath9k_init_priv(priv, devid); | 778 | error = ath9k_init_priv(priv, devid, product); |
747 | if (error != 0) | 779 | if (error != 0) |
748 | goto err_init; | 780 | goto err_init; |
749 | 781 | ||
@@ -801,7 +833,7 @@ err_init: | |||
801 | } | 833 | } |
802 | 834 | ||
803 | int ath9k_htc_probe_device(struct htc_target *htc_handle, struct device *dev, | 835 | int ath9k_htc_probe_device(struct htc_target *htc_handle, struct device *dev, |
804 | u16 devid) | 836 | u16 devid, char *product) |
805 | { | 837 | { |
806 | struct ieee80211_hw *hw; | 838 | struct ieee80211_hw *hw; |
807 | struct ath9k_htc_priv *priv; | 839 | struct ath9k_htc_priv *priv; |
@@ -835,7 +867,7 @@ int ath9k_htc_probe_device(struct htc_target *htc_handle, struct device *dev, | |||
835 | /* The device may have been unplugged earlier. */ | 867 | /* The device may have been unplugged earlier. */ |
836 | priv->op_flags &= ~OP_UNPLUGGED; | 868 | priv->op_flags &= ~OP_UNPLUGGED; |
837 | 869 | ||
838 | ret = ath9k_init_device(priv, devid); | 870 | ret = ath9k_init_device(priv, devid, product); |
839 | if (ret) | 871 | if (ret) |
840 | goto err_init; | 872 | goto err_init; |
841 | 873 | ||