xref: /wlan-dirver/qca-wifi-host-cmn/umac/scan/core/src/wlan_scan_manager.h (revision 901120c066e139c7f8a2c8e4820561fdd83c67ef)
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_listners - 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  * @req: start scan req params
55  *
56  * The API to start a scan
57  *
58  * Return: QDF_STATUS
59  */
60 QDF_STATUS scm_scan_start_req(struct scheduler_msg *msg);
61 
62 /**
63  * scm_scan_cancel_req() - scan cancel req core api
64  * @msg: scheduler message object containing stop scan params
65  * @req: stop scan params
66  *
67  * The API to cancel a scan
68  *
69  * Return: QDF_STATUS
70  */
71 QDF_STATUS scm_scan_cancel_req(struct scheduler_msg *msg);
72 
73 
74 /**
75  * scm_scan_event_handler() - core scan event handler from tgt interface
76  * @msg: scheduler message object containing scan event
77  *
78  * This function calls registered event handlers of various modules
79  *
80  * Return: QDF_STATUS
81  */
82 QDF_STATUS scm_scan_event_handler(struct scheduler_msg *msg);
83 
84 /**
85  * scm_scan_free_scan_request_mem() - Free scan request memory
86  * @req: scan_start_request object
87  *
88  * Return: QDF_STATUS
89  */
90 QDF_STATUS scm_scan_free_scan_request_mem(struct scan_start_request *req);
91 
92 /**
93  * scm_scan_event_flush_callback() - flush scan event
94  * @msg: scheduler message object containing scan event
95  *
96  * This function call is invoked when scheduler thread is going down
97  *
98  * Return: QDF_STATUS
99  */
100 QDF_STATUS scm_scan_event_flush_callback(struct scheduler_msg *msg);
101 
102 /**
103  * scm_bcn_probe_flush_callback() - flush beacon/probe response
104  * @msg: scheduler message object containing scan event
105  *
106  * This function call is invoked when scheduler thread is going down
107  *
108  * Return: QDF_STATUS
109  */
110 QDF_STATUS scm_bcn_probe_flush_callback(struct scheduler_msg *msg);
111 
112 /**
113  * scm_scan_start_flush_callback() - flush scan start request
114  * @msg: scheduler message object containing scan event
115  *
116  * This function call is invoked when scheduler thread is going down
117  *
118  * Return: QDF_STATUS
119  */
120 QDF_STATUS scm_scan_start_flush_callback(struct scheduler_msg *msg);
121 
122 /**
123  * scm_scan_cancel_flush_callback() - flush scan cancel request
124  * @msg: scheduler message object containing scan event
125  *
126  * This function call is invoked when scheduler thread is going down
127  *
128  * Return: QDF_STATUS
129  */
130 QDF_STATUS scm_scan_cancel_flush_callback(struct scheduler_msg *msg);
131 
132 /**
133  * scm_disable_obss_pdev_scan() - Public API to disable pdev obss scan
134  * @psoc: psoc pointer
135  * @pdev: pdev pointer
136  *
137  * Return: void
138  */
139 void scm_disable_obss_pdev_scan(struct wlan_objmgr_psoc *psoc,
140 				struct wlan_objmgr_pdev *pdev);
141 
142 #endif
143