1 2 /* Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for any 5 * purpose with or without fee is hereby granted, provided that the above 6 * copyright notice and this permission notice appear in all copies. 7 * 8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 */ 16 17 18 19 20 21 22 23 24 25 26 #ifndef _TX_FES_STATUS_START_H_ 27 #define _TX_FES_STATUS_START_H_ 28 #if !defined(__ASSEMBLER__) 29 #endif 30 31 #define NUM_OF_DWORDS_TX_FES_STATUS_START 4 32 33 #define NUM_OF_QWORDS_TX_FES_STATUS_START 2 34 35 36 struct tx_fes_status_start { 37 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN 38 uint32_t schedule_id : 32; // [31:0] 39 uint32_t reserved_1a : 8, // [7:0] 40 transmit_start_reason : 3, // [10:8] 41 disabled_user_bitmap_36_32 : 5, // [15:11] 42 schedule_cmd_ring_id : 5, // [20:16] 43 fes_control_mode : 2, // [22:21] 44 schedule_try : 4, // [26:23] 45 medium_prot_type : 3, // [29:27] 46 reserved_1b : 2; // [31:30] 47 uint32_t optimal_bw_try_count : 4, // [3:0] 48 number_of_users : 7, // [10:4] 49 coex_nack_count : 5, // [15:11] 50 cca_ed0 : 16; // [31:16] 51 uint32_t disabled_user_bitmap_31_0 : 32; // [31:0] 52 #else 53 uint32_t schedule_id : 32; // [31:0] 54 uint32_t reserved_1b : 2, // [31:30] 55 medium_prot_type : 3, // [29:27] 56 schedule_try : 4, // [26:23] 57 fes_control_mode : 2, // [22:21] 58 schedule_cmd_ring_id : 5, // [20:16] 59 disabled_user_bitmap_36_32 : 5, // [15:11] 60 transmit_start_reason : 3, // [10:8] 61 reserved_1a : 8; // [7:0] 62 uint32_t cca_ed0 : 16, // [31:16] 63 coex_nack_count : 5, // [15:11] 64 number_of_users : 7, // [10:4] 65 optimal_bw_try_count : 4; // [3:0] 66 uint32_t disabled_user_bitmap_31_0 : 32; // [31:0] 67 #endif 68 }; 69 70 71 /* Description SCHEDULE_ID 72 73 A field that SW can use to link this FES status to the schedule 74 command that originated this transmission. 75 */ 76 77 #define TX_FES_STATUS_START_SCHEDULE_ID_OFFSET 0x0000000000000000 78 #define TX_FES_STATUS_START_SCHEDULE_ID_LSB 0 79 #define TX_FES_STATUS_START_SCHEDULE_ID_MSB 31 80 #define TX_FES_STATUS_START_SCHEDULE_ID_MASK 0x00000000ffffffff 81 82 83 /* Description RESERVED_1A 84 85 Hamilton v1 used this to report 'cca_ed0' but it was expanded 86 and moved to word 2. 87 <legal 0> 88 */ 89 90 #define TX_FES_STATUS_START_RESERVED_1A_OFFSET 0x0000000000000000 91 #define TX_FES_STATUS_START_RESERVED_1A_LSB 32 92 #define TX_FES_STATUS_START_RESERVED_1A_MSB 39 93 #define TX_FES_STATUS_START_RESERVED_1A_MASK 0x000000ff00000000 94 95 96 /* Description TRANSMIT_START_REASON 97 98 Indicates what the SCH start reason reason was for initiating 99 this transmission. 100 101 <enum 0 BO_based_transmit_start> The transmission of this 102 PPDU got initiated by the scheduler due to Backoff expiration 103 104 <enum 1 Trigger_based_transmit_start> The transmission of 105 this PPDU got initiated by the scheduler due to reception 106 (by the SCH) of the TLV RECEIVED_TRIGGER_INFO that RXPCU 107 generated. Note that this can be an OFDMA trigger frame 108 based transmission as well as some legacy trigger (PS-POLL, 109 Qboost, U-APSD, etc.) based transmission 110 <enum 2 Sifs_continuation_in_ongoing_burst> This transmission 111 of this PPDU got initiated as part of SIFS continuation. 112 An earlier PPDU was transmitted due to RBO expiration. Next 113 command is also expected to be transmitted in SIFS burst. 114 115 <enum 3 Sifs_continuation_last_command> This transmission 116 of this PPDU got initiated as part of SIFS continuation 117 and this is the last command in the burst. An earlier PPDU 118 was transmitted due to RBO expiration. 119 <enum 4 NTBR_response_start> DO NOT USE 120 <legal 0-4> 121 */ 122 123 #define TX_FES_STATUS_START_TRANSMIT_START_REASON_OFFSET 0x0000000000000000 124 #define TX_FES_STATUS_START_TRANSMIT_START_REASON_LSB 40 125 #define TX_FES_STATUS_START_TRANSMIT_START_REASON_MSB 42 126 #define TX_FES_STATUS_START_TRANSMIT_START_REASON_MASK 0x0000070000000000 127 128 129 /* Description DISABLED_USER_BITMAP_36_32 130 131 Bitmap of users that are disabled for this transmission, 132 MSB 5 bits 133 134 TXPCU converts disabled_group_bitmap_* in 'PCU_PPDU_SETUP_START' 135 from groups to users. 136 <legal all> 137 */ 138 139 #define TX_FES_STATUS_START_DISABLED_USER_BITMAP_36_32_OFFSET 0x0000000000000000 140 #define TX_FES_STATUS_START_DISABLED_USER_BITMAP_36_32_LSB 43 141 #define TX_FES_STATUS_START_DISABLED_USER_BITMAP_36_32_MSB 47 142 #define TX_FES_STATUS_START_DISABLED_USER_BITMAP_36_32_MASK 0x0000f80000000000 143 144 145 /* Description SCHEDULE_CMD_RING_ID 146 147 The schedule command ring that originated this transmission 148 149 <enum 0 sch_cmd_ring_number0> 150 <enum 1 sch_cmd_ring_number1> 151 <enum 2 sch_cmd_ring_number2> 152 <enum 3 sch_cmd_ring_number3> 153 <enum 4 sch_cmd_ring_number4> 154 <enum 5 sch_cmd_ring_number5> 155 <enum 6 sch_cmd_ring_number6> 156 <enum 7 sch_cmd_ring_number7> 157 <enum 8 sch_cmd_ring_number8> 158 <enum 9 sch_cmd_ring_number9> 159 <enum 10 sch_cmd_ring_number10> 160 <enum 11 sch_cmd_ring_number11> 161 <enum 12 sch_cmd_ring_number12> 162 <enum 13 sch_cmd_ring_number13> 163 <enum 14 sch_cmd_ring_number14> 164 <enum 15 sch_cmd_ring_number15> 165 <enum 16 sch_cmd_ring_number16> 166 <enum 17 sch_cmd_ring_number17> 167 <enum 18 sch_cmd_ring_number18> 168 <enum 19 sch_cmd_ring_number19> 169 <enum 20 sch_cmd_ring_number20> 170 171 <legal 0-20> 172 */ 173 174 #define TX_FES_STATUS_START_SCHEDULE_CMD_RING_ID_OFFSET 0x0000000000000000 175 #define TX_FES_STATUS_START_SCHEDULE_CMD_RING_ID_LSB 48 176 #define TX_FES_STATUS_START_SCHEDULE_CMD_RING_ID_MSB 52 177 #define TX_FES_STATUS_START_SCHEDULE_CMD_RING_ID_MASK 0x001f000000000000 178 179 180 /* Description FES_CONTROL_MODE 181 182 <enum 0 SW_transmit_mode> No HW generated TLVs 183 <enum 1 PDG_transmit_mode> PDG is activated to generate 184 TLVs 185 186 187 Note: Final Bandwidth selection is always performed by TX 188 PCU. 189 190 <legal 0-1> 191 */ 192 193 #define TX_FES_STATUS_START_FES_CONTROL_MODE_OFFSET 0x0000000000000000 194 #define TX_FES_STATUS_START_FES_CONTROL_MODE_LSB 53 195 #define TX_FES_STATUS_START_FES_CONTROL_MODE_MSB 54 196 #define TX_FES_STATUS_START_FES_CONTROL_MODE_MASK 0x0060000000000000 197 198 199 /* Description SCHEDULE_TRY 200 201 The number of times this scheduler command has been tried 202 203 <legal all> 204 */ 205 206 #define TX_FES_STATUS_START_SCHEDULE_TRY_OFFSET 0x0000000000000000 207 #define TX_FES_STATUS_START_SCHEDULE_TRY_LSB 55 208 #define TX_FES_STATUS_START_SCHEDULE_TRY_MSB 58 209 #define TX_FES_STATUS_START_SCHEDULE_TRY_MASK 0x0780000000000000 210 211 212 /* Description MEDIUM_PROT_TYPE 213 214 Self Gen Medium Prot type used 215 <enum 0 No_protection> 216 <enum 1 RTS_legacy> 217 <enum 2 RTS_11ac_static_bw> 218 <enum 3 RTS_11ac_dynamic_bw> 219 <enum 4 CTS2Self> 220 <enum 5 QoS_Null_no_ack_3addr> 221 <enum 6 QoS_Null_no_ack_4addr> 222 223 <legal 0-6> 224 Field only valid for user0 FES status. 225 */ 226 227 #define TX_FES_STATUS_START_MEDIUM_PROT_TYPE_OFFSET 0x0000000000000000 228 #define TX_FES_STATUS_START_MEDIUM_PROT_TYPE_LSB 59 229 #define TX_FES_STATUS_START_MEDIUM_PROT_TYPE_MSB 61 230 #define TX_FES_STATUS_START_MEDIUM_PROT_TYPE_MASK 0x3800000000000000 231 232 233 /* Description RESERVED_1B 234 235 <legal 0> 236 */ 237 238 #define TX_FES_STATUS_START_RESERVED_1B_OFFSET 0x0000000000000000 239 #define TX_FES_STATUS_START_RESERVED_1B_LSB 62 240 #define TX_FES_STATUS_START_RESERVED_1B_MSB 63 241 #define TX_FES_STATUS_START_RESERVED_1B_MASK 0xc000000000000000 242 243 244 /* Description OPTIMAL_BW_TRY_COUNT 245 246 This field indicates how many times this scheduling command 247 has been flushed by TXPCU as a result of most desired 248 BW not being available. 249 <legal all> 250 */ 251 252 #define TX_FES_STATUS_START_OPTIMAL_BW_TRY_COUNT_OFFSET 0x0000000000000008 253 #define TX_FES_STATUS_START_OPTIMAL_BW_TRY_COUNT_LSB 0 254 #define TX_FES_STATUS_START_OPTIMAL_BW_TRY_COUNT_MSB 3 255 #define TX_FES_STATUS_START_OPTIMAL_BW_TRY_COUNT_MASK 0x000000000000000f 256 257 258 /* Description NUMBER_OF_USERS 259 260 The number of users in this transmission. 261 */ 262 263 #define TX_FES_STATUS_START_NUMBER_OF_USERS_OFFSET 0x0000000000000008 264 #define TX_FES_STATUS_START_NUMBER_OF_USERS_LSB 4 265 #define TX_FES_STATUS_START_NUMBER_OF_USERS_MSB 10 266 #define TX_FES_STATUS_START_NUMBER_OF_USERS_MASK 0x00000000000007f0 267 268 269 /* Description COEX_NACK_COUNT 270 271 Consumer: SCH 272 Producer: TXPCU 273 274 The number of times PDG informed the SCHeduler module that 275 for this scheduling command, the WLAN transmission can 276 not be initialized due to getting a NACK response from the 277 Coex engine, or PDG not being able to fit a transmission 278 within the timing constraints given by Coex. 279 280 Note that SCH will (re)set this count to 0 at the start 281 of reading a new SCH command. 282 This count is maintained on a per ring basis by the SCHeduler 283 284 285 286 <legal all> 287 */ 288 289 #define TX_FES_STATUS_START_COEX_NACK_COUNT_OFFSET 0x0000000000000008 290 #define TX_FES_STATUS_START_COEX_NACK_COUNT_LSB 11 291 #define TX_FES_STATUS_START_COEX_NACK_COUNT_MSB 15 292 #define TX_FES_STATUS_START_COEX_NACK_COUNT_MASK 0x000000000000f800 293 294 295 /* Description CCA_ED0 296 297 Used by TXPCU to report CCA status at time of transmit bandwidth 298 selection. Each bit is a sample of BUSY/IDLE of ED[0] (as 299 provided by SCH to TXPCU) for each 20 MHz sub-band. These 300 stats could potentially be used in future for rate adaptation. 301 302 Hamilton v1 used this to report 'current_tx_duration' but 303 it was unreliable and changed to expand 'cca_ed0' to 16-bit. 304 305 <legal all> 306 */ 307 308 #define TX_FES_STATUS_START_CCA_ED0_OFFSET 0x0000000000000008 309 #define TX_FES_STATUS_START_CCA_ED0_LSB 16 310 #define TX_FES_STATUS_START_CCA_ED0_MSB 31 311 #define TX_FES_STATUS_START_CCA_ED0_MASK 0x00000000ffff0000 312 313 314 /* Description DISABLED_USER_BITMAP_31_0 315 316 Bitmap of users that are disabled for this transmission, 317 LSB 32 bits 318 319 TXPCU converts disabled_group_bitmap_* in 'PCU_PPDU_SETUP_START' 320 from groups to users. 321 322 Hamilton v1 did not include this (and any subsequent) word. 323 324 <legal all> 325 */ 326 327 #define TX_FES_STATUS_START_DISABLED_USER_BITMAP_31_0_OFFSET 0x0000000000000008 328 #define TX_FES_STATUS_START_DISABLED_USER_BITMAP_31_0_LSB 32 329 #define TX_FES_STATUS_START_DISABLED_USER_BITMAP_31_0_MSB 63 330 #define TX_FES_STATUS_START_DISABLED_USER_BITMAP_31_0_MASK 0xffffffff00000000 331 332 333 334 #endif // TX_FES_STATUS_START 335