qcacld-3.0: Add WMI interface to configure EDCA/PIFS param

Add WMI interface(WMI_VDEV_SET_TWT_EDCA_PARAMS_CMDID) to
configure EDCA/PIFS param for LL SAP.

This configuration depends on edca_param_type.
If edca_param_type is 0 then host will configure EDCA param and
send it to firmware via WMI interface.
If edca_param_type is 1 then host will configure PIFS param and
send it to firmware via WMI interface.

Change-Id: I09f49474c0a698257d06aa4f1a17b56aae735fa5
CRs-Fixed: 3349447
This commit is contained in:
Jyoti Kumari
2022-11-25 15:15:08 +05:30
committed by Madan Koyyalamudi
parent 3bc6862f31
commit af62331dd8
12 changed files with 151 additions and 2 deletions

View File

@@ -4086,4 +4086,15 @@ wlan_mlme_get_peer_ch_width(struct wlan_objmgr_psoc *psoc, uint8_t *mac);
void
wlan_mlme_get_sr_enable_modes(struct wlan_objmgr_psoc *psoc, uint8_t *val);
#endif
/**
* wlan_mlme_set_edca_pifs_param() - set edca/pifs param for ll sap
* @ep: pointer to wlan_edca_pifs_param_ie
* @type: edca_param_type
*
* Return: None
*/
void
wlan_mlme_set_edca_pifs_param(struct wlan_edca_pifs_param_ie *ep,
enum host_edca_param_type type);
#endif /* _WLAN_MLME_API_H_ */

View File

@@ -380,9 +380,20 @@ struct wlan_mlme_edca_params {
struct mlme_edca_ac_bk edca_ac_bk;
struct mlme_edca_ac_be edca_ac_be;
uint8_t edca_param_type;
enum host_edca_param_type edca_param_type;
};
/* To configure EDCA/PIFS param for LL SAP */
#define CFG_EDCA_PARAM_ACM 0
#define CFG_EDCA_PARAM_AIFSN 1
#define CFG_EDCA_PARAM_ACI 3
#define CFG_EDCA_PARAM_CWMIN 2
#define CFG_EDCA_PARAM_CWMAX 3
#define CFG_EDCA_PARAM_TXOP 47
#define CFG_PIFS_PARAM_SAP_OFFSET 0
#define CFG_PIFS_PARAM_LEB_OFFSET 1
#define CFG_PIFS_PARAM_REB_OFFSET 2
#define WLAN_CFG_MFR_NAME_LEN (63)
#define WLAN_CFG_MODEL_NUMBER_LEN (31)
#define WLAN_CFG_MODEL_NAME_LEN (31)

View File

@@ -6447,3 +6447,26 @@ enum phy_ch_width wlan_mlme_convert_vht_op_bw_to_phy_ch_width(
return phy_bw;
}
void
wlan_mlme_set_edca_pifs_param(struct wlan_edca_pifs_param_ie *ep,
enum host_edca_param_type type)
{
ep->edca_param_type = type;
if (type == HOST_EDCA_PARAM_TYPE_AGGRESSIVE) {
ep->edca_pifs_param.eparam.acvo_aifsn = CFG_EDCA_PARAM_AIFSN;
ep->edca_pifs_param.eparam.acvo_acm = CFG_EDCA_PARAM_ACM;
ep->edca_pifs_param.eparam.acvo_aci = CFG_EDCA_PARAM_ACI;
ep->edca_pifs_param.eparam.acvo_cwmin = CFG_EDCA_PARAM_CWMIN;
ep->edca_pifs_param.eparam.acvo_cwmax = CFG_EDCA_PARAM_CWMAX;
ep->edca_pifs_param.eparam.acvo_txoplimit = CFG_EDCA_PARAM_TXOP;
} else if (type == HOST_EDCA_PARAM_TYPE_PIFS) {
ep->edca_pifs_param.pparam.sap_pifs_offset =
CFG_PIFS_PARAM_SAP_OFFSET;
ep->edca_pifs_param.pparam.leb_pifs_offset =
CFG_PIFS_PARAM_LEB_OFFSET;
ep->edca_pifs_param.pparam.reb_pifs_offset =
CFG_PIFS_PARAM_REB_OFFSET;
}
}

View File

@@ -650,7 +650,7 @@ enum halmsgtype {
SIR_HAL_PEER_CREATE_REQ = (SIR_HAL_ITC_MSG_TYPES_BEGIN + 421),
SIR_HAL_TWT_NUDGE_DIALOG_REQUEST = (SIR_HAL_ITC_MSG_TYPES_BEGIN + 422),
SIR_HAL_PASN_PEER_DELETE_REQUEST = (SIR_HAL_ITC_MSG_TYPES_BEGIN + 423),
SIR_HAL_UPDATE_EDCA_PIFS_PARAM_IND = (SIR_HAL_ITC_MSG_TYPES_BEGIN + 424),
SIR_HAL_MSG_TYPES_END = (SIR_HAL_MSG_TYPES_BEGIN + 0x1FF),
};

View File

@@ -551,3 +551,35 @@ QDF_STATUS lim_send_ht40_obss_scanind(struct mac_context *mac_ctx,
}
return ret;
}
QDF_STATUS
lim_send_edca_pifs_param(struct mac_context *mac,
struct wlan_edca_pifs_param_ie *param,
uint8_t vdev_id)
{
struct edca_pifs_vparam *edca_pifs = NULL;
QDF_STATUS ret = QDF_STATUS_SUCCESS;
struct scheduler_msg msgQ = {0};
edca_pifs = qdf_mem_malloc(sizeof(*edca_pifs));
if (!edca_pifs)
return QDF_STATUS_E_NOMEM;
edca_pifs->vdev_id = vdev_id;
qdf_mem_copy(&edca_pifs->param, param,
sizeof(struct wlan_edca_pifs_param_ie));
msgQ.type = WMA_UPDATE_EDCA_PIFS_PARAM_IND;
msgQ.reserved = 0;
msgQ.bodyptr = edca_pifs;
msgQ.bodyval = 0;
pe_debug("Sending WMA_UPDATE_EDCA_PIFS_PARAM_IND");
MTRACE(mac_trace_msg_tx(mac, NO_SESSION, msgQ.type));
ret = wma_post_ctrl_msg(mac, &msgQ);
if (QDF_IS_STATUS_ERROR(ret)) {
qdf_mem_free(edca_pifs);
pe_err("Posting WMA_UPDATE_EDCA_PIFS_PARAM_IND failed, reason=%X",
ret);
}
return ret;
}

View File

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2011-2019, 2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -112,4 +113,18 @@ QDF_STATUS lim_send_ht40_obss_scanind(struct mac_context *mac_ctx,
struct pe_session *session);
void lim_handle_sme_join_result(struct mac_context *,
tSirResultCodes, uint16_t, struct pe_session *);
/**
* lim_send_edca_pifs_param() - Send edca/pifs param to firmware based on
* edca_param_type ini
* @mac: pointer to Global Mac structure
* @param: pointer to param
* @vdev_id: vdev id
*
* Return: QDF_STATUS
*/
QDF_STATUS
lim_send_edca_pifs_param(struct mac_context *mac,
struct wlan_edca_pifs_param_ie *param,
uint8_t vdev_id);
#endif

View File

@@ -508,6 +508,18 @@ void sch_qos_concurrency_update(void)
lim_send_conc_params_update();
}
static void sch_qos_update_edca_pifs_param_for_ll_sap(struct mac_context *mac,
uint8_t vdev_id)
{
struct wlan_edca_pifs_param_ie param = {0};
enum host_edca_param_type edca_param_type =
HOST_EDCA_PARAM_TYPE_AGGRESSIVE;
edca_param_type = mac->mlme_cfg->edca_params.edca_param_type;
wlan_mlme_set_edca_pifs_param(&param, edca_param_type);
lim_send_edca_pifs_param(mac, &param, vdev_id);
}
/**
* sch_edca_profile_update() - This function updates the local and broadcast
* EDCA params in the gLimEdcaParams structure. It also updates the
@@ -523,6 +535,14 @@ void sch_edca_profile_update(struct mac_context *mac, struct pe_session *pe_sess
sch_qos_update_local(mac, pe_session);
sch_qos_update_broadcast(mac, pe_session);
sch_qos_concurrency_update();
if (policy_mgr_is_ll_sap_present(
mac->psoc,
policy_mgr_convert_device_mode_to_qdf_type(
pe_session->opmode), pe_session->vdev_id))
sch_qos_update_edca_pifs_param_for_ll_sap(
mac,
pe_session->vdev_id);
}
}

View File

@@ -550,6 +550,7 @@ uint8_t *mac_trace_get_wma_msg_string(uint16_t wma_msg)
CASE_RETURN_STRING(WMA_SET_THERMAL_THROTTLE_CFG);
CASE_RETURN_STRING(WMA_SET_THERMAL_MGMT);
#endif /* FW_THERMAL_THROTTLE_SUPPORT */
CASE_RETURN_STRING(WMA_UPDATE_EDCA_PIFS_PARAM_IND);
default:
return (uint8_t *) "UNKNOWN";
break;

View File

@@ -1807,4 +1807,17 @@ uint16_t wma_mcs_rate_match(uint16_t raw_rate, bool is_he,
const uint16_t *nss1_rate,
const uint16_t *nss2_rate,
uint8_t *nss, enum txrate_gi *guard_interval);
/**
* wma_update_edca_pifs_param() - Update edca/pifs param
* @handle: wma handle
* @edca_pifs_param: pointer to edca_pifs_vparam struct
*
* This is a helper function to update edca/pifs param for ll sap
*
* Return: QDF_STATUS
*/
QDF_STATUS
wma_update_edca_pifs_param(WMA_HANDLE handle,
struct edca_pifs_vparam *edca_pifs_param);
#endif

View File

@@ -441,6 +441,7 @@ enum wmamsgtype {
WMA_PEER_CREATE_REQ = SIR_HAL_PEER_CREATE_REQ,
WMA_TWT_NUDGE_DIALOG_REQUEST = SIR_HAL_TWT_NUDGE_DIALOG_REQUEST,
WMA_PASN_PEER_DELETE_REQUEST = SIR_HAL_PASN_PEER_DELETE_REQUEST,
WMA_UPDATE_EDCA_PIFS_PARAM_IND = SIR_HAL_UPDATE_EDCA_PIFS_PARAM_IND,
};
/* Bit 6 will be used to control BD rate for Management frames */

View File

@@ -9410,6 +9410,12 @@ static QDF_STATUS wma_mc_process_msg(struct scheduler_msg *msg)
wma_twt_process_nudge_dialog(wma_handle, msg->bodyptr);
qdf_mem_free(msg->bodyptr);
break;
case WMA_UPDATE_EDCA_PIFS_PARAM_IND:
wma_update_edca_pifs_param(
wma_handle,
(struct edca_pifs_vparam *)msg->bodyptr);
qdf_mem_free(msg->bodyptr);
break;
default:
wma_debug("Unhandled WMA message of type %d", msg->type);
if (msg->bodyptr)

View File

@@ -4170,4 +4170,20 @@ QDF_STATUS wma_mgmt_frame_fill_peer_cb(struct wlan_objmgr_peer *peer,
return QDF_STATUS_SUCCESS;
}
QDF_STATUS
wma_update_edca_pifs_param(WMA_HANDLE handle,
struct edca_pifs_vparam *edca_pifs_param)
{
tp_wma_handle wma_handle = (tp_wma_handle) handle;
QDF_STATUS status;
status = wmi_unified_update_edca_pifs_param(wma_handle->wmi_handle,
edca_pifs_param);
if (QDF_IS_STATUS_ERROR(status))
wma_err("Failed to set EDCA/PIFS Parameters");
return status;
}
#endif