Krishna Kumaar Natarajan | d0bbb3c | 2017-03-13 17:04:58 -0700 | [diff] [blame] | 1 | /* |
Arunk Khandavalli | 10af728 | 2018-02-05 16:55:48 +0530 | [diff] [blame] | 2 | * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. |
Krishna Kumaar Natarajan | d0bbb3c | 2017-03-13 17:04:58 -0700 | [diff] [blame] | 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 | #ifndef __WMA_HE_H |
| 20 | #define __WMA_HE_H |
| 21 | |
| 22 | #include "wma.h" |
| 23 | #include "sir_api.h" |
Arunk Khandavalli | 10af728 | 2018-02-05 16:55:48 +0530 | [diff] [blame] | 24 | #include "target_if.h" |
Krishna Kumaar Natarajan | d0bbb3c | 2017-03-13 17:04:58 -0700 | [diff] [blame] | 25 | |
| 26 | #ifdef WLAN_FEATURE_11AX |
Krishna Kumaar Natarajan | 9a7638f | 2017-03-23 11:37:35 -0700 | [diff] [blame] | 27 | /** |
Arunk Khandavalli | 4b44ef4 | 2018-01-25 16:45:49 +0530 | [diff] [blame] | 28 | * wma_print_he_cap() - Print HE capabilities |
Krishna Kumaar Natarajan | 9a7638f | 2017-03-23 11:37:35 -0700 | [diff] [blame] | 29 | * @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 Rawat | d8feac1 | 2017-09-08 15:08:39 -0700 | [diff] [blame] | 37 | void wma_print_he_cap(tDot11fIEhe_cap *he_cap); |
Krishna Kumaar Natarajan | 9a7638f | 2017-03-23 11:37:35 -0700 | [diff] [blame] | 38 | |
| 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 Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 49 | void wma_print_he_ppet(void *ppet); |
Krishna Kumaar Natarajan | 9a7638f | 2017-03-23 11:37:35 -0700 | [diff] [blame] | 50 | |
| 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 Natarajan | d0bbb3c | 2017-03-13 17:04:58 -0700 | [diff] [blame] | 59 | void wma_print_he_phy_cap(uint32_t *phy_cap); |
Krishna Kumaar Natarajan | 9a7638f | 2017-03-23 11:37:35 -0700 | [diff] [blame] | 60 | |
| 61 | /** |
Kiran Kumar Lokere | 1f96b4a | 2018-08-22 14:47:11 -0700 | [diff] [blame^] | 62 | * wma_print_he_mac_cap_w1() - Print HE MAC Capability |
Krishna Kumaar Natarajan | 9a7638f | 2017-03-23 11:37:35 -0700 | [diff] [blame] | 63 | * @mac_cap: MAC Capability |
| 64 | * |
| 65 | * This function prints HE MAC Capability received from FW. |
| 66 | * |
| 67 | * Return: none |
| 68 | */ |
Kiran Kumar Lokere | 1f96b4a | 2018-08-22 14:47:11 -0700 | [diff] [blame^] | 69 | void 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 | */ |
| 79 | void wma_print_he_mac_cap_w2(uint32_t mac_cap); |
Krishna Kumaar Natarajan | 9a7638f | 2017-03-23 11:37:35 -0700 | [diff] [blame] | 80 | |
| 81 | /** |
Arunk Khandavalli | 4b44ef4 | 2018-01-25 16:45:49 +0530 | [diff] [blame] | 82 | * wma_print_he_op() - Print HE Operation |
Krishna Kumaar Natarajan | 9a7638f | 2017-03-23 11:37:35 -0700 | [diff] [blame] | 83 | * @he_cap: pointer to HE Operation |
| 84 | * |
| 85 | * Print HE operation stored as dot11f structure |
| 86 | * |
| 87 | * Return: None |
| 88 | */ |
Naveen Rawat | d8feac1 | 2017-09-08 15:08:39 -0700 | [diff] [blame] | 89 | void wma_print_he_op(tDot11fIEhe_op *he_ops); |
Krishna Kumaar Natarajan | 9a7638f | 2017-03-23 11:37:35 -0700 | [diff] [blame] | 90 | |
| 91 | /** |
| 92 | * wma_update_target_ext_he_cap() - Update HE caps with given extended cap |
Arunk Khandavalli | 10af728 | 2018-02-05 16:55:48 +0530 | [diff] [blame] | 93 | * @tgt_hdl: target psoc information |
Krishna Kumaar Natarajan | 9a7638f | 2017-03-23 11:37:35 -0700 | [diff] [blame] | 94 | * @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 Khandavalli | 10af728 | 2018-02-05 16:55:48 +0530 | [diff] [blame] | 102 | void wma_update_target_ext_he_cap(struct target_psoc_info *tgt_hdl, |
| 103 | struct wma_tgt_cfg *tgt_cfg); |
Krishna Kumaar Natarajan | 9a7638f | 2017-03-23 11:37:35 -0700 | [diff] [blame] | 104 | |
| 105 | /* |
| 106 | * wma_he_update_tgt_services() - update tgt cfg to indicate 11ax support |
Arunk Khandavalli | 4b44ef4 | 2018-01-25 16:45:49 +0530 | [diff] [blame] | 107 | * @wmi_handle: pointer to WMI handle |
Krishna Kumaar Natarajan | 9a7638f | 2017-03-23 11:37:35 -0700 | [diff] [blame] | 108 | * @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 Khandavalli | 4b44ef4 | 2018-01-25 16:45:49 +0530 | [diff] [blame] | 115 | void wma_he_update_tgt_services(struct wmi_unified *wmi_handle, |
Krishna Kumaar Natarajan | d0bbb3c | 2017-03-13 17:04:58 -0700 | [diff] [blame] | 116 | struct wma_tgt_services *cfg); |
Krishna Kumaar Natarajan | 9a7638f | 2017-03-23 11:37:35 -0700 | [diff] [blame] | 117 | |
| 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 Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 125 | void wma_populate_peer_he_cap(struct peer_assoc_params *peer, |
| 126 | tpAddStaParams params); |
Krishna Kumaar Natarajan | 9a7638f | 2017-03-23 11:37:35 -0700 | [diff] [blame] | 127 | |
| 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 Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 135 | void wma_update_vdev_he_ops(struct wma_vdev_start_req *req, |
| 136 | tpAddBssParams add_bss); |
Krishna Kumaar Natarajan | 9a7638f | 2017-03-23 11:37:35 -0700 | [diff] [blame] | 137 | |
| 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 Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 145 | void wma_copy_txrxnode_he_ops(struct wma_txrx_node *node, |
| 146 | struct wma_vdev_start_req *req); |
Krishna Kumaar Natarajan | 9a7638f | 2017-03-23 11:37:35 -0700 | [diff] [blame] | 147 | |
| 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 Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 155 | void wma_copy_vdev_start_he_ops(struct vdev_start_params *params, |
| 156 | struct wma_vdev_start_req *req); |
Krishna Kumaar Natarajan | 9a7638f | 2017-03-23 11:37:35 -0700 | [diff] [blame] | 157 | |
| 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 Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 166 | void wma_vdev_set_he_bss_params(tp_wma_handle wma, uint8_t vdev_id, |
| 167 | struct wma_vdev_start_req *req); |
| 168 | |
Manikandan Mohan | 39accff | 2017-05-02 16:09:00 -0700 | [diff] [blame] | 169 | /** |
| 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 | */ |
| 177 | void wma_vdev_set_he_config(tp_wma_handle wma, uint8_t vdev_id, |
| 178 | tpAddBssParams add_bss); |
| 179 | |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 180 | static inline bool wma_is_peer_he_capable(tpAddStaParams params) |
| 181 | { |
| 182 | return params->he_capable; |
| 183 | } |
| 184 | |
Krishna Kumaar Natarajan | 9a7638f | 2017-03-23 11:37:35 -0700 | [diff] [blame] | 185 | /** |
| 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 Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 192 | void wma_update_vdev_he_capable(struct wma_vdev_start_req *req, |
| 193 | tpSwitchChannelParams params); |
| 194 | |
Krishna Kumaar Natarajan | f567650 | 2017-03-06 10:28:44 -0800 | [diff] [blame] | 195 | /** |
Krunal Soni | b7f2043 | 2017-04-27 13:01:02 -0700 | [diff] [blame] | 196 | * 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 | */ |
| 206 | QDF_STATUS wma_update_he_ops_ie(tp_wma_handle wma, uint8_t vdev_id, |
Naveen Rawat | df221b7 | 2017-11-15 11:32:31 -0800 | [diff] [blame] | 207 | tDot11fIEhe_op *he_ops); |
Krunal Soni | b7f2043 | 2017-04-27 13:01:02 -0700 | [diff] [blame] | 208 | |
| 209 | /** |
Krishna Kumaar Natarajan | f567650 | 2017-03-06 10:28:44 -0800 | [diff] [blame] | 210 | * 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 | */ |
| 220 | QDF_STATUS wma_get_he_capabilities(struct he_capability *he_cap); |
| 221 | |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 222 | /** |
| 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 | */ |
| 230 | void 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 | */ |
| 240 | uint32_t wma_get_he_vdev_param(struct wma_txrx_node *intr, |
| 241 | WMI_VDEV_PARAM param_id); |
| 242 | |
Krishna Kumaar Natarajan | d0bbb3c | 2017-03-13 17:04:58 -0700 | [diff] [blame] | 243 | #else |
Naveen Rawat | d8feac1 | 2017-09-08 15:08:39 -0700 | [diff] [blame] | 244 | static inline void wma_print_he_cap(tDot11fIEhe_cap *he_cap) |
Krishna Kumaar Natarajan | d0bbb3c | 2017-03-13 17:04:58 -0700 | [diff] [blame] | 245 | { |
| 246 | } |
| 247 | |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 248 | static inline void wma_print_he_ppet(void *ppet) |
Krishna Kumaar Natarajan | d0bbb3c | 2017-03-13 17:04:58 -0700 | [diff] [blame] | 249 | { |
| 250 | } |
| 251 | |
| 252 | static inline void wma_print_he_phy_cap(uint32_t *phy_cap) |
| 253 | { |
| 254 | } |
| 255 | |
Kiran Kumar Lokere | 1f96b4a | 2018-08-22 14:47:11 -0700 | [diff] [blame^] | 256 | static inline void wma_print_he_mac_cap_w1(uint32_t mac_cap) |
| 257 | { |
| 258 | } |
| 259 | |
| 260 | static inline void wma_print_he_mac_cap_w2(uint32_t mac_cap) |
Krishna Kumaar Natarajan | d0bbb3c | 2017-03-13 17:04:58 -0700 | [diff] [blame] | 261 | { |
| 262 | } |
| 263 | |
Naveen Rawat | d8feac1 | 2017-09-08 15:08:39 -0700 | [diff] [blame] | 264 | static inline void wma_print_he_op(tDot11fIEhe_op *he_ops) |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 265 | { |
| 266 | } |
| 267 | |
Arunk Khandavalli | 10af728 | 2018-02-05 16:55:48 +0530 | [diff] [blame] | 268 | static inline void wma_update_target_ext_he_cap(struct |
| 269 | target_psoc_info *tgt_hdl, |
Krishna Kumaar Natarajan | d0bbb3c | 2017-03-13 17:04:58 -0700 | [diff] [blame] | 270 | struct wma_tgt_cfg *tgt_cfg) |
| 271 | { |
| 272 | } |
| 273 | |
Arunk Khandavalli | 4b44ef4 | 2018-01-25 16:45:49 +0530 | [diff] [blame] | 274 | static inline void wma_he_update_tgt_services(struct wmi_unified *wmi_handle, |
Krishna Kumaar Natarajan | d0bbb3c | 2017-03-13 17:04:58 -0700 | [diff] [blame] | 275 | struct wma_tgt_services *cfg) |
| 276 | { |
| 277 | cfg->en_11ax = false; |
| 278 | return; |
| 279 | } |
| 280 | |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 281 | static inline void wma_populate_peer_he_cap(struct peer_assoc_params *peer, |
| 282 | tpAddStaParams params) |
| 283 | { |
| 284 | } |
| 285 | |
| 286 | static inline void wma_update_vdev_he_ops(struct wma_vdev_start_req *req, |
| 287 | tpAddBssParams add_bss) |
| 288 | { |
| 289 | } |
| 290 | static inline void wma_copy_txrxnode_he_ops(struct wma_txrx_node *intr, |
| 291 | struct wma_vdev_start_req *req) |
| 292 | { |
| 293 | } |
| 294 | |
| 295 | static inline void wma_copy_vdev_start_he_ops(struct vdev_start_params *params, |
| 296 | struct wma_vdev_start_req *req) |
| 297 | { |
| 298 | } |
| 299 | |
Krunal Soni | b7f2043 | 2017-04-27 13:01:02 -0700 | [diff] [blame] | 300 | static inline QDF_STATUS wma_update_he_ops_ie(tp_wma_handle wma, |
Naveen Rawat | df221b7 | 2017-11-15 11:32:31 -0800 | [diff] [blame] | 301 | uint8_t vdev_id, tDot11fIEhe_op *he_ops) |
Krunal Soni | b7f2043 | 2017-04-27 13:01:02 -0700 | [diff] [blame] | 302 | { |
| 303 | return QDF_STATUS_SUCCESS; |
| 304 | } |
| 305 | |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 306 | static 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 Mohan | 39accff | 2017-05-02 16:09:00 -0700 | [diff] [blame] | 311 | static inline void wma_vdev_set_he_config(tp_wma_handle wma, uint8_t vdev_id, |
| 312 | tpAddBssParams add_bss) |
| 313 | { |
| 314 | } |
| 315 | |
Krishna Kumaar Natarajan | 0103ef8 | 2017-02-17 18:15:56 -0800 | [diff] [blame] | 316 | static inline bool wma_is_peer_he_capable(tpAddStaParams params) |
| 317 | { |
| 318 | return false; |
| 319 | } |
| 320 | |
| 321 | static inline void wma_update_vdev_he_capable(struct wma_vdev_start_req *req, |
| 322 | tpSwitchChannelParams params) |
| 323 | { |
| 324 | } |
Krishna Kumaar Natarajan | 1a71ec7 | 2017-03-23 12:26:31 -0700 | [diff] [blame] | 325 | |
| 326 | static 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 | |
| 332 | static 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 Natarajan | d0bbb3c | 2017-03-13 17:04:58 -0700 | [diff] [blame] | 339 | #endif |
| 340 | |
| 341 | #endif /* __WMA_HE_H */ |