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