mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 07:03:09 -04:00
qcacld-3.0: Pass short_retry_limit and long_retry_limit to FW
qcacld-2.0 to qcacld-3.0 propagation Add data structures to save short_retry_limit and long_retry_limit. long_retry_limit is count to retry frame at current rate. short_retry_limit is count to retry frame on lower rate. Add changes to pass these params to firmware as well. Change-Id: Icb45c37358dcfacbea8e3b3f40b93189d62e1be4 CRs-Fixed: 1020078
This commit is contained in:
parent
35b251d495
commit
da3e950519
5 changed files with 206 additions and 0 deletions
|
|
@ -6595,4 +6595,26 @@ struct sme_tx_fail_cnt_threshold {
|
|||
uint8_t session_id;
|
||||
uint32_t tx_fail_cnt_threshold;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct sme_short_retry_limit - transmission retry limit for short frames.
|
||||
* @session_id: Session id
|
||||
* @short_retry_limit: tranmission retry limit for short frame.
|
||||
*
|
||||
*/
|
||||
struct sme_short_retry_limit {
|
||||
uint8_t session_id;
|
||||
uint32_t short_retry_limit;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct sme_long_retry_limit - tranmission retry limit for long frames
|
||||
* @session_id: Session id
|
||||
* @short_retry_limit: tranmission retry limit for long frames.
|
||||
*
|
||||
*/
|
||||
struct sme_long_retry_limit {
|
||||
uint8_t session_id;
|
||||
uint32_t long_retry_limit;
|
||||
};
|
||||
#endif /* __SIR_API_H */
|
||||
|
|
|
|||
|
|
@ -635,6 +635,8 @@ 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_SHORT_RETRY_LIMIT_CNT (SIR_HAL_ITC_MSG_TYPES_BEGIN + 365)
|
||||
#define SIR_HAL_LONG_RETRY_LIMIT_CNT (SIR_HAL_ITC_MSG_TYPES_BEGIN + 366)
|
||||
|
||||
#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)
|
||||
|
|
|
|||
|
|
@ -1329,4 +1329,8 @@ 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);
|
||||
QDF_STATUS sme_update_short_retry_limit_threshold(tHalHandle hal_handle,
|
||||
struct sme_short_retry_limit *short_retry_limit_th);
|
||||
QDF_STATUS sme_update_long_retry_limit_threshold(tHalHandle hal_handle,
|
||||
struct sme_long_retry_limit *long_retry_limit_th);
|
||||
#endif /* #if !defined( __SME_API_H ) */
|
||||
|
|
|
|||
|
|
@ -12260,6 +12260,101 @@ QDF_STATUS sme_update_access_policy_vendor_ie(tHalHandle hal,
|
|||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* sme_update_short_retry_limit_threshold() - update short frame retry limit TH
|
||||
* @hal: Handle returned by mac_open
|
||||
* @session_id: Session ID on which short frame retry limit needs to be
|
||||
* updated to FW
|
||||
* @short_limit_count_th: Retry count TH to retry short frame.
|
||||
*
|
||||
* This function is used to configure count to retry short frame.
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS sme_update_short_retry_limit_threshold(tHalHandle hal_handle,
|
||||
struct sme_short_retry_limit *short_retry_limit_th)
|
||||
{
|
||||
tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal_handle);
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
struct sme_short_retry_limit *srl;
|
||||
cds_msg_t msg;
|
||||
|
||||
srl = qdf_mem_malloc(sizeof(*srl));
|
||||
if (NULL == srl) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
|
||||
"%s: fail to alloc short retry limit", __func__);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
sms_log(mac_ctx, LOG1, FL("session_id %d short retry limit count: %d"),
|
||||
short_retry_limit_th->session_id,
|
||||
short_retry_limit_th->short_retry_limit);
|
||||
|
||||
srl->session_id = short_retry_limit_th->session_id;
|
||||
srl->short_retry_limit = short_retry_limit_th->short_retry_limit;
|
||||
|
||||
qdf_mem_zero(&msg, sizeof(msg));
|
||||
msg.type = SIR_HAL_SHORT_RETRY_LIMIT_CNT;
|
||||
msg.reserved = 0;
|
||||
msg.bodyptr = srl;
|
||||
status = cds_mq_post_message(QDF_MODULE_ID_WMA, &msg);
|
||||
if (status != QDF_STATUS_SUCCESS) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
|
||||
FL("Not able to post short retry limit count to WDA"));
|
||||
qdf_mem_free(srl);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* sme_update_long_retry_limit_threshold() - update long retry limit TH
|
||||
* @hal: Handle returned by mac_open
|
||||
* @session_id: Session ID on which long frames retry TH needs to be updated
|
||||
* to FW
|
||||
* @long_limit_count_th: Retry count to retry long frame.
|
||||
*
|
||||
* This function is used to configure TH to retry long frame.
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS sme_update_long_retry_limit_threshold(tHalHandle hal_handle,
|
||||
struct sme_long_retry_limit *long_retry_limit_th)
|
||||
{
|
||||
tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal_handle);
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
struct sme_long_retry_limit *lrl;
|
||||
cds_msg_t msg;
|
||||
|
||||
lrl = qdf_mem_malloc(sizeof(*lrl));
|
||||
if (NULL == lrl) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
|
||||
"%s: fail to alloc long retry limit", __func__);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
sms_log(mac_ctx, LOG1, FL("session_id %d long retry limit count: %d"),
|
||||
long_retry_limit_th->session_id,
|
||||
long_retry_limit_th->long_retry_limit);
|
||||
|
||||
lrl->session_id = long_retry_limit_th->session_id;
|
||||
lrl->long_retry_limit = long_retry_limit_th->long_retry_limit;
|
||||
|
||||
qdf_mem_zero(&msg, sizeof(msg));
|
||||
msg.type = SIR_HAL_LONG_RETRY_LIMIT_CNT;
|
||||
msg.reserved = 0;
|
||||
msg.bodyptr = lrl;
|
||||
status = cds_mq_post_message(QDF_MODULE_ID_WMA, &msg);
|
||||
|
||||
if (status != QDF_STATUS_SUCCESS) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
|
||||
FL("Not able to post long retry limit count to WDA"));
|
||||
qdf_mem_free(lrl);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* sme_get_reg_info() - To get registration info
|
||||
* @hHal: HAL context
|
||||
|
|
|
|||
|
|
@ -5954,6 +5954,81 @@ static QDF_STATUS wma_update_tx_fail_cnt_th(tp_wma_handle wma,
|
|||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* wma_update_short_retry_limit() - Set retry limit for short frames
|
||||
* @wma_handle: WMA handle
|
||||
* @short_retry_limit_th: retry limir count for Short frames.
|
||||
*
|
||||
* This function is used to configure the transmission retry limit at which
|
||||
* short frames needs to be retry.
|
||||
*
|
||||
* Return: VOS_STATUS_SUCCESS on success, error number otherwise
|
||||
*/
|
||||
static QDF_STATUS wma_update_short_retry_limit(tp_wma_handle wma,
|
||||
struct sme_short_retry_limit *short_retry_limit_th)
|
||||
{
|
||||
uint8_t vdev_id;
|
||||
uint32_t short_retry_limit;
|
||||
int ret;
|
||||
|
||||
if (!wma || !wma->wmi_handle) {
|
||||
WMA_LOGE("WMA is closed, can not issue short retry limit threshold");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
vdev_id = short_retry_limit_th->session_id;
|
||||
short_retry_limit = short_retry_limit_th->short_retry_limit;
|
||||
WMA_LOGD("Set short retry limit threshold vdevId %d count %d",
|
||||
vdev_id, short_retry_limit);
|
||||
|
||||
ret = wma_vdev_set_param(wma->wmi_handle, vdev_id,
|
||||
WMI_VDEV_PARAM_NON_AGG_SW_RETRY_TH,
|
||||
short_retry_limit);
|
||||
|
||||
if (ret) {
|
||||
WMA_LOGE("Failed to send short limit threshold command");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* wma_update_long_retry_limit() - Set retry limit for long frames
|
||||
* @wma_handle: WMA handle
|
||||
* @long_retry_limit_th: retry limir count for long frames
|
||||
*
|
||||
* This function is used to configure the transmission retry limit at which
|
||||
* long frames needs to be retry
|
||||
*
|
||||
* Return: VOS_STATUS_SUCCESS on success, error number otherwise
|
||||
*/
|
||||
static QDF_STATUS wma_update_long_retry_limit(tp_wma_handle wma,
|
||||
struct sme_long_retry_limit *long_retry_limit_th)
|
||||
{
|
||||
uint8_t vdev_id;
|
||||
uint32_t long_retry_limit;
|
||||
int ret;
|
||||
|
||||
if (!wma || !wma->wmi_handle) {
|
||||
WMA_LOGE("WMA is closed, can not issue long retry limit threshold");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
vdev_id = long_retry_limit_th->session_id;
|
||||
long_retry_limit = long_retry_limit_th->long_retry_limit;
|
||||
WMA_LOGD("Set TX pkt fail count threshold vdevId %d count %d",
|
||||
vdev_id, long_retry_limit);
|
||||
|
||||
ret = wma_vdev_set_param(wma->wmi_handle, vdev_id,
|
||||
WMI_VDEV_PARAM_AGG_SW_RETRY_TH,
|
||||
long_retry_limit);
|
||||
|
||||
if (ret) {
|
||||
WMA_LOGE("Failed to send long limit 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
|
||||
|
|
@ -6769,6 +6844,14 @@ QDF_STATUS wma_mc_process_msg(void *cds_context, cds_msg_t *msg)
|
|||
wma_update_tx_fail_cnt_th(wma_handle, msg->bodyptr);
|
||||
qdf_mem_free(msg->bodyptr);
|
||||
break;
|
||||
case SIR_HAL_LONG_RETRY_LIMIT_CNT:
|
||||
wma_update_long_retry_limit(wma_handle, msg->bodyptr);
|
||||
qdf_mem_free(msg->bodyptr);
|
||||
break;
|
||||
case SIR_HAL_SHORT_RETRY_LIMIT_CNT:
|
||||
wma_update_short_retry_limit(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 */
|
||||
|
|
|
|||
Loading…
Reference in a new issue