net: wireless: rockchip_wlan: add rtl8723cs support
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rtl8723cs / include / rtl8821c_hal.h
1 /******************************************************************************
2  *
3  * Copyright(c) 2016 Realtek Corporation. All rights reserved.
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  * You should have received a copy of the GNU General Public License along with
15  * this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
17  *
18  *
19  ******************************************************************************/
20 #ifndef _RTL8821C_HAL_H_
21 #define _RTL8821C_HAL_H_
22
23 #include <osdep_service.h>              /* BIT(x) */
24 #include "../hal/halmac/halmac_api.h"   /* MAC REG definition */
25 #include "hal_data.h"
26 #include "rtl8821c_spec.h"
27 #include "../hal/rtl8821c/hal8821c_fw.h"
28
29 #ifdef CONFIG_USB_HCI
30 #include <rtl8821cu_hal.h>
31 #endif
32 #ifdef CONFIG_SDIO_HCI
33 #include <rtl8821cs_hal.h>
34 #endif
35 #ifdef CONFIG_PCI_HCI
36 #include <rtl8821ce_hal.h>
37 #endif
38
39 #ifdef CONFIG_SUPPORT_TRX_SHARED
40 #define FIFO_BLOCK_SIZE         32768 /*@Block size = 32K*/
41 #define RX_FIFO_EXPANDING       (1 * FIFO_BLOCK_SIZE)
42 #else
43 #define RX_FIFO_EXPANDING       0
44 #endif
45
46
47 #if defined(CONFIG_USB_HCI)
48
49         #ifndef MAX_RECVBUF_SZ
50                 #ifndef CONFIG_MINIMAL_MEMORY_USAGE
51                         #ifdef CONFIG_PLATFORM_MSTAR
52                                 #define MAX_RECVBUF_SZ (8192 + RX_FIFO_EXPANDING) /* 8K */
53                         #else
54                                 /* 8821C - RX FIFO :16K ,for RX agg DMA mode = 16K, Rx agg USB mode could large than 16k*/
55                                 #define MAX_RECVBUF_SZ          (HALMAC_RX_FIFO_SIZE_8821C + RX_FIFO_EXPANDING)
56                         #endif
57                         /*#define MAX_RECVBUF_SZ_8821C (24576)*/ /* 24k*/
58                         /*#define MAX_RECVBUF_SZ_8821C (20480)*/ /*20K*/
59                         /*#define MAX_RECVBUF_SZ_8821C (10240) */ /*10K*/
60                         /*#define MAX_RECVBUF_SZ_8821C (15360)*/ /*15k < 16k*/
61                         /*#define MAX_RECVBUF_SZ_8821C (8192+1024)*/ /* 8K+1k*/
62                 #else
63                         #define MAX_RECVBUF_SZ (4096 + RX_FIFO_EXPANDING) /* about 4K */
64                 #endif
65         #endif/* !MAX_RECVBUF_SZ*/
66
67 #elif defined(CONFIG_PCI_HCI)
68         /*#ifndef CONFIG_MINIMAL_MEMORY_USAGE
69         #define MAX_RECVBUF_SZ (9100)
70         #else*/
71         #define MAX_RECVBUF_SZ (4096 + RX_FIFO_EXPANDING) /* about 4K */
72         /*#endif*/
73
74 #elif defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
75         #define MAX_RECVBUF_SZ  (HALMAC_RX_FIFO_SIZE_8821C + RX_FIFO_EXPANDING)
76 #endif
77
78 void init_hal_spec_rtl8821c(PADAPTER);
79 /* MP Functions */
80 #ifdef CONFIG_MP_INCLUDED
81 void rtl8821c_phy_init_haldm(PADAPTER);                         /* rtw_mp.c */
82 void rtl8821c_prepare_mp_txdesc(PADAPTER, struct mp_priv *);    /* rtw_mp.c */
83 void rtl8821c_mp_config_rfpath(PADAPTER);                       /* hal_mp.c */
84 #endif
85
86 #endif /* _RTL8821C_HAL_H_ */