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