xref: /wlan-driver/fw-api/hw/kiwi/v2/rx_mpdu_desc_info.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 
2 /*
3  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 
21 
22 #ifndef _RX_MPDU_DESC_INFO_H_
23 #define _RX_MPDU_DESC_INFO_H_
24 #if !defined(__ASSEMBLER__)
25 #endif
26 
27 #define NUM_OF_DWORDS_RX_MPDU_DESC_INFO 2
28 
29 struct rx_mpdu_desc_info {
30 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
31              uint32_t msdu_count                                              :  8,
32                       fragment_flag                                           :  1,
33                       mpdu_retry_bit                                          :  1,
34                       ampdu_flag                                              :  1,
35                       bar_frame                                               :  1,
36                       pn_fields_contain_valid_info                            :  1,
37                       raw_mpdu                                                :  1,
38                       more_fragment_flag                                      :  1,
39                       src_info                                                : 12,
40                       mpdu_qos_control_valid                                  :  1,
41                       tid                                                     :  4;
42              uint32_t peer_meta_data                                          : 32;
43 #else
44              uint32_t tid                                                     :  4,
45                       mpdu_qos_control_valid                                  :  1,
46                       src_info                                                : 12,
47                       more_fragment_flag                                      :  1,
48                       raw_mpdu                                                :  1,
49                       pn_fields_contain_valid_info                            :  1,
50                       bar_frame                                               :  1,
51                       ampdu_flag                                              :  1,
52                       mpdu_retry_bit                                          :  1,
53                       fragment_flag                                           :  1,
54                       msdu_count                                              :  8;
55              uint32_t peer_meta_data                                          : 32;
56 #endif
57 };
58 
59 #define RX_MPDU_DESC_INFO_MSDU_COUNT_OFFSET                                         0x00000000
60 #define RX_MPDU_DESC_INFO_MSDU_COUNT_LSB                                            0
61 #define RX_MPDU_DESC_INFO_MSDU_COUNT_MSB                                            7
62 #define RX_MPDU_DESC_INFO_MSDU_COUNT_MASK                                           0x000000ff
63 
64 #define RX_MPDU_DESC_INFO_FRAGMENT_FLAG_OFFSET                                      0x00000000
65 #define RX_MPDU_DESC_INFO_FRAGMENT_FLAG_LSB                                         8
66 #define RX_MPDU_DESC_INFO_FRAGMENT_FLAG_MSB                                         8
67 #define RX_MPDU_DESC_INFO_FRAGMENT_FLAG_MASK                                        0x00000100
68 
69 #define RX_MPDU_DESC_INFO_MPDU_RETRY_BIT_OFFSET                                     0x00000000
70 #define RX_MPDU_DESC_INFO_MPDU_RETRY_BIT_LSB                                        9
71 #define RX_MPDU_DESC_INFO_MPDU_RETRY_BIT_MSB                                        9
72 #define RX_MPDU_DESC_INFO_MPDU_RETRY_BIT_MASK                                       0x00000200
73 
74 #define RX_MPDU_DESC_INFO_AMPDU_FLAG_OFFSET                                         0x00000000
75 #define RX_MPDU_DESC_INFO_AMPDU_FLAG_LSB                                            10
76 #define RX_MPDU_DESC_INFO_AMPDU_FLAG_MSB                                            10
77 #define RX_MPDU_DESC_INFO_AMPDU_FLAG_MASK                                           0x00000400
78 
79 #define RX_MPDU_DESC_INFO_BAR_FRAME_OFFSET                                          0x00000000
80 #define RX_MPDU_DESC_INFO_BAR_FRAME_LSB                                             11
81 #define RX_MPDU_DESC_INFO_BAR_FRAME_MSB                                             11
82 #define RX_MPDU_DESC_INFO_BAR_FRAME_MASK                                            0x00000800
83 
84 #define RX_MPDU_DESC_INFO_PN_FIELDS_CONTAIN_VALID_INFO_OFFSET                       0x00000000
85 #define RX_MPDU_DESC_INFO_PN_FIELDS_CONTAIN_VALID_INFO_LSB                          12
86 #define RX_MPDU_DESC_INFO_PN_FIELDS_CONTAIN_VALID_INFO_MSB                          12
87 #define RX_MPDU_DESC_INFO_PN_FIELDS_CONTAIN_VALID_INFO_MASK                         0x00001000
88 
89 #define RX_MPDU_DESC_INFO_RAW_MPDU_OFFSET                                           0x00000000
90 #define RX_MPDU_DESC_INFO_RAW_MPDU_LSB                                              13
91 #define RX_MPDU_DESC_INFO_RAW_MPDU_MSB                                              13
92 #define RX_MPDU_DESC_INFO_RAW_MPDU_MASK                                             0x00002000
93 
94 #define RX_MPDU_DESC_INFO_MORE_FRAGMENT_FLAG_OFFSET                                 0x00000000
95 #define RX_MPDU_DESC_INFO_MORE_FRAGMENT_FLAG_LSB                                    14
96 #define RX_MPDU_DESC_INFO_MORE_FRAGMENT_FLAG_MSB                                    14
97 #define RX_MPDU_DESC_INFO_MORE_FRAGMENT_FLAG_MASK                                   0x00004000
98 
99 #define RX_MPDU_DESC_INFO_SRC_INFO_OFFSET                                           0x00000000
100 #define RX_MPDU_DESC_INFO_SRC_INFO_LSB                                              15
101 #define RX_MPDU_DESC_INFO_SRC_INFO_MSB                                              26
102 #define RX_MPDU_DESC_INFO_SRC_INFO_MASK                                             0x07ff8000
103 
104 #define RX_MPDU_DESC_INFO_MPDU_QOS_CONTROL_VALID_OFFSET                             0x00000000
105 #define RX_MPDU_DESC_INFO_MPDU_QOS_CONTROL_VALID_LSB                                27
106 #define RX_MPDU_DESC_INFO_MPDU_QOS_CONTROL_VALID_MSB                                27
107 #define RX_MPDU_DESC_INFO_MPDU_QOS_CONTROL_VALID_MASK                               0x08000000
108 
109 #define RX_MPDU_DESC_INFO_TID_OFFSET                                                0x00000000
110 #define RX_MPDU_DESC_INFO_TID_LSB                                                   28
111 #define RX_MPDU_DESC_INFO_TID_MSB                                                   31
112 #define RX_MPDU_DESC_INFO_TID_MASK                                                  0xf0000000
113 
114 #define RX_MPDU_DESC_INFO_PEER_META_DATA_OFFSET                                     0x00000004
115 #define RX_MPDU_DESC_INFO_PEER_META_DATA_LSB                                        0
116 #define RX_MPDU_DESC_INFO_PEER_META_DATA_MSB                                        31
117 #define RX_MPDU_DESC_INFO_PEER_META_DATA_MASK                                       0xffffffff
118 
119 #endif
120