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