1 /*
2  * Copyright (c) 2017,2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 /*
21  * DOC: contains scan south bound interface definitions
22  */
23 
24 #ifndef _WLAN_SCAN_TGT_API_H_
25 #define _WLAN_SCAN_TGT_API_H_
26 
27 #include <wlan_objmgr_psoc_obj.h>
28 #include <wlan_objmgr_pdev_obj.h>
29 #include <wlan_objmgr_vdev_obj.h>
30 #include <wlan_objmgr_peer_obj.h>
31 #include <wlan_scan_public_structs.h>
32 #include <wlan_mgmt_txrx_utils_api.h>
33 
34 /**
35  * tgt_scan_bcn_probe_rx_callback() - The callbeack registered to tx/rx module
36  * @psoc: psoc context
37  * @peer: peer
38  * @buf: frame buf
39  * @rx_param: rx event params
40  * @frm_type: frame type
41  *
42  * The callbeack registered to tx/rx module and is called when beacon
43  * or probe resp is received. This will post a msg to target_if queue.
44  *
45  * Return: success or error code.
46  */
47 QDF_STATUS tgt_scan_bcn_probe_rx_callback(struct wlan_objmgr_psoc *psoc,
48 	struct wlan_objmgr_peer *peer, qdf_nbuf_t buf,
49 	struct mgmt_rx_event_params *rx_param,
50 	enum mgmt_frame_type frm_type);
51 
52 /**
53  * tgt_scan_event_handler() - The callbeack registered to WMI for scan events
54  * @psoc: psoc handle
55  * @event_info: event info
56  *
57  * The callbeack registered to WMI for scan events and is called
58  * event for scan is received. This will post a msg to target_if queue.
59  *
60  * Return: 0 for success or error code.
61  */
62 QDF_STATUS
63 tgt_scan_event_handler(struct wlan_objmgr_psoc *psoc,
64 	struct scan_event_info *event_info);
65 
66 #ifdef FEATURE_WLAN_SCAN_PNO
67 
68 /**
69  * tgt_scan_pno_start() - invoke lmac send PNO start req
70  * @vdev: vdev pointer
71  * @req: pno req params
72  *
73  * Return: 0 for success or error code.
74  */
75 QDF_STATUS tgt_scan_pno_start(struct wlan_objmgr_vdev *vdev,
76 	struct pno_scan_req_params *req);
77 
78 /**
79  * tgt_scan_pno_stop() - invoke lmac send PNO stop req
80  * @vdev: vdev pointer
81  * @vdev_id: pno req params
82  *
83  * Return: 0 for success or error code.
84  */
85 QDF_STATUS tgt_scan_pno_stop(struct wlan_objmgr_vdev *vdev,
86 	uint8_t vdev_id);
87 
88 #endif
89 
90 /**
91  * tgt_scan_obss_disable() - invoke lmac disable obss scan req
92  * @vdev: vdev pointer
93  *
94  *
95  * Return: QDF_STATUS_SUCCESS for success or error code.
96  */
97 QDF_STATUS tgt_scan_obss_disable(struct wlan_objmgr_vdev *vdev);
98 
99 /**
100  * tgt_scan_start() - invoke lmac scan start
101  * @req: scan request object
102  *
103  * This API invokes lmac API function to start scan
104  *
105  * Return: QDF_STATUS_SUCCESS for success or error code.
106  */
107 QDF_STATUS
108 tgt_scan_start(struct scan_start_request *req);
109 
110 
111 /**
112  * tgt_scan_cancel() - invoke lmac scan cancel
113  * @req: scan request object
114  *
115  * This API invokes lmac API function to cancel scan
116  *
117  * Return: QDF_STATUS_SUCCESS for success or error code.
118  */
119 QDF_STATUS
120 tgt_scan_cancel(struct scan_cancel_request *req);
121 
122 /**
123  * tgt_scan_register_ev_handler() - invoke lmac register scan event handler
124  * @psoc: psoc object
125  *
126  * This API invokes lmac API function to register for scan events
127  *
128  * Return: QDF_STATUS_SUCCESS for success or error code.
129  */
130 QDF_STATUS
131 tgt_scan_register_ev_handler(struct wlan_objmgr_psoc *psoc);
132 
133 /**
134  * tgt_scan_unregister_ev_handler() - invoke lmac unregister scan event handler
135  * @psoc: psoc object
136  *
137  * This API invokes lmac API function to unregister for scan events
138  *
139  * Return: QDF_STATUS_SUCCESS for success or error code.
140  */
141 QDF_STATUS
142 tgt_scan_unregister_ev_handler(struct wlan_objmgr_psoc *psoc);
143 
144 /**
145  * tgt_scan_set_max_active_scans() - lmac handler to set max active scans
146  * @psoc: psoc object
147  * @max_active_scans: maximum active scans allowed on underlying psoc
148  *
149  * Return: QDF_STATUS
150  */
151 QDF_STATUS
152 tgt_scan_set_max_active_scans(struct wlan_objmgr_psoc *psoc,
153 		uint32_t max_active_scans);
154 
155 #endif
156