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 _TXPCU_USER_BUFFER_STATUS_H_ 18 #define _TXPCU_USER_BUFFER_STATUS_H_ 19 #if !defined(__ASSEMBLER__) 20 #endif 21 22 #include "txpcu_buffer_basics.h" 23 #define NUM_OF_DWORDS_TXPCU_USER_BUFFER_STATUS 2 24 25 #define NUM_OF_QWORDS_TXPCU_USER_BUFFER_STATUS 1 26 27 28 struct txpcu_user_buffer_status { 29 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN 30 struct txpcu_buffer_basics txpcu_basic_buffer_info; 31 uint32_t stored_word_count_user : 14, // [13:0] 32 reserved_1a : 1, // [14:14] 33 msdu_end : 1, // [15:15] 34 tx_data_sync_value : 16; // [31:16] 35 #else 36 struct txpcu_buffer_basics txpcu_basic_buffer_info; 37 uint32_t tx_data_sync_value : 16, // [31:16] 38 msdu_end : 1, // [15:15] 39 reserved_1a : 1, // [14:14] 40 stored_word_count_user : 14; // [13:0] 41 #endif 42 }; 43 44 45 /* Description TXPCU_BASIC_BUFFER_INFO 46 47 Global overview of the TXPCU buffer 48 <legal all> 49 */ 50 51 52 /* Description AVAILABLE_MEMORY 53 54 The amount of TX_FIFO memory in 128 byte units that is available. 55 56 TXPCU gets this from the Avail_fifo_mem signal from SFM. 57 58 59 When SFM is indicating a larger available amount, that value 60 shall be saturated to 0xFF in this field. 61 62 <legal all> 63 */ 64 65 #define TXPCU_USER_BUFFER_STATUS_TXPCU_BASIC_BUFFER_INFO_AVAILABLE_MEMORY_OFFSET 0x0000000000000000 66 #define TXPCU_USER_BUFFER_STATUS_TXPCU_BASIC_BUFFER_INFO_AVAILABLE_MEMORY_LSB 0 67 #define TXPCU_USER_BUFFER_STATUS_TXPCU_BASIC_BUFFER_INFO_AVAILABLE_MEMORY_MSB 7 68 #define TXPCU_USER_BUFFER_STATUS_TXPCU_BASIC_BUFFER_INFO_AVAILABLE_MEMORY_MASK 0x00000000000000ff 69 70 71 /* Description PARTIAL_TX_DATA_TLV_COUNT 72 73 The number of 16 bytes units received of the TX_DATA TLV 74 that is currently under reception by TXPCU. 75 Value saturates at 255 in case TX_DATA TLV length is larger 76 then 4080 bytes. This is unlikely as TX_DATA will generally 77 not be larger then then the Max MSDU size. 78 <legal all> 79 */ 80 81 #define TXPCU_USER_BUFFER_STATUS_TXPCU_BASIC_BUFFER_INFO_PARTIAL_TX_DATA_TLV_COUNT_OFFSET 0x0000000000000000 82 #define TXPCU_USER_BUFFER_STATUS_TXPCU_BASIC_BUFFER_INFO_PARTIAL_TX_DATA_TLV_COUNT_LSB 8 83 #define TXPCU_USER_BUFFER_STATUS_TXPCU_BASIC_BUFFER_INFO_PARTIAL_TX_DATA_TLV_COUNT_MSB 15 84 #define TXPCU_USER_BUFFER_STATUS_TXPCU_BASIC_BUFFER_INFO_PARTIAL_TX_DATA_TLV_COUNT_MASK 0x000000000000ff00 85 86 87 /* Description TX_DATA_TLV_COUNT 88 89 The number of completely received TX_DATA TLVs (of all the 90 users together) received by TXPCU 91 <legal all> 92 */ 93 94 #define TXPCU_USER_BUFFER_STATUS_TXPCU_BASIC_BUFFER_INFO_TX_DATA_TLV_COUNT_OFFSET 0x0000000000000000 95 #define TXPCU_USER_BUFFER_STATUS_TXPCU_BASIC_BUFFER_INFO_TX_DATA_TLV_COUNT_LSB 16 96 #define TXPCU_USER_BUFFER_STATUS_TXPCU_BASIC_BUFFER_INFO_TX_DATA_TLV_COUNT_MSB 31 97 #define TXPCU_USER_BUFFER_STATUS_TXPCU_BASIC_BUFFER_INFO_TX_DATA_TLV_COUNT_MASK 0x00000000ffff0000 98 99 100 /* Description STORED_WORD_COUNT_USER 101 102 Number of 4 word units (4 x 32 bits) stored for this user 103 in the buffer 104 105 <legal all> 106 */ 107 108 #define TXPCU_USER_BUFFER_STATUS_STORED_WORD_COUNT_USER_OFFSET 0x0000000000000000 109 #define TXPCU_USER_BUFFER_STATUS_STORED_WORD_COUNT_USER_LSB 32 110 #define TXPCU_USER_BUFFER_STATUS_STORED_WORD_COUNT_USER_MSB 45 111 #define TXPCU_USER_BUFFER_STATUS_STORED_WORD_COUNT_USER_MASK 0x00003fff00000000 112 113 114 /* Description RESERVED_1A 115 116 <legal 0> 117 */ 118 119 #define TXPCU_USER_BUFFER_STATUS_RESERVED_1A_OFFSET 0x0000000000000000 120 #define TXPCU_USER_BUFFER_STATUS_RESERVED_1A_LSB 46 121 #define TXPCU_USER_BUFFER_STATUS_RESERVED_1A_MSB 46 122 #define TXPCU_USER_BUFFER_STATUS_RESERVED_1A_MASK 0x0000400000000000 123 124 125 /* Description MSDU_END 126 127 Bit to indicate that TXPCU has received an entire MSDU and 128 'TX_MSDU_END' 129 <legal all> 130 */ 131 132 #define TXPCU_USER_BUFFER_STATUS_MSDU_END_OFFSET 0x0000000000000000 133 #define TXPCU_USER_BUFFER_STATUS_MSDU_END_LSB 47 134 #define TXPCU_USER_BUFFER_STATUS_MSDU_END_MSB 47 135 #define TXPCU_USER_BUFFER_STATUS_MSDU_END_MASK 0x0000800000000000 136 137 138 /* Description TX_DATA_SYNC_VALUE 139 140 The last received sync_value number from the TX_DATA_SYNC 141 TLV 142 At reception of TX_FES_SETUP, TXPCU initializes this value 143 to 0 144 <legal all> 145 */ 146 147 #define TXPCU_USER_BUFFER_STATUS_TX_DATA_SYNC_VALUE_OFFSET 0x0000000000000000 148 #define TXPCU_USER_BUFFER_STATUS_TX_DATA_SYNC_VALUE_LSB 48 149 #define TXPCU_USER_BUFFER_STATUS_TX_DATA_SYNC_VALUE_MSB 63 150 #define TXPCU_USER_BUFFER_STATUS_TX_DATA_SYNC_VALUE_MASK 0xffff000000000000 151 152 153 154 #endif // TXPCU_USER_BUFFER_STATUS 155