xref: /wlan-dirver/qca-wifi-host-cmn/umac/scan/dispatcher/inc/wlan_scan_api.h (revision 861af9fad3d20cded5a90c420dd1ed901be32691)
1 /*
2  * Copyright (c) 2017-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: contains scan api
21  */
22 
23 #ifndef _WLAN_SCAN_API_H_
24 #define _WLAN_SCAN_API_H_
25 
26 #include <wlan_objmgr_psoc_obj.h>
27 #include <wlan_objmgr_pdev_obj.h>
28 #include <wlan_objmgr_vdev_obj.h>
29 #include "../../core/src/wlan_scan_main.h"
30 
31 /**
32  * wlan_scan_cfg_set_active_2g_dwelltime() - API to set scan active 2g dwelltime
33  * @psoc: pointer to psoc object
34  * @dwell_time: scan active dwell time
35  *
36  * Return: none
37  */
38 void wlan_scan_cfg_set_active_2g_dwelltime(struct wlan_objmgr_psoc *psoc,
39 					   uint32_t dwell_time);
40 
41 /**
42  * wlan_scan_cfg_get_active_2g_dwelltime() - API to get active 2g dwelltime
43  * @psoc: pointer to psoc object
44  * @dwell_time: scan active dwelltime
45  *
46  * Return: scan active dwell time
47  */
48 void wlan_scan_cfg_get_active_2g_dwelltime(struct wlan_objmgr_psoc *psoc,
49 					   uint32_t *dwell_time);
50 
51 /**
52  * wlan_scan_cfg_set_active_dwelltime() - API to set scan active dwelltime
53  * @psoc: pointer to psoc object
54  * @dwell_time: scan active dwell time
55  *
56  * Return: none
57  */
58 void wlan_scan_cfg_set_active_dwelltime(struct wlan_objmgr_psoc *psoc,
59 					uint32_t dwell_time);
60 /**
61  * wlan_scan_cfg_get_active_dwelltime() - API to get active dwelltime
62  * @psoc: pointer to psoc object
63  * @dwell_time: scan active dwelltime
64  *
65  * Return: scan active dwell time
66  */
67 void wlan_scan_cfg_get_active_dwelltime(struct wlan_objmgr_psoc *psoc,
68 					uint32_t *dwell_time);
69 
70 /**
71  * wlan_scan_cfg_set_passive_dwelltime() - API to set scan passive dwelltime
72  * @psoc: pointer to psoc object
73  * @dwell_time: scan passive dwell time
74  *
75  * Return: none
76  */
77 void wlan_scan_cfg_set_passive_dwelltime(struct wlan_objmgr_psoc *psoc,
78 					 uint32_t dwell_time);
79 /**
80  * wlan_scan_cfg_get_passive_dwelltime() - API to get passive dwelltime
81  * @psoc: pointer to psoc object
82  * @dwell_time: scan passive dwelltime
83  *
84  * Return: scan passive dwell time
85  */
86 void wlan_scan_cfg_get_passive_dwelltime(struct wlan_objmgr_psoc *psoc,
87 					 uint32_t *dwell_time);
88 
89 /**
90  * wlan_scan_cfg_get_conc_active_dwelltime() - Get concurrent active dwelltime
91  * @psoc: pointer to psoc object
92  * @dwell_time: scan active dwelltime
93  *
94  * Return: scan concurrent active dwell time
95  */
96 void wlan_scan_cfg_get_conc_active_dwelltime(struct wlan_objmgr_psoc *psoc,
97 					     uint32_t *dwell_time);
98 
99 /**
100  * wlan_scan_cfg_set_conc_active_dwelltime() - Set concurrent active dwelltime
101  * @psoc: pointer to psoc object
102  * @dwell_time: scan active dwelltime
103  *
104  * Return: scan concurrent active dwell time
105  */
106 void wlan_scan_cfg_set_conc_active_dwelltime(struct wlan_objmgr_psoc *psoc,
107 					     uint32_t dwell_time);
108 
109 /**
110  * wlan_scan_cfg_get_conc_passive_dwelltime() - Get passive concurrent dwelltime
111  * @psoc: pointer to psoc object
112  * @dwell_time: scan passive dwelltime
113  *
114  * Return: scan concurrent passive dwell time
115  */
116 void wlan_scan_cfg_get_conc_passive_dwelltime(struct wlan_objmgr_psoc *psoc,
117 					      uint32_t *dwell_time);
118 
119 /**
120  * wlan_scan_cfg_set_conc_passive_dwelltime() - Set passive concurrent dwelltime
121  * @psoc: pointer to psoc object
122  * @dwell_time: scan passive dwelltime
123  *
124  * Return: scan concurrent passive dwell time
125  */
126 void wlan_scan_cfg_set_conc_passive_dwelltime(struct wlan_objmgr_psoc *psoc,
127 					      uint32_t dwell_time);
128 
129 /**
130  * wlan_scan_cfg_honour_nl_scan_policy_flags() - API to get nl scan policy
131  * flags honoured
132  * @psoc: pointer to psoc object
133  *
134  * Return: nl scan policy flags honoured or not
135  */
136 bool wlan_scan_cfg_honour_nl_scan_policy_flags(struct wlan_objmgr_psoc *psoc);
137 
138 /**
139  * wlan_scan_cfg_get_conc_max_resttime() - API to get max rest time
140  * @psoc: pointer to psoc object
141  * @rest_time: scan concurrent max resttime
142  *
143  * Return: scan concurrent max rest time
144  */
145 void wlan_scan_cfg_get_conc_max_resttime(struct wlan_objmgr_psoc *psoc,
146 					 uint32_t *rest_time);
147 
148 /**
149  * wlan_scan_cfg_get_dfs_chan_scan_allowed() - API to get dfs scan enabled
150  * @psoc: pointer to psoc object
151  * @enable_dfs_scan: DFS scan enabled or not.
152  *
153  * Return: None
154  */
155 void wlan_scan_cfg_get_dfs_chan_scan_allowed(struct wlan_objmgr_psoc *psoc,
156 					     bool *enable_dfs_scan);
157 
158 /**
159  * wlan_scan_cfg_set_dfs_chan_scan_allowed() - API to set dfs scan enabled.
160  * @psoc: pointer to psoc object
161  * @enable_dfs_scan: Set dfs scan enabled or not.
162  *
163  * Return: None
164  */
165 void wlan_scan_cfg_set_dfs_chan_scan_allowed(struct wlan_objmgr_psoc *psoc,
166 					     bool enable_dfs_scan);
167 
168 /**
169  * wlan_scan_cfg_get_conc_min_resttime() - API to get concurrent min rest time
170  * @psoc: pointer to psoc object
171  * @rest_time: scan concurrent min rest time
172  *
173  * Return: scan concurrent min rest time
174  */
175 void wlan_scan_cfg_get_conc_min_resttime(struct wlan_objmgr_psoc *psoc,
176 					 uint32_t *rest_time);
177 
178 /**
179  * wlan_scan_is_snr_monitor_enabled() - API to get SNR monitoring enabled or not
180  * @psoc: pointer to psoc object
181  *
182  * Return: enable/disable snr monitor mode.
183  */
184 bool wlan_scan_is_snr_monitor_enabled(struct wlan_objmgr_psoc *psoc);
185 
186 /**
187  * wlan_scan_process_bcn_probe_rx_sync() - handle bcn without posting to
188  * scheduler thread
189  * @psoc: psoc context
190  * @buf: frame buf
191  * @params: rx event params
192  * @frm_type: frame type
193  *
194  * handle bcn without posting to scheduler thread, this should be called
195  * while caller is already in scheduler thread context
196  *
197  * Return: success or error code.
198  */
199 QDF_STATUS
200 wlan_scan_process_bcn_probe_rx_sync(struct wlan_objmgr_psoc *psoc,
201 				    qdf_nbuf_t buf,
202 				    struct mgmt_rx_event_params *rx_param,
203 				    enum mgmt_frame_type frm_type);
204 
205 /**
206  * wlan_scan_get_aging_time  - Get the scan aging time config
207  * @psoc: psoc context
208  *
209  * Return: Scan aging time config
210  */
211 qdf_time_t wlan_scan_get_aging_time(struct wlan_objmgr_psoc *psoc);
212 
213 #endif
214