summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAgrawal, Ashish <ashishka@codeaurora.org>2016-09-08 19:21:03 +0530
committerqcabuildsw <qcabuildsw@localhost>2016-11-01 03:02:50 -0700
commitbe8cfa7627012b2041e6af4cca27c690ed5e4d54 (patch)
treecb64de143cd8a577a21f7f9a0d37f729927c6ca7
parentde260616af6738620a59c5d6824cc36480a08c39 (diff)
qcacld-3.0: Pass tx_pkt_fail_cnt_threshold to FW
qcacld-2.0 to qcacld-3.0 propagation Add data structures to save tx_pkt_fail_cnt_threshold and changes to pass the same to FW. Change-Id: I46dc401c26c3eeeb41b345d0fe1b4406394971fb CRs-Fixed: 1020078
-rw-r--r--core/mac/inc/sir_api.h9
-rw-r--r--core/mac/src/include/sir_params.h1
-rw-r--r--core/sme/inc/sme_api.h2
-rw-r--r--core/sme/src/common/sme_api.c46
-rw-r--r--core/wma/src/wma_main.c44
5 files changed, 102 insertions, 0 deletions
diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h
index 3a8c353bde25..ca07329a20f8 100644
--- a/core/mac/inc/sir_api.h
+++ b/core/mac/inc/sir_api.h
@@ -6586,4 +6586,13 @@ struct sir_encrypt_decrypt_rsp_params {
uint8_t *data;
};
+/**
+ * struct sme_tx_fail_cnt_threshold - tx failure count for disconnect to fw
+ * @session_id: Session id
+ * @tx_fail_cnt_threshold: Tx failure count to do disconnect
+ */
+struct sme_tx_fail_cnt_threshold {
+ uint8_t session_id;
+ uint32_t tx_fail_cnt_threshold;
+};
#endif /* __SIR_API_H */
diff --git a/core/mac/src/include/sir_params.h b/core/mac/src/include/sir_params.h
index bff7c7b1bc6c..83838f5f5eb5 100644
--- a/core/mac/src/include/sir_params.h
+++ b/core/mac/src/include/sir_params.h
@@ -636,6 +636,7 @@ typedef struct sSirMbMsgP2p {
#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_UPDATE_TX_FAIL_CNT_TH (SIR_HAL_ITC_MSG_TYPES_BEGIN + 367)
#define SIR_HAL_MSG_TYPES_END (SIR_HAL_MSG_TYPES_BEGIN + 0x1FF)
/* CFG message types */
diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h
index 3990ebab984b..52a56ab335b3 100644
--- a/core/sme/inc/sme_api.h
+++ b/core/sme/inc/sme_api.h
@@ -1327,4 +1327,6 @@ QDF_STATUS sme_encrypt_decrypt_msg(tHalHandle hal,
QDF_STATUS sme_set_cts2self_for_p2p_go(tHalHandle hal);
void sme_set_prefer_80MHz_over_160MHz(tHalHandle hal,
bool sta_prefer_80MHz_over_160MHz);
+QDF_STATUS sme_update_tx_fail_cnt_threshold(tHalHandle hal_handle,
+ uint8_t session_id, uint32_t tx_fail_count);
#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 6ba4d8a89717..490a1453d00d 100644
--- a/core/sme/src/common/sme_api.c
+++ b/core/sme/src/common/sme_api.c
@@ -16805,3 +16805,49 @@ QDF_STATUS sme_set_cts2self_for_p2p_go(tHalHandle hal_handle)
}
return QDF_STATUS_SUCCESS;
}
+/**
+ * sme_update_tx_fail_cnt_threshold() - update tx fail count Threshold
+ * @hal: Handle returned by mac_open
+ * @session_id: Session ID on which tx fail count needs to be updated to FW
+ * @tx_fail_count: Count for tx fail threshold after which FW will disconnect
+ *
+ * This function is used to set tx fail count threshold to firmware.
+ * firmware will issue disocnnect with peer device once this threshold is
+ * reached.
+ *
+ * Return: Return QDF_STATUS, otherwise appropriate failure code
+ */
+QDF_STATUS sme_update_tx_fail_cnt_threshold(tHalHandle hal_handle,
+ uint8_t session_id, uint32_t tx_fail_count)
+{
+ tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal_handle);
+ QDF_STATUS status = QDF_STATUS_E_FAILURE;
+ struct sme_tx_fail_cnt_threshold *tx_fail_cnt;
+ cds_msg_t msg;
+
+ tx_fail_cnt = qdf_mem_malloc(sizeof(*tx_fail_cnt));
+ if (NULL == tx_fail_cnt) {
+ QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
+ "%s: fail to alloc filter_param", __func__);
+ return QDF_STATUS_E_FAILURE;
+ }
+ sms_log(mac_ctx, LOG1,
+ FL("session_id %d tx_fail_count: %d"),
+ session_id, tx_fail_count);
+ tx_fail_cnt->session_id = session_id;
+ tx_fail_cnt->tx_fail_cnt_threshold = tx_fail_count;
+
+ qdf_mem_zero(&msg, sizeof(cds_msg_t));
+ msg.type = SIR_HAL_UPDATE_TX_FAIL_CNT_TH;
+ msg.reserved = 0;
+ msg.bodyptr = tx_fail_cnt;
+ status = cds_mq_post_message(QDF_MODULE_ID_WMA, &msg);
+
+ if (!QDF_IS_STATUS_SUCCESS(status)) {
+ QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
+ FL("Not able to post Tx fail count message to WDA"));
+ qdf_mem_free(tx_fail_cnt);
+ }
+
+ return status;
+}
diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c
index 98eadc66cbb8..c83f1eace036 100644
--- a/core/wma/src/wma_main.c
+++ b/core/wma/src/wma_main.c
@@ -5914,6 +5914,46 @@ static QDF_STATUS wma_update_wep_default_key(tp_wma_handle wma,
return QDF_STATUS_SUCCESS;
}
+
+/**
+ * wma_update_tx_fail_cnt_th() - Set threshold for TX pkt fail
+ * @wma_handle: WMA handle
+ * @tx_fail_cnt_th: sme_tx_fail_cnt_threshold parameter
+ *
+ * This function is used to set Tx pkt fail count threshold,
+ * FW will do disconnect with station once this threshold is reached.
+ *
+ * Return: VOS_STATUS_SUCCESS on success, error number otherwise
+ */
+static QDF_STATUS wma_update_tx_fail_cnt_th(tp_wma_handle wma,
+ struct sme_tx_fail_cnt_threshold *tx_fail_cnt_th)
+{
+ u_int8_t vdev_id;
+ u_int32_t tx_fail_disconn_th;
+ int ret = -EIO;
+
+ if (!wma || !wma->wmi_handle) {
+ WMA_LOGE(FL("WMA is closed, can not issue Tx pkt fail count threshold"));
+ return QDF_STATUS_E_INVAL;
+ }
+ vdev_id = tx_fail_cnt_th->session_id;
+ tx_fail_disconn_th = tx_fail_cnt_th->tx_fail_cnt_threshold;
+ WMA_LOGD("Set TX pkt fail count threshold vdevId %d count %d",
+ vdev_id, tx_fail_disconn_th);
+
+
+ ret = wma_vdev_set_param(wma->wmi_handle, vdev_id,
+ WMI_VDEV_PARAM_DISCONNECT_TH,
+ tx_fail_disconn_th);
+
+ if (ret) {
+ WMA_LOGE(FL("Failed to send TX pkt fail count threshold command"));
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ return QDF_STATUS_SUCCESS;
+}
+
/**
* wma_mc_process_msg() - process wma messages and call appropriate function.
* @cds_context: cds context
@@ -6725,6 +6765,10 @@ QDF_STATUS wma_mc_process_msg(void *cds_context, cds_msg_t *msg)
wma_encrypt_decrypt_msg(wma_handle, msg->bodyptr);
qdf_mem_free(msg->bodyptr);
break;
+ case SIR_HAL_UPDATE_TX_FAIL_CNT_TH:
+ wma_update_tx_fail_cnt_th(wma_handle, msg->bodyptr);
+ qdf_mem_free(msg->bodyptr);
+ break;
default:
WMA_LOGD("unknow msg type %x", msg->type);
/* Do Nothing? MSG Body should be freed at here */