xref: /wlan-driver/qca-wifi-host-cmn/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_ucfg_api.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021-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: wlan_vdev_mgr_ucfg_api.h
22  *
23  * This header file provides definitions to data structures required
24  * for mlme ucfg and declarations for ucfg public APIs
25  */
26 
27 #ifndef __WLAN_VDEV_MGR_UCFG_API_H__
28 #define __WLAN_VDEV_MGR_UCFG_API_H__
29 
30 #include <wlan_objmgr_vdev_obj.h>
31 #include <wlan_vdev_mgr_tgt_if_tx_defs.h>
32 #include <qdf_nbuf.h>
33 #include <include/wlan_vdev_mlme.h>
34 
35 enum wlan_mlme_cfg_id {
36 	WLAN_MLME_CFG_DTIM_PERIOD,
37 	WLAN_MLME_CFG_SLOT_TIME,
38 	WLAN_MLME_CFG_PROTECTION_MODE,
39 	WLAN_MLME_CFG_BEACON_INTERVAL,
40 	WLAN_MLME_CFG_LDPC,
41 	WLAN_MLME_CFG_NSS,
42 	WLAN_MLME_CFG_TSF_ADJUST,
43 	WLAN_MLME_CFG_ASSOC_ID,
44 	WLAN_MLME_CFG_VHT_CAPS,
45 	WLAN_MLME_CFG_SUBFER,
46 	WLAN_MLME_CFG_MUBFER,
47 	WLAN_MLME_CFG_SUBFEE,
48 	WLAN_MLME_CFG_MUBFEE,
49 	WLAN_MLME_CFG_IMLICIT_BF,
50 	WLAN_MLME_CFG_SOUNDING_DIM,
51 	WLAN_MLME_CFG_BFEE_STS_CAP,
52 	WLAN_MLME_CFG_TXBF_CAPS,
53 	WLAN_MLME_CFG_HT_CAPS,
54 	WLAN_MLME_CFG_HE_OPS,
55 	WLAN_MLME_CFG_RTS_THRESHOLD,
56 	WLAN_MLME_CFG_FRAG_THRESHOLD,
57 	WLAN_MLME_CFG_PROBE_DELAY,
58 	WLAN_MLME_CFG_REPEAT_PROBE_TIME,
59 	WLAN_MLME_CFG_DROP_UNENCRY,
60 	WLAN_MLME_CFG_TX_PWR_LIMIT,
61 	WLAN_MLME_CFG_TX_POWER,
62 	WLAN_MLME_CFG_AMPDU,
63 	WLAN_MLME_CFG_AMPDU_SIZE,
64 	WLAN_MLME_CFG_AMSDU,
65 	WLAN_MLME_CFG_AMSDU_SIZE,
66 	WLAN_MLME_CFG_SSID,
67 	WLAN_MLME_CFG_SSID_LEN,
68 	WLAN_MLME_CFG_OP_MODE,
69 	WLAN_MLME_CFG_BMISS_FIRST_BCNT,
70 	WLAN_MLME_CFG_BMISS_FINAL_BCNT,
71 	WLAN_MLME_CFG_MIN_IDLE_INACTIVE_TIME,
72 	WLAN_MLME_CFG_MAX_IDLE_INACTIVE_TIME,
73 	WLAN_MLME_CFG_MAX_UNRESPONSIVE_INACTIVE_TIME,
74 	WLAN_MLME_CFG_RATE_FLAGS,
75 	WLAN_MLME_CFG_PER_BAND_TX_MGMT_RATE,
76 	WLAN_MLME_CFG_MAX_RATE,
77 	WLAN_MLME_CFG_TX_MGMT_RATE,
78 	WLAN_MLME_CFG_TX_MGMT_RATE_CODE,
79 	WLAN_MLME_CFG_TX_RTSCTS_RATE,
80 	WLAN_MLME_CFG_TX_CHAINMASK,
81 	WLAN_MLME_CFG_RX_CHAINMASK,
82 	WLAN_MLME_CFG_PKT_POWERSAVE,
83 	WLAN_MLME_CFG_MAX_LI_OF_MODDTIM,
84 	WLAN_MLME_CFG_DYNDTIM_CNT,
85 	WLAN_MLME_CFG_LISTEN_INTERVAL,
86 	WLAN_MLME_CFG_MODDTIM_CNT,
87 	WLAN_MLME_CFG_BEACON_BUFFER,
88 	WLAN_MLME_CFG_BEACON_OFFSETS,
89 	WLAN_MLME_CFG_PROFILE_IDX,
90 	WLAN_MLME_CFG_PROFILE_NUM,
91 	WLAN_MLME_CFG_MBSSID_FLAGS,
92 	WLAN_MLME_CFG_VDEVID_TRANS,
93 	WLAN_MLME_CFG_TRANS_BSSID,
94 	WLAN_MLME_CFG_TYPE,
95 	WLAN_MLME_CFG_SUBTYPE,
96 	WLAN_MLME_CFG_UAPSD,
97 	WLAN_MLME_CFG_TX_ENCAP_TYPE,
98 	WLAN_MLME_CFG_RX_DECAP_TYPE,
99 	WLAN_MLME_CFG_RATEMASK_TYPE,
100 	WLAN_MLME_CFG_RATEMASK_LOWER32,
101 	WLAN_MLME_CFG_RATEMASK_HIGHER32,
102 	WLAN_MLME_CFG_RATEMASK_LOWER32_2,
103 	WLAN_MLME_CFG_BCN_TX_RATE,
104 	WLAN_MLME_CFG_BCN_TX_RATE_CODE,
105 	WLAN_MLME_CFG_RATEMASK_CAPS,
106 	WLAN_MLME_CFG_ENABLE_MULTI_GROUP_KEY,
107 	WLAN_MLME_CFG_MAX_GROUP_KEYS,
108 	WLAN_MLME_CFG_TX_STREAMS,
109 	WLAN_MLME_CFG_RX_STREAMS,
110 	WLAN_MLME_CFG_ENABLE_DISABLE_RTT_RESPONDER_ROLE,
111 	WLAN_MLME_CFG_ENABLE_DISABLE_RTT_INITIATOR_ROLE,
112 #ifdef WLAN_FEATURE_11BE
113 	WLAN_MLME_CFG_EHT_OPS,
114 #endif
115 	WLAN_MLME_CFG_MAX
116 };
117 
118 /**
119  * struct ratemask_cfg - ratemask config
120  * @index: index of ratemask parameter array
121  * @value: configuration value
122  */
123 struct ratemask_cfg {
124 	uint8_t index;
125 	uint32_t value;
126 };
127 
128 /**
129  * struct wlan_vdev_mgr_cfg - vdev mgr configuration
130  * @value: configuration value
131  * @tsf: tsf adjust value
132  * @trans_bssid: transmission bssid address
133  * @ssid_cfg: ssid configuration
134  * @ratemask: ratemask configuration
135  */
136 struct wlan_vdev_mgr_cfg {
137 	union {
138 		uint32_t value;
139 		uint64_t tsf;
140 		uint8_t trans_bssid[QDF_MAC_ADDR_SIZE];
141 		struct wlan_ssid ssid_cfg;
142 		struct ratemask_cfg ratemask;
143 	};
144 };
145 
146 /**
147  * ucfg_wlan_vdev_mgr_set_param() - ucfg MLME API to
148  * set value into mlme vdev mgr component
149  * @vdev: pointer to vdev object
150  * @param_id: param of type wlan_mlme_cfg_id
151  * @mlme_cfg: value to set into mlme vdev mgr
152  *
153  * Return: QDF_STATUS
154  */
155 QDF_STATUS ucfg_wlan_vdev_mgr_set_param(struct wlan_objmgr_vdev *vdev,
156 					enum wlan_mlme_cfg_id param_id,
157 					struct wlan_vdev_mgr_cfg mlme_cfg);
158 
159 /**
160  * ucfg_wlan_vdev_mgr_get_param() - ucfg MLME API to
161  * get value from mlme vdev mgr component
162  * @vdev: pointer to vdev object
163  * @param_id: param of type wlan_mlme_cfg_id
164  * @param_value: pointer to store the value of mlme vdev mgr
165  *
166  * Return: void
167  */
168 void ucfg_wlan_vdev_mgr_get_param(struct wlan_objmgr_vdev *vdev,
169 				  enum wlan_mlme_cfg_id param_id,
170 				  uint32_t *param_value);
171 
172 /**
173  * ucfg_wlan_vdev_mgr_get_param_ssid() - ucfg MLME API to
174  * get ssid from mlme vdev mgr component
175  * @vdev: pointer to vdev object
176  * @ssid: pointer to store the ssid
177  * @ssid_len: pointer to store the ssid length value
178  *
179  * Return: void
180  */
181 void ucfg_wlan_vdev_mgr_get_param_ssid(struct wlan_objmgr_vdev *vdev,
182 				       uint8_t *ssid,
183 				       uint8_t *ssid_len);
184 
185 /**
186  * ucfg_wlan_vdev_mgr_get_param_bssid() - ucfg MLME API to
187  * get bssid from mlme vdev mgr component
188  * @vdev: pointer to vdev object
189  * @bssid: pointer to store the bssid
190  *
191  */
192 void ucfg_wlan_vdev_mgr_get_param_bssid(
193 				struct wlan_objmgr_vdev *vdev,
194 				uint8_t *bssid);
195 
196 /**
197  * ucfg_wlan_vdev_mgr_get_beacon_buffer() - ucfg MLME API to
198  * get beacon buffer from mlme vdev mgr component
199  * @vdev: pointer to vdev object
200  * @buf: pointer to store the beacon buffer
201  *
202  * Return: void
203  */
204 void ucfg_wlan_vdev_mgr_get_beacon_buffer(struct wlan_objmgr_vdev *vdev,
205 					  qdf_nbuf_t buf);
206 
207 /**
208  * ucfg_wlan_vdev_mgr_get_trans_bssid() - ucfg MLME API to
209  * get transmission bssid from mlme vdev mgr component
210  * @vdev: pointer to vdev object
211  * @addr: pointer to store the transmission bssid
212  *
213  * Return: void
214  */
215 void ucfg_wlan_vdev_mgr_get_trans_bssid(struct wlan_objmgr_vdev *vdev,
216 					uint8_t *addr);
217 
218 /**
219  * ucfg_wlan_vdev_mgr_get_tsf_adjust() - ucfg MLME API to
220  * get tsf_adjust from mlme vdev mgr component
221  * @vdev: pointer to vdev object
222  * @tsf_adjust: pointer to store the tsf adjust value
223  *
224  * Return: void
225  */
226 void ucfg_wlan_vdev_mgr_get_tsf_adjust(struct wlan_objmgr_vdev *vdev,
227 				       uint64_t *tsf_adjust);
228 
229 #ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
230 /**
231  * ucfg_vdev_mgr_cdp_vdev_attach() - ucfg MLME API to attach CDP vdev
232  * @vdev: pointer to vdev object
233  *
234  * Return: QDF_STATUS - Success or Failure
235  */
236 QDF_STATUS ucfg_vdev_mgr_cdp_vdev_attach(struct wlan_objmgr_vdev *vdev);
237 
238 /**
239  * ucfg_vdev_mgr_cdp_vdev_detach() - ucfg MLME API to detach CDP vdev
240  * @vdev: pointer to vdev object
241  *
242  * Return: QDF_STATUS - Success or Failure
243  */
244 QDF_STATUS ucfg_vdev_mgr_cdp_vdev_detach(struct wlan_objmgr_vdev *vdev);
245 #endif
246 
247 /**
248  * ucfg_util_vdev_mgr_set_acs_mode_for_vdev() - ucfg API to set SAP start mode
249  * @vdev: pointer to vdev object
250  * @is_acs_mode: Carries true if SAP is started in ACS
251  *
252  * Return: None
253  */
254 void
255 ucfg_util_vdev_mgr_set_acs_mode_for_vdev(struct wlan_objmgr_vdev *vdev,
256 					 bool is_acs_mode);
257 #endif /* __WLAN_VDEV_MLME_UCFG_H__ */
258