xref: /wlan-dirver/qca-wifi-host-cmn/target_if/mlme/vdev_mgr/inc/target_if_vdev_mgr_rx_ops.h (revision 503663c6daafffe652fa360bde17243568cd6d2a)
1 /*
2  * Copyright (c) 2019 The Linux Foundation. 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_vdev_mgr_rx_ops.h
21  *
22  * This file provides declarations for APIs registered for wmi events
23  */
24 
25 #ifndef __TARGET_IF_VDEV_MGR_RX_OPS_H__
26 #define __TARGET_IF_VDEV_MGR_RX_OPS_H__
27 
28 #include <wmi_unified_param.h>
29 #include <wlan_objmgr_psoc_obj.h>
30 #include <wlan_lmac_if_def.h>
31 #include <qdf_platform.h>
32 
33 /**
34  * target_if_vdev_mgr_is_panic_allowed: API to get if panic is allowed on
35  * timeout
36  *
37  * Return: TRUE or FALSE when VDEV_ASSERT_MANAGEMENT is disabled else FALSE
38  */
39 #ifdef VDEV_ASSERT_MANAGEMENT
40 static inline bool target_if_vdev_mgr_is_panic_allowed(void)
41 {
42 	return false;
43 }
44 #else
45 static inline bool target_if_vdev_mgr_is_panic_allowed(void)
46 {
47 	if (qdf_is_recovering() || qdf_is_fw_down())
48 		return false;
49 
50 	return true;
51 }
52 #endif
53 
54 
55 /**
56  * target_if_vdev_mgr_offload_bcn_tx_status_handler() - API to handle beacon
57  * tx status event
58  * @scn: pointer to scan object
59  * @data: pointer to data
60  * @datalen: length of data
61  *
62  * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
63  */
64 int target_if_vdev_mgr_offload_bcn_tx_status_handler(ol_scn_t scn,
65 						     uint8_t *data,
66 						     uint32_t datalen);
67 
68 /**
69  * target_if_vdev_mgr_tbttoffset_update_handler() - API to handle tbtt offset
70  * update event
71  * @scn: pointer to scan object
72  * @data: pointer to data
73  * @datalen: length of data
74  *
75  * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
76  */
77 int target_if_vdev_mgr_tbttoffset_update_handler(ol_scn_t scn,
78 						 uint8_t *data,
79 						 uint32_t datalen);
80 
81 /**
82  * target_if_vdev_mgr_ext_tbttoffset_update_handler() - API to handle ext tbtt
83  * offset update event
84  * @scn: pointer to scan object
85  * @data: pointer to data
86  * @datalen: length of data
87  *
88  * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
89  */
90 int target_if_vdev_mgr_ext_tbttoffset_update_handler(ol_scn_t scn,
91 						     uint8_t *data,
92 						     uint32_t datalen);
93 
94 /**
95  * target_if_vdev_mgr_is_panic_on_bug: API to get panic on bug
96  *
97  * Return: TRUE or FALSE
98  */
99 static inline bool target_if_vdev_mgr_is_panic_on_bug(void)
100 {
101 #ifdef PANIC_ON_BUG
102 	return true;
103 #else
104 	return false;
105 #endif
106 }
107 
108 /**
109  * target_if_vdev_mgr_get_rx_ops() - get rx ops
110  * @psoc: pointer to psoc object
111  *
112  * Return: pointer to rx ops
113  */
114 static inline struct wlan_lmac_if_mlme_rx_ops *
115 target_if_vdev_mgr_get_rx_ops(struct wlan_objmgr_psoc *psoc)
116 {
117 	return &psoc->soc_cb.rx_ops.mops;
118 }
119 
120 /**
121  * target_if_vdev_mgr_rsp_timer_mgmt_cb() - function to handle response timer
122  * @arg: pointer to argument
123  *
124  * Callback timer triggered when response timer expires which pass
125  * vdev as argument
126  *
127  * Return: status of operation.
128  */
129 void target_if_vdev_mgr_rsp_timer_mgmt_cb(void *arg);
130 
131 /**
132  * target_if_vdev_mgr_wmi_event_register() - function to handle register
133  * events from WMI
134  * @psoc: pointer to psoc object
135  *
136  * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
137  */
138 QDF_STATUS target_if_vdev_mgr_wmi_event_register(
139 					struct wlan_objmgr_psoc *psoc);
140 
141 /**
142  * target_if_vdev_mgr_wmi_event_unregister() - function to handle unregister
143  * events from WMI
144  * @psoc: pointer to psoc object
145  *
146  * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
147  */
148 QDF_STATUS target_if_vdev_mgr_wmi_event_unregister(
149 					struct wlan_objmgr_psoc *psoc);
150 
151 /**
152  * target_if_vdev_mgr_rsp_timer_cb() - function to handle vdev related timeouts
153  * @vdev_rsp: pointer to vdev response timer
154  *
155  * Return: NONE
156  */
157 void target_if_vdev_mgr_rsp_timer_cb(struct vdev_response_timer *vdev_rsp);
158 
159 #endif /* __TARGET_IF_VDEV_MGR_RX_OPS_H__ */
160