qcacmn: Add support to extract link removal TLVs from MGMT Rx event

To assist the Host in ML reconfiguration element construction for probe
responses, FW sends MLO link removal information as part of the MGMT Rx
event containing the corresponding probe request. This information is an
array of TLVs, one TLV for each link that is undergoing link removal from
the MLD for which this probe request is intended. The TLV carries the link
removal TBTT countdown value maintained by the FW for that link.
Add support to extract the same.

CRs-Fixed: 3335361
Change-Id: I16c6791a443ddb166da596d404a52ff2a38da291
This commit is contained in:
Shiva Krishna Pittala
2022-11-13 04:36:35 +05:30
committed by Madan Koyyalamudi
parent 22be442546
commit 11fa724d8a
11 changed files with 224 additions and 6 deletions

View File

@@ -27,9 +27,10 @@
#include <target_if.h>
#include <wlan_lmac_if_def.h>
#ifdef WLAN_FEATURE_11BE_MLO
/**
* target_if_mlo_get_rx_ops() - get rx ops
* @tx_ops: pointer to target_if tx ops
* @psoc: pointer to soc object
*
* API to retrieve the MLO rx ops from the psoc context
*
@@ -51,7 +52,7 @@ target_if_mlo_get_rx_ops(struct wlan_objmgr_psoc *psoc)
/**
* target_if_mlo_get_tx_ops() - get tx ops
* @tx_ops: pointer to target_if tx ops
* @psoc: pointer to soc object
*
* API to retrieve the MLO tx ops from the psoc context
*
@@ -92,5 +93,28 @@ QDF_STATUS target_if_mlo_send_link_removal_cmd(
struct wlan_objmgr_psoc *psoc,
const struct mlo_link_removal_cmd_params *param);
/**
* target_if_extract_mlo_link_removal_info_mgmt_rx() - Extract MLO link removal
* information from MGMT Rx event
* @wmi_handle: WMI handle
* @evt_buf: Event buffer
* @rx_event: MGMT Rx event parameters
*
* Return: QDF_STATUS of operation
*/
QDF_STATUS
target_if_extract_mlo_link_removal_info_mgmt_rx(
wmi_unified_t wmi_handle,
void *evt_buf,
struct mgmt_rx_event_params *rx_event);
#else
static inline QDF_STATUS
target_if_extract_mlo_link_removal_info_mgmt_rx(
wmi_unified_t wmi_handle,
void *evt_buf,
struct mgmt_rx_event_params *rx_event)
{
return QDF_STATUS_SUCCESS;
}
#endif
#endif /* __TARGET_IF_MLO_MGR_H__ */

View File

@@ -142,6 +142,55 @@ exit:
return qdf_status_to_os_return(status);
}
QDF_STATUS
target_if_extract_mlo_link_removal_info_mgmt_rx(
wmi_unified_t wmi_handle,
void *evt_buf,
struct mgmt_rx_event_params *rx_event)
{
QDF_STATUS status;
struct mgmt_rx_mlo_link_removal_info *link_removal_info;
if (!rx_event) {
target_if_err("Invalid rx_event");
return QDF_STATUS_E_NULL_VALUE;
}
rx_event->link_removal_info = NULL;
if (!rx_event->num_link_removal_info) {
/**
* This is not an error. Only probe request frames will contain
* Link removal TLVs, that too only till the link removal TBTT
* countdown completion.
*/
target_if_debug("Link removal TLVs are not present");
return QDF_STATUS_SUCCESS;
}
link_removal_info = qdf_mem_malloc(rx_event->num_link_removal_info *
sizeof(*link_removal_info));
if (!link_removal_info) {
target_if_err("Couldn't allocate memory for link_removal_info");
rx_event->num_link_removal_info = 0;
return QDF_STATUS_E_NOMEM;
}
status = wmi_extract_mgmt_rx_mlo_link_removal_info(
wmi_handle, evt_buf,
link_removal_info,
rx_event->num_link_removal_info);
if (QDF_IS_STATUS_ERROR(status)) {
target_if_err("Unable to extract link removal TLVs");
rx_event->num_link_removal_info = 0;
qdf_mem_free(link_removal_info);
return status;
}
rx_event->link_removal_info = link_removal_info;
return QDF_STATUS_SUCCESS;
}
/**
* target_if_mlo_register_event_handler() - function to register handler for
* mlo related wmi event from firmware.