1 /*
2  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
3  * Copyright (c) 2017-2018, 2020-2021 The Linux Foundation. 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: Defines internal scan manager api
22  * Core routines which deal with starting a scan,
23  * serializing scan requests, scan cancellation, scan completion,
24  * scan event processing.
25  */
26 
27 #ifndef _WLAN_SCAN_MANAGER_API_H_
28 #define _WLAN_SCAN_MANAGER_API_H_
29 
30 #include "wlan_scan_main.h"
31 #include "wlan_scan_manager_6ghz.h"
32 
33 /**
34  * struct scan_event_listeners - listeners interested in a particular scan event
35  * @count: number of listeners
36  * @cb: callback handler
37  */
38 struct scan_event_listeners {
39 	uint32_t count;
40 	struct cb_handler cb[MAX_SCAN_EVENT_LISTENERS];
41 };
42 
43 /**
44  * scm_is_scan_allowed() - check if scan is allowed
45  * @vdev: vdev for which scan allowed is check
46  *
47  * Return: true if scan is allowed else false
48  */
49 bool scm_is_scan_allowed(struct wlan_objmgr_vdev *vdev);
50 
51 /**
52  * scm_scan_start_req() - scan start req core api
53  * @msg: scheduler message object containing start scan req params
54  *
55  * The API to start a scan
56  *
57  * Return: QDF_STATUS
58  */
59 QDF_STATUS scm_scan_start_req(struct scheduler_msg *msg);
60 
61 /**
62  * scm_scan_cancel_req() - scan cancel req core api
63  * @msg: scheduler message object containing stop scan params
64  *
65  * The API to cancel a scan
66  *
67  * Return: QDF_STATUS
68  */
69 QDF_STATUS scm_scan_cancel_req(struct scheduler_msg *msg);
70 
71 
72 /**
73  * scm_scan_event_handler() - core scan event handler from tgt interface
74  * @msg: scheduler message object containing scan event
75  *
76  * This function calls registered event handlers of various modules
77  *
78  * Return: QDF_STATUS
79  */
80 QDF_STATUS scm_scan_event_handler(struct scheduler_msg *msg);
81 
82 /**
83  * scm_scan_free_scan_request_mem() - Free scan request memory
84  * @req: scan_start_request object
85  *
86  * Return: QDF_STATUS
87  */
88 QDF_STATUS scm_scan_free_scan_request_mem(struct scan_start_request *req);
89 
90 /**
91  * scm_scan_event_flush_callback() - flush scan event
92  * @msg: scheduler message object containing scan event
93  *
94  * This function call is invoked when scheduler thread is going down
95  *
96  * Return: QDF_STATUS
97  */
98 QDF_STATUS scm_scan_event_flush_callback(struct scheduler_msg *msg);
99 
100 /**
101  * scm_bcn_probe_flush_callback() - flush beacon/probe response
102  * @msg: scheduler message object containing scan event
103  *
104  * This function call is invoked when scheduler thread is going down
105  *
106  * Return: QDF_STATUS
107  */
108 QDF_STATUS scm_bcn_probe_flush_callback(struct scheduler_msg *msg);
109 
110 /**
111  * scm_scan_start_flush_callback() - flush scan start request
112  * @msg: scheduler message object containing scan event
113  *
114  * This function call is invoked when scheduler thread is going down
115  *
116  * Return: QDF_STATUS
117  */
118 QDF_STATUS scm_scan_start_flush_callback(struct scheduler_msg *msg);
119 
120 /**
121  * scm_scan_cancel_flush_callback() - flush scan cancel request
122  * @msg: scheduler message object containing scan event
123  *
124  * This function call is invoked when scheduler thread is going down
125  *
126  * Return: QDF_STATUS
127  */
128 QDF_STATUS scm_scan_cancel_flush_callback(struct scheduler_msg *msg);
129 
130 /**
131  * scm_disable_obss_pdev_scan() - Public API to disable pdev obss scan
132  * @psoc: psoc pointer
133  * @pdev: pdev pointer
134  *
135  * Return: void
136  */
137 void scm_disable_obss_pdev_scan(struct wlan_objmgr_psoc *psoc,
138 				struct wlan_objmgr_pdev *pdev);
139 
140 #endif
141