xref: /wlan-driver/fw-api/hw/qcn6432/txpcu_buffer_basics.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
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_BUFFER_BASICS_H_
18 #define _TXPCU_BUFFER_BASICS_H_
19 #if !defined(__ASSEMBLER__)
20 #endif
21 
22 #define NUM_OF_DWORDS_TXPCU_BUFFER_BASICS 1
23 
24 
25 struct txpcu_buffer_basics {
26 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
27              uint32_t available_memory                                        :  8, // [7:0]
28                       partial_tx_data_tlv_count                               :  8, // [15:8]
29                       tx_data_tlv_count                                       : 16; // [31:16]
30 #else
31              uint32_t tx_data_tlv_count                                       : 16, // [31:16]
32                       partial_tx_data_tlv_count                               :  8, // [15:8]
33                       available_memory                                        :  8; // [7:0]
34 #endif
35 };
36 
37 
38 /* Description		AVAILABLE_MEMORY
39 
40 			The amount of TX_FIFO memory in 128 byte units that is available.
41 
42 			TXPCU gets this from the Avail_fifo_mem signal from SFM.
43 
44 
45 			When SFM is indicating a larger available amount, that value
46 			 shall be saturated to 0xFF in this field.
47 
48 			<legal all>
49 */
50 
51 #define TXPCU_BUFFER_BASICS_AVAILABLE_MEMORY_OFFSET                                 0x00000000
52 #define TXPCU_BUFFER_BASICS_AVAILABLE_MEMORY_LSB                                    0
53 #define TXPCU_BUFFER_BASICS_AVAILABLE_MEMORY_MSB                                    7
54 #define TXPCU_BUFFER_BASICS_AVAILABLE_MEMORY_MASK                                   0x000000ff
55 
56 
57 /* Description		PARTIAL_TX_DATA_TLV_COUNT
58 
59 			The number of  16 bytes units received of the TX_DATA TLV
60 			 that is currently under reception by TXPCU.
61 			Value saturates at 255 in case TX_DATA TLV length is larger
62 			 then 4080 bytes. This is unlikely as TX_DATA will generally
63 			 not be larger then then the Max MSDU size.
64 			<legal all>
65 */
66 
67 #define TXPCU_BUFFER_BASICS_PARTIAL_TX_DATA_TLV_COUNT_OFFSET                        0x00000000
68 #define TXPCU_BUFFER_BASICS_PARTIAL_TX_DATA_TLV_COUNT_LSB                           8
69 #define TXPCU_BUFFER_BASICS_PARTIAL_TX_DATA_TLV_COUNT_MSB                           15
70 #define TXPCU_BUFFER_BASICS_PARTIAL_TX_DATA_TLV_COUNT_MASK                          0x0000ff00
71 
72 
73 /* Description		TX_DATA_TLV_COUNT
74 
75 			The number of completely received TX_DATA TLVs (of all the
76 			 users together) received by TXPCU
77 			<legal all>
78 */
79 
80 #define TXPCU_BUFFER_BASICS_TX_DATA_TLV_COUNT_OFFSET                                0x00000000
81 #define TXPCU_BUFFER_BASICS_TX_DATA_TLV_COUNT_LSB                                   16
82 #define TXPCU_BUFFER_BASICS_TX_DATA_TLV_COUNT_MSB                                   31
83 #define TXPCU_BUFFER_BASICS_TX_DATA_TLV_COUNT_MASK                                  0xffff0000
84 
85 
86 
87 #endif   // TXPCU_BUFFER_BASICS
88