blob: 9f3d036ccc819850a2e526c95dd0412ec82befe6 [file] [log] [blame]
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07001/*
Arunk Khandavalli10af7282018-02-05 16:55:48 +05302 * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -07003 *
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#ifndef __WMA_HE_H
20#define __WMA_HE_H
21
22#include "wma.h"
23#include "sir_api.h"
Arunk Khandavalli10af7282018-02-05 16:55:48 +053024#include "target_if.h"
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -070025
26#ifdef WLAN_FEATURE_11AX
Krishna Kumaar Natarajan9a7638f2017-03-23 11:37:35 -070027/**
Arunk Khandavalli4b44ef42018-01-25 16:45:49 +053028 * wma_print_he_cap() - Print HE capabilities
Krishna Kumaar Natarajan9a7638f2017-03-23 11:37:35 -070029 * @he_cap: pointer to HE Capability
30 *
31 * Received HE capabilities are converted into dot11f structure.
32 * This function will print all the HE capabilities as stored
33 * in the dot11f structure.
34 *
35 * Return: None
36 */
Naveen Rawatd8feac12017-09-08 15:08:39 -070037void wma_print_he_cap(tDot11fIEhe_cap *he_cap);
Krishna Kumaar Natarajan9a7638f2017-03-23 11:37:35 -070038
39/**
40 * wma_print_he_ppet() - Prints HE PPE Threshold
41 * @he_ppet: PPE Threshold
42 *
43 * This function prints HE PPE Threshold as received from FW.
44 * Refer to the definition of wmi_ppe_threshold to understand
45 * how PPE thresholds are packed by FW for a given NSS and RU.
46 *
47 * Return: none
48 */
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -080049void wma_print_he_ppet(void *ppet);
Krishna Kumaar Natarajan9a7638f2017-03-23 11:37:35 -070050
51/**
52 * wma_print_he_phy_cap() - Print HE PHY Capability
53 * @phy_cap: pointer to PHY Capability
54 *
55 * This function prints HE PHY Capability received from FW.
56 *
57 * Return: none
58 */
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -070059void wma_print_he_phy_cap(uint32_t *phy_cap);
Krishna Kumaar Natarajan9a7638f2017-03-23 11:37:35 -070060
61/**
Kiran Kumar Lokere1f96b4a2018-08-22 14:47:11 -070062 * wma_print_he_mac_cap_w1() - Print HE MAC Capability
Krishna Kumaar Natarajan9a7638f2017-03-23 11:37:35 -070063 * @mac_cap: MAC Capability
64 *
65 * This function prints HE MAC Capability received from FW.
66 *
67 * Return: none
68 */
Kiran Kumar Lokere1f96b4a2018-08-22 14:47:11 -070069void wma_print_he_mac_cap_w1(uint32_t mac_cap);
70
71/**
72 * wma_print_he_mac_cap_w2() - Print HE MAC Capability
73 * @mac_cap: MAC Capability
74 *
75 * This function prints HE MAC Capability received from FW.
76 *
77 * Return: none
78 */
79void wma_print_he_mac_cap_w2(uint32_t mac_cap);
Krishna Kumaar Natarajan9a7638f2017-03-23 11:37:35 -070080
81/**
Arunk Khandavalli4b44ef42018-01-25 16:45:49 +053082 * wma_print_he_op() - Print HE Operation
Krishna Kumaar Natarajan9a7638f2017-03-23 11:37:35 -070083 * @he_cap: pointer to HE Operation
84 *
85 * Print HE operation stored as dot11f structure
86 *
87 * Return: None
88 */
Naveen Rawatd8feac12017-09-08 15:08:39 -070089void wma_print_he_op(tDot11fIEhe_op *he_ops);
Krishna Kumaar Natarajan9a7638f2017-03-23 11:37:35 -070090
91/**
92 * wma_update_target_ext_he_cap() - Update HE caps with given extended cap
Arunk Khandavalli10af7282018-02-05 16:55:48 +053093 * @tgt_hdl: target psoc information
Krishna Kumaar Natarajan9a7638f2017-03-23 11:37:35 -070094 * @tgt_cfg: Target config
95 *
96 * This function loop through each hardware mode and for each hardware mode
97 * again it loop through each MAC/PHY and pull the caps 2G and 5G specific
98 * HE caps and derives the final cap.
99 *
100 * Return: None
101 */
Arunk Khandavalli10af7282018-02-05 16:55:48 +0530102void wma_update_target_ext_he_cap(struct target_psoc_info *tgt_hdl,
103 struct wma_tgt_cfg *tgt_cfg);
Krishna Kumaar Natarajan9a7638f2017-03-23 11:37:35 -0700104
105/*
106 * wma_he_update_tgt_services() - update tgt cfg to indicate 11ax support
Arunk Khandavalli4b44ef42018-01-25 16:45:49 +0530107 * @wmi_handle: pointer to WMI handle
Krishna Kumaar Natarajan9a7638f2017-03-23 11:37:35 -0700108 * @cfg: pointer to WMA target services
109 *
110 * Based on WMI SERVICES information, enable 11ax support and set DOT11AX bit
111 * in feature caps bitmap.
112 *
113 * Return: None
114 */
Arunk Khandavalli4b44ef42018-01-25 16:45:49 +0530115void wma_he_update_tgt_services(struct wmi_unified *wmi_handle,
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -0700116 struct wma_tgt_services *cfg);
Krishna Kumaar Natarajan9a7638f2017-03-23 11:37:35 -0700117
118/**
119 * wma_populate_peer_he_cap() - populate peer HE capabilities in peer assoc cmd
120 * @peer: pointer to peer assoc params
121 * @params: pointer to ADD STA params
122 *
123 * Return: None
124 */
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800125void wma_populate_peer_he_cap(struct peer_assoc_params *peer,
126 tpAddStaParams params);
Krishna Kumaar Natarajan9a7638f2017-03-23 11:37:35 -0700127
128/**
129 * wma_update_vdev_he_ops() - update he ops in vdev start request
130 * @req: pointer to vdev start request
131 * @add_bss: pointer to ADD BSS params
132 *
133 * Return: None
134 */
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800135void wma_update_vdev_he_ops(struct wma_vdev_start_req *req,
136 tpAddBssParams add_bss);
Krishna Kumaar Natarajan9a7638f2017-03-23 11:37:35 -0700137
138/**
139 * wma_copy_txrxnode_he_ops() - copy HE ops from vdev start req to txrx node
140 * @node: pointer to txrx node
141 * @req: pointer to vdev start request
142 *
143 * Return: None
144 */
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800145void wma_copy_txrxnode_he_ops(struct wma_txrx_node *node,
146 struct wma_vdev_start_req *req);
Krishna Kumaar Natarajan9a7638f2017-03-23 11:37:35 -0700147
148/**
149 * wma_copy_vdev_start_he_ops() - copy HE ops from vdev start req to vdev start
150 * @params: pointer to vdev_start_params
151 * @req: pointer to vdev start request
152 *
153 * Return: None
154 */
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800155void wma_copy_vdev_start_he_ops(struct vdev_start_params *params,
156 struct wma_vdev_start_req *req);
Krishna Kumaar Natarajan9a7638f2017-03-23 11:37:35 -0700157
158/**
159 * wma_vdev_set_he_bss_params() - set HE OPs in vdev start
160 * @wma: pointer to wma handle
161 * @vdev_id: VDEV id
162 * @req: pointer to vdev start request
163 *
164 * Return: None
165 */
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800166void wma_vdev_set_he_bss_params(tp_wma_handle wma, uint8_t vdev_id,
167 struct wma_vdev_start_req *req);
168
Manikandan Mohan39accff2017-05-02 16:09:00 -0700169/**
170 * wma_vdev_set_he_config() - set HE Config in vdev start
171 * @wma: pointer to wma handle
172 * @vdev_id: VDEV id
173 * @add_bss: BSS params
174 *
175 * Return: None
176 */
177void wma_vdev_set_he_config(tp_wma_handle wma, uint8_t vdev_id,
178 tpAddBssParams add_bss);
179
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800180static inline bool wma_is_peer_he_capable(tpAddStaParams params)
181{
182 return params->he_capable;
183}
184
Krishna Kumaar Natarajan9a7638f2017-03-23 11:37:35 -0700185/**
186 * wma_update_vdev_he_capable() - update vdev start request he capability
187 * @req: pointer to vdev start request
188 * @params: pointer to chan switch params
189 *
190 * Return: None
191 */
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800192void wma_update_vdev_he_capable(struct wma_vdev_start_req *req,
193 tpSwitchChannelParams params);
194
Krishna Kumaar Natarajanf5676502017-03-06 10:28:44 -0800195/**
Krunal Sonib7f20432017-04-27 13:01:02 -0700196 * wma_update_he_ops_ie() - update the HE OPS IE to firmware
197 * @wma: pointer to wma context
198 * @vdev_id: vdev id
199 * @he_ops: 32bit value of HE ops
200 *
201 * This API is used to send updated HE operational IE to firmware, so that
202 * firmware can be in sync with host
203 *
204 * Return: QDF_STATUS
205 */
206QDF_STATUS wma_update_he_ops_ie(tp_wma_handle wma, uint8_t vdev_id,
Naveen Rawatdf221b72017-11-15 11:32:31 -0800207 tDot11fIEhe_op *he_ops);
Krunal Sonib7f20432017-04-27 13:01:02 -0700208
209/**
Krishna Kumaar Natarajanf5676502017-03-06 10:28:44 -0800210 * wma_get_he_capabilities() - Get HE capabilities from WMA
211 * @he_cap: Pointer to HE capabilities
212 *
213 * Currently HE capabilities are not updated in wma_handle. This
214 * is an interface for upper layer to query capabilities from WMA.
215 * When the real use case arise, update wma_handle with HE capabilities
216 * as required.
217 *
218 * Return: QDF_STATUS
219 */
220QDF_STATUS wma_get_he_capabilities(struct he_capability *he_cap);
221
Krishna Kumaar Natarajan1a71ec72017-03-23 12:26:31 -0700222/**
223 * wma_set_he_vdev_param() - update he vdev param in wma
224 * @intr: pointer to wma_txrx_node
225 * @param_id: vdev param id
226 * @value: value of vdev param
227 *
228 * Result: None
229 */
230void wma_set_he_vdev_param(struct wma_txrx_node *intr, WMI_VDEV_PARAM param_id,
231 uint32_t value);
232
233/**
234 * wma_get_he_vdev_param() - retrieve he vdev param from wma
235 * @intr: pointer to wma_txrx_node
236 * @param_id: vdev param id
237 *
238 * Result: param value
239 */
240uint32_t wma_get_he_vdev_param(struct wma_txrx_node *intr,
241 WMI_VDEV_PARAM param_id);
242
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -0700243#else
Naveen Rawatd8feac12017-09-08 15:08:39 -0700244static inline void wma_print_he_cap(tDot11fIEhe_cap *he_cap)
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -0700245{
246}
247
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800248static inline void wma_print_he_ppet(void *ppet)
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -0700249{
250}
251
252static inline void wma_print_he_phy_cap(uint32_t *phy_cap)
253{
254}
255
Kiran Kumar Lokere1f96b4a2018-08-22 14:47:11 -0700256static inline void wma_print_he_mac_cap_w1(uint32_t mac_cap)
257{
258}
259
260static inline void wma_print_he_mac_cap_w2(uint32_t mac_cap)
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -0700261{
262}
263
Naveen Rawatd8feac12017-09-08 15:08:39 -0700264static inline void wma_print_he_op(tDot11fIEhe_op *he_ops)
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800265{
266}
267
Arunk Khandavalli10af7282018-02-05 16:55:48 +0530268static inline void wma_update_target_ext_he_cap(struct
269 target_psoc_info *tgt_hdl,
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -0700270 struct wma_tgt_cfg *tgt_cfg)
271{
272}
273
Arunk Khandavalli4b44ef42018-01-25 16:45:49 +0530274static inline void wma_he_update_tgt_services(struct wmi_unified *wmi_handle,
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -0700275 struct wma_tgt_services *cfg)
276{
277 cfg->en_11ax = false;
278 return;
279}
280
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800281static inline void wma_populate_peer_he_cap(struct peer_assoc_params *peer,
282 tpAddStaParams params)
283{
284}
285
286static inline void wma_update_vdev_he_ops(struct wma_vdev_start_req *req,
287 tpAddBssParams add_bss)
288{
289}
290static inline void wma_copy_txrxnode_he_ops(struct wma_txrx_node *intr,
291 struct wma_vdev_start_req *req)
292{
293}
294
295static inline void wma_copy_vdev_start_he_ops(struct vdev_start_params *params,
296 struct wma_vdev_start_req *req)
297{
298}
299
Krunal Sonib7f20432017-04-27 13:01:02 -0700300static inline QDF_STATUS wma_update_he_ops_ie(tp_wma_handle wma,
Naveen Rawatdf221b72017-11-15 11:32:31 -0800301 uint8_t vdev_id, tDot11fIEhe_op *he_ops)
Krunal Sonib7f20432017-04-27 13:01:02 -0700302{
303 return QDF_STATUS_SUCCESS;
304}
305
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800306static inline void wma_vdev_set_he_bss_params(tp_wma_handle wma,
307 uint8_t vdev_id, struct wma_vdev_start_req *req)
308{
309}
310
Manikandan Mohan39accff2017-05-02 16:09:00 -0700311static inline void wma_vdev_set_he_config(tp_wma_handle wma, uint8_t vdev_id,
312 tpAddBssParams add_bss)
313{
314}
315
Krishna Kumaar Natarajan0103ef82017-02-17 18:15:56 -0800316static inline bool wma_is_peer_he_capable(tpAddStaParams params)
317{
318 return false;
319}
320
321static inline void wma_update_vdev_he_capable(struct wma_vdev_start_req *req,
322 tpSwitchChannelParams params)
323{
324}
Krishna Kumaar Natarajan1a71ec72017-03-23 12:26:31 -0700325
326static inline void wma_set_he_vdev_param(struct wma_txrx_node *intr,
327 WMI_VDEV_PARAM param_id, uint32_t value)
328{
329 WMA_LOGI(FL("Unable to update WMI_VDEV_PARAM: %0x"), param_id);
330}
331
332static inline uint32_t wma_get_he_vdev_param(struct wma_txrx_node *intr,
333 WMI_VDEV_PARAM param_id)
334{
335 WMA_LOGI(FL("Unable to update WMI_VDEV_PARAM: %0x"), param_id);
336 return 0;
337}
338
Krishna Kumaar Natarajand0bbb3c2017-03-13 17:04:58 -0700339#endif
340
341#endif /* __WMA_HE_H */