xref: /wlan-driver/fw-api/hw/wcn7750/v1/ce_stat_desc.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
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 
18 #ifndef _CE_STAT_DESC_H_
19 #define _CE_STAT_DESC_H_
20 
21 #define NUM_OF_DWORDS_CE_STAT_DESC 4
22 
23 struct ce_stat_desc {
24 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
25              uint32_t ce_res_5                                                :  8,
26                       toeplitz_en                                             :  1,
27                       src_swap                                                :  1,
28                       dest_swap                                               :  1,
29                       gather                                                  :  1,
30                       barrier_read                                            :  1,
31                       ce_res_6                                                :  3,
32                       length                                                  : 16;
33              uint32_t toeplitz_hash_0                                         : 32;
34              uint32_t toeplitz_hash_1                                         : 32;
35              uint32_t fw_metadata                                             : 16,
36                       ce_res_7                                                :  4,
37                       ring_id                                                 :  8,
38                       looping_count                                           :  4;
39 #else
40              uint32_t length                                                  : 16,
41                       ce_res_6                                                :  3,
42                       barrier_read                                            :  1,
43                       gather                                                  :  1,
44                       dest_swap                                               :  1,
45                       src_swap                                                :  1,
46                       toeplitz_en                                             :  1,
47                       ce_res_5                                                :  8;
48              uint32_t toeplitz_hash_0                                         : 32;
49              uint32_t toeplitz_hash_1                                         : 32;
50              uint32_t looping_count                                           :  4,
51                       ring_id                                                 :  8,
52                       ce_res_7                                                :  4,
53                       fw_metadata                                             : 16;
54 #endif
55 };
56 
57 #define CE_STAT_DESC_CE_RES_5_OFFSET                                                0x00000000
58 #define CE_STAT_DESC_CE_RES_5_LSB                                                   0
59 #define CE_STAT_DESC_CE_RES_5_MSB                                                   7
60 #define CE_STAT_DESC_CE_RES_5_MASK                                                  0x000000ff
61 
62 #define CE_STAT_DESC_TOEPLITZ_EN_OFFSET                                             0x00000000
63 #define CE_STAT_DESC_TOEPLITZ_EN_LSB                                                8
64 #define CE_STAT_DESC_TOEPLITZ_EN_MSB                                                8
65 #define CE_STAT_DESC_TOEPLITZ_EN_MASK                                               0x00000100
66 
67 #define CE_STAT_DESC_SRC_SWAP_OFFSET                                                0x00000000
68 #define CE_STAT_DESC_SRC_SWAP_LSB                                                   9
69 #define CE_STAT_DESC_SRC_SWAP_MSB                                                   9
70 #define CE_STAT_DESC_SRC_SWAP_MASK                                                  0x00000200
71 
72 #define CE_STAT_DESC_DEST_SWAP_OFFSET                                               0x00000000
73 #define CE_STAT_DESC_DEST_SWAP_LSB                                                  10
74 #define CE_STAT_DESC_DEST_SWAP_MSB                                                  10
75 #define CE_STAT_DESC_DEST_SWAP_MASK                                                 0x00000400
76 
77 #define CE_STAT_DESC_GATHER_OFFSET                                                  0x00000000
78 #define CE_STAT_DESC_GATHER_LSB                                                     11
79 #define CE_STAT_DESC_GATHER_MSB                                                     11
80 #define CE_STAT_DESC_GATHER_MASK                                                    0x00000800
81 
82 #define CE_STAT_DESC_BARRIER_READ_OFFSET                                            0x00000000
83 #define CE_STAT_DESC_BARRIER_READ_LSB                                               12
84 #define CE_STAT_DESC_BARRIER_READ_MSB                                               12
85 #define CE_STAT_DESC_BARRIER_READ_MASK                                              0x00001000
86 
87 #define CE_STAT_DESC_CE_RES_6_OFFSET                                                0x00000000
88 #define CE_STAT_DESC_CE_RES_6_LSB                                                   13
89 #define CE_STAT_DESC_CE_RES_6_MSB                                                   15
90 #define CE_STAT_DESC_CE_RES_6_MASK                                                  0x0000e000
91 
92 #define CE_STAT_DESC_LENGTH_OFFSET                                                  0x00000000
93 #define CE_STAT_DESC_LENGTH_LSB                                                     16
94 #define CE_STAT_DESC_LENGTH_MSB                                                     31
95 #define CE_STAT_DESC_LENGTH_MASK                                                    0xffff0000
96 
97 #define CE_STAT_DESC_TOEPLITZ_HASH_0_OFFSET                                         0x00000004
98 #define CE_STAT_DESC_TOEPLITZ_HASH_0_LSB                                            0
99 #define CE_STAT_DESC_TOEPLITZ_HASH_0_MSB                                            31
100 #define CE_STAT_DESC_TOEPLITZ_HASH_0_MASK                                           0xffffffff
101 
102 #define CE_STAT_DESC_TOEPLITZ_HASH_1_OFFSET                                         0x00000008
103 #define CE_STAT_DESC_TOEPLITZ_HASH_1_LSB                                            0
104 #define CE_STAT_DESC_TOEPLITZ_HASH_1_MSB                                            31
105 #define CE_STAT_DESC_TOEPLITZ_HASH_1_MASK                                           0xffffffff
106 
107 #define CE_STAT_DESC_FW_METADATA_OFFSET                                             0x0000000c
108 #define CE_STAT_DESC_FW_METADATA_LSB                                                0
109 #define CE_STAT_DESC_FW_METADATA_MSB                                                15
110 #define CE_STAT_DESC_FW_METADATA_MASK                                               0x0000ffff
111 
112 #define CE_STAT_DESC_CE_RES_7_OFFSET                                                0x0000000c
113 #define CE_STAT_DESC_CE_RES_7_LSB                                                   16
114 #define CE_STAT_DESC_CE_RES_7_MSB                                                   19
115 #define CE_STAT_DESC_CE_RES_7_MASK                                                  0x000f0000
116 
117 #define CE_STAT_DESC_RING_ID_OFFSET                                                 0x0000000c
118 #define CE_STAT_DESC_RING_ID_LSB                                                    20
119 #define CE_STAT_DESC_RING_ID_MSB                                                    27
120 #define CE_STAT_DESC_RING_ID_MASK                                                   0x0ff00000
121 
122 #define CE_STAT_DESC_LOOPING_COUNT_OFFSET                                           0x0000000c
123 #define CE_STAT_DESC_LOOPING_COUNT_LSB                                              28
124 #define CE_STAT_DESC_LOOPING_COUNT_MSB                                              31
125 #define CE_STAT_DESC_LOOPING_COUNT_MASK                                             0xf0000000
126 
127 #endif
128