1 /*
2 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for
5 * any purpose with or without fee is hereby granted, provided that the
6 * above copyright notice and this permission notice appear in all
7 * copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 * PERFORMANCE OF THIS SOFTWARE.
17 */
18 /**
19 * DOC: wlan_twt_tgt_if_ext_rx_api.c
20 *
21 * This file provide definition for APIs registered for LMAC TWT Rx Ops
22 */
23 #include <qdf_types.h>
24 #include <wlan_objmgr_psoc_obj.h>
25 #include <wlan_twt_public_structs.h>
26 #include <wlan_twt_tgt_if_ext_rx_ops.h>
27 #include "twt/core/src/wlan_twt_main.h"
28
29 static QDF_STATUS
tgt_twt_setup_complete_resp_handler(struct wlan_objmgr_psoc * psoc,struct twt_add_dialog_complete_event * event)30 tgt_twt_setup_complete_resp_handler(struct wlan_objmgr_psoc *psoc,
31 struct twt_add_dialog_complete_event *event)
32 {
33 return wlan_twt_setup_complete_event_handler(psoc, event);
34 }
35
36 static QDF_STATUS
tgt_twt_teardown_complete_resp_handler(struct wlan_objmgr_psoc * psoc,struct twt_del_dialog_complete_event_param * event)37 tgt_twt_teardown_complete_resp_handler(struct wlan_objmgr_psoc *psoc,
38 struct twt_del_dialog_complete_event_param *event)
39 {
40 return wlan_twt_teardown_complete_event_handler(psoc, event);
41 }
42
43 static QDF_STATUS
tgt_twt_pause_complete_resp_handler(struct wlan_objmgr_psoc * psoc,struct twt_pause_dialog_complete_event_param * event)44 tgt_twt_pause_complete_resp_handler(struct wlan_objmgr_psoc *psoc,
45 struct twt_pause_dialog_complete_event_param *event)
46 {
47 return wlan_twt_pause_complete_event_handler(psoc, event);
48 }
49
50 static QDF_STATUS
tgt_twt_resume_complete_resp_handler(struct wlan_objmgr_psoc * psoc,struct twt_resume_dialog_complete_event_param * event)51 tgt_twt_resume_complete_resp_handler(struct wlan_objmgr_psoc *psoc,
52 struct twt_resume_dialog_complete_event_param *event)
53 {
54 return wlan_twt_resume_complete_event_handler(psoc, event);
55 }
56
57 static QDF_STATUS
tgt_twt_nudge_complete_resp_handler(struct wlan_objmgr_psoc * psoc,struct twt_nudge_dialog_complete_event_param * event)58 tgt_twt_nudge_complete_resp_handler(struct wlan_objmgr_psoc *psoc,
59 struct twt_nudge_dialog_complete_event_param *event)
60 {
61 return wlan_twt_nudge_complete_event_handler(psoc, event);
62 }
63
64 static QDF_STATUS
tgt_twt_notify_complete_resp_handler(struct wlan_objmgr_psoc * psoc,struct twt_notify_event_param * event)65 tgt_twt_notify_complete_resp_handler(struct wlan_objmgr_psoc *psoc,
66 struct twt_notify_event_param *event)
67 {
68 return wlan_twt_notify_event_handler(psoc, event);
69 }
70
71 static QDF_STATUS
tgt_twt_ack_complete_resp_handler(struct wlan_objmgr_psoc * psoc,struct twt_ack_complete_event_param * event)72 tgt_twt_ack_complete_resp_handler(struct wlan_objmgr_psoc *psoc,
73 struct twt_ack_complete_event_param *event)
74 {
75 return wlan_twt_ack_event_handler(psoc, event);
76 }
77
tgt_twt_register_ext_rx_ops(struct wlan_lmac_if_rx_ops * rx_ops)78 void tgt_twt_register_ext_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops)
79 {
80 struct wlan_lmac_if_twt_rx_ops *twt_rx_ops = &rx_ops->twt_rx_ops;
81
82 twt_rx_ops->twt_setup_comp_cb = tgt_twt_setup_complete_resp_handler;
83 twt_rx_ops->twt_teardown_comp_cb =
84 tgt_twt_teardown_complete_resp_handler;
85 twt_rx_ops->twt_pause_comp_cb = tgt_twt_pause_complete_resp_handler;
86 twt_rx_ops->twt_resume_comp_cb = tgt_twt_resume_complete_resp_handler;
87 twt_rx_ops->twt_nudge_comp_cb = tgt_twt_nudge_complete_resp_handler;
88 twt_rx_ops->twt_notify_comp_cb = tgt_twt_notify_complete_resp_handler;
89 twt_rx_ops->twt_ack_comp_cb = tgt_twt_ack_complete_resp_handler;
90 }
91
92