xref: /wlan-dirver/qca-wifi-host-cmn/umac/scan/core/src/wlan_scan_manager.h (revision 1f55ed1a9f5050d8da228aa8dd3fff7c0242aa71)
1 /*
2  * Copyright (c) 2017-2018 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  * Maximum numbers of callback functions that may be invoked
33  * for a particular scan event.
34  */
35 #define MAX_SCAN_EVENT_LISTENERS (MAX_SCAN_EVENT_HANDLERS_PER_PDEV + 1)
36 
37 /**
38  * struct scan_event_listners - listeners interested in a particular scan event
39  * @count: number of listners
40  * @cb: callback handler
41  */
42 struct scan_event_listeners {
43 	uint32_t count;
44 	struct cb_handler cb[MAX_SCAN_EVENT_LISTENERS];
45 };
46 
47 /**
48  * scm_is_scan_allowed() - check if scan is allowed
49  * @vdev: vdev for which scan allowed is check
50  *
51  * Return: true if scan is allowed else false
52  */
53 bool scm_is_scan_allowed(struct wlan_objmgr_vdev *vdev);
54 
55 /**
56  * scm_scan_start_req() - scan start req core api
57  * @msg: scheduler message object containing start scan req params
58  * @req: start scan req params
59  *
60  * The API to start a scan
61  *
62  * Return: QDF_STATUS
63  */
64 QDF_STATUS scm_scan_start_req(struct scheduler_msg *msg);
65 
66 /**
67  * scm_scan_cancel_req() - scan cancel req core api
68  * @msg: scheduler message object containing stop scan params
69  * @req: stop scan params
70  *
71  * The API to cancel a scan
72  *
73  * Return: QDF_STATUS
74  */
75 QDF_STATUS scm_scan_cancel_req(struct scheduler_msg *msg);
76 
77 
78 /**
79  * scm_scan_event_handler() - core scan event handler from tgt interface
80  * @msg: scheduler message object containing scan event
81  *
82  * This function calls registered event handlers of various modules
83  *
84  * Return: QDF_STATUS
85  */
86 QDF_STATUS scm_scan_event_handler(struct scheduler_msg *msg);
87 
88 /**
89  * scm_scan_free_scan_request_mem() - Free scan request memory
90  * @req: scan_start_request object
91  *
92  * Return: QDF_STATUS
93  */
94 QDF_STATUS scm_scan_free_scan_request_mem(struct scan_start_request *req);
95 
96 /**
97  * scm_scan_event_flush_callback() - flush scan event
98  * @msg: scheduler message object containing scan event
99  *
100  * This function call is invoked when scheduler thread is going down
101  *
102  * Return: QDF_STATUS
103  */
104 QDF_STATUS scm_scan_event_flush_callback(struct scheduler_msg *msg);
105 
106 /**
107  * scm_bcn_probe_flush_callback() - flush beacon/probe response
108  * @msg: scheduler message object containing scan event
109  *
110  * This function call is invoked when scheduler thread is going down
111  *
112  * Return: QDF_STATUS
113  */
114 QDF_STATUS scm_bcn_probe_flush_callback(struct scheduler_msg *msg);
115 
116 /**
117  * scm_scan_start_flush_callback() - flush scan start request
118  * @msg: scheduler message object containing scan event
119  *
120  * This function call is invoked when scheduler thread is going down
121  *
122  * Return: QDF_STATUS
123  */
124 QDF_STATUS scm_scan_start_flush_callback(struct scheduler_msg *msg);
125 
126 /**
127  * scm_scan_cancel_flush_callback() - flush scan cancel request
128  * @msg: scheduler message object containing scan event
129  *
130  * This function call is invoked when scheduler thread is going down
131  *
132  * Return: QDF_STATUS
133  */
134 QDF_STATUS scm_scan_cancel_flush_callback(struct scheduler_msg *msg);
135 
136 #endif
137