xref: /wlan-dirver/qca-wifi-host-cmn/umac/scan/dispatcher/inc/wlan_scan_api.h (revision dd4dc88b837a295134aa9869114a2efee0f4894b)
1 /*
2  * Copyright (c) 2017-2019 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_dwelltime() - API to set scan active 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_dwelltime(struct wlan_objmgr_psoc *psoc,
39 					uint32_t dwell_time);
40 /**
41  * wlan_scan_cfg_get_active_dwelltime() - API to get active dwelltime
42  * @psoc: pointer to psoc object
43  * @dwell_time: scan active dwelltime
44  *
45  * Return: scan active dwell time
46  */
47 void wlan_scan_cfg_get_active_dwelltime(struct wlan_objmgr_psoc *psoc,
48 					uint32_t *dwell_time);
49 
50 /**
51  * wlan_scan_cfg_set_passive_dwelltime() - API to set scan passive dwelltime
52  * @psoc: pointer to psoc object
53  * @dwell_time: scan passive dwell time
54  *
55  * Return: none
56  */
57 void wlan_scan_cfg_set_passive_dwelltime(struct wlan_objmgr_psoc *psoc,
58 					 uint32_t dwell_time);
59 /**
60  * wlan_scan_cfg_get_passive_dwelltime() - API to get passive dwelltime
61  * @psoc: pointer to psoc object
62  * @dwell_time: scan passive dwelltime
63  *
64  * Return: scan passive dwell time
65  */
66 void wlan_scan_cfg_get_passive_dwelltime(struct wlan_objmgr_psoc *psoc,
67 					 uint32_t *dwell_time);
68 
69 /**
70  * wlan_scan_cfg_get_conc_active_dwelltime() - Get concurrent active dwelltime
71  * @psoc: pointer to psoc object
72  * @dwell_time: scan active dwelltime
73  *
74  * Return: scan concurrent active dwell time
75  */
76 void wlan_scan_cfg_get_conc_active_dwelltime(struct wlan_objmgr_psoc *psoc,
77 					     uint32_t *dwell_time);
78 
79 /**
80  * wlan_scan_cfg_set_conc_active_dwelltime() - Set concurrent active dwelltime
81  * @psoc: pointer to psoc object
82  * @dwell_time: scan active dwelltime
83  *
84  * Return: scan concurrent active dwell time
85  */
86 void wlan_scan_cfg_set_conc_active_dwelltime(struct wlan_objmgr_psoc *psoc,
87 					     uint32_t dwell_time);
88 
89 /**
90  * wlan_scan_cfg_get_conc_passive_dwelltime() - Get passive concurrent dwelltime
91  * @psoc: pointer to psoc object
92  * @dwell_time: scan passive dwelltime
93  *
94  * Return: scan concurrent passive dwell time
95  */
96 void wlan_scan_cfg_get_conc_passive_dwelltime(struct wlan_objmgr_psoc *psoc,
97 					      uint32_t *dwell_time);
98 
99 /**
100  * wlan_scan_cfg_set_conc_passive_dwelltime() - Set passive concurrent dwelltime
101  * @psoc: pointer to psoc object
102  * @dwell_time: scan passive dwelltime
103  *
104  * Return: scan concurrent passive dwell time
105  */
106 void wlan_scan_cfg_set_conc_passive_dwelltime(struct wlan_objmgr_psoc *psoc,
107 					      uint32_t dwell_time);
108 
109 /**
110  * wlan_scan_cfg_honour_nl_scan_policy_flags() - API to get nl scan policy
111  * flags honoured
112  * @psoc: pointer to psoc object
113  *
114  * Return: nl scan policy flags honoured or not
115  */
116 bool wlan_scan_cfg_honour_nl_scan_policy_flags(struct wlan_objmgr_psoc *psoc);
117 
118 /**
119  * wlan_scan_cfg_get_conc_max_resttime() - API to get max rest time
120  * @psoc: pointer to psoc object
121  * @rest_time: scan concurrent max resttime
122  *
123  * Return: scan concurrent max rest time
124  */
125 void wlan_scan_cfg_get_conc_max_resttime(struct wlan_objmgr_psoc *psoc,
126 					 uint32_t *rest_time);
127 
128 /**
129  * wlan_scan_cfg_get_dfs_chan_scan_allowed() - API to get dfs scan enabled
130  * @psoc: pointer to psoc object
131  * @enable_dfs_scan: DFS scan enabled or not.
132  *
133  * Return: None
134  */
135 void wlan_scan_cfg_get_dfs_chan_scan_allowed(struct wlan_objmgr_psoc *psoc,
136 					     bool *enable_dfs_scan);
137 
138 /**
139  * wlan_scan_cfg_set_dfs_chan_scan_allowed() - API to set dfs scan enabled.
140  * @psoc: pointer to psoc object
141  * @enable_dfs_scan: Set dfs scan enabled or not.
142  *
143  * Return: None
144  */
145 void wlan_scan_cfg_set_dfs_chan_scan_allowed(struct wlan_objmgr_psoc *psoc,
146 					     bool enable_dfs_scan);
147 
148 /**
149  * wlan_scan_cfg_get_conc_min_resttime() - API to get concurrent min rest time
150  * @psoc: pointer to psoc object
151  * @rest_time: scan concurrent min rest time
152  *
153  * Return: scan concurrent min rest time
154  */
155 void wlan_scan_cfg_get_conc_min_resttime(struct wlan_objmgr_psoc *psoc,
156 					 uint32_t *rest_time);
157 
158 /**
159  * wlan_scan_is_snr_monitor_enabled() - API to get SNR monitoring enabled or not
160  * @psoc: pointer to psoc object
161  *
162  * Return: enable/disable snr monitor mode.
163  */
164 bool wlan_scan_is_snr_monitor_enabled(struct wlan_objmgr_psoc *psoc);
165 
166 /**
167  * wlan_scan_process_bcn_probe_rx_sync() - handle bcn without posting to
168  * scheduler thread
169  * @psoc: psoc context
170  * @buf: frame buf
171  * @params: rx event params
172  * @frm_type: frame type
173  *
174  * handle bcn without posting to scheduler thread, this should be called
175  * while caller is already in scheduler thread context
176  *
177  * Return: success or error code.
178  */
179 QDF_STATUS
180 wlan_scan_process_bcn_probe_rx_sync(struct wlan_objmgr_psoc *psoc,
181 				    qdf_nbuf_t buf,
182 				    struct mgmt_rx_event_params *rx_param,
183 				    enum mgmt_frame_type frm_type);
184 
185 #endif
186