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