1 
2 /*
3  * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for any
6  * purpose with or without fee is hereby granted, provided that the above
7  * copyright notice and this permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16  */
17 
18 
19 
20 #ifndef _MON_DROP_H_
21 #define _MON_DROP_H_
22 #if !defined(__ASSEMBLER__)
23 #endif
24 
25 #define NUM_OF_DWORDS_MON_DROP 2
26 
27 #define NUM_OF_QWORDS_MON_DROP 1
28 
29 struct mon_drop {
30 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
31              uint32_t ppdu_id                                                 : 32;
32              uint32_t ppdu_drop_cnt                                           : 10,
33                       mpdu_drop_cnt                                           : 10,
34                       tlv_drop_cnt                                            : 10,
35                       end_of_ppdu_seen                                        :  1,
36                       reserved_1a                                             :  1;
37 #else
38              uint32_t ppdu_id                                                 : 32;
39              uint32_t reserved_1a                                             :  1,
40                       end_of_ppdu_seen                                        :  1,
41                       tlv_drop_cnt                                            : 10,
42                       mpdu_drop_cnt                                           : 10,
43                       ppdu_drop_cnt                                           : 10;
44 #endif
45 };
46 
47 #define MON_DROP_PPDU_ID_OFFSET                                                     0x0000000000000000
48 #define MON_DROP_PPDU_ID_LSB                                                        0
49 #define MON_DROP_PPDU_ID_MSB                                                        31
50 #define MON_DROP_PPDU_ID_MASK                                                       0x00000000ffffffff
51 
52 #define MON_DROP_PPDU_DROP_CNT_OFFSET                                               0x0000000000000000
53 #define MON_DROP_PPDU_DROP_CNT_LSB                                                  32
54 #define MON_DROP_PPDU_DROP_CNT_MSB                                                  41
55 #define MON_DROP_PPDU_DROP_CNT_MASK                                                 0x000003ff00000000
56 
57 #define MON_DROP_MPDU_DROP_CNT_OFFSET                                               0x0000000000000000
58 #define MON_DROP_MPDU_DROP_CNT_LSB                                                  42
59 #define MON_DROP_MPDU_DROP_CNT_MSB                                                  51
60 #define MON_DROP_MPDU_DROP_CNT_MASK                                                 0x000ffc0000000000
61 
62 #define MON_DROP_TLV_DROP_CNT_OFFSET                                                0x0000000000000000
63 #define MON_DROP_TLV_DROP_CNT_LSB                                                   52
64 #define MON_DROP_TLV_DROP_CNT_MSB                                                   61
65 #define MON_DROP_TLV_DROP_CNT_MASK                                                  0x3ff0000000000000
66 
67 #define MON_DROP_END_OF_PPDU_SEEN_OFFSET                                            0x0000000000000000
68 #define MON_DROP_END_OF_PPDU_SEEN_LSB                                               62
69 #define MON_DROP_END_OF_PPDU_SEEN_MSB                                               62
70 #define MON_DROP_END_OF_PPDU_SEEN_MASK                                              0x4000000000000000
71 
72 #define MON_DROP_RESERVED_1A_OFFSET                                                 0x0000000000000000
73 #define MON_DROP_RESERVED_1A_LSB                                                    63
74 #define MON_DROP_RESERVED_1A_MSB                                                    63
75 #define MON_DROP_RESERVED_1A_MASK                                                   0x8000000000000000
76 
77 #endif
78