|
@@ -79,6 +79,69 @@ target_if_mlo_link_set_active_resp_handler(ol_scn_t scn, uint8_t *data,
|
|
|
return qdf_status_to_os_return(status);
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * target_if_mlo_link_removal_event_handler() - Handler for MLO link removal
|
|
|
+ * 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_removal_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_removal_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_removal_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_removal_evt_fixed_param(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 = wmi_extract_mlo_link_removal_tbtt_update(
|
|
|
+ wmi_handle, data, &evt_params.tbtt_info);
|
|
|
+ if (QDF_IS_STATUS_ERROR(status)) {
|
|
|
+ target_if_err("Unable to extract TBTT update TLV, ret = %d",
|
|
|
+ status);
|
|
|
+ goto exit;
|
|
|
+ }
|
|
|
+
|
|
|
+ status = mlo_rx_ops->mlo_link_removal_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.
|
|
@@ -103,6 +166,14 @@ target_if_mlo_register_event_handler(struct wlan_objmgr_psoc *psoc)
|
|
|
return QDF_STATUS_E_INVAL;
|
|
|
}
|
|
|
|
|
|
+ status = wmi_unified_register_event(
|
|
|
+ wmi_handle,
|
|
|
+ wmi_mlo_link_removal_eventid,
|
|
|
+ target_if_mlo_link_removal_event_handler);
|
|
|
+ if (QDF_IS_STATUS_ERROR(status))
|
|
|
+ target_if_err("Couldn't register handler for Link removal WMI event %d",
|
|
|
+ status);
|
|
|
+
|
|
|
status = wmi_unified_register_event_handler(
|
|
|
wmi_handle,
|
|
|
wmi_mlo_link_set_active_resp_eventid,
|
|
@@ -144,6 +215,9 @@ target_if_mlo_unregister_event_handler(struct wlan_objmgr_psoc *psoc)
|
|
|
wmi_unified_unregister_event_handler(wmi_handle,
|
|
|
wmi_mlo_link_set_active_resp_eventid);
|
|
|
|
|
|
+ wmi_unified_unregister_event(wmi_handle,
|
|
|
+ wmi_mlo_link_removal_eventid);
|
|
|
+
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
|
|