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