summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAgrawal Ashish <ashishka@codeaurora.org>2016-05-05 12:23:58 +0530
committerqcabuildsw <qcabuildsw@localhost>2016-10-06 04:08:49 -0700
commitb2d1a45a783034beddc500b30ee0f23e507b3bad (patch)
treea290ab25ed886e300aa49ff8e11a506ffb3341a6
parent05910db713702df80ea5116260e833ea824af16c (diff)
qcacld-3.0: Add support for legacy off channel notification in case of p2p-GO
qcacld-2.0 to qcacld-3.0 propagation In this feature, 1) When a legacy client connects to P2P GO, Host will indicate FW to stop NOA and start CTS2SELF. 2) Ini Support for this feature. Change-Id: If76d8ef454633d9a02dd6057b5d6ca3e9e639ea4 CRs-Fixed: 932264
-rw-r--r--core/hdd/inc/wlan_hdd_cfg.h11
-rw-r--r--core/hdd/src/wlan_hdd_cfg.c11
-rw-r--r--core/hdd/src/wlan_hdd_main.c2
-rw-r--r--core/mac/src/include/sir_params.h2
-rw-r--r--core/sme/inc/sme_api.h7
-rw-r--r--core/sme/src/common/sme_api.c25
-rw-r--r--core/wma/inc/wma_api.h13
-rw-r--r--core/wma/inc/wma_types.h1
-rw-r--r--core/wma/src/wma_main.c2
-rw-r--r--core/wma/src/wma_mgmt.c28
10 files changed, 102 insertions, 0 deletions
diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h
index 9cfeeb3cf36a..c0b065f4b761 100644
--- a/core/hdd/inc/wlan_hdd_cfg.h
+++ b/core/hdd/inc/wlan_hdd_cfg.h
@@ -2917,6 +2917,16 @@ enum dot11p_mode {
#define CFG_EXTSCAN_ACTIVE_MIN_CHANNEL_TIME_DEFAULT (20)
#endif
+/* When gEnable_go_cts2self_for_sta is
+ * enabled then if a legacy client connects to P2P GO,
+ * Host will send a WMI VDEV command to FW to stop using NOA for P2P GO
+ * and start using CTS2SELF.
+ */
+#define CFG_ENABLE_GO_CTS2SELF_FOR_STA "gEnable_go_cts2self_for_sta"
+#define CFG_ENABLE_GO_CTS2SELF_FOR_STA_DEFAULT (0)
+#define CFG_ENABLE_GO_CTS2SELF_FOR_STA_MIN (0)
+#define CFG_ENABLE_GO_CTS2SELF_FOR_STA_MAX (1)
+
#define CFG_CE_CLASSIFY_ENABLE_NAME "gCEClassifyEnable"
#define CFG_CE_CLASSIFY_ENABLE_MIN (0)
#define CFG_CE_CLASSIFY_ENABLE_MAX (1)
@@ -4152,6 +4162,7 @@ struct hdd_config {
/* parameter for indicating sifs burst duration to fw */
uint8_t sifs_burst_duration;
bool goptimize_chan_avoid_event;
+ bool enable_go_cts2self_for_sta;
};
#define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var))
diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c
index 4a21c6cbf385..d22a5f8bde3f 100644
--- a/core/hdd/src/wlan_hdd_cfg.c
+++ b/core/hdd/src/wlan_hdd_cfg.c
@@ -3734,6 +3734,14 @@ REG_TABLE_ENTRY g_registry_table[] = {
CFG_ENABLE_EDCA_INI_MIN,
CFG_ENABLE_EDCA_INI_MAX),
+ REG_VARIABLE(CFG_ENABLE_GO_CTS2SELF_FOR_STA, WLAN_PARAM_Integer,
+ struct hdd_config, enable_go_cts2self_for_sta,
+ VAR_FLAGS_OPTIONAL |
+ VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+ CFG_ENABLE_GO_CTS2SELF_FOR_STA_DEFAULT,
+ CFG_ENABLE_GO_CTS2SELF_FOR_STA_MIN,
+ CFG_ENABLE_GO_CTS2SELF_FOR_STA_MAX),
+
REG_VARIABLE(CFG_EDCA_VO_CWMIN_VALUE_NAME, WLAN_PARAM_Integer,
struct hdd_config, edca_vo_cwmin,
VAR_FLAGS_OPTIONAL |
@@ -5646,6 +5654,9 @@ void hdd_cfg_print(hdd_context_t *pHddCtx)
hdd_info("Name = [%s] Value = [%d]",
CFG_FILTER_MULTICAST_REPLAY_NAME,
pHddCtx->config->multicast_replay_filter);
+ hdd_info("Name = [%s] Value = [%u]",
+ CFG_ENABLE_GO_CTS2SELF_FOR_STA,
+ pHddCtx->config->enable_go_cts2self_for_sta);
}
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 82be6b96f3f3..47b3c6470000 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -7817,6 +7817,8 @@ int hdd_wlan_startup(struct device *dev)
hdd_release_rtnl_lock();
rtnl_held = false;
+ if (hdd_ctx->config->enable_go_cts2self_for_sta)
+ sme_set_cts2self_for_p2p_go(hdd_ctx->hHal);
#ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE
status = qdf_mc_timer_init(&hdd_ctx->skip_acs_scan_timer,
QDF_TIMER_TYPE_SW,
diff --git a/core/mac/src/include/sir_params.h b/core/mac/src/include/sir_params.h
index 2b71b5143209..b11343f2be9b 100644
--- a/core/mac/src/include/sir_params.h
+++ b/core/mac/src/include/sir_params.h
@@ -606,6 +606,7 @@ typedef struct sSirMbMsgP2p {
#define SIR_HAL_ADD_BCN_FILTER_CMDID (SIR_HAL_ITC_MSG_TYPES_BEGIN + 339)
#define SIR_HAL_REMOVE_BCN_FILTER_CMDID (SIR_HAL_ITC_MSG_TYPES_BEGIN + 340)
+
#define SIR_HAL_BPF_GET_CAPABILITIES_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 341)
#define SIR_HAL_BPF_SET_INSTRUCTIONS_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 342)
@@ -634,6 +635,7 @@ typedef struct sSirMbMsgP2p {
#define SIR_HAL_POWER_DBG_CMD (SIR_HAL_ITC_MSG_TYPES_BEGIN + 362)
#define SIR_HAL_SET_DTIM_PERIOD (SIR_HAL_ITC_MSG_TYPES_BEGIN + 363)
#define SIR_HAL_ENCRYPT_DECRYPT_MSG (SIR_HAL_ITC_MSG_TYPES_BEGIN + 364)
+#define SIR_HAL_SET_CTS2SELF_FOR_STA (SIR_HAL_ITC_MSG_TYPES_BEGIN + 368)
#define SIR_HAL_MSG_TYPES_END (SIR_HAL_MSG_TYPES_BEGIN + 0x1FF)
diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h
index 15f845510ef9..cfbbe22ec405 100644
--- a/core/sme/inc/sme_api.h
+++ b/core/sme/inc/sme_api.h
@@ -1316,4 +1316,11 @@ QDF_STATUS sme_encrypt_decrypt_msg_deregister_callback(tHalHandle h_hal);
QDF_STATUS sme_encrypt_decrypt_msg(tHalHandle hal,
struct encrypt_decrypt_req_params *encrypt_decrypt_params);
+/**
+ * sme_set_cts2self_for_p2p_go() - sme function to set ini parms to FW.
+ * @hal: reference to the HAL
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS sme_set_cts2self_for_p2p_go(tHalHandle hal);
#endif /* #if !defined( __SME_API_H ) */
diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c
index 57c167a44b1f..738ba4302f88 100644
--- a/core/sme/src/common/sme_api.c
+++ b/core/sme/src/common/sme_api.c
@@ -16715,3 +16715,28 @@ QDF_STATUS sme_encrypt_decrypt_msg_deregister_callback(tHalHandle h_hal)
}
return status;
}
+
+QDF_STATUS sme_set_cts2self_for_p2p_go(tHalHandle hal_handle)
+{
+ cds_msg_t message;
+ void *wma_handle;
+
+ wma_handle = cds_get_context(QDF_MODULE_ID_WMA);
+ if (!wma_handle) {
+ QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
+ "wma_handle is NULL");
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ message.bodyptr = NULL;
+ message.type = WMA_SET_CTS2SELF_FOR_STA;
+
+ if (QDF_STATUS_SUCCESS !=
+ wma_set_cts2self_for_p2p_go(wma_handle, true)) {
+ QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
+ "%s: Failed to set cts2self for p2p GO to firmware",
+ __func__);
+ return QDF_STATUS_E_FAILURE;
+ }
+ return QDF_STATUS_SUCCESS;
+}
diff --git a/core/wma/inc/wma_api.h b/core/wma/inc/wma_api.h
index dcd121e37fdb..ecbead7e438f 100644
--- a/core/wma/inc/wma_api.h
+++ b/core/wma/inc/wma_api.h
@@ -303,4 +303,17 @@ void wma_process_pdev_hw_mode_trans_ind(void *wma,
QDF_STATUS wma_set_powersave_config(uint8_t val);
QDF_STATUS wma_encrypt_decrypt_msg(WMA_HANDLE wma,
struct encrypt_decrypt_req_params *encrypt_decrypt_params);
+
+/**
+ * wma_set_cts2self_for_p2p_go() - set CTS2SELF command for P2P GO.
+ * @wma_handle: pointer to wma handle.
+ * @cts2self_for_p2p_go: value needs to set to firmware.
+ *
+ * At the time of driver startup, inform about ini parma to FW that
+ * if legacy client connects to P2P GO, stop using NOA for P2P GO.
+ *
+ * Return: QDF_STATUS.
+ */
+QDF_STATUS wma_set_cts2self_for_p2p_go(void *wma_handle,
+ uint32_t cts2self_for_p2p_go);
#endif
diff --git a/core/wma/inc/wma_types.h b/core/wma/inc/wma_types.h
index 89f06c9db0b5..143bc5b53d9a 100644
--- a/core/wma/inc/wma_types.h
+++ b/core/wma/inc/wma_types.h
@@ -467,6 +467,7 @@
#define WMA_ADD_BCN_FILTER_CMDID SIR_HAL_ADD_BCN_FILTER_CMDID
#define WMA_REMOVE_BCN_FILTER_CMDID SIR_HAL_REMOVE_BCN_FILTER_CMDID
#define WMA_SET_ADAPT_DWELLTIME_CONF_PARAMS SIR_HAL_SET_ADAPT_DWELLTIME_PARAMS
+#define WMA_SET_CTS2SELF_FOR_STA SIR_HAL_SET_CTS2SELF_FOR_STA
#define WDA_BPF_GET_CAPABILITIES_REQ SIR_HAL_BPF_GET_CAPABILITIES_REQ
#define WDA_BPF_SET_INSTRUCTIONS_REQ SIR_HAL_BPF_SET_INSTRUCTIONS_REQ
diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c
index 00f1735cc44e..296bbe3bda9d 100644
--- a/core/wma/src/wma_main.c
+++ b/core/wma/src/wma_main.c
@@ -6280,6 +6280,8 @@ QDF_STATUS wma_mc_process_msg(void *cds_context, cds_msg_t *msg)
case WDA_BPF_SET_INSTRUCTIONS_REQ:
wma_set_bpf_instructions(wma_handle, msg->bodyptr);
qdf_mem_free(msg->bodyptr);
+ case WMA_SET_CTS2SELF_FOR_STA:
+ wma_set_cts2self_for_p2p_go(wma_handle, true);
break;
case SIR_HAL_NDP_INITIATOR_REQ:
wma_handle_ndp_initiator_req(wma_handle, msg->bodyptr);
diff --git a/core/wma/src/wma_mgmt.c b/core/wma/src/wma_mgmt.c
index 5a4690eb576c..a3223b2f6814 100644
--- a/core/wma/src/wma_mgmt.c
+++ b/core/wma/src/wma_mgmt.c
@@ -965,6 +965,8 @@ QDF_STATUS wma_send_peer_assoc(tp_wma_handle wma,
cmd->peer_flags |= WMI_PEER_160MHZ;
cmd->peer_vht_caps = params->vht_caps;
+ if (params->p2pCapableSta)
+ cmd->peer_flags |= WMI_PEER_IS_P2P_CAPABLE;
if (params->rmfEnabled)
cmd->peer_flags |= WMI_PEER_PMF;
@@ -2655,6 +2657,32 @@ void wma_process_update_userpos(tp_wma_handle wma_handle,
}
+QDF_STATUS wma_set_cts2self_for_p2p_go(void *wma_handle,
+ uint32_t cts2self_for_p2p_go)
+{
+ int32_t ret;
+ tp_wma_handle wma = (tp_wma_handle)wma_handle;
+ struct pdev_params pdevparam;
+
+ pdevparam.param_id = WMI_PDEV_PARAM_CTS2SELF_FOR_P2P_GO_CONFIG;
+ pdevparam.param_value = cts2self_for_p2p_go;
+
+ ret = wmi_unified_pdev_param_send(wma->wmi_handle,
+ &pdevparam,
+ WMA_WILDCARD_PDEV_ID);
+ if (ret) {
+ WMA_LOGE("Fail to Set CTS2SELF for p2p GO %d",
+ cts2self_for_p2p_go);
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ WMA_LOGD("Successfully Set CTS2SELF for p2p GO %d",
+ cts2self_for_p2p_go);
+
+ return QDF_STATUS_SUCCESS;
+}
+
+
/**
* wma_set_htconfig() - set ht config parameters to target
* @vdev_id: vdev id