1 /*
2 * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
3 * Copyright (c) 2022-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 #if !defined(__NAN_CFG_API_H__)
21 #define __NAN_CFG_API_H__
22
23 /**
24 * DOC: nan_cfg_api.h
25 *
26 * NAN feature INI configuration parameters get/set APIs
27 */
28 #include "qdf_types.h"
29
30 struct wlan_objmgr_psoc;
31
32 #ifdef WLAN_FEATURE_NAN
33 /**
34 * cfg_nan_get_enable() - get NAN support enable status
35 * @psoc: pointer to psoc object
36 *
37 * This function returns NAN enable status
38 */
39 bool cfg_nan_get_enable(struct wlan_objmgr_psoc *psoc);
40
41 /**
42 * cfg_nan_get_datapath_enable() - get NAN Datapath support enable status
43 * @psoc: pointer to psoc object
44 *
45 * This function returns NAN Datapath enable status
46 */
47 bool cfg_nan_get_datapath_enable(struct wlan_objmgr_psoc *psoc);
48
49 /**
50 * cfg_nan_get_ndi_mac_randomize() - get NDI MAC randomize enable status
51 * @psoc: pointer to psoc object
52 *
53 * This function returns NAN Datapath Interface MAC randomization status
54 */
55 bool cfg_nan_get_ndi_mac_randomize(struct wlan_objmgr_psoc *psoc);
56
57 /**
58 * cfg_nan_get_ndp_inactivity_timeout() - get NDP inactivity timeout value
59 * @psoc: pointer to psoc object
60 * @val: pointer to the value where inactivity timeout has to be copied to
61 *
62 * Return: QDF_STATUS
63 */
64 QDF_STATUS cfg_nan_get_ndp_inactivity_timeout(struct wlan_objmgr_psoc *psoc,
65 uint16_t *val);
66
67 /**
68 * cfg_nan_get_ndp_keepalive_period() - get NDP keepalive period
69 * @psoc: pointer to psoc object
70 * @val: pointer to the value where keepalive period has to be copied to
71 *
72 * Return: QDF_STATUS
73 */
74 QDF_STATUS cfg_nan_get_ndp_keepalive_period(struct wlan_objmgr_psoc *psoc,
75 uint16_t *val);
76
77 /**
78 * cfg_nan_get_ndp_max_sessions() - get NDP max sessions host supports
79 * @psoc: pointer to psoc object
80 * @val: pointer to hold max ndp sessions
81 *
82 * Return: QDF_STATUS
83 */
84 QDF_STATUS cfg_nan_get_ndp_max_sessions(struct wlan_objmgr_psoc *psoc,
85 uint32_t *val);
86
87 /**
88 * cfg_nan_get_max_ndi() - get max number of ndi host supports
89 * @psoc: pointer to psoc object
90 * @val: pointer to hold max number of ndi
91 *
92 * Return: QDF_STATUS
93 */
94 QDF_STATUS cfg_nan_get_max_ndi(struct wlan_objmgr_psoc *psoc, uint32_t *val);
95
96 /**
97 * cfg_nan_get_support_mp0_discovery() - get value of config support mp0
98 * discovery
99 * @psoc: pointer to psoc object
100 *
101 * Return: Value of config join clustur with mp
102 */
103 bool cfg_nan_get_support_mp0_discovery(struct wlan_objmgr_psoc *psoc);
104
105 /**
106 * cfg_nan_is_roam_config_disabled() - get value of nan config roam disable
107 * discovery
108 * @psoc: pointer to psoc object
109 *
110 * Return: true on sta roam disable by nan else false
111 */
112 bool cfg_nan_is_roam_config_disabled(struct wlan_objmgr_psoc *psoc);
113
114 /**
115 * cfg_nan_is_eht_cap_enable() - Get NAN EHT capability
116 * @psoc: pointer to psoc object
117 *
118 * Return: Boolean flag indicating whether the NAN EHT capability is
119 * disabled or not
120 */
121 bool cfg_nan_is_eht_cap_enable(struct wlan_objmgr_psoc *psoc);
122 #else
123 static inline
cfg_nan_is_roam_config_disabled(struct wlan_objmgr_psoc * psoc)124 bool cfg_nan_is_roam_config_disabled(struct wlan_objmgr_psoc *psoc)
125 {
126 return false;
127 }
128
cfg_nan_get_enable(struct wlan_objmgr_psoc * psoc)129 static inline bool cfg_nan_get_enable(struct wlan_objmgr_psoc *psoc)
130 {
131 return false;
132 }
133
cfg_nan_get_datapath_enable(struct wlan_objmgr_psoc * psoc)134 static inline bool cfg_nan_get_datapath_enable(struct wlan_objmgr_psoc *psoc)
135 {
136 return false;
137 }
138
cfg_nan_get_ndi_mac_randomize(struct wlan_objmgr_psoc * psoc)139 static inline bool cfg_nan_get_ndi_mac_randomize(struct wlan_objmgr_psoc *psoc)
140 {
141 return false;
142 }
143
144 static inline
cfg_nan_get_ndp_inactivity_timeout(struct wlan_objmgr_psoc * psoc,uint16_t * val)145 QDF_STATUS cfg_nan_get_ndp_inactivity_timeout(struct wlan_objmgr_psoc *psoc,
146 uint16_t *val)
147 {
148 return QDF_STATUS_SUCCESS;
149 }
150
151 static inline
cfg_nan_get_ndp_keepalive_period(struct wlan_objmgr_psoc * psoc,uint16_t * val)152 QDF_STATUS cfg_nan_get_ndp_keepalive_period(struct wlan_objmgr_psoc *psoc,
153 uint16_t *val)
154 {
155 return QDF_STATUS_SUCCESS;
156 }
157
158 static inline
cfg_nan_get_ndp_max_sessions(struct wlan_objmgr_psoc * psoc,uint32_t * val)159 QDF_STATUS cfg_nan_get_ndp_max_sessions(struct wlan_objmgr_psoc *psoc,
160 uint32_t *val)
161 {
162 return QDF_STATUS_SUCCESS;
163 }
164
165 static inline
cfg_nan_get_max_ndi(struct wlan_objmgr_psoc * psoc,uint32_t * val)166 QDF_STATUS cfg_nan_get_max_ndi(struct wlan_objmgr_psoc *psoc, uint32_t *val)
167 {
168 return QDF_STATUS_SUCCESS;
169 }
170
cfg_nan_get_support_mp0_discovery(struct wlan_objmgr_psoc * psoc)171 static inline bool cfg_nan_get_support_mp0_discovery(
172 struct wlan_objmgr_psoc *psoc)
173 {
174 return false;
175 }
176
177
cfg_nan_is_eht_cap_enable(struct wlan_objmgr_psoc * psoc)178 static inline bool cfg_nan_is_eht_cap_enable(struct wlan_objmgr_psoc *psoc)
179 {
180 return false;
181 }
182
183 #endif
184
185 #endif
186
187