1 /*
2  * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 /**
21  * DOC: This file contains APIs of EXTSCAN component
22  */
23 
24 #ifndef _WLAN_EXTSCAN_API_H_
25 #define _WLAN_EXTSCAN_API_H_
26 
27 #include <wlan_objmgr_psoc_obj.h>
28 #include <wlan_objmgr_pdev_obj.h>
29 #include <wlan_objmgr_vdev_obj.h>
30 #include "../../core/src/wlan_scan_main.h"
31 
32 #ifdef FEATURE_WLAN_EXTSCAN
33 
34 /**
35  * extscan_get_enable() - API to get extscan enable value
36  * @psoc: pointer to psoc object
37  *
38  * Return: true if enabled else false.
39  */
40 bool extscan_get_enable(struct wlan_objmgr_psoc *psoc);
41 
42 /**
43  * extscan_get_passive_max_time() - API to get passive
44  *					max channel time
45  * @psoc: pointer to psoc object
46  * @passive_max_chn_time: extscan passive max channel time
47  *
48  * Return: none
49  */
50 void extscan_get_passive_max_time(struct wlan_objmgr_psoc *psoc,
51 				  uint32_t *passive_max_chn_time);
52 
53 /**
54  * extscan_get_active_max_time() - API to get active
55  *					max channel time
56  * @psoc: pointer to psoc object
57  * @active_max_chn_time: extscan active max channel time
58  *
59  * Return: none
60  */
61 void extscan_get_active_max_time(struct wlan_objmgr_psoc *psoc,
62 				 uint32_t *active_max_chn_time);
63 
64 /**
65  * extscan_get_active_min_time() - API to set active
66  *					min channel time
67  * @psoc: pointer to psoc object
68  * @active_min_chn_time: extscan active min channel time
69  *
70  * Return: none
71  */
72 void extscan_get_active_min_time(struct wlan_objmgr_psoc *psoc,
73 				 uint32_t *active_min_chn_time);
74 
75 /**
76  * wlan_extscan_global_init() - Initialize extscan
77  * @psoc: pointer to psoc object
78  * @scan_obj: pointer to scan object
79  *
80  * Return: QDF_STATUS
81  */
82 QDF_STATUS
83 wlan_extscan_global_init(struct wlan_objmgr_psoc *psoc,
84 			 struct wlan_scan_obj *scan_obj);
85 
86 /**
87  * wlan_extscan_global_deinit() - Deinitialize extscan
88  *
89  * Return: QDF_STATUS
90  */
91 QDF_STATUS
92 wlan_extscan_global_deinit(void);
93 
94 #else
95 
96 static inline
cfg_extscan_get_enable(struct wlan_objmgr_psoc * psoc)97 bool cfg_extscan_get_enable(struct wlan_objmgr_psoc *psoc)
98 {
99 	return false;
100 }
101 
102 static inline
cfg_extscan_get_passive_max_time(struct wlan_objmgr_psoc * psoc,uint32_t * passive_max_chn_time)103 void cfg_extscan_get_passive_max_time(struct wlan_objmgr_psoc *psoc,
104 				      uint32_t *passive_max_chn_time)
105 {
106 }
107 
108 static inline
cfg_extscan_get_active_max_time(struct wlan_objmgr_psoc * psoc,uint32_t * active_max_chn_time)109 void cfg_extscan_get_active_max_time(struct wlan_objmgr_psoc *psoc,
110 				     uint32_t *active_max_chn_time)
111 {
112 }
113 
114 static inline
cfg_extscan_get_active_min_time(struct wlan_objmgr_psoc * psoc,uint32_t * active_min_chn_time)115 void cfg_extscan_get_active_min_time(struct wlan_objmgr_psoc *psoc,
116 				     uint32_t *active_min_chn_time)
117 {
118 }
119 
120 static inline QDF_STATUS
wlan_extscan_global_init(struct wlan_objmgr_psoc * psoc,struct wlan_scan_obj * scan_obj)121 wlan_extscan_global_init(struct wlan_objmgr_psoc *psoc,
122 			 struct wlan_scan_obj *scan_obj)
123 {
124 	return QDF_STATUS_SUCCESS;
125 }
126 
wlan_extscan_global_deinit(void)127 static inline QDF_STATUS wlan_extscan_global_deinit(void)
128 {
129 	return QDF_STATUS_SUCCESS;
130 }
131 
132 #endif
133 #endif
134