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 /**
20 * DOC: target_if_twt.h
21 */
22
23 #ifndef _TARGET_IF_TWT_H_
24 #define _TARGET_IF_TWT_H_
25
26 #include <wmi_unified_param.h>
27 #include <wlan_lmac_if_def.h>
28 #include <target_if.h>
29 #include <wlan_twt_public_structs.h>
30
31 #if defined(WLAN_SUPPORT_TWT) && defined(WLAN_TWT_CONV_SUPPORTED)
32 /**
33 * target_if_twt_set_twt_ack_support() - set ack support
34 * @psoc: psoc handle
35 * @val: value
36 *
37 * return: QDF_STATUS
38 */
39 QDF_STATUS
40 target_if_twt_set_twt_ack_support(struct wlan_objmgr_psoc *psoc,
41 bool val);
42
43 /**
44 * target_if_twt_fill_tgt_caps() - fill twt target caps
45 * @psoc: psoc handle
46 * @wmi_handle: wmi handle
47 *
48 * This function populates twt target capability info in twt private psoc object
49 *
50 * return: QDF_STATUS
51 */
52 QDF_STATUS
53 target_if_twt_fill_tgt_caps(struct wlan_objmgr_psoc *psoc,
54 wmi_unified_t wmi_handle);
55
56 /**
57 * target_if_twt_register_tx_ops() - Register twt tx ops
58 * @tx_ops: tx_ops structure
59 *
60 * return: QDF_STATUS
61 */
62 QDF_STATUS
63 target_if_twt_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops);
64
65 /**
66 * target_if_twt_register_events() - Register twt wmi events
67 * @psoc: psoc handle
68 *
69 * Register TWT WMI events
70 *
71 * return: QDF_STATUS
72 */
73 QDF_STATUS
74 target_if_twt_register_events(struct wlan_objmgr_psoc *psoc);
75
76 /**
77 * target_if_twt_deregister_events() - De-register twt wmi events
78 * @psoc: psoc handle
79 *
80 * De-register TWT WMI events
81 *
82 * return: QDF_STATUS
83 */
84 QDF_STATUS
85 target_if_twt_deregister_events(struct wlan_objmgr_psoc *psoc);
86
87 #else
88 static inline
target_if_twt_set_twt_ack_support(struct wlan_objmgr_psoc * psoc,bool val)89 QDF_STATUS target_if_twt_set_twt_ack_support(struct wlan_objmgr_psoc *psoc,
90 bool val)
91 {
92 return QDF_STATUS_SUCCESS;
93 }
94
95 static inline
target_if_twt_fill_tgt_caps(struct wlan_objmgr_psoc * psoc,wmi_unified_t wmi_handle)96 QDF_STATUS target_if_twt_fill_tgt_caps(struct wlan_objmgr_psoc *psoc,
97 wmi_unified_t wmi_handle)
98 {
99 return QDF_STATUS_SUCCESS;
100 }
101
102 static inline
target_if_twt_register_tx_ops(struct wlan_lmac_if_tx_ops * tx_ops)103 QDF_STATUS target_if_twt_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
104 {
105 return QDF_STATUS_SUCCESS;
106 }
107
108 static inline
target_if_twt_register_events(struct wlan_objmgr_psoc * psoc)109 QDF_STATUS target_if_twt_register_events(struct wlan_objmgr_psoc *psoc)
110 {
111 return QDF_STATUS_SUCCESS;
112 }
113
114 static inline
target_if_twt_deregister_events(struct wlan_objmgr_psoc * psoc)115 QDF_STATUS target_if_twt_deregister_events(struct wlan_objmgr_psoc *psoc)
116 {
117 return QDF_STATUS_SUCCESS;
118 }
119
120 #endif
121 #endif /* _TARGET_IF_TWT_H_ */
122