xref: /wlan-driver/fw-api/hw/qca6490/v1/wbm_buffer_ring.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2019 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 //
20 // DO NOT EDIT!  This file is automatically generated
21 //               These definitions are tied to a particular hardware layout
22 
23 
24 #ifndef _WBM_BUFFER_RING_H_
25 #define _WBM_BUFFER_RING_H_
26 #if !defined(__ASSEMBLER__)
27 #endif
28 
29 #include "buffer_addr_info.h"
30 
31 // ################ START SUMMARY #################
32 //
33 //	Dword	Fields
34 //	0-1	struct buffer_addr_info buf_addr_info;
35 //
36 // ################ END SUMMARY #################
37 
38 #define NUM_OF_DWORDS_WBM_BUFFER_RING 2
39 
40 struct wbm_buffer_ring {
41     struct            buffer_addr_info                       buf_addr_info;
42 };
43 
44 /*
45 
46 struct buffer_addr_info buf_addr_info
47 
48 			Consumer: WBM
49 
50 			Producer: WBM
51 
52 
53 
54 			Details of the physical address of the buffer + source
55 			buffer owner +  some SW meta data.
56 
57 			All modules getting this buffer address info, shall keep
58 			all the 64 bits of info in this descriptor together and
59 			eventually all 64 bits shall be given back to WMB when the
60 			buffer is released.
61 */
62 
63 
64  /* EXTERNAL REFERENCE : struct buffer_addr_info buf_addr_info */
65 
66 
67 /* Description		WBM_BUFFER_RING_0_BUF_ADDR_INFO_BUFFER_ADDR_31_0
68 
69 			Address (lower 32 bits) of the MSDU buffer OR
70 			MSDU_EXTENSION descriptor OR Link Descriptor
71 
72 
73 
74 			In case of 'NULL' pointer, this field is set to 0
75 
76 			<legal all>
77 */
78 #define WBM_BUFFER_RING_0_BUF_ADDR_INFO_BUFFER_ADDR_31_0_OFFSET      0x00000000
79 #define WBM_BUFFER_RING_0_BUF_ADDR_INFO_BUFFER_ADDR_31_0_LSB         0
80 #define WBM_BUFFER_RING_0_BUF_ADDR_INFO_BUFFER_ADDR_31_0_MASK        0xffffffff
81 
82 /* Description		WBM_BUFFER_RING_1_BUF_ADDR_INFO_BUFFER_ADDR_39_32
83 
84 			Address (upper 8 bits) of the MSDU buffer OR
85 			MSDU_EXTENSION descriptor OR Link Descriptor
86 
87 
88 
89 			In case of 'NULL' pointer, this field is set to 0
90 
91 			<legal all>
92 */
93 #define WBM_BUFFER_RING_1_BUF_ADDR_INFO_BUFFER_ADDR_39_32_OFFSET     0x00000004
94 #define WBM_BUFFER_RING_1_BUF_ADDR_INFO_BUFFER_ADDR_39_32_LSB        0
95 #define WBM_BUFFER_RING_1_BUF_ADDR_INFO_BUFFER_ADDR_39_32_MASK       0x000000ff
96 
97 /* Description		WBM_BUFFER_RING_1_BUF_ADDR_INFO_RETURN_BUFFER_MANAGER
98 
99 			Consumer: WBM
100 
101 			Producer: SW/FW
102 
103 
104 
105 			In case of 'NULL' pointer, this field is set to 0
106 
107 
108 
109 			Indicates to which buffer manager the buffer OR
110 			MSDU_EXTENSION descriptor OR link descriptor that is being
111 			pointed to shall be returned after the frame has been
112 			processed. It is used by WBM for routing purposes.
113 
114 
115 
116 			<enum 0 WBM_IDLE_BUF_LIST> This buffer shall be returned
117 			to the WMB buffer idle list
118 
119 			<enum 1 WBM_IDLE_DESC_LIST> This buffer shall be
120 			returned to the WMB idle link descriptor idle list
121 
122 			<enum 2 FW_BM> This buffer shall be returned to the FW
123 
124 			<enum 3 SW0_BM> This buffer shall be returned to the SW,
125 			ring 0
126 
127 			<enum 4 SW1_BM> This buffer shall be returned to the SW,
128 			ring 1
129 
130 			<enum 5 SW2_BM> This buffer shall be returned to the SW,
131 			ring 2
132 
133 			<enum 6 SW3_BM> This buffer shall be returned to the SW,
134 			ring 3
135 
136 			<enum 7 SW4_BM> This buffer shall be returned to the SW,
137 			ring 4
138 
139 
140 
141 			<legal all>
142 */
143 #define WBM_BUFFER_RING_1_BUF_ADDR_INFO_RETURN_BUFFER_MANAGER_OFFSET 0x00000004
144 #define WBM_BUFFER_RING_1_BUF_ADDR_INFO_RETURN_BUFFER_MANAGER_LSB    8
145 #define WBM_BUFFER_RING_1_BUF_ADDR_INFO_RETURN_BUFFER_MANAGER_MASK   0x00000700
146 
147 /* Description		WBM_BUFFER_RING_1_BUF_ADDR_INFO_SW_BUFFER_COOKIE
148 
149 			Cookie field exclusively used by SW.
150 
151 
152 
153 			In case of 'NULL' pointer, this field is set to 0
154 
155 
156 
157 			HW ignores the contents, accept that it passes the
158 			programmed value on to other descriptors together with the
159 			physical address
160 
161 
162 
163 			Field can be used by SW to for example associate the
164 			buffers physical address with the virtual address
165 
166 			The bit definitions as used by SW are within SW HLD
167 			specification
168 
169 
170 
171 			NOTE:
172 
173 			The three most significant bits can have a special
174 			meaning in case this struct is embedded in a TX_MPDU_DETAILS
175 			STRUCT, and field transmit_bw_restriction is set
176 
177 
178 
179 			In case of NON punctured transmission:
180 
181 			Sw_buffer_cookie[20:19] = 2'b00: 20 MHz TX only
182 
183 			Sw_buffer_cookie[20:19] = 2'b01: 40 MHz TX only
184 
185 			Sw_buffer_cookie[20:19] = 2'b10: 80 MHz TX only
186 
187 			Sw_buffer_cookie[20:19] = 2'b11: 160 MHz TX only
188 
189 
190 
191 			In case of punctured transmission:
192 
193 			Sw_buffer_cookie[20:18] = 3'b000: pattern 0 only
194 
195 			Sw_buffer_cookie[20:18] = 3'b001: pattern 1 only
196 
197 			Sw_buffer_cookie[20:18] = 3'b010: pattern 2 only
198 
199 			Sw_buffer_cookie[20:18] = 3'b011: pattern 3 only
200 
201 			Sw_buffer_cookie[20:18] = 3'b100: pattern 4 only
202 
203 			Sw_buffer_cookie[20:18] = 3'b101: pattern 5 only
204 
205 			Sw_buffer_cookie[20:18] = 3'b110: pattern 6 only
206 
207 			Sw_buffer_cookie[20:18] = 3'b111: pattern 7 only
208 
209 
210 
211 			Note: a punctured transmission is indicated by the
212 			presence of TLV TX_PUNCTURE_SETUP embedded in the scheduler
213 			TLV
214 
215 
216 
217 			<legal all>
218 */
219 #define WBM_BUFFER_RING_1_BUF_ADDR_INFO_SW_BUFFER_COOKIE_OFFSET      0x00000004
220 #define WBM_BUFFER_RING_1_BUF_ADDR_INFO_SW_BUFFER_COOKIE_LSB         11
221 #define WBM_BUFFER_RING_1_BUF_ADDR_INFO_SW_BUFFER_COOKIE_MASK        0xfffff800
222 
223 
224 #endif // _WBM_BUFFER_RING_H_
225