qcacld-3.0: TWT WMI callback registration/deregistration
Add TWT WMI event registration and deregistration Change-Id: Ib6cadfe05ba38f3ca33fb9f128c40698d6a969c0 CRs-Fixed: 3085525
This commit is contained in:

committed by
Madan Koyyalamudi

parent
cc019663ab
commit
a76b7145d5
@@ -78,6 +78,159 @@ target_if_twt_ack_complete_event_handler(ol_scn_t scn, uint8_t *event,
|
||||
QDF_STATUS
|
||||
target_if_twt_register_ext_events(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
QDF_STATUS status;
|
||||
struct wmi_unified *wmi_handle;
|
||||
|
||||
if (!psoc) {
|
||||
target_if_err("psoc obj is null!");
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("wmi_handle is null!");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = wmi_unified_register_event_handler
|
||||
(wmi_handle,
|
||||
wmi_twt_add_dialog_complete_event_id,
|
||||
target_if_twt_setup_complete_event_handler,
|
||||
WMI_RX_WORK_CTX);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("Failed to register twt add dialog event cb");
|
||||
return status;
|
||||
}
|
||||
|
||||
status = wmi_unified_register_event_handler
|
||||
(wmi_handle,
|
||||
wmi_twt_del_dialog_complete_event_id,
|
||||
target_if_twt_teardown_complete_event_handler,
|
||||
WMI_RX_WORK_CTX);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("Failed to register twt del dialog event cb");
|
||||
return status;
|
||||
}
|
||||
|
||||
status = wmi_unified_register_event_handler
|
||||
(wmi_handle,
|
||||
wmi_twt_pause_dialog_complete_event_id,
|
||||
target_if_twt_pause_complete_event_handler,
|
||||
WMI_RX_WORK_CTX);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("Failed to register twt pause dialog event cb");
|
||||
return status;
|
||||
}
|
||||
|
||||
status = wmi_unified_register_event_handler
|
||||
(wmi_handle,
|
||||
wmi_twt_resume_dialog_complete_event_id,
|
||||
target_if_twt_resume_complete_event_handler,
|
||||
WMI_RX_WORK_CTX);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("Failed to register twt resume dialog event cb");
|
||||
return status;
|
||||
}
|
||||
|
||||
status = wmi_unified_register_event_handler
|
||||
(wmi_handle,
|
||||
wmi_twt_nudge_dialog_complete_event_id,
|
||||
target_if_twt_nudge_complete_event_handler,
|
||||
WMI_RX_WORK_CTX);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("Failed to register twt nudge dialog event cb");
|
||||
return status;
|
||||
}
|
||||
|
||||
status = wmi_unified_register_event_handler
|
||||
(wmi_handle,
|
||||
wmi_twt_notify_event_id,
|
||||
target_if_twt_notify_event_handler,
|
||||
WMI_RX_WORK_CTX);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("Failed to register twt notify event cb");
|
||||
return status;
|
||||
}
|
||||
|
||||
status = wmi_unified_register_event_handler
|
||||
(wmi_handle,
|
||||
wmi_twt_ack_complete_event_id,
|
||||
target_if_twt_ack_complete_event_handler,
|
||||
WMI_RX_WORK_CTX);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("Failed to register twt ack event cb");
|
||||
return status;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
target_if_twt_deregister_ext_events(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
struct wmi_unified *wmi_handle;
|
||||
|
||||
if (!psoc) {
|
||||
target_if_err("psoc is NULL!");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("wmi_handle is null");
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
status = wmi_unified_unregister_event_handler(wmi_handle,
|
||||
wmi_twt_add_dialog_complete_event_id);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("Failed to deregister twt add dialog event cb");
|
||||
return status;
|
||||
}
|
||||
|
||||
status = wmi_unified_unregister_event_handler(wmi_handle,
|
||||
wmi_twt_del_dialog_complete_event_id);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("Failed to deregister twt del dialog event cb");
|
||||
return status;
|
||||
}
|
||||
|
||||
status = wmi_unified_unregister_event_handler(wmi_handle,
|
||||
wmi_twt_pause_dialog_complete_event_id);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("Failed to deregister twt pause dialog event cb");
|
||||
return status;
|
||||
}
|
||||
|
||||
status = wmi_unified_unregister_event_handler(wmi_handle,
|
||||
wmi_twt_resume_dialog_complete_event_id);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("Failed to deregister twt resume dialog event");
|
||||
return status;
|
||||
}
|
||||
|
||||
status = wmi_unified_unregister_event_handler(wmi_handle,
|
||||
wmi_twt_nudge_dialog_complete_event_id);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("Failed to deregister twt nudge dialog event cb");
|
||||
return status;
|
||||
}
|
||||
|
||||
status = wmi_unified_unregister_event_handler(wmi_handle,
|
||||
wmi_twt_notify_event_id);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("Failed to deregister twt notify event cb");
|
||||
return status;
|
||||
}
|
||||
|
||||
status = wmi_unified_unregister_event_handler(wmi_handle,
|
||||
wmi_twt_ack_complete_event_id);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("Failed to deregister twt ack complete event cb");
|
||||
return status;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user