xref: /OK3568_Linux_fs/external/rkwifibt/drivers/rtl8852bs/phl/hci/phl_trx_def_sdio.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /******************************************************************************
2  *
3  * Copyright(c) 2019 - 2020 Realtek Corporation.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of version 2 of the GNU General Public License as
7  * published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12  * more details.
13  *
14  *****************************************************************************/
15 #ifndef _PHL_TRX_DEF_SDIO_H_
16 #define _PHL_TRX_DEF_SDIO_H_
17 
18 #define MAX_BUS_RX_AGG		20
19 
20 struct sdio_rx_pkt {
21 	u8 *wd;
22 	u8 wd_len;
23 	u8 *pkt;
24 	u16 pkt_len;
25 	struct rtw_r_meta_data meta;
26 };
27 
28 struct rtw_rx_buf {
29 	_os_list list;
30 	_os_mutex mutex;
31 	_os_atomic ref;				/* reference count */
32 
33 	u8 *buffer;
34 	u32 buf_len;			/* buffer size */
35 	u32 used_len;			/* total valid data size */
36 	u8 *ptr;			/* start address of data */
37 	u32 len;			/* data length */
38 	struct sdio_rx_pkt pkt[MAX_BUS_RX_AGG];
39 	u8 agg_cnt;			/* bus aggregation nubmer */
40 	u8 agg_start;			/* agg start index */
41 	u8 *next_ptr;			/* next ptr to process if there are */
42 					/* more data to be procesed */
43 					/* NULL for no more data */
44 };
45 
46 #endif	/* _PHL_TRX_DEF_SDIO_H_ */
47