qcacmn: Add handling for mlo link disable event
Add code changes to handle new wmi_mlo_link_disable_event Extract the wmi event params and store in host defined structure. Change-Id: I6893bfa4da7b27f4a9b1ce2936057bb3576a317c CRs-Fixed: 3458680
This commit is contained in:

committed by
Madan Koyyalamudi

parent
2b2a9fc6c8
commit
c16aa9d544
@@ -191,6 +191,62 @@ target_if_extract_mlo_link_removal_info_mgmt_rx(
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_mlo_link_disable_request_event_handler() - Handler for MLO
|
||||
* link disable request event sent by the FW
|
||||
* @scn: scn handle
|
||||
* @data: data buffer for event
|
||||
* @datalen: data length
|
||||
*
|
||||
* Return: 0 on success, else error on failure
|
||||
*/
|
||||
static int
|
||||
target_if_mlo_link_disable_request_event_handler(ol_scn_t scn, uint8_t *data,
|
||||
uint32_t datalen)
|
||||
{
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct wmi_unified *wmi_handle;
|
||||
struct wlan_lmac_if_mlo_rx_ops *mlo_rx_ops;
|
||||
QDF_STATUS status;
|
||||
struct mlo_link_disable_request_evt_params evt_params;
|
||||
|
||||
if (!scn || !data) {
|
||||
target_if_err("scn: 0x%pK, data: 0x%pK", scn, data);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(scn);
|
||||
if (!psoc) {
|
||||
target_if_err("null psoc");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
mlo_rx_ops = target_if_mlo_get_rx_ops(psoc);
|
||||
if (!mlo_rx_ops || !mlo_rx_ops->mlo_link_disable_request_handler) {
|
||||
target_if_err("callback not registered");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("wmi_handle is null");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
status = wmi_extract_mlo_link_disable_request_evt(wmi_handle, data,
|
||||
&evt_params);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("Unable to extract fixed param, ret = %d",
|
||||
status);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
status = mlo_rx_ops->mlo_link_disable_request_handler(psoc,
|
||||
&evt_params);
|
||||
exit:
|
||||
return qdf_status_to_os_return(status);
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_mlo_register_event_handler() - function to register handler for
|
||||
* mlo related wmi event from firmware.
|
||||
@@ -238,6 +294,14 @@ target_if_mlo_register_event_handler(struct wlan_objmgr_psoc *psoc)
|
||||
target_if_mlo_register_vdev_tid_to_link_map_event(wmi_handle);
|
||||
target_if_mlo_register_mlo_link_state_info_event(wmi_handle);
|
||||
|
||||
status = wmi_unified_register_event(
|
||||
wmi_handle,
|
||||
wmi_mlo_link_disable_request_eventid,
|
||||
target_if_mlo_link_disable_request_event_handler);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
target_if_err("Couldn't register handler for Link removal WMI event %d",
|
||||
status);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -273,6 +337,9 @@ target_if_mlo_unregister_event_handler(struct wlan_objmgr_psoc *psoc)
|
||||
target_if_mlo_unregister_vdev_tid_to_link_map_event(wmi_handle);
|
||||
target_if_mlo_unregister_mlo_link_state_info_event(wmi_handle);
|
||||
|
||||
wmi_unified_unregister_event(wmi_handle,
|
||||
wmi_mlo_link_disable_request_eventid);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
@@ -1532,6 +1532,7 @@ struct wlan_lmac_if_mlo_tx_ops {
|
||||
* @process_mlo_vdev_tid_to_link_map_event: function pointer to rx T2LM event
|
||||
* @mlo_link_removal_handler: function pointer for MLO link removal handler
|
||||
* @process_mlo_link_state_info_event: function pointer for mlo link state
|
||||
* @mlo_link_disable_request_handler: function ptr for mlo link disable request
|
||||
*/
|
||||
struct wlan_lmac_if_mlo_rx_ops {
|
||||
QDF_STATUS
|
||||
@@ -1546,6 +1547,9 @@ struct wlan_lmac_if_mlo_rx_ops {
|
||||
QDF_STATUS (*process_mlo_link_state_info_event)(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
struct ml_link_state_info_event *event);
|
||||
QDF_STATUS (*mlo_link_disable_request_handler)(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
void *evt_params);
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@@ -978,7 +978,8 @@ wlan_lmac_if_mlo_mgr_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
|
||||
wlan_mlo_vdev_tid_to_link_map_event;
|
||||
rx_ops->mlo_rx_ops.process_mlo_link_state_info_event =
|
||||
wlan_handle_ml_link_state_info_event;
|
||||
|
||||
rx_ops->mlo_rx_ops.mlo_link_disable_request_handler =
|
||||
wlan_mlo_link_disable_request_handler;
|
||||
}
|
||||
#else
|
||||
static void
|
||||
|
@@ -1068,4 +1068,14 @@ struct mgmt_rx_mlo_link_removal_info {
|
||||
uint16_t tbtt_count;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct mlo_link_disable_request_evt_params - MLO link disable
|
||||
* request params
|
||||
* @mld_addr: disable mld address
|
||||
* @link_id_bitmap: Disable Link id bitmap
|
||||
*/
|
||||
struct mlo_link_disable_request_evt_params {
|
||||
struct qdf_mac_addr mld_addr;
|
||||
uint32_t link_id_bitmap;
|
||||
};
|
||||
#endif
|
||||
|
@@ -714,6 +714,7 @@ QDF_STATUS wlan_process_bcn_prbrsp_t2lm_ie(struct wlan_objmgr_vdev *vdev,
|
||||
*/
|
||||
QDF_STATUS wlan_send_tid_to_link_mapping(struct wlan_objmgr_vdev *vdev,
|
||||
struct wlan_t2lm_info *t2lm);
|
||||
|
||||
/**
|
||||
* wlan_get_t2lm_mapping_status() - API to get T2LM info
|
||||
* @vdev: Pointer to vdev
|
||||
@@ -736,7 +737,6 @@ QDF_STATUS wlan_get_t2lm_mapping_status(struct wlan_objmgr_vdev *vdev,
|
||||
QDF_STATUS
|
||||
wlan_send_peer_level_tid_to_link_mapping(struct wlan_objmgr_vdev *vdev,
|
||||
struct wlan_objmgr_peer *peer);
|
||||
|
||||
#else
|
||||
static inline QDF_STATUS wlan_mlo_parse_t2lm_ie(
|
||||
struct wlan_t2lm_onging_negotiation_info *t2lm, uint8_t *ie)
|
||||
@@ -880,10 +880,30 @@ wlan_send_peer_level_tid_to_link_mapping(struct wlan_objmgr_vdev *vdev,
|
||||
*/
|
||||
void
|
||||
wlan_clear_peer_level_tid_to_link_mapping(struct wlan_objmgr_vdev *vdev);
|
||||
|
||||
/**
|
||||
* wlan_mlo_link_disable_request_handler() - API to handle mlo link disable
|
||||
* request handler.
|
||||
*
|
||||
* @psoc: Pointer to psoc
|
||||
* @evt_params: MLO Link disable request params
|
||||
*
|
||||
* Return QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
wlan_mlo_link_disable_request_handler(struct wlan_objmgr_psoc *psoc,
|
||||
void *evt_params);
|
||||
#else
|
||||
static inline void
|
||||
wlan_clear_peer_level_tid_to_link_mapping(struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
}
|
||||
|
||||
static inline QDF_STATUS
|
||||
wlan_mlo_link_disable_request_handler(struct wlan_objmgr_psoc *psoc,
|
||||
void *evt_params)
|
||||
{
|
||||
return QDF_STATUS_E_NOSUPPORT;
|
||||
}
|
||||
#endif
|
||||
#endif /* _WLAN_MLO_T2LM_H_ */
|
||||
|
@@ -22,10 +22,10 @@
|
||||
#include <wlan_objmgr_vdev_obj.h>
|
||||
#include <wlan_objmgr_peer_obj.h>
|
||||
#include <wlan_mlo_mgr_public_structs.h>
|
||||
#include <wlan_mlo_t2lm.h>
|
||||
#include <wlan_mlo_mgr_cmn.h>
|
||||
#include <qdf_util.h>
|
||||
#include <wlan_cm_api.h>
|
||||
#include "wlan_utility.h"
|
||||
#if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_FEATURE_11BE_MLO_ADV_FEATURE)
|
||||
#include <wlan_t2lm_api.h>
|
||||
#endif
|
||||
@@ -300,7 +300,8 @@ uint8_t *wlan_mlo_add_t2lm_info_ie(uint8_t *frm, struct wlan_t2lm_info *t2lm,
|
||||
frm += sizeof(*t2lm_ie) + sizeof(uint8_t);
|
||||
} else {
|
||||
for (tid_num = 0; tid_num < T2LM_MAX_NUM_TIDS; tid_num++)
|
||||
if (t2lm->hw_link_map_tid[tid_num])
|
||||
if (t2lm->hw_link_map_tid[tid_num] ||
|
||||
t2lm->ieee_link_map_tid[tid_num])
|
||||
link_mapping_presence_indicator |= BIT(tid_num);
|
||||
|
||||
QDF_SET_BITS(t2lm_control,
|
||||
@@ -1397,3 +1398,60 @@ wlan_mlo_t2lm_timer_deinit(struct wlan_objmgr_vdev *vdev)
|
||||
t2lm_dev_lock_destroy(&vdev->mlo_dev_ctx->t2lm_ctx);
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#if defined(WLAN_FEATURE_11BE_MLO_ADV_FEATURE) && defined(WLAN_FEATURE_11BE)
|
||||
QDF_STATUS
|
||||
wlan_mlo_link_disable_request_handler(struct wlan_objmgr_psoc *psoc,
|
||||
void *evt_params)
|
||||
{
|
||||
struct wlan_objmgr_vdev *vdev;
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
uint8_t vdev_id;
|
||||
bool is_connected = false;
|
||||
struct mlo_link_disable_request_evt_params *params;
|
||||
|
||||
if (!psoc)
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
|
||||
if (!evt_params) {
|
||||
t2lm_err("event params is null");
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
params = (struct mlo_link_disable_request_evt_params *)evt_params;
|
||||
if (qdf_is_macaddr_zero(¶ms->mld_addr)) {
|
||||
t2lm_err("mld mac addr in event params is null");
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
if (!params->link_id_bitmap) {
|
||||
t2lm_debug("Link id bitmap is 0, no action frame to be sent");
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
is_connected = wlan_get_connected_vdev_by_mld_addr(psoc,
|
||||
params->mld_addr.bytes,
|
||||
&vdev_id);
|
||||
if (!is_connected) {
|
||||
t2lm_err("Not connected to peer MLD " QDF_MAC_ADDR_FMT,
|
||||
params->mld_addr.bytes);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
|
||||
WLAN_MLO_MGR_ID);
|
||||
if (!vdev) {
|
||||
t2lm_err("vdev is null");
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
status = wlan_populate_link_disable_t2lm_frame(vdev, params);
|
||||
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
t2lm_err("Failed to handle link disable");
|
||||
|
||||
wlan_objmgr_vdev_release_ref(vdev, WLAN_MLO_MGR_ID);
|
||||
return status;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@@ -194,6 +194,19 @@ QDF_STATUS wmi_extract_mlo_link_state_info_event(
|
||||
void *evt_buf,
|
||||
struct ml_link_state_info_event *params);
|
||||
|
||||
/**
|
||||
* wmi_extract_mlo_link_disable_request_evt() - Extract fixed parameters TLV
|
||||
* from the MLO link disable request WMI event
|
||||
* @wmi: wmi handle
|
||||
* @buf: pointer to event buffer
|
||||
* @params: MLO link disable request event parameters
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS of operation
|
||||
*/
|
||||
QDF_STATUS wmi_extract_mlo_link_disable_request_evt(
|
||||
struct wmi_unified *wmi,
|
||||
void *buf,
|
||||
struct mlo_link_disable_request_evt_params *params);
|
||||
#endif /* WLAN_FEATURE_11BE */
|
||||
|
||||
#endif /*_WMI_UNIFIED_11BE_API_H_*/
|
||||
|
@@ -5238,6 +5238,7 @@ typedef enum {
|
||||
wmi_mlo_teardown_complete_event_id,
|
||||
wmi_mlo_link_set_active_resp_eventid,
|
||||
wmi_mlo_link_removal_eventid,
|
||||
wmi_mlo_link_disable_request_eventid,
|
||||
#endif
|
||||
wmi_pdev_fips_extend_event_id,
|
||||
wmi_roam_frame_event_id,
|
||||
|
@@ -3127,6 +3127,11 @@ QDF_STATUS (*extract_mgmt_rx_mlo_link_removal_info)(
|
||||
void *buf,
|
||||
struct mgmt_rx_mlo_link_removal_info *link_removal_info,
|
||||
int num_link_removal_info);
|
||||
|
||||
QDF_STATUS (*extract_mlo_link_disable_request_evt_param)(
|
||||
struct wmi_unified *wmi_handle,
|
||||
void *buf,
|
||||
struct mlo_link_disable_request_evt_params *params);
|
||||
#endif
|
||||
|
||||
#ifdef WLAN_FEATURE_SON
|
||||
|
@@ -129,6 +129,18 @@ QDF_STATUS wmi_extract_mlo_link_state_info_event(
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
QDF_STATUS wmi_extract_mlo_link_disable_request_evt(
|
||||
struct wmi_unified *wmi,
|
||||
void *buf,
|
||||
struct mlo_link_disable_request_evt_params *params)
|
||||
{
|
||||
if (wmi->ops->extract_mlo_link_disable_request_evt_param)
|
||||
return wmi->ops->extract_mlo_link_disable_request_evt_param(
|
||||
wmi, buf, params);
|
||||
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
#endif /* WLAN_FEATURE_11BE */
|
||||
|
||||
QDF_STATUS
|
||||
|
@@ -844,6 +844,47 @@ extract_mgmt_rx_mlo_link_removal_info_tlv(
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* extract_mlo_link_disable_request_evt_param_tlv() - Extract fixed
|
||||
* parameters TLV from the MLO link removal WMI event
|
||||
* @wmi_handle: wmi handle
|
||||
* @buf: pointer to event buffer
|
||||
* @params: MLO link removal event parameters
|
||||
*
|
||||
* Return: QDF_STATUS of operation
|
||||
*/
|
||||
static QDF_STATUS
|
||||
extract_mlo_link_disable_request_evt_param_tlv(
|
||||
struct wmi_unified *wmi_handle,
|
||||
void *buf,
|
||||
struct mlo_link_disable_request_evt_params *params)
|
||||
{
|
||||
WMI_MLO_LINK_DISABLE_REQUEST_EVENTID_param_tlvs *param_buf = buf;
|
||||
wmi_mlo_link_disable_request_event_fixed_param *ev;
|
||||
|
||||
if (!param_buf) {
|
||||
wmi_err_rl("Param_buf is NULL");
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
if (!params) {
|
||||
wmi_err_rl("params is NULL");
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
ev = param_buf->fixed_param;
|
||||
WMI_MAC_ADDR_TO_CHAR_ARRAY(&ev->mld_addr,
|
||||
params->mld_addr.bytes);
|
||||
|
||||
params->link_id_bitmap = ev->linkid_bitmap;
|
||||
|
||||
wmi_debug("Link id bitmap 0x%x MLD addr " QDF_MAC_ADDR_FMT,
|
||||
params->link_id_bitmap,
|
||||
QDF_MAC_ADDR_REF(params->mld_addr.bytes));
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef WLAN_FEATURE_11BE
|
||||
size_t peer_assoc_t2lm_params_size(struct peer_assoc_params *req)
|
||||
{
|
||||
@@ -1799,4 +1840,6 @@ void wmi_11be_attach_tlv(wmi_unified_t wmi_handle)
|
||||
extract_mlo_link_removal_tbtt_update_tlv;
|
||||
ops->extract_mgmt_rx_mlo_link_removal_info =
|
||||
extract_mgmt_rx_mlo_link_removal_info_tlv;
|
||||
ops->extract_mlo_link_disable_request_evt_param =
|
||||
extract_mlo_link_disable_request_evt_param_tlv;
|
||||
}
|
||||
|
@@ -21146,6 +21146,8 @@ static void populate_tlv_events_id_mlo(WMI_EVT_ID *event_ids)
|
||||
WMI_MLO_LINK_REMOVAL_EVENTID;
|
||||
event_ids[wmi_mlo_link_state_info_eventid] =
|
||||
WMI_MLO_VDEV_LINK_INFO_EVENTID;
|
||||
event_ids[wmi_mlo_link_disable_request_eventid] =
|
||||
WMI_MLO_LINK_DISABLE_REQUEST_EVENTID;
|
||||
}
|
||||
#else /* WLAN_FEATURE_11BE_MLO */
|
||||
static inline void populate_tlv_events_id_mlo(WMI_EVT_ID *event_ids)
|
||||
|
Reference in New Issue
Block a user