1 /*
2  * Copyright (c) 2024 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 _UNIFORM_DESCRIPTOR_HEADER_H_
18 #define _UNIFORM_DESCRIPTOR_HEADER_H_
19 
20 #define NUM_OF_DWORDS_UNIFORM_DESCRIPTOR_HEADER 1
21 
22 struct uniform_descriptor_header {
23 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
24              uint32_t owner                                                   :  4,
25                       buffer_type                                             :  4,
26                       tx_mpdu_queue_number                                    : 20,
27                       reserved_0a                                             :  4;
28 #else
29              uint32_t reserved_0a                                             :  4,
30                       tx_mpdu_queue_number                                    : 20,
31                       buffer_type                                             :  4,
32                       owner                                                   :  4;
33 #endif
34 };
35 
36 #define UNIFORM_DESCRIPTOR_HEADER_OWNER_OFFSET                                      0x00000000
37 #define UNIFORM_DESCRIPTOR_HEADER_OWNER_LSB                                         0
38 #define UNIFORM_DESCRIPTOR_HEADER_OWNER_MSB                                         3
39 #define UNIFORM_DESCRIPTOR_HEADER_OWNER_MASK                                        0x0000000f
40 
41 #define UNIFORM_DESCRIPTOR_HEADER_BUFFER_TYPE_OFFSET                                0x00000000
42 #define UNIFORM_DESCRIPTOR_HEADER_BUFFER_TYPE_LSB                                   4
43 #define UNIFORM_DESCRIPTOR_HEADER_BUFFER_TYPE_MSB                                   7
44 #define UNIFORM_DESCRIPTOR_HEADER_BUFFER_TYPE_MASK                                  0x000000f0
45 
46 #define UNIFORM_DESCRIPTOR_HEADER_TX_MPDU_QUEUE_NUMBER_OFFSET                       0x00000000
47 #define UNIFORM_DESCRIPTOR_HEADER_TX_MPDU_QUEUE_NUMBER_LSB                          8
48 #define UNIFORM_DESCRIPTOR_HEADER_TX_MPDU_QUEUE_NUMBER_MSB                          27
49 #define UNIFORM_DESCRIPTOR_HEADER_TX_MPDU_QUEUE_NUMBER_MASK                         0x0fffff00
50 
51 /* RESERVED is overlapping with TX_MPDU_QUEUE_NUMBER
52  * TX_MPDU_QUEUE_NUMBER valid on in Buffer_type is any of Transmit_MPDU_*_descriptor
53  * Where as RESERVED is only used for debugging in REO_QUEUE_Descr reo_queue_desc
54  */
55 #define UNIFORM_DESCRIPTOR_HEADER_RESERVED_0A_OFFSET                                0x00000000
56 #define UNIFORM_DESCRIPTOR_HEADER_RESERVED_0A_LSB                                   8
57 #define UNIFORM_DESCRIPTOR_HEADER_RESERVED_0A_MSB                                   31
58 #define UNIFORM_DESCRIPTOR_HEADER_RESERVED_0A_MASK                                  0xf0000000
59 
60 #endif
61