1*5113495bSYour Name 2*5113495bSYour Name /* Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved. 3*5113495bSYour Name * 4*5113495bSYour Name * Permission to use, copy, modify, and/or distribute this software for any 5*5113495bSYour Name * purpose with or without fee is hereby granted, provided that the above 6*5113495bSYour Name * copyright notice and this permission notice appear in all copies. 7*5113495bSYour Name * 8*5113495bSYour Name * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9*5113495bSYour Name * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10*5113495bSYour Name * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11*5113495bSYour Name * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12*5113495bSYour Name * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13*5113495bSYour Name * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14*5113495bSYour Name * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15*5113495bSYour Name */ 16*5113495bSYour Name 17*5113495bSYour Name 18*5113495bSYour Name 19*5113495bSYour Name 20*5113495bSYour Name 21*5113495bSYour Name 22*5113495bSYour Name 23*5113495bSYour Name 24*5113495bSYour Name 25*5113495bSYour Name 26*5113495bSYour Name #ifndef _MON_DESTINATION_RING_WITH_DROP_H_ 27*5113495bSYour Name #define _MON_DESTINATION_RING_WITH_DROP_H_ 28*5113495bSYour Name #if !defined(__ASSEMBLER__) 29*5113495bSYour Name #endif 30*5113495bSYour Name 31*5113495bSYour Name #define NUM_OF_DWORDS_MON_DESTINATION_RING_WITH_DROP 4 32*5113495bSYour Name 33*5113495bSYour Name 34*5113495bSYour Name struct mon_destination_ring_with_drop { 35*5113495bSYour Name #ifndef WIFI_BIT_ORDER_BIG_ENDIAN 36*5113495bSYour Name uint32_t ppdu_drop_cnt : 10, // [9:0] 37*5113495bSYour Name mpdu_drop_cnt : 10, // [19:10] 38*5113495bSYour Name tlv_drop_cnt : 10, // [29:20] 39*5113495bSYour Name end_of_ppdu_seen : 1, // [30:30] 40*5113495bSYour Name reserved_0a : 1; // [31:31] 41*5113495bSYour Name uint32_t reserved_1a : 32; // [31:0] 42*5113495bSYour Name uint32_t ppdu_id : 32; // [31:0] 43*5113495bSYour Name uint32_t reserved_3a : 18, // [17:0] 44*5113495bSYour Name initiator : 1, // [18:18] 45*5113495bSYour Name empty_descriptor : 1, // [19:19] 46*5113495bSYour Name ring_id : 8, // [27:20] 47*5113495bSYour Name looping_count : 4; // [31:28] 48*5113495bSYour Name #else 49*5113495bSYour Name uint32_t reserved_0a : 1, // [31:31] 50*5113495bSYour Name end_of_ppdu_seen : 1, // [30:30] 51*5113495bSYour Name tlv_drop_cnt : 10, // [29:20] 52*5113495bSYour Name mpdu_drop_cnt : 10, // [19:10] 53*5113495bSYour Name ppdu_drop_cnt : 10; // [9:0] 54*5113495bSYour Name uint32_t reserved_1a : 32; // [31:0] 55*5113495bSYour Name uint32_t ppdu_id : 32; // [31:0] 56*5113495bSYour Name uint32_t looping_count : 4, // [31:28] 57*5113495bSYour Name ring_id : 8, // [27:20] 58*5113495bSYour Name empty_descriptor : 1, // [19:19] 59*5113495bSYour Name initiator : 1, // [18:18] 60*5113495bSYour Name reserved_3a : 18; // [17:0] 61*5113495bSYour Name #endif 62*5113495bSYour Name }; 63*5113495bSYour Name 64*5113495bSYour Name 65*5113495bSYour Name /* Description PPDU_DROP_CNT 66*5113495bSYour Name 67*5113495bSYour Name The number of PPDUs dropped due to the back-pressure 68*5113495bSYour Name 69*5113495bSYour Name Set to 1023 if >1023 PPDUs got dropped 70*5113495bSYour Name <legal all> 71*5113495bSYour Name */ 72*5113495bSYour Name 73*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_PPDU_DROP_CNT_OFFSET 0x00000000 74*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_PPDU_DROP_CNT_LSB 0 75*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_PPDU_DROP_CNT_MSB 9 76*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_PPDU_DROP_CNT_MASK 0x000003ff 77*5113495bSYour Name 78*5113495bSYour Name 79*5113495bSYour Name /* Description MPDU_DROP_CNT 80*5113495bSYour Name 81*5113495bSYour Name The number of MPDUs dropped within the first PPDU due to 82*5113495bSYour Name the back-pressure 83*5113495bSYour Name 84*5113495bSYour Name Set to 1023 if >1023 MPDUs got dropped 85*5113495bSYour Name <legal all> 86*5113495bSYour Name */ 87*5113495bSYour Name 88*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_MPDU_DROP_CNT_OFFSET 0x00000000 89*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_MPDU_DROP_CNT_LSB 10 90*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_MPDU_DROP_CNT_MSB 19 91*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_MPDU_DROP_CNT_MASK 0x000ffc00 92*5113495bSYour Name 93*5113495bSYour Name 94*5113495bSYour Name /* Description TLV_DROP_CNT 95*5113495bSYour Name 96*5113495bSYour Name The number of PPDU-level (global or per-user) TLVs dropped 97*5113495bSYour Name within the first PPDU due to the back-pressure 98*5113495bSYour Name */ 99*5113495bSYour Name 100*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_TLV_DROP_CNT_OFFSET 0x00000000 101*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_TLV_DROP_CNT_LSB 20 102*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_TLV_DROP_CNT_MSB 29 103*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_TLV_DROP_CNT_MASK 0x3ff00000 104*5113495bSYour Name 105*5113495bSYour Name 106*5113495bSYour Name /* Description END_OF_PPDU_SEEN 107*5113495bSYour Name 108*5113495bSYour Name Field valid only if mpdu_drop_cnt > 0 or tlv_drop_cnt > 109*5113495bSYour Name 0 110*5113495bSYour Name 111*5113495bSYour Name Set by TXMON if 'TX_FES_STATUS_END' is received for a partially 112*5113495bSYour Name dropped PPDU when Initiator = 1. 113*5113495bSYour Name Set by TXMON if 'RESPONSE_END_STATUS' is received for a 114*5113495bSYour Name partially dropped PPDU when Initiator = 0. 115*5113495bSYour Name Set by RXMON if 'RX_PPDU_END_STATUS_DONE' is received for 116*5113495bSYour Name a partially dropped PPDU. 117*5113495bSYour Name */ 118*5113495bSYour Name 119*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_END_OF_PPDU_SEEN_OFFSET 0x00000000 120*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_END_OF_PPDU_SEEN_LSB 30 121*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_END_OF_PPDU_SEEN_MSB 30 122*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_END_OF_PPDU_SEEN_MASK 0x40000000 123*5113495bSYour Name 124*5113495bSYour Name 125*5113495bSYour Name /* Description RESERVED_0A 126*5113495bSYour Name 127*5113495bSYour Name <legal 0> 128*5113495bSYour Name */ 129*5113495bSYour Name 130*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_RESERVED_0A_OFFSET 0x00000000 131*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_RESERVED_0A_LSB 31 132*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_RESERVED_0A_MSB 31 133*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_RESERVED_0A_MASK 0x80000000 134*5113495bSYour Name 135*5113495bSYour Name 136*5113495bSYour Name /* Description RESERVED_1A 137*5113495bSYour Name 138*5113495bSYour Name <legal 0> 139*5113495bSYour Name */ 140*5113495bSYour Name 141*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_RESERVED_1A_OFFSET 0x00000004 142*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_RESERVED_1A_LSB 0 143*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_RESERVED_1A_MSB 31 144*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_RESERVED_1A_MASK 0xffffffff 145*5113495bSYour Name 146*5113495bSYour Name 147*5113495bSYour Name /* Description PPDU_ID 148*5113495bSYour Name 149*5113495bSYour Name The ID of the last PPDU which saw the back-pressure on AXI 150*5113495bSYour Name 151*5113495bSYour Name 152*5113495bSYour Name TXMON fills this with the schedule_id from 'TX_FES_SETUP' 153*5113495bSYour Name when Initiator = 1. 154*5113495bSYour Name TXMON fills this with the Phy_ppdu_id from 'RX_RESPONSE_REQUIRED_INFO' 155*5113495bSYour Name when Initiator = 0. 156*5113495bSYour Name RXMON fills this with the Phy_ppdu_id from 'RX_PPDU_START.' 157*5113495bSYour Name 158*5113495bSYour Name <legal all> 159*5113495bSYour Name */ 160*5113495bSYour Name 161*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_PPDU_ID_OFFSET 0x00000008 162*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_PPDU_ID_LSB 0 163*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_PPDU_ID_MSB 31 164*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_PPDU_ID_MASK 0xffffffff 165*5113495bSYour Name 166*5113495bSYour Name 167*5113495bSYour Name /* Description RESERVED_3A 168*5113495bSYour Name 169*5113495bSYour Name <legal 0> 170*5113495bSYour Name */ 171*5113495bSYour Name 172*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_RESERVED_3A_OFFSET 0x0000000c 173*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_RESERVED_3A_LSB 0 174*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_RESERVED_3A_MSB 17 175*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_RESERVED_3A_MASK 0x0003ffff 176*5113495bSYour Name 177*5113495bSYour Name 178*5113495bSYour Name /* Description INITIATOR 179*5113495bSYour Name 180*5113495bSYour Name 1: This descriptor belongs to a TX FES (TXOP initiator) 181*5113495bSYour Name 0: This descriptor belongs to a response TX (TXOP responder) 182*5113495bSYour Name 183*5113495bSYour Name <legal all> 184*5113495bSYour Name */ 185*5113495bSYour Name 186*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_INITIATOR_OFFSET 0x0000000c 187*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_INITIATOR_LSB 18 188*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_INITIATOR_MSB 18 189*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_INITIATOR_MASK 0x00040000 190*5113495bSYour Name 191*5113495bSYour Name 192*5113495bSYour Name /* Description EMPTY_DESCRIPTOR 193*5113495bSYour Name 194*5113495bSYour Name 0: This descriptor is written on a flush or the end of a 195*5113495bSYour Name PPDU or the end of status buffer (see 'MON_DESTINATION_RING' 196*5113495bSYour Name structure) 197*5113495bSYour Name 1: This descriptor is written to indicate drop information 198*5113495bSYour Name 199*5113495bSYour Name <legal 1> 200*5113495bSYour Name */ 201*5113495bSYour Name 202*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_EMPTY_DESCRIPTOR_OFFSET 0x0000000c 203*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_EMPTY_DESCRIPTOR_LSB 19 204*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_EMPTY_DESCRIPTOR_MSB 19 205*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_EMPTY_DESCRIPTOR_MASK 0x00080000 206*5113495bSYour Name 207*5113495bSYour Name 208*5113495bSYour Name /* Description RING_ID 209*5113495bSYour Name 210*5113495bSYour Name Consumer: SW/REO/DEBUG 211*5113495bSYour Name Producer: SRNG (of TXMON/RXMON) 212*5113495bSYour Name 213*5113495bSYour Name For debugging. 214*5113495bSYour Name This field is filled in by the SRNG module. 215*5113495bSYour Name It help to identify the ring that is being looked 216*5113495bSYour Name <legal 0> 217*5113495bSYour Name */ 218*5113495bSYour Name 219*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_RING_ID_OFFSET 0x0000000c 220*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_RING_ID_LSB 20 221*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_RING_ID_MSB 27 222*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_RING_ID_MASK 0x0ff00000 223*5113495bSYour Name 224*5113495bSYour Name 225*5113495bSYour Name /* Description LOOPING_COUNT 226*5113495bSYour Name 227*5113495bSYour Name Consumer: SW/DEBUG 228*5113495bSYour Name Producer: SRNG (of TXMON/RXMON) 229*5113495bSYour Name 230*5113495bSYour Name For debugging. 231*5113495bSYour Name This field is filled in by the SRNG module. 232*5113495bSYour Name 233*5113495bSYour Name A count value that indicates the number of times the producer 234*5113495bSYour Name of entries into this Ring has looped around the ring. 235*5113495bSYour Name At initialization time, this value is set to 0. On the first 236*5113495bSYour Name loop, this value is set to 1. After the max value is reached 237*5113495bSYour Name allowed by the number of bits for this field, the count 238*5113495bSYour Name value continues with 0 again. 239*5113495bSYour Name 240*5113495bSYour Name In case SW is the consumer of the ring entries, it can use 241*5113495bSYour Name this field to figure out up to where the producer of entries 242*5113495bSYour Name has created new entries. This eliminates the need to check 243*5113495bSYour Name where the "head pointer' of the ring is located once the 244*5113495bSYour Name SW starts processing an interrupt indicating that new entries 245*5113495bSYour Name have been put into this ring... 246*5113495bSYour Name 247*5113495bSYour Name Also note that SW if it wants only needs to look at the 248*5113495bSYour Name LSB bit of this count value. 249*5113495bSYour Name <legal all> 250*5113495bSYour Name */ 251*5113495bSYour Name 252*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_LOOPING_COUNT_OFFSET 0x0000000c 253*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_LOOPING_COUNT_LSB 28 254*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_LOOPING_COUNT_MSB 31 255*5113495bSYour Name #define MON_DESTINATION_RING_WITH_DROP_LOOPING_COUNT_MASK 0xf0000000 256*5113495bSYour Name 257*5113495bSYour Name 258*5113495bSYour Name 259*5113495bSYour Name #endif // MON_DESTINATION_RING_WITH_DROP 260