1 /* 2 * Copyright (c) 2019 The Linux Foundation. All rights reserved. 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 /** 20 * DOC: wlan_vdev_mgr_tgt_if_tx_defs.h 21 * 22 * This file provides definitions to data structures required for vdev Tx ops 23 */ 24 25 #ifndef __WLAN_VDEV_MGR_TX_OPS_DEFS_H__ 26 #define __WLAN_VDEV_MGR_TX_OPS_DEFS_H__ 27 28 #include <qdf_nbuf.h> 29 30 /** 31 * struct mac_ssid - mac ssid structure 32 * @length: ssid length 33 * @mac_ssid: ssid 34 */ 35 struct mlme_mac_ssid { 36 uint8_t length; 37 uint8_t mac_ssid[WLAN_SSID_MAX_LEN]; 38 } qdf_packed; 39 40 /** slot time long */ 41 #define WLAN_MLME_VDEV_SLOT_TIME_LONG 0x1 42 /** slot time short */ 43 #define WLAN_MLME_VDEV_SLOT_TIME_SHORT 0x2 44 45 /** 46 * enum MLME_bcn_tx_rate_code - beacon tx rate code 47 */ 48 enum mlme_bcn_tx_rate_code { 49 MLME_BCN_TX_RATE_CODE_1_M = 0x43, 50 MLME_BCN_TX_RATE_CODE_2_M = 0x42, 51 MLME_BCN_TX_RATE_CODE_5_5_M = 0x41, 52 MLME_BCN_TX_RATE_CODE_6_M = 0x03, 53 MLME_BCN_TX_RATE_CODE_9_M = 0x07, 54 MLME_BCN_TX_RATE_CODE_11M = 0x40, 55 MLME_BCN_TX_RATE_CODE_12_M = 0x02, 56 MLME_BCN_TX_RATE_CODE_18_M = 0x06, 57 MLME_BCN_TX_RATE_CODE_24_M = 0x01, 58 MLME_BCN_TX_RATE_CODE_36_M = 0x05, 59 MLME_BCN_TX_RATE_CODE_48_M = 0x00, 60 MLME_BCN_TX_RATE_CODE_54_M = 0x04, 61 }; 62 63 /** 64 * enum wlan_mlme_host_sta_ps_param_uapsd - STA UPASD params 65 */ 66 enum wlan_mlme_host_sta_ps_param_uapsd { 67 WLAN_MLME_HOST_STA_PS_UAPSD_AC0_DELIVERY_EN = (1 << 0), 68 WLAN_MLME_HOST_STA_PS_UAPSD_AC0_TRIGGER_EN = (1 << 1), 69 WLAN_MLME_HOST_STA_PS_UAPSD_AC1_DELIVERY_EN = (1 << 2), 70 WLAN_MLME_HOST_STA_PS_UAPSD_AC1_TRIGGER_EN = (1 << 3), 71 WLAN_MLME_HOST_STA_PS_UAPSD_AC2_DELIVERY_EN = (1 << 4), 72 WLAN_MLME_HOST_STA_PS_UAPSD_AC2_TRIGGER_EN = (1 << 5), 73 WLAN_MLME_HOST_STA_PS_UAPSD_AC3_DELIVERY_EN = (1 << 6), 74 WLAN_MLME_HOST_STA_PS_UAPSD_AC3_TRIGGER_EN = (1 << 7), 75 }; 76 77 /** 78 * enum wlan_mlme_host_vdev_start_status - vdev start status code 79 */ 80 enum wlan_mlme_host_vdev_start_status { 81 WLAN_MLME_HOST_VDEV_START_OK = 0, 82 WLAN_MLME_HOST_VDEV_START_CHAN_INVALID, 83 WLAN_MLME_HOST_VDEV_START_CHAN_BLOCKED, 84 WLAN_MLME_HOST_VDEV_START_CHAN_DFS_VIOLATION, 85 WLAN_MLME_HOST_VDEV_START_CHAN_INVALID_REGDOMAIN, 86 WLAN_MLME_HOST_VDEV_START_CHAN_INVALID_BAND, 87 WLAN_MLME_HOST_VDEV_START_TIMEOUT, 88 /* Add new response status code from here */ 89 WLAN_MLME_HOST_VDEV_START_MAX_REASON, 90 }; 91 92 /** 93 * string_from_start_rsp_status() - Convert start response status to string 94 * @start_rsp - start response status 95 * 96 * Please note to add new string in the array at index equal to 97 * its enum value in wlan_mlme_host_vdev_start_status. 98 */ 99 static inline char *string_from_start_rsp_status( 100 enum wlan_mlme_host_vdev_start_status start_rsp) 101 { 102 static const char *strings[] = { "START_OK", 103 "CHAN_INVALID", 104 "CHAN_BLOCKED", 105 "CHAN_DFS_VIOLATION", 106 "CHAN_INVALID_REGDOMAIN", 107 "CHAN_INVALID_BAND", 108 "START_RESPONSE_TIMEOUT", 109 "START_RESPONSE_UNKNOWN"}; 110 111 if (start_rsp >= WLAN_MLME_HOST_VDEV_START_MAX_REASON) 112 start_rsp = WLAN_MLME_HOST_VDEV_START_MAX_REASON; 113 114 return (char *)strings[start_rsp]; 115 } 116 117 /** 118 * enum wlan_mlme_host_start_event_param - start/restart resp event 119 */ 120 enum wlan_mlme_host_start_event_param { 121 WLAN_MLME_HOST_VDEV_START_RESP_EVENT = 0, 122 WLAN_MLME_HOST_VDEV_RESTART_RESP_EVENT, 123 }; 124 125 /** 126 * enum wlan_mlme_custom_aggr_type: custon aggregate type 127 * @WLAN_MLME_CUSTOM_AGGR_TYPE_AMPDU: A-MPDU aggregation 128 * @WLAN_MLME_CUSTOM_AGGR_TYPE_AMSDU: A-MSDU aggregation 129 * @WLAN_MLME_CUSTOM_AGGR_TYPE_MAX: Max type 130 */ 131 enum wlan_mlme_custom_aggr_type { 132 WLAN_MLME_CUSTOM_AGGR_TYPE_AMPDU = 0, 133 WLAN_MLME_CUSTOM_AGGR_TYPE_AMSDU = 1, 134 WLAN_MLME_CUSTOM_AGGR_TYPE_MAX, 135 }; 136 137 /** 138 * struct sta_ps_params - sta ps cmd parameter 139 * @vdev_id: vdev id 140 * @param_id: sta ps parameter 141 * @value: sta ps parameter value 142 */ 143 struct sta_ps_params { 144 uint32_t vdev_id; 145 uint32_t param_id; 146 uint32_t value; 147 }; 148 149 /** 150 * struct tbttoffset_params - Tbttoffset event params 151 * @vdev_id: Virtual AP device identifier 152 * @tbttoffset : Tbttoffset for the virtual AP device 153 * @vdev_tbtt_qtime_lo: Tbtt qtime low value 154 * @vdev_tbtt_qtime_hi: Tbtt qtime high value 155 */ 156 struct tbttoffset_params { 157 uint32_t vdev_id; 158 uint32_t tbttoffset; 159 uint32_t vdev_tbtt_qtime_lo; 160 uint32_t vdev_tbtt_qtime_hi; 161 }; 162 163 /** 164 * struct beacon_tmpl_params - beacon template cmd parameter 165 * @vdev_id: vdev id 166 * @tim_ie_offset: tim ie offset 167 * @mbssid_ie_offset: mbssid ie offset 168 * @tmpl_len: beacon template length 169 * @tmpl_len_aligned: beacon template alignment 170 * @csa_switch_count_offset: CSA swith count offset in beacon frame 171 * @ext_csa_switch_count_offset: ECSA switch count offset in beacon frame 172 * @esp_ie_offset: ESP IE offset in beacon frame 173 * @mu_edca_ie_offset: Mu EDCA IE offset in beacon frame 174 * @frm: beacon template parameter 175 */ 176 struct beacon_tmpl_params { 177 uint8_t vdev_id; 178 uint32_t tim_ie_offset; 179 uint32_t mbssid_ie_offset; 180 uint32_t tmpl_len; 181 uint32_t tmpl_len_aligned; 182 uint32_t csa_switch_count_offset; 183 uint32_t ext_csa_switch_count_offset; 184 uint32_t esp_ie_offset; 185 uint32_t mu_edca_ie_offset; 186 uint8_t *frm; 187 }; 188 189 /** 190 * struct beacon_params - beacon cmd parameter 191 * @vdev_id: vdev id 192 * @beacon_interval: Beacon interval 193 * @wbuf: beacon buffer 194 * @frame_ctrl: frame control field 195 * @bcn_txant: beacon antenna 196 * @is_dtim_count_zero: is it dtim beacon 197 * @is_bitctl_reqd: is Bit control required 198 * @is_high_latency: Is this high latency target 199 */ 200 struct beacon_params { 201 uint8_t vdev_id; 202 uint16_t beacon_interval; 203 qdf_nbuf_t wbuf; 204 uint16_t frame_ctrl; 205 uint32_t bcn_txant; 206 bool is_dtim_count_zero; 207 bool is_bitctl_reqd; 208 bool is_high_latency; 209 }; 210 211 /* struct fils_discovery_tmpl_params - FILS Discovery template cmd parameter 212 * @vdev_id: vdev ID 213 * @tmpl_len: FILS Discovery template length 214 * @tmpl_aligned: FILS Discovery template alignment 215 * @frm: FILS Discovery template parameter 216 */ 217 struct fils_discovery_tmpl_params { 218 uint8_t vdev_id; 219 uint32_t tmpl_len; 220 uint32_t tmpl_len_aligned; 221 uint8_t *frm; 222 }; 223 224 /** 225 * struct mlme_channel_param - Channel parameters with all 226 * info required by target. 227 * @chan_id: channel id 228 * @pwr: channel power 229 * @mhz: channel frequency 230 * @half_rate: is half rate 231 * @quarter_rate: is quarter rate 232 * @dfs_set: is dfs channel 233 * @dfs_set_cfreq2: is secondary freq dfs channel 234 * @is_chan_passive: is this passive channel 235 * @allow_ht: HT allowed in chan 236 * @allow_vht: VHT allowed on chan 237 * @set_agile: is agile mode 238 * @phy_mode: phymode (vht80 or ht40 or ...) 239 * @cfreq1: centre frequency on primary 240 * @cfreq2: centre frequency on secondary 241 * @maxpower: max power for channel 242 * @minpower: min power for channel 243 * @maxreqpower: Max regulatory power 244 * @antennamac: Max antenna 245 * @reg_class_id: Regulatory class id. 246 */ 247 struct mlme_channel_param { 248 uint8_t chan_id; 249 uint8_t pwr; 250 uint32_t mhz; 251 uint32_t half_rate:1, 252 quarter_rate:1, 253 dfs_set:1, 254 dfs_set_cfreq2:1, 255 is_chan_passive:1, 256 allow_ht:1, 257 allow_vht:1, 258 set_agile:1; 259 enum wlan_phymode phy_mode; 260 uint32_t cfreq1; 261 uint32_t cfreq2; 262 int8_t maxpower; 263 int8_t minpower; 264 int8_t maxregpower; 265 uint8_t antennamax; 266 uint8_t reg_class_id; 267 }; 268 269 /** 270 * struct multiple_vdev_restart_params - Multiple vdev restart cmd parameter 271 * @pdev_id: Pdev identifier 272 * @requestor_id: Unique id identifying the module 273 * @disable_hw_ack: Flag to indicate disabling HW ACK during CAC 274 * @cac_duration_ms: CAC duration on the given channel 275 * @num_vdevs: No. of vdevs that need to be restarted 276 * @ch_param: Pointer to channel_param 277 * @vdev_ids: Pointer to array of vdev_ids 278 */ 279 struct multiple_vdev_restart_params { 280 uint32_t pdev_id; 281 uint32_t requestor_id; 282 uint32_t disable_hw_ack; 283 uint32_t cac_duration_ms; 284 uint32_t num_vdevs; 285 struct mlme_channel_param ch_param; 286 uint32_t vdev_ids[WLAN_UMAC_PDEV_MAX_VDEVS]; 287 }; 288 289 /** 290 * struct peer_flush_params - peer flush cmd parameter 291 * @peer_tid_bitmap: peer tid bitmap 292 * @vdev_id: vdev id 293 * @peer_mac: peer mac address 294 */ 295 struct peer_flush_params { 296 uint32_t peer_tid_bitmap; 297 uint8_t vdev_id; 298 uint8_t peer_mac[QDF_MAC_ADDR_SIZE]; 299 }; 300 301 /* Default FILS DISCOVERY sent in period of 20TU */ 302 #define DEFAULT_FILS_DISCOVERY_PERIOD 20 303 304 /** 305 * struct config_fils_params - FILS config params 306 * @vdev_id: vdev id 307 * @fd_period: 0 - Disabled, non-zero - Period in ms (mili seconds) 308 * @send_prb_rsp_frame: send broadcast prb resp frame 309 */ 310 struct config_fils_params { 311 uint8_t vdev_id; 312 uint32_t fd_period; 313 uint32_t send_prb_rsp_frame: 1; 314 }; 315 316 /** 317 * struct config_ratemask_params - ratemask config parameters 318 * @vdev_id: vdev id 319 * @type: Type 320 * @lower32: Lower 32 bits in the 1st 64-bit value 321 * @higher32: Higher 32 bits in the 1st 64-bit value 322 * @lower32_2: Lower 32 bits in the 2nd 64-bit value 323 */ 324 struct config_ratemask_params { 325 uint8_t vdev_id; 326 uint8_t type; 327 uint32_t lower32; 328 uint32_t higher32; 329 uint32_t lower32_2; 330 }; 331 332 /** 333 * struct set_custom_aggr_size_params - custom aggr size params 334 * @vdev_id : vdev id 335 * @tx_aggr_size : TX aggr size 336 * @rx_aggr_size : RX aggr size 337 * @enable_bitmap: Bitmap for aggr size check 338 */ 339 struct set_custom_aggr_size_params { 340 uint32_t vdev_id; 341 uint32_t tx_aggr_size; 342 uint32_t rx_aggr_size; 343 uint32_t ac:2, 344 aggr_type:1, 345 tx_aggr_size_disable:1, 346 rx_aggr_size_disable:1, 347 tx_ac_enable:1, 348 reserved:26; 349 }; 350 351 /** 352 * struct sifs_trigger_param - sifs_trigger cmd parameter 353 * @vdev_id: vdev id 354 * @param_value: parameter value 355 */ 356 struct sifs_trigger_param { 357 uint32_t vdev_id; 358 uint32_t param_value; 359 }; 360 361 /** 362 * struct set_neighbour_rx_params - Neighbour RX params 363 * @vdev_id: vdev id 364 * @idx: index of param 365 * @action: action 366 * @type: Type of param 367 */ 368 struct set_neighbour_rx_params { 369 uint8_t vdev_id; 370 uint32_t idx; 371 uint32_t action; 372 uint32_t type; 373 }; 374 375 /** 376 * struct vdev_scan_nac_rssi_params - NAC_RSSI cmd parameter 377 * @vdev_id: vdev id 378 * @bssid_addr: BSSID address 379 * @client_addr: client address 380 * @chan_num: channel number 381 * @action:NAC_RSSI action, 382 */ 383 struct vdev_scan_nac_rssi_params { 384 uint32_t vdev_id; 385 uint8_t bssid_addr[QDF_MAC_ADDR_SIZE]; 386 uint8_t client_addr[QDF_MAC_ADDR_SIZE]; 387 uint32_t chan_num; 388 uint32_t action; /* WMI_FILTER_NAC_RSSI_ACTION */ 389 }; 390 391 /** 392 * struct vdev_start_params - vdev start cmd parameter 393 * @vdev_id: vdev id 394 * @beacon_interval: beacon interval 395 * @dtim_period: dtim period 396 * @is_restart: flag to check if it is vdev 397 * @disable_hw_ack: to update disable hw ack flag 398 * @hidden_ssid: hidden ssid 399 * @pmf_enabled: pmf enabled 400 * @ssid: ssid MAC 401 * @num_noa_descriptors: number of noa descriptors 402 * @preferred_tx_streams: preferred tx streams 403 * @preferred_rx_streams: preferred rx streams 404 * @cac_duration_ms: cac duration in milliseconds 405 * @regdomain: Regulatory domain 406 * @he_ops: HE ops 407 * @channel_param: Channel params required by target. 408 * @bcn_tx_rate_code: Beacon tx rate code. 409 * @ldpc_rx_enabled: Enable/Disable LDPC RX for this vdev 410 */ 411 struct vdev_start_params { 412 uint8_t vdev_id; 413 uint32_t beacon_interval; 414 uint32_t dtim_period; 415 bool is_restart; 416 uint32_t disable_hw_ack; 417 bool hidden_ssid; 418 bool pmf_enabled; 419 struct mlme_mac_ssid ssid; 420 uint32_t num_noa_descriptors; 421 uint32_t preferred_rx_streams; 422 uint32_t preferred_tx_streams; 423 uint32_t cac_duration_ms; 424 uint32_t regdomain; 425 uint32_t he_ops; 426 struct mlme_channel_param channel; 427 enum mlme_bcn_tx_rate_code bcn_tx_rate_code; 428 bool ldpc_rx_enabled; 429 }; 430 431 /** 432 * struct vdev_set_params - vdev set cmd parameter 433 * @vdev_id: vdev id 434 * @param_id: parameter id 435 * @param_value: parameter value 436 */ 437 struct vdev_set_params { 438 uint32_t vdev_id; 439 uint32_t param_id; 440 uint32_t param_value; 441 }; 442 443 /** 444 * struct vdev_create_params - vdev create cmd parameter 445 * @vdev_id: interface id 446 * @type: interface type 447 * @subtype: interface subtype 448 * @nss_2g: NSS for 2G 449 * @nss_5g: NSS for 5G 450 * @pdev_id: pdev id on pdev for this vdev 451 * @mbssid_flags: MBSS IE flags indicating vdev type 452 * @vdevid_trans: id of transmitting vdev for MBSS IE 453 */ 454 struct vdev_create_params { 455 uint8_t vdev_id; 456 uint32_t type; 457 uint32_t subtype; 458 uint8_t nss_2g; 459 uint8_t nss_5g; 460 uint32_t pdev_id; 461 uint32_t mbssid_flags; 462 uint8_t vdevid_trans; 463 }; 464 465 /** 466 * struct vdev_delete_params - vdev delete cmd parameter 467 * @vdev_id: vdev id 468 */ 469 struct vdev_delete_params { 470 uint8_t vdev_id; 471 }; 472 473 /** 474 * struct vdev_stop_params - vdev stop cmd parameter 475 * @vdev_id: vdev id 476 */ 477 struct vdev_stop_params { 478 uint8_t vdev_id; 479 }; 480 481 /** 482 * struct vdev_up_params - vdev up cmd parameter 483 * @vdev_id: vdev id 484 * @assoc_id: association id 485 * @profile_idx: profile index of the connected non-trans ap (mbssid case). 486 * 0 means invalid. 487 * @profile_num: the total profile numbers of non-trans aps (mbssid case). 488 * 0 means non-MBSS AP. 489 * @trans_bssid: bssid of transmitted AP (MBSS IE case) 490 */ 491 struct vdev_up_params { 492 uint8_t vdev_id; 493 uint16_t assoc_id; 494 uint32_t profile_idx; 495 uint32_t profile_num; 496 uint8_t trans_bssid[QDF_MAC_ADDR_SIZE]; 497 }; 498 499 /** 500 * struct vdev_down_params - vdev down cmd parameter 501 * @vdev_id: vdev id 502 */ 503 struct vdev_down_params { 504 uint8_t vdev_id; 505 }; 506 507 /** 508 * struct peer_delete_all_params - peer delete all request parameter 509 * @vdev_id: vdev id 510 */ 511 struct peer_delete_all_params { 512 uint8_t vdev_id; 513 }; 514 515 #endif /* __WLAN_VDEV_MGR_TX_OPS_DEFS_H__ */ 516