xref: /OK3568_Linux_fs/external/rkwifibt/drivers/rtl8188fu/include/rtl8821c_hal.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /******************************************************************************
2  *
3  * Copyright(c) 2016 - 2017 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 _RTL8821C_HAL_H_
16 #define _RTL8821C_HAL_H_
17 
18 #include <osdep_service.h>		/* BIT(x) */
19 #include "../hal/halmac/halmac_api.h"	/* MAC REG definition */
20 #include "hal_data.h"
21 #include "rtl8821c_spec.h"
22 #include "../hal/rtl8821c/hal8821c_fw.h"
23 
24 #ifdef CONFIG_USB_HCI
25 #include <rtl8821cu_hal.h>
26 #endif
27 #ifdef CONFIG_SDIO_HCI
28 #include <rtl8821cs_hal.h>
29 #endif
30 #ifdef CONFIG_PCI_HCI
31 #include <rtl8821ce_hal.h>
32 #endif
33 
34 #ifdef CONFIG_SUPPORT_TRX_SHARED
35 #define FIFO_BLOCK_SIZE		32768 /*@Block size = 32K*/
36 #define RX_FIFO_EXPANDING	(1 * FIFO_BLOCK_SIZE)
37 #else
38 #define RX_FIFO_EXPANDING	0
39 #endif
40 
41 
42 #if defined(CONFIG_USB_HCI)
43 
44 	#ifndef MAX_RECVBUF_SZ
45 		#ifndef CONFIG_MINIMAL_MEMORY_USAGE
46 			/* 8821C - RX FIFO :16K ,for RX agg DMA mode = 16K, Rx agg USB mode could large than 16k*/
47 			/* #define MAX_RECVBUF_SZ		(16384 + RX_FIFO_EXPANDING)*/
48 			/* For Max throughput issue , need to use USB AGG mode to replace DMA AGG mode*/
49 			#define MAX_RECVBUF_SZ (32768)
50 
51 			/*#define MAX_RECVBUF_SZ_8821C (24576)*/ /* 24k*/
52 			/*#define MAX_RECVBUF_SZ_8821C (20480)*/ /*20K*/
53 			/*#define MAX_RECVBUF_SZ_8821C (10240) */ /*10K*/
54 			/*#define MAX_RECVBUF_SZ_8821C (15360)*/ /*15k < 16k*/
55 			/*#define MAX_RECVBUF_SZ_8821C (8192+1024)*/ /* 8K+1k*/
56 		#else
57 			#define MAX_RECVBUF_SZ (4096 + RX_FIFO_EXPANDING) /* about 4K */
58 		#endif
59 	#endif/* !MAX_RECVBUF_SZ*/
60 
61 #elif defined(CONFIG_PCI_HCI)
62 	/*#ifndef CONFIG_MINIMAL_MEMORY_USAGE
63 	#define MAX_RECVBUF_SZ (9100)
64 	#else*/
65 	#define MAX_RECVBUF_SZ (4096 + RX_FIFO_EXPANDING) /* about 4K */
66 	/*#endif*/
67 
68 #elif defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
69 	#define MAX_RECVBUF_SZ	(16384 + RX_FIFO_EXPANDING)
70 #endif
71 
72 void init_hal_spec_rtl8821c(PADAPTER);
73 /* MP Functions */
74 #ifdef CONFIG_MP_INCLUDED
75 void rtl8821c_prepare_mp_txdesc(PADAPTER, struct mp_priv *);	/* rtw_mp.c */
76 void rtl8821c_mp_config_rfpath(PADAPTER);			/* hal_mp.c */
77 #endif
78 void rtl8821c_dl_rsvd_page(PADAPTER adapter, u8 mstatus);
79 
80 #ifdef CONFIG_PCI_HCI
81 u16 get_txbd_rw_reg(u16 q_idx);
82 #endif
83 
84 #endif /* _RTL8821C_HAL_H_ */
85