xref: /wlan-dirver/qca-wifi-host-cmn/umac/scan/core/src/wlan_scan_manager.h (revision 45a38684b07295822dc8eba39e293408f203eec8)
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 
31 /**
32  * struct scan_event_listners - listeners interested in a particular scan event
33  * @count: number of listners
34  * @cb: callback handler
35  */
36 struct scan_event_listeners {
37 	uint32_t count;
38 	struct cb_handler cb[MAX_SCAN_EVENT_LISTENERS];
39 };
40 
41 /**
42  * scm_is_scan_allowed() - check if scan is allowed
43  * @vdev: vdev for which scan allowed is check
44  *
45  * Return: true if scan is allowed else false
46  */
47 bool scm_is_scan_allowed(struct wlan_objmgr_vdev *vdev);
48 
49 /**
50  * scm_scan_start_req() - scan start req core api
51  * @msg: scheduler message object containing start scan req params
52  * @req: start scan req params
53  *
54  * The API to start a scan
55  *
56  * Return: QDF_STATUS
57  */
58 QDF_STATUS scm_scan_start_req(struct scheduler_msg *msg);
59 
60 /**
61  * scm_scan_cancel_req() - scan cancel req core api
62  * @msg: scheduler message object containing stop scan params
63  * @req: 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 #endif
131