xref: /wlan-driver/fw-api/fw/wdi_ipa.h (revision 5113495b16420b49004c444715d2daae2066e7dc) !
1 /*
2  * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
6  *
7  *
8  * Permission to use, copy, modify, and/or distribute this software for
9  * any purpose with or without fee is hereby granted, provided that the
10  * above copyright notice and this permission notice appear in all
11  * copies.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
14  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
15  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
16  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
17  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
18  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20  * PERFORMANCE OF THIS SOFTWARE.
21  */
22 
23 /*
24  * This file was originally distributed by Qualcomm Atheros, Inc.
25  * under proprietary terms before Copyright ownership was assigned
26  * to the Linux Foundation.
27  */
28 
29 /**
30  * @file wdi_ipa.h
31  *
32  * @details WIFI <-> IPA direct data-path interface related definitions.
33  */
34 
35 #ifndef _WDI_IPA_H_
36 #define _WDI_IPA_H_
37 
38 #if defined(ATH_TARGET)
39 #include <osapi.h>      /* A_UINT32 */
40 
41 #else
42 
43 #if defined(IPA_TARGET)
44 typedef unsigned int  A_UINT32
45 typedef unsigned char A_UINT8
46 #define A_ASSERT(__bool) \
47   do {  \
48      if (0 == (__bool)) { \
49         while(1); \
50      } \
51   } while(0)
52 #define A_COMPILE_TIME_ASSERT(assertion_name, predicate) \
53     typedef char assertion_name[(predicate) ? 1 : -1];
54 #define PREPACK
55 #define POSTPACK
56 
57 #else
58 
59 #include <a_types.h>    /* A_UINT32 */
60 #include <a_osapi.h>    /* PREPACK, POSTPACK */
61 
62 #endif /* IPA_TARGET */
63 
64 #endif /* ATH_TARGET */
65 
66 
67 #ifndef offsetof
68 #define offsetof(type, field)   ((unsigned int)(&((type *)0)->field))
69 #endif
70 
71 /*
72  * WDI_IPA version history:
73  * 1.0 initial numbered version
74  */
75 #define WDI_IPA_CURRENT_VERSION_MAJOR 1
76 #define WDI_IPA_CURRENT_VERSION_MINOR 1
77 
78 
79 #define WDI_IPA_CHECK_SET_VAL(field, val) \
80     A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
81 
82 
83 
84 
85 /**
86  * @brief WDI_IPA TX_FRAG_DESC
87  *
88  *     |31            24|23            16|15             8|7              0|
89  *     |----------------+----------------+----------------+----------------|
90  *     |                           frag buf ptr                            |
91  *     |-------------------------------------------------------------------|
92  *     |            Reserved             |             frag len            |
93  *     |-------------------------------------------------------------------|
94  *     |                                 0                                 |
95  *     |-------------------------------------------------------------------|
96  *
97  * Header fields:
98  * Header fields:
99  *   - FRAG_BUF_PTR
100  *     Bits 31:0
101  *     Purpose: Specify pointer to the starting of Ethernet Packet
102  *   - FRAG_LEN
103  *     Bits 15:0
104  *     Purpose: Specify total length of the Ethernet Packet.
105  *   - 0
106  *     Bits 31:0
107  *     Purpose: fixed value 0, it is used for indicating WIFI HW
108  *         that Ethernet Packet is contained in ONE fragment.
109  *
110  */
111 
112 #define WDI_IPA_TX_FRAG_DESC_SZ                          12 /* bytes */
113 
114 #define WDI_IPA_TX_FRAG_DESC_FRAG_BUF_PTR_M              0xffffffff
115 #define WDI_IPA_TX_FRAG_DESC_FRAG_BUF_PTR_S              0
116 
117 #define WDI_IPA_TX_FRAG_DESC_FRAG_LEN_M                  0x0000ffff
118 #define WDI_IPA_TX_FRAG_DESC_FRAG_LEN_S                  0
119 
120 #define WDI_IPA_TX_FRAG_DESC_FRAG_BUF_PTR_GET(_var)        \
121         (((_var) & WDI_IPA_TX_FRAG_DESC_FRAG_BUF_PTR_M) >> \
122          WDI_IPA_TX_FRAG_DESC_FRAG_BUF_PTR_S)
123 #define WDI_IPA_TX_FRAG_DESC_FRAG_BUF_PTR_SET(_var, _val)  \
124         do {                                               \
125             WDI_IPA_CHECK_SET_VAL(WDI_IPA_TX_FRAG_DESC_FRAG_BUF_PTR, _val);  \
126             ((_var) &= (WDI_IPA_TX_FRAG_DESC_FRAG_BUF_PTR_M)); \
127             ((_var) |= ((_val) << WDI_IPA_TX_FRAG_DESC_FRAG_BUF_PTR_S)); \         } while(0)
128 
129 #define WDI_IPA_TX_FRAG_DESC_FRAG_LEN_GET(_var)        \
130         (((_var) & WDI_IPA_TX_FRAG_DESC_FRAG_LEN_M) >> \
131          WDI_IPA_TX_FRAG_DESC_FRAG_LEN_S)
132 #define WDI_IPA_TX_FRAG_DESC_FRAG_LEN_SET(_var, _val)  \
133         do {                                               \
134             WDI_IPA_CHECK_SET_VAL(WDI_IPA_TX_FRAG_DESC_FRAG_LEN, _val);  \
135             ((_var) &= (WDI_IPA_TX_FRAG_DESC_FRAG_LEN_M)); \
136             ((_var) |= ((_val) << WDI_IPA_TX_FRAG_DESC_FRAG_LEN_S)); \             } while(0)
137 
138 PREPACK struct wdi_ipa_tx_frag_desc_t
139 {
140     A_UINT32 frag_buf_ptr; /* word 0 */
141 
142     A_UINT32 /* word 1 */
143         frag_len:   16,
144         reserved:   16;
145 
146     A_UINT32 fixed_val_zero; /* word 2 */
147 } POSTPACK;
148 
149 
150 
151 /**
152  * @brief WDI_IPA TX_HTT_DESC is same as HTT TX Msdu descriptor (defined in
153  *        htt.h). TX_HTT_DESC fields are opaque to IPA uC, so we just need
154  *        to define size of the descriptor in wdi_ipa.h. Host WLAN driver
155  *        and WIFI FW uses htt.h for the bit-field definitions.
156  *
157  */
158 #define WDI_IPA_TX_HTT_DESC_SZ                         16 /* bytes */
159 
160 
161 
162 /**
163  * @brief WDI_IPA TX_IPA_DESC
164  *
165  *     |31            24|23            16|15             8|7              0|
166  *     |----------------+----------------+----------------+----------------|
167  *     |                       Reserved                   |     vdev id    |
168  *     |-------------------------------------------------------------------|
169  *
170  * Header fields:
171  * Header fields:
172  *   - VDEV_ID
173  *     Bits 23:16
174  *     Purpose: Specifies the SoftAP VDEV interface, pertaining to the packet
175  *         filled by IPA HW.
176  */
177 
178 #define WDI_IPA_TX_IPA_DESC_SZ                        4 /* bytes */
179 
180 #define WDI_IPA_TX_IPA_DESC_VDEV_ID_M                 0x000000ff
181 #define WDI_IPA_TX_IPA_DESC_VDEV_ID_S                 0
182 
183 #define WDI_IPA_TX_IPA_DESC_VDEV_ID_GET(_var)        \
184         (((_var) & WDI_IPA_TX_IPA_DESC_VDEV_ID_M) >> \
185          WDI_IPA_TX_IPA_DESC_VDEV_ID_S)
186 #define WDI_IPA_TX_IPA_DESC_VDEV_ID_SET(_var, _val)  \
187         do {                                               \
188             WDI_IPA_CHECK_SET_VAL(WDI_IPA_TX_IPA_DESC_VDEV_ID, _val);  \
189             ((_var) &= (WDI_IPA_TX_IPA_DESC_VDEV_ID_M)); \
190             ((_var) |= ((_val) << WDI_IPA_TX_IPA_DESC_VDEV_ID_S)); \
191         } while(0)
192 
193 PREPACK struct wdi_ipa_tx_ipa_desc_t
194 {
195     A_UINT32 /* word 0 */
196         vdev_id:      8,
197         reserved:     24;
198 } POSTPACK;
199 
200 
201 #define WDI_IPA_TX_ETHR_PKT_MAX_SZ                  1518 /* bytes */
202 
203 PREPACK struct wdi_ipa_tx_pkt_buf_t
204 {
205     A_UINT8 htt_desc[WDI_IPA_TX_HTT_DESC_SZ];
206     struct wdi_ipa_tx_frag_desc_t frag_desc;
207     struct wdi_ipa_tx_ipa_desc_t ipa_desc;
208     A_UINT8 ethr_pkt[WDI_IPA_TX_ETHR_PKT_MAX_SZ];
209 } POSTPACK;
210 
211 #define WDI_IPA_TX_PKT_BUF_MAX_SZ                   2048 /* bytes */
212 A_COMPILE_TIME_ASSERT(verify_pkt_buf_sz,
213        sizeof(struct wdi_ipa_tx_pkt_buf_t)<=WDI_IPA_TX_PKT_BUF_MAX_SZ);
214 #define WDI_IPA_TX_PKT_POOL_SZ                      1023 /* packets */
215 
216 
217 
218 /**
219  * @brief WDI_IPA TX_CE_DESC
220  *
221  *     |31            24|23            16|15             8|7              0|
222  *     |----------------+----------------+----------------+----------------|
223  *     |                              src ptr                              |
224  *     |-------------------------------------------------------------------|
225  *     |           meta data         |S|G|             src buf len         |
226  *     |-------------------------------------------------------------------|
227  *
228  * Header fields:
229  * Header fields:
230  *   - SRC_PTR
231  *     Bits 31:0
232  *     Purpose: Specify pointer to the starting of Pacet Buf
233  *   - SRC_BUF_LEN
234  *     Bits 15:0
235  *     Purpose: Specify number of bytes to be copied by Copy Engine
236  *   - G
237  *     Bits 16
238  *     Purpose: Enable gather of multiple CE descriptors to one destination
239  *        Always 0 (disable) for WDI_IPA data path
240  *   - S
241  *     Bits 17
242  *     Purpose: Enable byte swap for endian conversation.
243  *         Always 0 (disable) for WDI_IPA data path.
244  *     META_DATA
245  *     Bits 31:18
246  *     Purpose: unused
247  */
248 
249 #define WDI_IPA_TX_CE_DESC_SZ                          8 /* bytes */
250 
251 #define WDI_IPA_TX_CE_DESC_SRC_PTR_M                   0xffffffff
252 #define WDI_IPA_TX_CE_DESC_SRC_PTR_S                   0
253 
254 #define WDI_IPA_TX_CE_DESC_SRC_BUF_LEN_M               0x0000ffff
255 #define WDI_IPA_TX_CE_DESC_SRC_BUF_LEN_S               0
256 
257 #define WDI_IPA_TX_CE_DESC_G_M                         0x00010000
258 #define WDI_IPA_TX_CE_DESC_G_S                         16
259 
260 #define WDI_IPA_TX_CE_DESC_S_M                         0x00020000
261 #define WDI_IPA_TX_CE_DESC_S_S                         17
262 
263 #define WDI_IPA_TX_CE_DESC_META_DATA_M                 0xFFFC0000
264 #define WDI_IPA_TX_CE_DESC_META_DATA_S                 18
265 
266 #define WDI_IPA_TX_CE_DESC_SRC_PTR_GET(_var)        \
267         (((_var) & WDI_IPA_TX_CE_DESC_SRC_PTR_M) >> \
268          WDI_IPA_TX_CE_DESC_SRC_PTR_S)
269 #define WDI_IPA_TX_CE_DESC_SRC_PTR_SET(_var, _val)  \
270         do {                                               \
271             WDI_IPA_CHECK_SET_VAL(WDI_IPA_TX_CE_DESC_SRC_PTR, _val);  \
272             ((_var) &= (WDI_IPA_TX_CE_DESC_SRC_PTR_M)); \
273             ((_var) |= ((_val) << WDI_IPA_TX_CE_DESC_SRC_PTR_S)); \
274         } while(0)
275 
276 #define WDI_IPA_TX_CE_DESC_SRC_BUF_LEN_GET(_var)        \
277         (((_var) & WDI_IPA_TX_CE_DESC_SRC_BUF_LEN_M) >> \
278          WDI_IPA_TX_CE_DESC_SRC_BUF_LEN_S)
279 #define WDI_IPA_TX_CE_DESC_SRC_BUF_LEN_SET(_var, _val)  \
280         do {                                               \
281             WDI_IPA_CHECK_SET_VAL(WDI_IPA_TX_CE_DESC_SRC_BUF_LEN, _val);  \
282             ((_var) &= (WDI_IPA_TX_CE_DESC_SRC_BUF_LEN_M)); \
283             ((_var) |= ((_val) << WDI_IPA_TX_CE_DESC_SRC_BUF_LEN_S)); \
284         } while(0)
285 
286 #define WDI_IPA_TX_CE_DESC_G_GET(_var)        \
287         (((_var) & WDI_IPA_TX_CE_DESC_G_M) >> \
288          WDI_IPA_TX_CE_DESC_G_S)
289 #define WDI_IPA_TX_CE_DESC_G_SET(_var, _val)  \
290         do {                                               \
291             WDI_IPA_CHECK_SET_VAL(WDI_IPA_TX_CE_DESC_G, _val);  \
292             ((_var) &= (WDI_IPA_TX_CE_DESC_G_M)); \
293             ((_var) |= ((_val) << WDI_IPA_TX_CE_DESC_G_S)); \
294         } while(0)
295 
296 #define WDI_IPA_TX_CE_DESC_S_GET(_var)        \
297         (((_var) & WDI_IPA_TX_CE_DESC_S_M) >> \
298          WDI_IPA_TX_CE_DESC_S_S)
299 #define WDI_IPA_TX_CE_DESC_S_SET(_var, _val)  \
300         do {                                               \
301             WDI_IPA_CHECK_SET_VAL(WDI_IPA_TX_CE_DESC_S, _val);  \
302             ((_var) &= (WDI_IPA_TX_CE_DESC_S_M)); \
303             ((_var) |= ((_val) << WDI_IPA_TX_CE_DESC_S_S)); \
304         } while(0)
305 
306 #define WDI_IPA_TX_CE_DESC_META_DATA_GET(_var)        \
307         (((_var) & WDI_IPA_TX_CE_DESC_META_DATA_M) >> \
308          WDI_IPA_TX_CE_DESC_META_DATA_S)
309 #define WDI_IPA_TX_CE_DESC_META_DATA_SET(_var, _val)  \
310         do {                                               \
311             WDI_IPA_CHECK_SET_VAL(WDI_IPA_TX_CE_DESC_META_DATA, _val);  \
312             ((_var) &= (WDI_IPA_TX_CE_DESC_META_DATA_M)); \
313             ((_var) |= ((_val) << WDI_IPA_TX_CE_DESC_META_DATA_S)); \
314         } while(0)
315 
316 PREPACK struct wdi_ipa_tx_ce_desc_t
317 {
318     A_UINT32 src_ptr; /* word 0 */
319     A_UINT32          /* word 1 */
320         src_buf_len:   16,
321         g:             1,
322         s:             1,
323         meta_data:     14;
324 } POSTPACK;
325 
326 
327 #define WDI_IPA_TX_CE_RING_SZ                       1024 /* no. of desc */
328 #define WDI_IPA_TX_INITIAL_PKT_HDR_SZ  28
329 #define WDI_IPA_TX_CE_FIXED_BUF_LEN    (WDI_IPA_TX_FRAG_DESC_SZ + \
330                                         WDI_IPA_TX_HTT_DESC_SZ + \
331                                         WDI_IPA_TX_IPA_DESC_SZ + \
332                                         WDI_IPA_TX_INITIAL_PKT_HDR_SZ)
333 
334 
335 /* Verify that CE ring size is power of 2 */
336 A_COMPILE_TIME_ASSERT(verify_ce_ring_sz,
337       ((WDI_IPA_TX_CE_RING_SZ) ^ (WDI_IPA_TX_CE_RING_SZ-1)) ==
338       ((WDI_IPA_TX_CE_RING_SZ<<1)-1));
339 
340 A_COMPILE_TIME_ASSERT(verify_pkt_pool_sz,
341       WDI_IPA_TX_PKT_POOL_SZ < WDI_IPA_TX_CE_RING_SZ);
342 
343 
344 /**
345  * @brief WDI_IPA TX_COMP_DESC
346  *
347  *     |31            24|23            16|15             8|7              0|
348  *     |----------------+----------------+----------------+----------------|
349  *     |                          Packet Buf Ptr                           |
350  *     |-------------------------------------------------------------------|
351  *
352  * Header fields:
353  * Header fields:
354  *   - PKT_BUF_PTR
355  *     Bits 31:0
356  *     Purpose: Specify pointer to Packet Buf, which is being freed
357  *         after TX comp
358  */
359 
360 
361 #define WDI_IPA_TX_COMP_DESC_SZ                          4 /* bytes */
362 
363 #define WDI_IPA_TX_COMP_DESC_PKT_BUF_PTR_M               0xffffffff
364 #define WDI_IPA_TX_COMP_DESC_PKT_BUF_PTR_S               0
365 
366 #define WDI_IPA_TX_COMP_DESC_PKT_BUF_PTR_GET(_var)        \
367         (((_var) & WDI_IPA_TX_COMP_DESC_PKT_BUF_PTR_M) >> \
368          WDI_IPA_TX_COMP_DESC_PKT_BUF_PTR_S)
369 #define WDI_IPA_TX_COMP_DESC_PKT_BUF_PTR_SET(_var, _val)  \
370         do {                                               \
371             WDI_IPA_CHECK_SET_VAL(WDI_IPA_TX_COMP_DESC_PKT_BUF_PTR, _val);\
372             ((_var) &= (WDI_IPA_TX_COMP_DESC_PKT_BUF_PTR_M)); \
373             ((_var) |= ((_val) << WDI_IPA_TX_COMP_DESC_PKT_BUF_PTR_S)); \
374         } while(0)
375 
376 PREPACK struct wdi_ipa_tx_comp_desc_t
377 {
378     A_UINT32 pkt_buf_ptr; /* word 0 */
379 } POSTPACK;
380 
381 #define WDI_IPA_TX_COMP_RING_SZ                          1024 /* no. of desc */
382 /* Verify that TX COMP ring size is power of 2 */
383 A_COMPILE_TIME_ASSERT(verify_tx_comp_ring_sz,
384       ((WDI_IPA_TX_COMP_RING_SZ) ^ (WDI_IPA_TX_COMP_RING_SZ-1)) ==
385       ((WDI_IPA_TX_COMP_RING_SZ<<1)-1));
386 
387 A_COMPILE_TIME_ASSERT(verify_Pkt_pool_sz,
388       WDI_IPA_TX_PKT_POOL_SZ < WDI_IPA_TX_COMP_RING_SZ);
389 
390 
391 
392 /**
393  * @brief WDI_IPA RX_IND_DESC
394  *
395  *     |31            24|23            16|15             8|7              0|
396  *     |----------------+----------------+----------------+----------------|
397  *     |                             Packet Ptr                            |
398  *     |-------------------------------------------------------------------|
399  *     |    Reserved    |    vdev id     |            Packet Length        |
400  *     |-------------------------------------------------------------------|
401  *
402  * Header fields:
403  * Header fields:
404  *   - PKT_PTR
405  *     Bits 31:0
406  *     Purpose: Specify pointer to starting of Ethernet Packet
407  *   - PKT_LENGTH
408  *     Bits 15:0
409  *     Purpose: Specify length Ethernet Packet
410  *   - VDEV_ID
411  *     Bits 23:16
412  *     Purpose: Specify the VDEV ID corresponding to the packet
413  */
414 
415 
416 #define WDI_IPA_RX_IND_DESC_SZ                      8 /* bytes */
417 
418 #define WDI_IPA_RX_IND_DESC_PKT_PTR_M               0xffffffff
419 #define WDI_IPA_RX_IND_DESC_PKT_PTR_S               0
420 
421 #define WDI_IPA_RX_IND_DESC_PKT_LEN_M               0x0000ffff
422 #define WDI_IPA_RX_IND_DESC_PKT_LEN_S               0
423 
424 #define WDI_IPA_RX_IND_DESC_VDEV_ID_M               0x00ff0000
425 #define WDI_IPA_RX_IND_DESC_VDEV_ID_S               16
426 
427 #define WDI_IPA_RX_IND_DESC_PKT_PTR_GET(_var)        \
428         (((_var) & WDI_IPA_RX_IND_DESC_PKT_PTR_M) >> \
429          WDI_IPA_RX_IND_DESC_PKT_PTR_S)
430 #define WDI_IPA_RX_IND_DESC_PKT_PTR_SET(_var, _val)  \
431         do {                                               \
432             WDI_IPA_CHECK_SET_VAL(WDI_IPA_RX_IND_DESC_PKT_PTR, _val);\
433             ((_var) &= (WDI_IPA_RX_IND_DESC_PKT_PTR_M)); \
434             ((_var) |= ((_val) << WDI_IPA_RX_IND_DESC_PKT_PTR_S)); \
435         } while(0)
436 
437 #define WDI_IPA_RX_IND_DESC_PKT_LEN_GET(_var)        \
438         (((_var) & WDI_IPA_RX_IND_DESC_PKT_LEN_M) >> \
439          WDI_IPA_RX_IND_DESC_PKT_LEN_S)
440 #define WDI_IPA_RX_IND_DESC_PKT_LEN_SET(_var, _val)  \
441         do {                                               \
442             WDI_IPA_CHECK_SET_VAL(WDI_IPA_RX_IND_DESC_PKT_LEN, _val);\
443             ((_var) &= (WDI_IPA_RX_IND_DESC_PKT_LEN_M)); \
444             ((_var) |= ((_val) << WDI_IPA_RX_IND_DESC_PKT_LEN_S)); \
445         } while(0)
446 
447 #define WDI_IPA_RX_IND_DESC_VDEV_ID_GET(_var)        \
448         (((_var) & WDI_IPA_RX_IND_DESC_VDEV_ID_M) >> \
449          WDI_IPA_RX_IND_DESC_VDEV_ID_S)
450 #define WDI_IPA_RX_IND_DESC_VDEV_ID_SET(_var, _val)  \
451         do {                                               \
452             WDI_IPA_CHECK_SET_VAL(WDI_IPA_RX_IND_DESC_VDEV_ID, _val);\
453             ((_var) &= (WDI_IPA_RX_IND_DESC_VDEV_ID_M)); \
454             ((_var) |= ((_val) << WDI_IPA_RX_IND_DESC_VDEV_ID_S)); \
455         } while(0)
456 
457 
458 PREPACK struct wdi_ipa_rx_ind_desc_t
459 {
460     A_UINT32 pkt_ptr; /* word 0 */
461     A_UINT32          /* word 1 */
462         pkt_len:16,
463         vdev_id:8,
464         reserved:8;
465 } POSTPACK;
466 
467 #define WDI_IPA_RX_IND_RING_SZ                     512 /* no. of desc */
468 /* Verify that RX IND ring size is power of 2 */
469 A_COMPILE_TIME_ASSERT(verify_rx_ind_ring_sz,
470       ((WDI_IPA_RX_IND_RING_SZ) ^ (WDI_IPA_RX_IND_RING_SZ-1)) ==
471       ((WDI_IPA_RX_IND_RING_SZ<<1)-1));
472 
473 /**
474  * @brief WLAN_WDI_IPA_DBG_STATS
475  *
476  *     |31            24|23            16|15             8|7              0|
477  *     |----------------+----------------+----------------+----------------|
478  *     |                          tx comp ring base                        |
479  *     |-------------------------------------------------------------------|
480  *     |                          tx comp ring size                        |
481  *     |-------------------------------------------------------------------|
482  *     |                       tx comp ring dbell addr                     |
483  *     |-------------------------------------------------------------------|
484  *     |                    tx comp ring dbell ind val                     |
485  *     |-------------------------------------------------------------------|
486  *     |                    tx comp ring dbell cached val                  |
487  *     |-------------------------------------------------------------------|
488  *     |                           tx pkts enqueued                        |
489  *     |-------------------------------------------------------------------|
490  *     |                        tx pkts completed                          |
491  *     |-------------------------------------------------------------------|
492  *     |                          tx is suspend                            |
493  *     |-------------------------------------------------------------------|
494  *     |                            reserved0                              |
495  *     |-------------------------------------------------------------------|
496  *     |                         rx ind ring base                          |
497  *     |-------------------------------------------------------------------|
498  *     |                         rx ind ring size                          |
499  *     |-------------------------------------------------------------------|
500  *     |                     rx ind ring dbell addr                        |
501  *     |-------------------------------------------------------------------|
502  *     |                    rx ind ring dbell ind val                      |
503  *     |-------------------------------------------------------------------|
504  *     |                  rx ind ring dbell cached val                     |
505  *     |-------------------------------------------------------------------|
506  *     |                        rx ind ring rdidx addr                     |
507  *     |-------------------------------------------------------------------|
508  *     |                      rx ind ring rd idx cached val                |
509  *     |-------------------------------------------------------------------|
510  *     |                           rx refill idx                           |
511  *     |-------------------------------------------------------------------|
512  *     |                      rx num pkts indicated                        |
513  *     |-------------------------------------------------------------------|
514  *     |                         rx buf refilled                           |
515  *     |-------------------------------------------------------------------|
516  *     |                       rx num ind drop no space                    |
517  *     |-------------------------------------------------------------------|
518  *     |                       rx num ind drop no buf                      |
519  *     |-------------------------------------------------------------------|
520  *     |                          rx is suspend                            |
521  *     |-------------------------------------------------------------------|
522  *     |                            reserved1                              |
523  *     |-------------------------------------------------------------------|
524  *
525  * Header fields:
526  * Header fields:
527  *   - TX_COMP_RING_BASE
528  *     Bits 31:0
529  *     Purpose: Specifies TX_COMP RING base in DDR
530  *   - TX_COMP_RING_SIZE
531  *     Bits 31:0
532  *     Purpose: Specifies TX_COMP RING size in terms of elements
533  *   - TX_COMP_RING_DBELL ADDR
534  *     Bits 31:0
535  *     Purpose: Specifies DBELL ADDR for updating TX COMP RING write index
536  *   - TX_COMP_RING_DBELL_IND_VAL
537  *     Bits 31:0
538  *     Purpose: Specifies latest TX COMP RING write index written to
539  *              Dbell address.
540  *   - TX_COMP_RING_DBELL_CACHED_VAL
541  *     Bits 31:0
542  *     Purpose: Specifies WLAN maintained latest TX COMP RING write index
543  *   - TX_PKTS_ENQUEUED
544  *     Bits 31:0
545  *     Purpose: Specifies total number of packets queued for transmission from
546  *              WDI_IPA path
547  *   - TX_PKTS_COMPLETED
548  *     Bits 31:0
549  *     Purpose: Specifies total number of packets completed on WDI_IPA path
550  *   - TX_IS_SUSPEND
551  *     Bits 31:0
552  *     Purpose: Specifies whether WDI_IPA TX is suspended or not.
553  *   - RX_IND_RING_BASE
554  *     Bits 31:0
555  *     Purpose: Specifies RX_IND Ring base in DDR.
556  *   - RX_IND_RING_SIZE
557  *     Bits 31:0
558  *     Purpose: Specifies RX_IND Ring size in terms of elements.
559  *   - RX_IND_RING_DBELL_ADDR
560  *     Bits 31:0
561  *     Purpose: Specifies DBELL ADDR for updating RX_IND WR idx.
562  *   - RX_IND_RING_DBELL_IND_VAL
563  *     Bits 31:0
564  *     Purpose: Specifies latest RX IND RING write index written to
565  *              Dbell address.
566  *   - RX_IND_RING_DBELL_CACHED_VAL
567  *     Bits 31:0
568  *     Purpose: Specifies WLAN maintained latest RX IND RING write index
569  *   - RX_IND_RING_RDIDX_ADDR
570  *     Bits 31:0
571  *     Purpose: Specifies ADDR where RX_IND Read Index is updated.
572  *   - RX_IND_RING_RDIDX_CACHED_VAL
573  *     Bits 31:0
574  *     Purpose: Specifies WLAN maintained latest RX IND Read index.
575  *   - RX_REFILL_IDX
576  *     Bits 31:0
577  *     Purpose: Specifies IDX upto which buffers are recycled from RX IND ring.
578  *   - RX_NUM_PKTS_INDICATED
579  *     Bits 31:0
580  *     Purpose: Specifies total number of RX pakets indicated on WDI_IPA path.
581  *   - RX_NUM_BUF_REFILLED
582  *     Bits 31:0
583  *     Purpose: Specifies total number of RX buffers recycled on WDI_IPA path.
584  *   - RX_NUM_IND_DROPS_NO_SPACE
585  *     Bits 31:0
586  *     Purpose: Specifies number of times RX packets dropped as
587  *              not enough space in RX_IND ring
588  *   - RX_NUM_IND_DROPS_NO_BUF
589  *     Bits 31:0
590  *     Purpose: Specifies number of times RX packets dropped as
591  *              not enough buffers available on WLAN
592  *   - RX_IS_SUSPEND
593  *     Bits 31:0
594  *     Purpose: Specifies whether WDI_IPA RX path is in suspend or not
595  */
596 
597 #define WLAN_WDI_IPA_DBG_STATS_SZ                                     92 /* bytes */
598 
599 #define WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_BASE_M                    0xffffffff
600 #define WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_BASE_S                    0x0
601 
602 #define WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_SIZE_M                    0xffffffff
603 #define WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_SIZE_S                    0x0
604 
605 #define WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_DBELL_ADDR_M              0xffffffff
606 #define WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_DBELL_ADDR_S              0x0
607 
608 #define WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_DBELL_IND_VAL_M           0xffffffff
609 #define WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_DBELL_IND_VAL_S           0x0
610 
611 #define WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_DBELL_CACHED_VAL_M        0xffffffff
612 #define WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_DBELL_CACHED_VAL_S        0x0
613 
614 #define WLAN_WDI_IPA_DBG_STATS_TX_PKTS_ENQUEUED_M                     0xffffffff
615 #define WLAN_WDI_IPA_DBG_STATS_TX_PKTS_ENQUEUED_S                     0x0
616 
617 #define WLAN_WDI_IPA_DBG_STATS_TX_PKTS_COMPLETED_M                    0xffffffff
618 #define WLAN_WDI_IPA_DBG_STATS_TX_PKTS_COMPLETED_S                    0x0
619 
620 #define WLAN_WDI_IPA_DBG_STATS_TX_IS_SUSPEND_M                        0xffffffff
621 #define WLAN_WDI_IPA_DBG_STATS_TX_IS_SUSPEND_S                        0x0
622 
623 #define WLAN_WDI_IPA_DBG_STATS_RESERVED0_M                            0xffffffff
624 #define WLAN_WDI_IPA_DBG_STATS_RESERVED0_S                            0x0
625 
626 #define WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_BASE_M                     0xffffffff
627 #define WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_BASE_S                     0x0
628 
629 #define WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_SIZE_M                     0xffffffff
630 #define WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_SIZE_S                     0x0
631 
632 #define WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_DBELL_ADDR_M               0xffffffff
633 #define WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_DBELL_ADDR_S               0x0
634 
635 #define WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_DBELL_IND_VAL_M            0xffffffff
636 #define WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_DBELL_IND_VAL_S            0x0
637 
638 #define WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_DBELL_CACHED_VAL_M         0xffffffff
639 #define WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_DBELL_CACHED_VAL_S         0x0
640 
641 #define WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_RDIDX_ADDR_M               0xffffffff
642 #define WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_RDIDX_ADDR_S               0x0
643 
644 #define WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_RDIDX_CACHED_VAL_M         0xffffffff
645 #define WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_RDIDX_CACHED_VAL_S         0x0
646 
647 #define WLAN_WDI_IPA_DBG_STATS_RX_REFILL_IDX_M                        0xffffffff
648 #define WLAN_WDI_IPA_DBG_STATS_RX_REFILL_IDX_S                        0x0
649 
650 #define WLAN_WDI_IPA_DBG_STATS_RX_NUM_PKTS_INDICATED_M                0xffffffff
651 #define WLAN_WDI_IPA_DBG_STATS_RX_NUM_PKTS_INDICATED_S                0x0
652 
653 #define WLAN_WDI_IPA_DBG_STATS_RX_BUF_REFILLED_M                      0xffffffff
654 #define WLAN_WDI_IPA_DBG_STATS_RX_BUF_REFILLED_S                      0x0
655 
656 #define WLAN_WDI_IPA_DBG_STATS_RX_NUM_IND_DROPS_NO_SPACE_M            0xffffffff
657 #define WLAN_WDI_IPA_DBG_STATS_RX_NUM_IND_DROPS_NO_SPACE_S            0x0
658 
659 #define WLAN_WDI_IPA_DBG_STATS_RX_NUM_IND_DROPS_NO_BUF_M              0xffffffff
660 #define WLAN_WDI_IPA_DBG_STATS_RX_NUM_IND_DROPS_NO_BUF_S              0x0
661 
662 #define WLAN_WDI_IPA_DBG_STATS_RX_IS_SUSPEND_M                        0xffffffff
663 #define WLAN_WDI_IPA_DBG_STATS_RX_IS_SUSPEND_S                        0x0
664 
665 #define WLAN_WDI_IPA_DBG_STATS_RESERVED1_M                            0xffffffff
666 #define WLAN_WDI_IPA_DBG_STATS_RESERVED1_S                            0x0
667 
668 
669 #define WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_BASE_GET(_var)        \
670         (((_var) & WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_BASE_M) >> \
671           WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_BASE_S)
672 #define WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_BASE_SET(_var, _val)  \
673         do {                                               \
674             WDI_IPA_CHECK_SET_VAL(WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_BASE, _val);\
675             ((_var) &= (WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_BASE_M)); \
676             ((_var) |= ((_val) << WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_BASE_S                    )); \
677         } while(0)
678 
679 #define WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_SIZE_GET(_var)        \
680         (((_var) & WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_SIZE_M) >> \
681           WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_SIZE_S)
682 #define WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_SIZE_SET(_var, _val)  \
683         do {                                               \
684             WDI_IPA_CHECK_SET_VAL(WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_SIZE, _val);\
685             ((_var) &= (WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_SIZE_M)); \
686             ((_var) |= ((_val) << WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_SIZE_S                    )); \
687         } while(0)
688 
689 #define WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_DBELL_ADDR_GET(_var)        \
690         (((_var) & WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_DBELL_ADDR_M) >> \
691           WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_DBELL_ADDR_S)
692 #define WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_DBELL_ADDR_SET(_var, _val)  \
693         do {                                               \
694             WDI_IPA_CHECK_SET_VAL(WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_DBELL_ADDR, _val);\
695             ((_var) &= (WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_DBELL_ADDR_M)); \
696             ((_var) |= ((_val) << WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_DBELL_ADDR_S                    )); \
697         } while(0)
698 
699 #define WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_DBELL_IND_VAL_GET(_var)        \
700         (((_var) & WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_DBELL_IND_VAL_M) >> \
701           WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_DBELL_IND_VAL_S)
702 #define WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_DBELL_IND_VAL_SET(_var, _val)  \
703         do {                                               \
704             WDI_IPA_CHECK_SET_VAL(WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_DBELL_IND_VAL, _val);\
705             ((_var) &= (WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_DBELL_IND_VAL_M)); \
706             ((_var) |= ((_val) << WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_DBELL_IND_VAL_S                    )); \
707         } while(0)
708 
709 
710 #define WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_DBELL_CACHED_VAL_GET(_var)        \
711         (((_var) & WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_DBELL_CACHED_VAL_M) >> \
712           WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_DBELL_CACHED_VAL_S)
713 #define WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_DBELL_CACHED_VAL_SET(_var, _val)  \
714         do {                                               \
715             WDI_IPA_CHECK_SET_VAL(WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_DBELL_CACHED_VAL, _val);\
716             ((_var) &= (WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_DBELL_CACHED_VAL_M)); \
717             ((_var) |= ((_val) << WLAN_WDI_IPA_DBG_STATS_TX_COMP_RING_DBELL_CACHED_VAL_S                    )); \
718         } while(0)
719 
720 
721 #define WLAN_WDI_IPA_DBG_STATS_TX_PKTS_ENQUEUED_GET(_var)        \
722         (((_var) & WLAN_WDI_IPA_DBG_STATS_TX_PKTS_ENQUEUED_M) >> \
723           WLAN_WDI_IPA_DBG_STATS_TX_PKTS_ENQUEUED_S)
724 #define WLAN_WDI_IPA_DBG_STATS_TX_PKTS_ENQUEUED_SET(_var, _val)  \
725         do {                                               \
726             WDI_IPA_CHECK_SET_VAL(WLAN_WDI_IPA_DBG_STATS_TX_PKTS_ENQUEUED, _val);\
727             ((_var) &= (WLAN_WDI_IPA_DBG_STATS_TX_PKTS_ENQUEUED_M)); \
728             ((_var) |= ((_val) << WLAN_WDI_IPA_DBG_STATS_TX_PKTS_ENQUEUED_S                    )); \
729         } while(0)
730 
731 #define WLAN_WDI_IPA_DBG_STATS_TX_PKTS_COMPLETED_GET(_var)        \
732         (((_var) & WLAN_WDI_IPA_DBG_STATS_TX_PKTS_COMPLETED_M) >> \
733           WLAN_WDI_IPA_DBG_STATS_TX_PKTS_COMPLETED_S)
734 #define WLAN_WDI_IPA_DBG_STATS_TX_PKTS_COMPLETED_SET(_var, _val)  \
735         do {                                               \
736             WDI_IPA_CHECK_SET_VAL(WLAN_WDI_IPA_DBG_STATS_TX_PKTS_COMPLETED, _val);\
737             ((_var) &= (WLAN_WDI_IPA_DBG_STATS_TX_PKTS_COMPLETED_M)); \
738             ((_var) |= ((_val) << WLAN_WDI_IPA_DBG_STATS_TX_PKTS_COMPLETED_S                    )); \
739         } while(0)
740 
741 #define WLAN_WDI_IPA_DBG_STATS_TX_IS_SUSPEND_GET(_var)        \
742         (((_var) & WLAN_WDI_IPA_DBG_STATS_TX_IS_SUSPEND_M) >> \
743           WLAN_WDI_IPA_DBG_STATS_TX_IS_SUSPEND_S)
744 #define WLAN_WDI_IPA_DBG_STATS_TX_IS_SUSPEND_SET(_var, _val)  \
745         do {                                               \
746             WDI_IPA_CHECK_SET_VAL(WLAN_WDI_IPA_DBG_STATS_TX_IS_SUSPEND, _val);\
747             ((_var) &= (WLAN_WDI_IPA_DBG_STATS_TX_IS_SUSPEND_M)); \
748             ((_var) |= ((_val) << WLAN_WDI_IPA_DBG_STATS_TX_IS_SUSPEND_S                    )); \
749         } while(0)
750 
751 #define WLAN_WDI_IPA_DBG_STATS_RESERVED0_GET(_var)        \
752         (((_var) & WLAN_WDI_IPA_DBG_STATS_RESERVED0_M) >> \
753           WLAN_WDI_IPA_DBG_STATS_RESERVED0_S)
754 #define WLAN_WDI_IPA_DBG_STATS_RESERVED0_SET(_var, _val)  \
755         do {                                               \
756             WDI_IPA_CHECK_SET_VAL(WLAN_WDI_IPA_DBG_STATS_RESERVED0, _val);\
757             ((_var) &= (WLAN_WDI_IPA_DBG_STATS_RESERVED0_M)); \
758             ((_var) |= ((_val) << WLAN_WDI_IPA_DBG_STATS_RESERVED0_S                    )); \
759         } while(0)
760 
761 #define WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_BASE_GET(_var)        \
762         (((_var) & WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_BASE_M) >> \
763           WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_BASE_S)
764 #define WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_BASE_SET(_var, _val)  \
765         do {                                               \
766             WDI_IPA_CHECK_SET_VAL(WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_BASE, _val);\
767             ((_var) &= (WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_BASE_M)); \
768             ((_var) |= ((_val) << WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_BASE_S                    )); \
769         } while(0)
770 
771 #define WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_SIZE_GET(_var)        \
772         (((_var) & WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_SIZE_M) >> \
773           WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_SIZE_S)
774 #define WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_SIZE_SET(_var, _val)  \
775         do {                                               \
776             WDI_IPA_CHECK_SET_VAL(WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_SIZE, _val);\
777             ((_var) &= (WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_SIZE_M)); \
778             ((_var) |= ((_val) << WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_SIZE_S                    )); \
779         } while(0)
780 
781 #define WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_DBELL_ADDR_GET(_var)        \
782         (((_var) & WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_DBELL_ADDR_M) >> \
783           WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_DBELL_ADDR_S)
784 #define WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_DBELL_ADDR_SET(_var, _val)  \
785         do {                                               \
786             WDI_IPA_CHECK_SET_VAL(WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_DBELL_ADDR, _val);\
787             ((_var) &= (WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_DBELL_ADDR_M)); \
788             ((_var) |= ((_val) << WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_DBELL_ADDR_S                    )); \
789         } while(0)
790 
791 #define WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_DBELL_IND_VAL_GET(_var)        \
792         (((_var) & WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_DBELL_IND_VAL_M) >> \
793           WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_DBELL_IND_VAL_S)
794 #define WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_DBELL_IND_VAL_SET(_var, _val)  \
795         do {                                               \
796             WDI_IPA_CHECK_SET_VAL(WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_DBELL_IND_VAL, _val);\
797             ((_var) &= (WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_DBELL_IND_VAL_M)); \
798             ((_var) |= ((_val) << WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_DBELL_IND_VAL_S                    )); \
799         } while(0)
800 
801 #define WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_DBELL_CACHED_VAL_GET(_var)        \
802         (((_var) & WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_DBELL_CACHED_VAL_M) >> \
803           WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_DBELL_CACHED_VAL_S)
804 #define WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_DBELL_CACHED_VAL_SET(_var, _val)  \
805         do {                                               \
806             WDI_IPA_CHECK_SET_VAL(WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_DBELL_CACHED_VAL, _val);\
807             ((_var) &= (WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_DBELL_CACHED_VAL_M)); \
808             ((_var) |= ((_val) << WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_DBELL_CACHED_VAL_S                    )); \
809         } while(0)
810 
811 #define WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_RDIDX_ADDR_GET(_var)        \
812         (((_var) & WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_RDIDX_ADDR_M) >> \
813           WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_RDIDX_ADDR_S)
814 #define WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_RDIDX_ADDR_SET(_var, _val)  \
815         do {                                               \
816             WDI_IPA_CHECK_SET_VAL(WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_RDIDX_ADDR, _val);\
817             ((_var) &= (WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_RDIDX_ADDR_M)); \
818             ((_var) |= ((_val) << WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_RDIDX_ADDR_S                    )); \
819         } while(0)
820 
821 #define WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_RDIDX_CACHED_VAL_GET(_var)        \
822         (((_var) & WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_RDIDX_CACHED_VAL_M) >> \
823           WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_RDIDX_CACHED_VAL_S)
824 #define WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_RDIDX_CACHED_VAL_SET(_var, _val)  \
825         do {                                               \
826             WDI_IPA_CHECK_SET_VAL(WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_RDIDX_CACHED_VAL, _val);\
827             ((_var) &= (WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_RDIDX_CACHED_VAL_M)); \
828             ((_var) |= ((_val) << WLAN_WDI_IPA_DBG_STATS_RX_IND_RING_RDIDX_CACHED_VAL_S                    )); \
829         } while(0)
830 
831 #define WLAN_WDI_IPA_DBG_STATS_RX_REFILL_IDX_GET(_var)        \
832         (((_var) & WLAN_WDI_IPA_DBG_STATS_RX_REFILL_IDX_M) >> \
833           WLAN_WDI_IPA_DBG_STATS_RX_REFILL_IDX_S)
834 #define WLAN_WDI_IPA_DBG_STATS_RX_REFILL_IDX_SET(_var, _val)  \
835         do {                                               \
836             WDI_IPA_CHECK_SET_VAL(WLAN_WDI_IPA_DBG_STATS_RX_REFILL_IDX, _val);\
837             ((_var) &= (WLAN_WDI_IPA_DBG_STATS_RX_REFILL_IDX_M)); \
838             ((_var) |= ((_val) << WLAN_WDI_IPA_DBG_STATS_RX_REFILL_IDX_S                    )); \
839         } while(0)
840 
841 #define WLAN_WDI_IPA_DBG_STATS_RX_NUM_PKTS_INDICATED_GET(_var)        \
842         (((_var) & WLAN_WDI_IPA_DBG_STATS_RX_NUM_PKTS_INDICATED_M) >> \
843           WLAN_WDI_IPA_DBG_STATS_RX_NUM_PKTS_INDICATED_S)
844 #define WLAN_WDI_IPA_DBG_STATS_RX_NUM_PKTS_INDICATED_SET(_var, _val)  \
845         do {                                               \
846             WDI_IPA_CHECK_SET_VAL(WLAN_WDI_IPA_DBG_STATS_RX_NUM_PKTS_INDICATED, _val);\
847             ((_var) &= (WLAN_WDI_IPA_DBG_STATS_RX_NUM_PKTS_INDICATED_M)); \
848             ((_var) |= ((_val) << WLAN_WDI_IPA_DBG_STATS_RX_NUM_PKTS_INDICATED_S                    )); \
849         } while(0)
850 
851 #define WLAN_WDI_IPA_DBG_STATS_RX_BUF_REFILLED_GET(_var)        \
852         (((_var) & WLAN_WDI_IPA_DBG_STATS_RX_BUF_REFILLED_M) >> \
853           WLAN_WDI_IPA_DBG_STATS_RX_BUF_REFILLED_S)
854 #define WLAN_WDI_IPA_DBG_STATS_RX_BUF_REFILLED_SET(_var, _val)  \
855         do {                                               \
856             WDI_IPA_CHECK_SET_VAL(WLAN_WDI_IPA_DBG_STATS_RX_BUF_REFILLED, _val);\
857             ((_var) &= (WLAN_WDI_IPA_DBG_STATS_RX_BUF_REFILLED_M)); \
858             ((_var) |= ((_val) << WLAN_WDI_IPA_DBG_STATS_RX_BUF_REFILLED_S                    )); \
859         } while(0)
860 
861 #define WLAN_WDI_IPA_DBG_STATS_RX_NUM_IND_DROPS_NO_SPACE_GET(_var)        \
862         (((_var) & WLAN_WDI_IPA_DBG_STATS_RX_NUM_IND_DROPS_NO_SPACE_M) >> \
863           WLAN_WDI_IPA_DBG_STATS_RX_NUM_IND_DROPS_NO_SPACE_S)
864 #define WLAN_WDI_IPA_DBG_STATS_RX_NUM_IND_DROPS_NO_SPACE_SET(_var, _val)  \
865         do {                                               \
866             WDI_IPA_CHECK_SET_VAL(WLAN_WDI_IPA_DBG_STATS_RX_NUM_IND_DROPS_NO_SPACE, _val);\
867             ((_var) &= (WLAN_WDI_IPA_DBG_STATS_RX_NUM_IND_DROPS_NO_SPACE_M)); \
868             ((_var) |= ((_val) << WLAN_WDI_IPA_DBG_STATS_RX_NUM_IND_DROPS_NO_SPACE_S                    )); \
869         } while(0)
870 
871 #define WLAN_WDI_IPA_DBG_STATS_RX_NUM_IND_DROPS_NO_BUF_GET(_var)        \
872         (((_var) & WLAN_WDI_IPA_DBG_STATS_RX_NUM_IND_DROPS_NO_BUF_M) >> \
873           WLAN_WDI_IPA_DBG_STATS_RX_NUM_IND_DROPS_NO_BUF_S)
874 #define WLAN_WDI_IPA_DBG_STATS_RX_NUM_IND_DROPS_NO_BUF_SET(_var, _val)  \
875         do {                                               \
876             WDI_IPA_CHECK_SET_VAL(WLAN_WDI_IPA_DBG_STATS_RX_NUM_IND_DROPS_NO_BUF, _val);\
877             ((_var) &= (WLAN_WDI_IPA_DBG_STATS_RX_NUM_IND_DROPS_NO_BUF_M)); \
878             ((_var) |= ((_val) << WLAN_WDI_IPA_DBG_STATS_RX_NUM_IND_DROPS_NO_BUF_S)); \
879         } while(0)
880 
881 #define WLAN_WDI_IPA_DBG_STATS_RX_IS_SUSPEND_GET(_var)        \
882         (((_var) & WLAN_WDI_IPA_DBG_STATS_RX_IS_SUSPEND_M) >> \
883           WLAN_WDI_IPA_DBG_STATS_RX_IS_SUSPEND_S)
884 #define WLAN_WDI_IPA_DBG_STATS_RX_IS_SUSPEND_SET(_var, _val)  \
885         do {                                               \
886             WDI_IPA_CHECK_SET_VAL(WLAN_WDI_IPA_DBG_STATS_RX_IS_SUSPEND, _val);\
887             ((_var) &= (WLAN_WDI_IPA_DBG_STATS_RX_IS_SUSPEND_M)); \
888             ((_var) |= ((_val) << WLAN_WDI_IPA_DBG_STATS_RX_IS_SUSPEND_S)); \
889         } while(0)
890 
891 #define WLAN_WDI_IPA_DBG_STATS_RESERVED1_GET(_var)        \
892         (((_var) & WLAN_WDI_IPA_DBG_STATS_RESERVED1_M) >> \
893           WLAN_WDI_IPA_DBG_STATS_RESERVED1_S)
894 #define WLAN_WDI_IPA_DBG_STATS_RESERVED1_SET(_var, _val)  \
895         do {                                               \
896             WDI_IPA_CHECK_SET_VAL(WLAN_WDI_IPA_DBG_STATS_RESERVED1, _val);\
897             ((_var) &= (WLAN_WDI_IPA_DBG_STATS_RESERVED1_M)); \
898             ((_var) |= ((_val) << WLAN_WDI_IPA_DBG_STATS_RESERVED1_S                    )); \
899         } while(0)
900 
901 
902 PREPACK struct wlan_wdi_ipa_dbg_stats_t
903 {
904     A_UINT32 tx_comp_ring_base;              /* word 0 */
905     A_UINT32 tx_comp_ring_size;              /* word 1 */
906     A_UINT32 tx_comp_ring_dbell_addr;        /* word 2 */
907     A_UINT32 tx_comp_ring_dbell_ind_val;     /* word 3 */
908     A_UINT32 tx_comp_ring_dbell_cached_val;  /* word 4 */
909     A_UINT32 tx_pkts_enqueued;               /* word 5 */
910     A_UINT32 tx_pkts_completed;              /* word 6 */
911     A_UINT32 tx_is_suspend;                  /* word 7 */
912     A_UINT32 reserved0;                      /* word 8 */
913 
914     A_UINT32 rx_ind_ring_base;               /* word 9 */
915     A_UINT32 rx_ind_ring_size;               /* word 10 */
916     A_UINT32 rx_ind_ring_dbell_addr;         /* word 11 */
917     A_UINT32 rx_ind_ring_dbell_ind_val;      /* word 12 */
918     A_UINT32 rx_ind_ring_dbell_cached_val;   /* word 13 */
919     A_UINT32 rx_ind_ring_rdidx_addr;         /* word 14 */
920     A_UINT32 rx_ind_ring_rdidx_cached_val;   /* word 15 */
921     A_UINT32 rx_refill_idx;                  /* word 16 */
922     A_UINT32 rx_num_pkts_indicated;          /* word 17 */
923     A_UINT32 rx_buf_refilled;                /* word 18 */
924     A_UINT32 rx_num_ind_drops_no_space;      /* word 19 */
925     A_UINT32 rx_num_ind_drops_no_buf;        /* word 20 */
926     A_UINT32 rx_is_suspend;                  /* word 21 */
927     A_UINT32 reserved1;                      /* word 22 */
928 } POSTPACK;
929 
930 /**
931  * @brief WLAN_WDI_IPA_GET_SHARING_STATS_REQ
932  *
933  *     |31            24|23            16|15             8|7              0|
934  *     |----------------+----------------+----------------+----------------|
935  *     |                reserved                          |  reset_stats   |
936  *     |-------------------------------------------------------------------|
937  * Header fields:
938  *   - RESET_STATS
939  *     Bits 7:0
940  *     Purpose: when 1, FW clears sharing stats
941  *   - RESERVED
942  *     Bits 31:8
943  *     Purpose: reserved bits
944  **/
945 
946 #define WLAN_WDI_IPA_GET_SHARING_STATS_REQ_SZ       4 /* bytes */
947 
948 #define WLAN_WDI_IPA_GET_SHARING_STATS_REQ_RESET_STATS_M    0x000000ff
949 #define WLAN_WDI_IPA_GET_SHARING_STATS_REQ_RESET_STATS_S    0x0
950 
951 #define WLAN_WDI_IPA_GET_SHARING_STATS_REQ_RESET_STATS_GET(_var)        \
952         (((_var) & WLAN_WDI_IPA_GET_SHARING_STATS_REQ_RESET_STATS_M) >> \
953           WLAN_WDI_IPA_GET_SHARING_STATS_REQ_RESET_STATS_S)
954 #define WLAN_WDI_IPA_GET_SHARING_STATS_REQ_RESET_STATS_SET(_var, _val)  \
955         do {                                               \
956             ((_var) &= (WLAN_WDI_IPA_GET_SHARING_STATS_REQ_RESET_STATS_M)); \
957             ((_var) |= ((_val) << WLAN_WDI_IPA_GET_SHARING_STATS_REQ_RESET_STATS_S)); \
958         } while(0)
959 
960 PREPACK struct wlan_wdi_ipa_get_sharing_stats_req_t {
961         A_UINT32 reset_stats:8,
962              reserved:24;
963 } POSTPACK;
964 
965 /*
966  * Response-type specific info for HTT_WDI_IPA_OPCODE_GET_SHARING_STATS
967  *
968  */
969 /**
970  * @brief WLAN_WDI_IPA_GET_SHARING_STATS_RESP
971  *
972  *     |31            24|23            16|15             8|7              0|
973  *     |----------------+----------------+----------------+----------------|
974  *     |                        ipv4_rx_packets_lo                         |
975  *     |-------------------------------------------------------------------|
976  *     |                        ipv4_rx_packets_hi                         |
977  *     |-------------------------------------------------------------------|
978  *     |                        ipv4_rx_bytes_lo                           |
979  *     |-------------------------------------------------------------------|
980  *     |                        ipv4_rx_bytes_lo                           |
981  *     |-------------------------------------------------------------------|
982  *     |                        ipv6_rx_packets_lo                         |
983  *     |-------------------------------------------------------------------|
984  *     |                        ipv6_rx_packets_hi                         |
985  *     |-------------------------------------------------------------------|
986  *     |                        ipv6_rx_bytes_lo                           |
987  *     |-------------------------------------------------------------------|
988  *     |                        ipv6_rx_bytes_hi                           |
989  *     |-------------------------------------------------------------------|
990  *     |                        ipv4_tx_packets_lo                         |
991  *     |-------------------------------------------------------------------|
992  *     |                        ipv4_tx_packets_hi                         |
993  *     |-------------------------------------------------------------------|
994  *     |                        ipv4_tx_bytes_lo                           |
995  *     |-------------------------------------------------------------------|
996  *     |                        ipv4_tx_bytes_lo                           |
997  *     |-------------------------------------------------------------------|
998  *     |                        ipv6_tx_packets_lo                         |
999  *     |-------------------------------------------------------------------|
1000  *     |                        ipv6_tx_packets_hi                         |
1001  *     |-------------------------------------------------------------------|
1002  *     |                        ipv6_tx_bytes_lo                           |
1003  *     |-------------------------------------------------------------------|
1004  *     |                        ipv6_tx_bytes_hi                           |
1005  *     |-------------------------------------------------------------------|
1006  *
1007  * Header fields:
1008  *   - ipv4_rx_packets_lo
1009  *     Bits 31:0
1010  *     Purpose: number of IPv4 RX packets, low 32-bit
1011  *   - ipv4_rx_packets_hi
1012  *     Bits 31:0
1013  *     Purpose: number of IPv4 RX packets, high 32-bit
1014  *   - ipv4_rx_bytes_lo
1015  *     Bits 31:0
1016  *     Purpose: bytes of IPv4 RX packets, low 32-bit
1017  *   - ipv4_rx_bytes_lo
1018  *     Bits 31:0
1019  *     Purpose: bytes of IPv4 RX packets, low 32-bit
1020  *   - ipv6_rx_packets_lo
1021  *     Bits 31:0
1022  *     Purpose: number of IPv6 RX packets, low 32-bit
1023  *   - ipv6_rx_packets_hi
1024  *     Bits 31:0
1025  *     Purpose: number of IPv6 RX packets, high 32-bit
1026  *   - ipv6_rx_bytes_lo
1027  *     Bits 31:0
1028  *     Purpose: bytes of IPv6 RX packets, low 32-bit
1029  *   - ipv6_rx_bytes_lo
1030  *     Bits 31:0
1031  *     Purpose: bytes of IPv6 RX packets, low 32-bit
1032  *   - ipv4_tx_packets_lo
1033  *     Bits 31:0
1034  *     Purpose: number of IPv4 TX packets, low 32-bit
1035  *   - ipv4_tx_packets_hi
1036  *     Bits 31:0
1037  *     Purpose: number of IPv4 TX packets, high 32-bit
1038  *   - ipv4_tx_bytes_lo
1039  *     Bits 31:0
1040  *     Purpose: bytes of IPv4 TX packets, low 32-bit
1041  *   - ipv4_tx_bytes_lo
1042  *     Bits 31:0
1043  *     Purpose: bytes of IPv4 TX packets, low 32-bit
1044  *   - ipv6_tx_packets_lo
1045  *     Bits 31:0
1046  *     Purpose: number of IPv6 TX packets, low 32-bit
1047  *   - ipv6_tx_packets_hi
1048  *     Bits 31:0
1049  *     Purpose: number of IPv6 TX packets, high 32-bit
1050  *   - ipv6_tx_bytes_lo
1051  *     Bits 31:0
1052  *     Purpose: bytes of IPv6 TX packets, low 32-bit
1053  *   - ipv6_tx_bytes_lo
1054  *     Bits 31:0
1055  *     Purpose: bytes of IPv6 TX packets, low 32-bit
1056  *
1057  **/
1058 
1059 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_SZ       64 /* bytes */
1060 
1061 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_PKTS_LO_M   0xffffffff
1062 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_PKTS_LO_S   0x0
1063 
1064 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_PKTS_HI_M   0xffffffff
1065 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_PKTS_HI_S   0x0
1066 
1067 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_BYTES_LO_M  0xffffffff
1068 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_BYTES_LO_S  0x0
1069 
1070 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_BYTES_HI_M  0xffffffff
1071 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_BYTES_HI_S  0x0
1072 
1073 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_PKTS_LO_M   0xffffffff
1074 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_PKTS_LO_S   0x0
1075 
1076 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_PKTS_HI_M   0xffffffff
1077 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_PKTS_HI_S   0x0
1078 
1079 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_BYTES_LO_M  0xffffffff
1080 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_BYTES_LO_S  0x0
1081 
1082 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_BYTES_HI_M  0xffffffff
1083 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_BYTES_HI_S  0x0
1084 
1085 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_PKTS_LO_M   0xffffffff
1086 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_PKTS_LO_S   0x0
1087 
1088 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_PKTS_HI_M   0xffffffff
1089 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_PKTS_HI_S   0x0
1090 
1091 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_BYTES_LO_M  0xffffffff
1092 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_BYTES_LO_S  0x0
1093 
1094 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_BYTES_HI_M  0xffffffff
1095 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_BYTES_HI_S  0x0
1096 
1097 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_PKTS_LO_M   0xffffffff
1098 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_PKTS_LO_S   0x0
1099 
1100 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_PKTS_HI_M   0xffffffff
1101 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_PKTS_HI_S   0x0
1102 
1103 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_BYTES_LO_M  0xffffffff
1104 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_BYTES_LO_S  0x0
1105 
1106 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_BYTES_HI_M  0xffffffff
1107 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_BYTES_HI_S  0x0
1108 
1109 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_PKTS_LO_GET(_var)        \
1110         (((_var) & WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_PKTS_LO_M) >> \
1111           WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_PKTS_LO_S)
1112 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_PKTS_LO_SET(_var, _val)  \
1113         do {                                               \
1114             ((_var) &= (WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_PKTS_LO_M)); \
1115             ((_var) |= ((_val) << WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_PKTS_LO_S)); \
1116         } while(0)
1117 
1118 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_PKTS_HI_GET(_var)        \
1119         (((_var) & WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_PKTS_HI_M) >> \
1120           WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_PKTS_HI_S)
1121 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_PKTS_HI_SET(_var, _val)  \
1122         do {                                               \
1123             ((_var) &= (WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_PKTS_HI_M)); \
1124             ((_var) |= ((_val) << WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_PKTS_HI_S)); \
1125         } while(0)
1126 
1127 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_BYTES_LO_GET(_var)        \
1128         (((_var) & WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_BYTES_LO_M) >> \
1129           WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_BYTES_LO_S)
1130 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_BYTES_LO_SET(_var, _val)  \
1131         do {                                               \
1132             ((_var) &= (WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_BYTES_LO_M)); \
1133             ((_var) |= ((_val) << WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_BYTES_LO_S)); \
1134         } while(0)
1135 
1136 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_BYTES_HI_GET(_var)        \
1137         (((_var) & WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_BYTES_HI_M) >> \
1138           WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_BYTES_HI_S)
1139 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_BYTES_HI_SET(_var, _val)  \
1140         do {                                               \
1141             ((_var) &= (WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_BYTES_HI_M)); \
1142             ((_var) |= ((_val) << WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_RX_BYTES_HI_S)); \
1143         } while(0)
1144 
1145 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_PKTS_LO_GET(_var)        \
1146         (((_var) & WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_PKTS_LO_M) >> \
1147           WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_PKTS_LO_S)
1148 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_PKTS_LO_SET(_var, _val)  \
1149         do {                                               \
1150             ((_var) &= (WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_PKTS_LO_M)); \
1151             ((_var) |= ((_val) << WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_PKTS_LO_S)); \
1152         } while(0)
1153 
1154 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_PKTS_HI_GET(_var)        \
1155         (((_var) & WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_PKTS_HI_M) >> \
1156           WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_PKTS_HI_S)
1157 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_PKTS_HI_SET(_var, _val)  \
1158         do {                                               \
1159             ((_var) &= (WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_PKTS_HI_M)); \
1160             ((_var) |= ((_val) << WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_PKTS_HI_S)); \
1161         } while(0)
1162 
1163 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_BYTES_LO_GET(_var)        \
1164         (((_var) & WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_BYTES_LO_M) >> \
1165           WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_BYTES_LO_S)
1166 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_BYTES_LO_SET(_var, _val)  \
1167         do {                                               \
1168             ((_var) &= (WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_BYTES_LO_M)); \
1169             ((_var) |= ((_val) << WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_BYTES_LO_S)); \
1170         } while(0)
1171 
1172 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_BYTES_HI_GET(_var)        \
1173         (((_var) & WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_BYTES_HI_M) >> \
1174           WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_BYTES_HI_S)
1175 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_BYTES_HI_SET(_var, _val)  \
1176         do {                                               \
1177             ((_var) &= (WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_BYTES_HI_M)); \
1178             ((_var) |= ((_val) << WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_RX_BYTES_HI_S)); \
1179         } while(0)
1180 
1181 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_PKTS_LO_GET(_var)        \
1182         (((_var) & WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_PKTS_LO_M) >> \
1183           WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_PKTS_LO_S)
1184 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_PKTS_LO_SET(_var, _val)  \
1185         do {                                               \
1186             ((_var) &= (WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_PKTS_LO_M)); \
1187             ((_var) |= ((_val) << WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_PKTS_LO_S)); \
1188         } while(0)
1189 
1190 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_PKTS_HI_GET(_var)        \
1191         (((_var) & WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_PKTS_HI_M) >> \
1192           WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_PKTS_HI_S)
1193 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_PKTS_HI_SET(_var, _val)  \
1194         do {                                               \
1195             ((_var) &= (WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_PKTS_HI_M)); \
1196             ((_var) |= ((_val) << WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_PKTS_HI_S)); \
1197         } while(0)
1198 
1199 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_BYTES_LO_GET(_var)        \
1200         (((_var) & WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_BYTES_LO_M) >> \
1201           WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_BYTES_LO_S)
1202 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_BYTES_LO_SET(_var, _val)  \
1203         do {                                               \
1204             ((_var) &= (WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_BYTES_LO_M)); \
1205             ((_var) |= ((_val) << WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_BYTES_LO_S)); \
1206         } while(0)
1207 
1208 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_BYTES_HI_GET(_var)        \
1209         (((_var) & WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_BYTES_HI_M) >> \
1210           WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_BYTES_HI_S)
1211 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_BYTES_HI_SET(_var, _val)  \
1212         do {                                               \
1213             ((_var) &= (WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_BYTES_HI_M)); \
1214             ((_var) |= ((_val) << WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV4_TX_BYTES_HI_S)); \
1215         } while(0)
1216 
1217 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_PKTS_LO_GET(_var)        \
1218         (((_var) & WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_PKTS_LO_M) >> \
1219           WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_PKTS_LO_S)
1220 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_PKTS_LO_SET(_var, _val)  \
1221         do {                                               \
1222             ((_var) &= (WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_PKTS_LO_M)); \
1223             ((_var) |= ((_val) << WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_PKTS_LO_S)); \
1224         } while(0)
1225 
1226 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_PKTS_HI_GET(_var)        \
1227         (((_var) & WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_PKTS_HI_M) >> \
1228           WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_PKTS_HI_S)
1229 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_PKTS_HI_SET(_var, _val)  \
1230         do {                                               \
1231             ((_var) &= (WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_PKTS_HI_M)); \
1232             ((_var) |= ((_val) << WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_PKTS_HI_S)); \
1233         } while(0)
1234 
1235 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_BYTES_LO_GET(_var)        \
1236         (((_var) & WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_BYTES_LO_M) >> \
1237           WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_BYTES_LO_S)
1238 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_BYTES_LO_SET(_var, _val)  \
1239         do {                                               \
1240             ((_var) &= (WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_BYTES_LO_M)); \
1241             ((_var) |= ((_val) << WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_BYTES_LO_S)); \
1242         } while(0)
1243 
1244 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_BYTES_HI_GET(_var)        \
1245         (((_var) & WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_BYTES_HI_M) >> \
1246           WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_BYTES_HI_S)
1247 #define WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_BYTES_HI_SET(_var, _val)  \
1248         do {                                               \
1249             ((_var) &= (WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_BYTES_HI_M)); \
1250             ((_var) |= ((_val) << WLAN_WDI_IPA_GET_SHARING_STATS_RESP_IPV6_TX_BYTES_HI_S)); \
1251         } while(0)
1252 
1253 PREPACK struct wlan_wdi_ipa_get_sharing_stats_resp_t {
1254     A_UINT32 ipv4_rx_packets_lo;
1255     A_UINT32 ipv4_rx_packets_hi;
1256         A_UINT32 ipv4_rx_bytes_lo;
1257         A_UINT32 ipv4_rx_bytes_hi;
1258         A_UINT32 ipv6_rx_packets_lo;
1259         A_UINT32 ipv6_rx_packets_hi;
1260         A_UINT32 ipv6_rx_bytes_lo;
1261         A_UINT32 ipv6_rx_bytes_hi;
1262 
1263         A_UINT32 ipv4_tx_packets_lo;
1264         A_UINT32 ipv4_tx_packets_hi;
1265         A_UINT32 ipv4_tx_bytes_lo;
1266         A_UINT32 ipv4_tx_bytes_hi;
1267         A_UINT32 ipv6_tx_packets_lo;
1268         A_UINT32 ipv6_tx_packets_hi;
1269         A_UINT32 ipv6_tx_bytes_lo;
1270         A_UINT32 ipv6_tx_bytes_hi;
1271 } POSTPACK;
1272 
1273 /**
1274  * @brief WLAN_WDI_IPA_SET_QUOTA_REQ
1275  *
1276  *     |31            24|23            16|15             8|7              0|
1277  *     |----------------+----------------+----------------+----------------|
1278  *     |                reserved                          |    set_quota   |
1279  *     |-------------------------------------------------------------------|
1280  *     |                            quota_lo                               |
1281  *     |-------------------------------------------------------------------|
1282  *     |                            quota_hi                               |
1283  *     |-------------------------------------------------------------------|
1284  * Header fields:
1285  *   - set_quota
1286  *     Bits 7:0
1287  *     Purpose: when 1, FW configures quota and starts quota monitoring. when 0, FW stops.
1288  *   - RESERVED
1289  *     Bits 31:8
1290  *     Purpose: reserved bits
1291  *   - quota_lo
1292  *     Bits 31:0
1293  *     Purpose: bytes of quota to be set, low 32-bit.
1294  *              It is accumulated number of bytes from when quota is configured.
1295  *   - quota_hi
1296  *     Bits 31:0
1297  *     Purpose: bytes of quota to be set, high 32-bit
1298  **/
1299 
1300 #define WLAN_WDI_IPA_SET_QUOTA_REQ_SZ           12 /* bytes */
1301 
1302 #define WLAN_WDI_IPA_SET_QUOTA_REQ_SET_QUOTA_M  0x000000ff
1303 #define WLAN_WDI_IPA_SET_QUOTA_REQ_SET_QUOTA_S  0x0
1304 
1305 #define WLAN_WDI_IPA_SET_QUOTA_REQ_QUOTA_LO_M   0xffffffff
1306 #define WLAN_WDI_IPA_SET_QUOTA_REQ_QUOTA_LO_S   0x0
1307 
1308 #define WLAN_WDI_IPA_SET_QUOTA_REQ_QUOTA_HI_M   0xffffffff
1309 #define WLAN_WDI_IPA_SET_QUOTA_REQ_QUOTA_HI_S   0x0
1310 
1311 #define WLAN_WDI_IPA_SET_QUOTA_REQ_SET_QUOTA_GET(_var)        \
1312         (((_var) & WLAN_WDI_IPA_SET_QUOTA_REQ_SET_QUOTA_M) >> \
1313           WLAN_WDI_IPA_SET_QUOTA_REQ_SET_QUOTA_S)
1314 #define WLAN_WDI_IPA_SET_QUOTA_REQ_SET_QUOTA_SET(_var, _val)  \
1315         do {                                               \
1316             ((_var) &= (WLAN_WDI_IPA_SET_QUOTA_REQ_SET_QUOTA_M)); \
1317             ((_var) |= ((_val) << WLAN_WDI_IPA_SET_QUOTA_REQ_SET_QUOTA_S)); \
1318         } while(0)
1319 
1320 #define WLAN_WDI_IPA_SET_QUOTA_REQ_QUOTA_LO_GET(_var)        \
1321         (((_var) & WLAN_WDI_IPA_SET_QUOTA_REQ_QUOTA_LO_M) >> \
1322           WLAN_WDI_IPA_SET_QUOTA_REQ_QUOTA_LO_S)
1323 #define WLAN_WDI_IPA_SET_QUOTA_REQ_QUOTA_LO_SET(_var, _val)  \
1324         do {                                               \
1325             ((_var) &= (WLAN_WDI_IPA_SET_QUOTA_REQ_QUOTA_LO_M)); \
1326             ((_var) |= ((_val) << WLAN_WDI_IPA_SET_QUOTA_REQ_QUOTA_LO_S)); \
1327         } while(0)
1328 
1329 #define WLAN_WDI_IPA_SET_QUOTA_REQ_QUOTA_HI_GET(_var)        \
1330         (((_var) & WLAN_WDI_IPA_SET_QUOTA_REQ_QUOTA_HI_M) >> \
1331           WLAN_WDI_IPA_SET_QUOTA_REQ_QUOTA_HI_S)
1332 #define WLAN_WDI_IPA_SET_QUOTA_REQ_QUOTA_HI_SET(_var, _val)  \
1333         do {                                               \
1334             ((_var) &= (WLAN_WDI_IPA_SET_QUOTA_REQ_QUOTA_HI_M)); \
1335             ((_var) |= ((_val) << WLAN_WDI_IPA_SET_QUOTA_REQ_QUOTA_HI_S)); \
1336         } while(0)
1337 
1338 PREPACK struct wlan_wdi_ipa_set_quota_req_t {
1339         A_UINT32 set_quota:8,
1340              reserved:24;
1341         A_UINT32 quota_lo;
1342         A_UINT32 quota_hi;
1343 } POSTPACK;
1344 
1345 /**
1346  * @brief WLAN_WDI_IPA_SET_QUOTA_RESP
1347  *
1348  *     |31            24|23            16|15             8|7              0|
1349  *     |----------------+----------------+----------------+----------------|
1350  *     |                reserved                          |    success     |
1351  *     |-------------------------------------------------------------------|
1352  *     |                            total_bytes_lo                         |
1353  *     |-------------------------------------------------------------------|
1354  *     |                            total_bytes_hi                         |
1355  *     |-------------------------------------------------------------------|
1356  * Header fields:
1357  *   - success
1358  *     Bits 7:0
1359  *     Purpose: when 1, FW successfully sets the quota.
1360  *              when 0, FW rejects because quota is smaller than current total
1361  *              bytes.
1362  *   - total_bytes_lo
1363  *     Bits 31:0
1364  *     Purpose: total bytes so far when the quota is configured, low 32-bit.
1365  *              It is accumulated number of bytes when quota is configured.
1366  *   - total_bytes_hi
1367  *     Bits 31:0
1368  *     Purpose: total bytes, high 32-bit
1369  **/
1370 
1371 #define WLAN_WDI_IPA_SET_QUOTA_RESP_SZ          12 /* bytes */
1372 
1373 #define WLAN_WDI_IPA_SET_QUOTA_RESP_SUCCESS_M   0x000000ff
1374 #define WLAN_WDI_IPA_SET_QUOTA_RESP_SUCCESS_S   0x0
1375 
1376 #define WLAN_WDI_IPA_SET_QUOTA_RESP_TOTAL_BYTES_LO_M   0xffffffff
1377 #define WLAN_WDI_IPA_SET_QUOTA_RESP_TOTAL_BYTES_LO_S   0x0
1378 
1379 #define WLAN_WDI_IPA_SET_QUOTA_RESP_TOTAL_BYTES_HI_M   0xffffffff
1380 #define WLAN_WDI_IPA_SET_QUOTA_RESP_TOTAL_BYTES_HI_S   0x0
1381 
1382 #define WLAN_WDI_IPA_SET_QUOTA_RESP_SUCCESS_GET(_var)        \
1383         (((_var) & WLAN_WDI_IPA_SET_QUOTA_RESP_SUCCESS_M) >> \
1384           WLAN_WDI_IPA_SET_QUOTA_RESP_SUCCESS_S)
1385 #define WLAN_WDI_IPA_SET_QUOTA_RESP_SUCCESS_SET(_var, _val)  \
1386         do {                                               \
1387             ((_var) &= (WLAN_WDI_IPA_SET_QUOTA_RESP_SUCCESS_M)); \
1388             ((_var) |= ((_val) << WLAN_WDI_IPA_SET_QUOTA_RESP_SUCCESS_S)); \
1389         } while(0)
1390 
1391 #define WLAN_WDI_IPA_SET_QUOTA_RESP_TOTAL_BYTES_LO_GET(_var)        \
1392         (((_var) & WLAN_WDI_IPA_SET_QUOTA_RESP_TOTAL_BYTES_LO_M) >> \
1393           WLAN_WDI_IPA_SET_QUOTA_RESP_TOTAL_BYTES_LO_S)
1394 #define WLAN_WDI_IPA_SET_QUOTA_RESP_TOTAL_BYTES_LO_SET(_var, _val)  \
1395         do {                                               \
1396             ((_var) &= (WLAN_WDI_IPA_SET_QUOTA_RESP_TOTAL_BYTES_LO_M)); \
1397             ((_var) |= ((_val) << WLAN_WDI_IPA_SET_QUOTA_RESP_TOTAL_BYTES_LO_S)); \
1398         } while(0)
1399 
1400 #define WLAN_WDI_IPA_SET_QUOTA_RESP_TOTAL_BYTES_HI_GET(_var)        \
1401         (((_var) & WLAN_WDI_IPA_SET_QUOTA_RESP_TOTAL_BYTES_HI_M) >> \
1402           WLAN_WDI_IPA_SET_QUOTA_RESP_TOTAL_BYTES_HI_S)
1403 #define WLAN_WDI_IPA_SET_QUOTA_RESP_TOTAL_BYTES_HI_SET(_var, _val)  \
1404         do {                                               \
1405             ((_var) &= (WLAN_WDI_IPA_SET_QUOTA_RESP_TOTAL_BYTES_HI_M)); \
1406             ((_var) |= ((_val) << WLAN_WDI_IPA_SET_QUOTA_RESP_TOTAL_BYTES_HI_S)); \
1407         } while(0)
1408 
1409 PREPACK struct wlan_wdi_ipa_set_quota_resp_t {
1410         A_UINT32 success:8,
1411              reserved:24;
1412         A_UINT32 total_bytes_lo;
1413         A_UINT32 total_bytes_hi;
1414 } POSTPACK;
1415 
1416 /**
1417  * @brief WLAN_WDI_IPA_QUOTA_IND_T
1418  *
1419  *     |31            24|23            16|15             8|7              0|
1420  *     |----------------+----------------+----------------+----------------|
1421  *     |                            total_bytes_lo                         |
1422  *     |-------------------------------------------------------------------|
1423  *     |                            total_bytes_hi                         |
1424  *     |-------------------------------------------------------------------|
1425  * Header fields:
1426  *   - total_bytes_lo
1427  *     Bits 31:0
1428  *     Purpose: accumulated bytes of packets through sharing interface
1429  *              when reaching to quota, low 32-bit
1430  *   - total_bytes_hi
1431  *     Bits 31:0
1432  *     Purpose: total bytes, high 32-bit
1433  **/
1434 
1435 #define WLAN_WDI_IPA_QUOTA_IND_SZ          8 /* bytes */
1436 
1437 #define WLAN_WDI_IPA_QUOTA_IND_TOTAL_BYTES_LO_M   0xffffffff
1438 #define WLAN_WDI_IPA_QUOTA_IND_TOTAL_BYTES_LO_S   0x0
1439 
1440 #define WLAN_WDI_IPA_QUOTA_IND_TOTAL_BYTES_HI_M   0xffffffff
1441 #define WLAN_WDI_IPA_QUOTA_IND_TOTAL_BYTES_HI_S   0x0
1442 
1443 #define WLAN_WDI_IPA_QUOTA_IND_TOTAL_BYTES_LO_GET(_var)        \
1444         (((_var) & WLAN_WDI_IPA_QUOTA_IND_TOTAL_BYTES_LO_M) >> \
1445           WLAN_WDI_IPA_QUOTA_IND_TOTAL_BYTES_LO_S)
1446 #define WLAN_WDI_IPA_QUOTA_IND_TOTAL_BYTES_LO_SET(_var, _val)  \
1447         do {                                               \
1448             ((_var) &= (WLAN_WDI_IPA_QUOTA_IND_TOTAL_BYTES_LO_M)); \
1449             ((_var) |= ((_val) << WLAN_WDI_IPA_QUOTA_IND_TOTAL_BYTES_LO_S)); \
1450         } while(0)
1451 
1452 #define WLAN_WDI_IPA_QUOTA_IND_TOTAL_BYTES_HI_GET(_var)        \
1453         (((_var) & WLAN_WDI_IPA_QUOTA_IND_TOTAL_BYTES_HI_M) >> \
1454           WLAN_WDI_IPA_QUOTA_IND_TOTAL_BYTES_HI_S)
1455 #define WLAN_WDI_IPA_QUOTA_IND_TOTAL_BYTES_HI_SET(_var, _val)  \
1456         do {                                               \
1457             ((_var) &= (WLAN_WDI_IPA_QUOTA_IND_TOTAL_BYTES_HI_M)); \
1458             ((_var) |= ((_val) << WLAN_WDI_IPA_QUOTA_IND_TOTAL_BYTES_HI_S)); \
1459         } while(0)
1460 
1461 PREPACK struct wlan_wdi_ipa_quota_ind_t {
1462         A_UINT32 total_bytes_lo;
1463         A_UINT32 total_bytes_hi;
1464 } POSTPACK;
1465 
1466 #endif /* _WDI_IPA_H_ */
1467