1 /******************************************************************************
3 * Copyright(c) 2016 Realtek Corporation. All rights reserved.
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.
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
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
19 ******************************************************************************/
20 #ifndef _RTL8821C_HAL_H_
21 #define _RTL8821C_HAL_H_
23 #include <osdep_service.h> /* BIT(x) */
24 #include "../hal/halmac/halmac_api.h" /* MAC REG definition */
26 #include "rtl8821c_spec.h"
27 #include "../hal/rtl8821c/hal8821c_fw.h"
30 #include <rtl8821cu_hal.h>
32 #ifdef CONFIG_SDIO_HCI
33 #include <rtl8821cs_hal.h>
36 #include <rtl8821ce_hal.h>
39 #ifdef CONFIG_SUPPORT_TRX_SHARED
40 #define FIFO_BLOCK_SIZE 32768 /*@Block size = 32K*/
41 #define RX_FIFO_EXPANDING (1 * FIFO_BLOCK_SIZE)
43 #define RX_FIFO_EXPANDING 0
47 #if defined(CONFIG_USB_HCI)
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 */
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)
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*/
63 #define MAX_RECVBUF_SZ (4096 + RX_FIFO_EXPANDING) /* about 4K */
65 #endif/* !MAX_RECVBUF_SZ*/
67 #elif defined(CONFIG_PCI_HCI)
68 /*#ifndef CONFIG_MINIMAL_MEMORY_USAGE
69 #define MAX_RECVBUF_SZ (9100)
71 #define MAX_RECVBUF_SZ (4096 + RX_FIFO_EXPANDING) /* about 4K */
74 #elif defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
75 #define MAX_RECVBUF_SZ (HALMAC_RX_FIFO_SIZE_8821C + RX_FIFO_EXPANDING)
78 void init_hal_spec_rtl8821c(PADAPTER);
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 */
86 #endif /* _RTL8821C_HAL_H_ */