ath10k: enable the BT-coex feature
authorYanbo Li <yanbol@qca.qualcomm.com>
Wed, 15 Apr 2015 12:28:08 +0000 (15:28 +0300)
committerKalle Valo <kvalo@qca.qualcomm.com>
Fri, 17 Apr 2015 06:45:28 +0000 (09:45 +0300)
The new 10.2.4 FW support the BT-coex feature with external BT module,
The external BT modules can communicate with it via the GPIO. This patch
check the BT-coex capability of the FW and enable it by default.

Signed-off-by: Yanbo Li <yanbol@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/wmi.c
drivers/net/wireless/ath/ath10k/wmi.h

index 20fd9f61fbadd63415df81a580077922d3d11203..ebaa096cf200c7968b4b5b5ae73944d8c58c1309 100644 (file)
@@ -3933,6 +3933,8 @@ static struct sk_buff *ath10k_wmi_10_2_op_gen_init(struct ath10k *ar)
        cmd = (struct wmi_init_cmd_10_2 *)buf->data;
 
        features = WMI_10_2_RX_BATCH_MODE;
+       if (test_bit(WMI_SERVICE_COEX_GPIO, ar->wmi.svc_map))
+               features |= WMI_10_2_COEX_GPIO;
        cmd->resource_config.feature_mask = __cpu_to_le32(features);
 
        memcpy(&cmd->resource_config.common, &config, sizeof(config));
index ea5dadb306315f779e1a179bb7ac61b88768f275..cad72ae76253362cf0e7f28ba9930a71814d35f4 100644 (file)
@@ -149,6 +149,7 @@ enum wmi_service {
        WMI_SERVICE_MDNS_OFFLOAD,
        WMI_SERVICE_SAP_AUTH_OFFLOAD,
        WMI_SERVICE_ATF,
+       WMI_SERVICE_COEX_GPIO,
 
        /* keep last */
        WMI_SERVICE_MAX,
@@ -179,6 +180,7 @@ enum wmi_10x_service {
        WMI_10X_SERVICE_FORCE_FW_HANG,
        WMI_10X_SERVICE_SMART_ANTENNA_HW_SUPPORT,
        WMI_10X_SERVICE_ATF,
+       WMI_10X_SERVICE_COEX_GPIO,
 };
 
 enum wmi_main_service {
@@ -296,6 +298,7 @@ static inline char *wmi_service_name(int service_id)
        SVCSTR(WMI_SERVICE_MDNS_OFFLOAD);
        SVCSTR(WMI_SERVICE_SAP_AUTH_OFFLOAD);
        SVCSTR(WMI_SERVICE_ATF);
+       SVCSTR(WMI_SERVICE_COEX_GPIO);
        default:
                return NULL;
        }
@@ -361,6 +364,8 @@ static inline void wmi_10x_svc_map(const __le32 *in, unsigned long *out,
               WMI_SERVICE_SMART_ANTENNA_HW_SUPPORT, len);
        SVCMAP(WMI_10X_SERVICE_ATF,
               WMI_SERVICE_ATF, len);
+       SVCMAP(WMI_10X_SERVICE_COEX_GPIO,
+              WMI_SERVICE_COEX_GPIO, len);
 }
 
 static inline void wmi_main_svc_map(const __le32 *in, unsigned long *out,
@@ -1960,6 +1965,7 @@ struct wmi_resource_config_10x {
 enum wmi_10_2_feature_mask {
        WMI_10_2_RX_BATCH_MODE = BIT(0),
        WMI_10_2_ATF_CONFIG    = BIT(1),
+       WMI_10_2_COEX_GPIO     = BIT(3),
 };
 
 struct wmi_resource_config_10_2 {