diff options
| author | Suresh Kumar Gautam <sgkuma@codeaurora.org> | 2017-07-10 12:03:17 +0530 |
|---|---|---|
| committer | snandini <snandini@codeaurora.org> | 2017-07-13 19:14:39 -0700 |
| commit | 6a2ead1f74be7b4568000a99ab090ea175d00e08 (patch) | |
| tree | de6f007d468ee629d99a34703398b5df9e2f19a4 | |
| parent | f46e698079bde30f083f4c51df7844aa9c6d8176 (diff) | |
qcacld-2.0: Define ini items gCoexPtaConfigEnable and gCoexPtaConfigParam
Define new ini items gCoexPtaConfigEnable to set PTA pins to enable the
coexistence,and gCoexPtaConfigParam to configure the coexistence param
between QCA wifi and External BT.
Change-Id: Id869e36667df5e43bfd07237bd539d50469e3b3f
CRs-Fixed: 2073728
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_cfg.h | 49 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg.c | 24 | ||||
| -rw-r--r-- | CORE/SERVICES/COMMON/wmi_unified.h | 4 | ||||
| -rw-r--r-- | CORE/SME/inc/sme_Api.h | 4 | ||||
| -rw-r--r-- | CORE/SME/src/sme_common/sme_Api.c | 40 |
5 files changed, 121 insertions, 0 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_cfg.h b/CORE/HDD/inc/wlan_hdd_cfg.h index 8bc04f9c8f7f..54b65c8f308e 100644 --- a/CORE/HDD/inc/wlan_hdd_cfg.h +++ b/CORE/HDD/inc/wlan_hdd_cfg.h @@ -4612,6 +4612,51 @@ FG_BTC_BT_INTERVAL_PAGE_P2P_STA_DEFAULT #define CFG_REDUCED_BEACON_INTERVAL_MAX (100) #define CFG_REDUCED_BEACON_INTERVAL_DEFAULT (0) +#ifdef FEATURE_COEX_PTA_CONFIG_ENABLE +/* + * <ini> + * gCoexPtaConfigEnable - enable pta coex + * @Min: 0 + * @Max: 1 + * @Default: 0 + * + * This ini is used to enable the coexistence between QCA wifi and External BT. + * when val is 1, or the feature is disabled. + * + * Related: none + * + * Usage: External + * + * </ini> + */ + +#define CFG_COEX_PTA_CONFIG_ENABLE "gCoexPtaConfigEnable" +#define CFG_COEX_PTA_CONFIG_ENABLE_MIN (0) +#define CFG_COEX_PTA_CONFIG_ENABLE_MAX (1) +#define CFG_COEX_PTA_CONFIG_ENABLE_DEFAULT (0) + +/* + * <ini> + * gCoexPtaConfigEnable - configure pta coex param + * @Min: 0x00000000 + * @Max: 0xFFFFFFFF + * @Default: 0x00000000 + * + * This ini is used to configure the coexistence param between QCA wifi and External BT. + * + * Related: none + * + * Usage: External + * + * </ini> + */ + +#define CFG_COEX_PTA_CONFIG_PARAM "gCoexPtaConfigParam" +#define CFG_COEX_PTA_CONFIG_PARAM_MIN (0x00000000) +#define CFG_COEX_PTA_CONFIG_PARAM_MAX (0xFFFFFFFF) +#define CFG_COEX_PTA_CONFIG_PARAM_DEFAULT (0x00000000) +#endif + /* * <ini> * arp_ac_category - ARP access category @@ -5382,6 +5427,10 @@ struct hdd_config { uint32_t coex_inquiry_p2p_sta_bt_interval; uint32_t coex_inquiry_p2p_sta_wlan_interval; uint32_t coex_tx_power; +#ifdef FEATURE_COEX_PTA_CONFIG_ENABLE + uint8_t coex_pta_config_enable; + uint32_t coex_pta_config_param; +#endif uint8_t inform_bss_rssi_raw; #ifdef WLAN_FEATURE_TSF diff --git a/CORE/HDD/src/wlan_hdd_cfg.c b/CORE/HDD/src/wlan_hdd_cfg.c index b91d940e279e..d0cc32752884 100644 --- a/CORE/HDD/src/wlan_hdd_cfg.c +++ b/CORE/HDD/src/wlan_hdd_cfg.c @@ -5024,6 +5024,22 @@ REG_TABLE_ENTRY g_registry_table[] = CFG_REDUCED_BEACON_INTERVAL_MIN, CFG_REDUCED_BEACON_INTERVAL_MAX), +#ifdef FEATURE_COEX_PTA_CONFIG_ENABLE + REG_VARIABLE(CFG_COEX_PTA_CONFIG_ENABLE, WLAN_PARAM_Integer, + hdd_config_t, coex_pta_config_enable, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_COEX_PTA_CONFIG_ENABLE_DEFAULT, + CFG_COEX_PTA_CONFIG_ENABLE_MIN, + CFG_COEX_PTA_CONFIG_ENABLE_MAX), + + REG_VARIABLE(CFG_COEX_PTA_CONFIG_PARAM, WLAN_PARAM_Integer, + hdd_config_t, coex_pta_config_param, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_COEX_PTA_CONFIG_PARAM_DEFAULT, + CFG_COEX_PTA_CONFIG_PARAM_MIN, + CFG_COEX_PTA_CONFIG_PARAM_MAX), +#endif + REG_VARIABLE(CFG_ARP_AC_CATEGORY, WLAN_PARAM_Integer, hdd_config_t, arp_ac_category, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -8604,6 +8620,14 @@ void hdd_set_btc_bt_wlan_interval(hdd_context_t *hdd_ctx) if (VOS_STATUS_SUCCESS != status) hddLog(LOGE, "Fail to set coex tx power"); + +#ifdef FEATURE_COEX_PTA_CONFIG_ENABLE + status = sme_configure_pta_coex(config->coex_pta_config_enable,config->coex_pta_config_param); + + if (VOS_STATUS_SUCCESS != status) + hddLog(LOGE, "Fail to set pta coex"); +#endif + } /** diff --git a/CORE/SERVICES/COMMON/wmi_unified.h b/CORE/SERVICES/COMMON/wmi_unified.h index 06dd9c2650bd..8e5e2c908e8a 100644 --- a/CORE/SERVICES/COMMON/wmi_unified.h +++ b/CORE/SERVICES/COMMON/wmi_unified.h @@ -17974,6 +17974,10 @@ typedef enum wmi_coex_config_type { arg5 PTA algorithm (WMI_COEX_ALGO_TYPE), arg6 PTA priority */ WMI_COEX_CONFIG_BTC_DUTYCYCLE = 18, /* config interval (ms units) (arg1 WLAN pause duration, arg2 WLAN unpause duration) for WLAN UL + BT Rx */ +#ifdef FEATURE_COEX_PTA_CONFIG_ENABLE + /* config BT info to FW when coexistence enable */ + WMI_COEX_CONFIG_PTA_BT_INFO = 20, +#endif } WMI_COEX_CONFIG_TYPE; typedef struct { diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h index a387ba67da42..d7da4dfd6941 100644 --- a/CORE/SME/inc/sme_Api.h +++ b/CORE/SME/inc/sme_Api.h @@ -4576,6 +4576,10 @@ VOS_STATUS sme_set_btc_bt_wlan_interval_inquiry_p2p_sta(uint32_t bt_interval, VOS_STATUS sme_set_btc_wlan_coex_tx_power(uint32_t coex_tx_power); +#ifdef FEATURE_COEX_PTA_CONFIG_ENABLE +VOS_STATUS sme_configure_pta_coex(uint8_t coex_pta_config_enable, uint32_t coex_pta_config_param); +#endif + uint8_t sme_is_any_session_in_connected_state(tHalHandle h_hal); typedef void ( *tSmeSetThermalLevelCallback)(void *pContext, u_int8_t level); diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c index 8554086471f6..4bd32fc71fa4 100644 --- a/CORE/SME/src/sme_common/sme_Api.c +++ b/CORE/SME/src/sme_common/sme_Api.c @@ -19075,6 +19075,46 @@ eHalStatus sme_delete_all_tdls_peers(tHalHandle hal, uint8_t session_id) return status; } +#ifdef FEATURE_COEX_PTA_CONFIG_ENABLE +/** + * sme_configure_pta_coex() - Set coex PTA params + * @pta_enable: PTA enable or not + * @pta_param: PTA params + * + * Return: Return VOS_STATUS. + */ +VOS_STATUS sme_configure_pta_coex(uint8_t coex_pta_config_enable, uint32_t coex_pta_config_param) +{ + vos_msg_t msg = {0}; + VOS_STATUS vos_status; + WMI_COEX_CONFIG_CMD_fixed_param *sme_pta_config; + + sme_pta_config = vos_mem_malloc(sizeof(*sme_pta_config)); + if (!sme_pta_config) { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + FL("Malloc failed")); + return VOS_STATUS_E_NOMEM; + } + + sme_pta_config->config_type = WMI_COEX_CONFIG_PTA_CONFIG; + sme_pta_config->config_arg1 = coex_pta_config_enable; + sme_pta_config->config_arg2 = coex_pta_config_param; + + msg.type = WDA_BTC_BT_WLAN_INTERVAL_CMD; + msg.reserved = 0; + msg.bodyptr = sme_pta_config; + + vos_status = vos_mq_post_message(VOS_MODULE_ID_WDA,&msg); + if (!VOS_IS_STATUS_SUCCESS(vos_status)) { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + FL("Not able to post message to WDA")); + vos_mem_free(sme_pta_config); + return VOS_STATUS_E_FAILURE; + } + + return vos_status; +} +#endif /** * sme_set_beacon_filter() - set the beacon filter configuration |
