1*4882a593Smuzhiyun /****************************************************************************** 2*4882a593Smuzhiyun * 3*4882a593Smuzhiyun * Copyright(c) 2016 - 2017 Realtek Corporation. 4*4882a593Smuzhiyun * 5*4882a593Smuzhiyun * This program is free software; you can redistribute it and/or modify it 6*4882a593Smuzhiyun * under the terms of version 2 of the GNU General Public License as 7*4882a593Smuzhiyun * published by the Free Software Foundation. 8*4882a593Smuzhiyun * 9*4882a593Smuzhiyun * This program is distributed in the hope that it will be useful, but WITHOUT 10*4882a593Smuzhiyun * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11*4882a593Smuzhiyun * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12*4882a593Smuzhiyun * more details. 13*4882a593Smuzhiyun * 14*4882a593Smuzhiyun *****************************************************************************/ 15*4882a593Smuzhiyun #ifndef _RTL8821C_HAL_H_ 16*4882a593Smuzhiyun #define _RTL8821C_HAL_H_ 17*4882a593Smuzhiyun 18*4882a593Smuzhiyun #include <osdep_service.h> /* BIT(x) */ 19*4882a593Smuzhiyun #include "../hal/halmac/halmac_api.h" /* MAC REG definition */ 20*4882a593Smuzhiyun #include "hal_data.h" 21*4882a593Smuzhiyun #include "rtl8821c_spec.h" 22*4882a593Smuzhiyun #include "../hal/rtl8821c/hal8821c_fw.h" 23*4882a593Smuzhiyun 24*4882a593Smuzhiyun #ifdef CONFIG_USB_HCI 25*4882a593Smuzhiyun #include <rtl8821cu_hal.h> 26*4882a593Smuzhiyun #endif 27*4882a593Smuzhiyun #ifdef CONFIG_SDIO_HCI 28*4882a593Smuzhiyun #include <rtl8821cs_hal.h> 29*4882a593Smuzhiyun #endif 30*4882a593Smuzhiyun #ifdef CONFIG_PCI_HCI 31*4882a593Smuzhiyun #include <rtl8821ce_hal.h> 32*4882a593Smuzhiyun #endif 33*4882a593Smuzhiyun 34*4882a593Smuzhiyun #ifdef CONFIG_SUPPORT_TRX_SHARED 35*4882a593Smuzhiyun #define FIFO_BLOCK_SIZE 32768 /*@Block size = 32K*/ 36*4882a593Smuzhiyun #define RX_FIFO_EXPANDING (1 * FIFO_BLOCK_SIZE) 37*4882a593Smuzhiyun #else 38*4882a593Smuzhiyun #define RX_FIFO_EXPANDING 0 39*4882a593Smuzhiyun #endif 40*4882a593Smuzhiyun 41*4882a593Smuzhiyun 42*4882a593Smuzhiyun #if defined(CONFIG_USB_HCI) 43*4882a593Smuzhiyun 44*4882a593Smuzhiyun #ifndef MAX_RECVBUF_SZ 45*4882a593Smuzhiyun #ifndef CONFIG_MINIMAL_MEMORY_USAGE 46*4882a593Smuzhiyun /* 8821C - RX FIFO :16K ,for RX agg DMA mode = 16K, Rx agg USB mode could large than 16k*/ 47*4882a593Smuzhiyun /* #define MAX_RECVBUF_SZ (16384 + RX_FIFO_EXPANDING)*/ 48*4882a593Smuzhiyun /* For Max throughput issue , need to use USB AGG mode to replace DMA AGG mode*/ 49*4882a593Smuzhiyun #define MAX_RECVBUF_SZ (32768) 50*4882a593Smuzhiyun 51*4882a593Smuzhiyun /*#define MAX_RECVBUF_SZ_8821C (24576)*/ /* 24k*/ 52*4882a593Smuzhiyun /*#define MAX_RECVBUF_SZ_8821C (20480)*/ /*20K*/ 53*4882a593Smuzhiyun /*#define MAX_RECVBUF_SZ_8821C (10240) */ /*10K*/ 54*4882a593Smuzhiyun /*#define MAX_RECVBUF_SZ_8821C (15360)*/ /*15k < 16k*/ 55*4882a593Smuzhiyun /*#define MAX_RECVBUF_SZ_8821C (8192+1024)*/ /* 8K+1k*/ 56*4882a593Smuzhiyun #else 57*4882a593Smuzhiyun #define MAX_RECVBUF_SZ (4096 + RX_FIFO_EXPANDING) /* about 4K */ 58*4882a593Smuzhiyun #endif 59*4882a593Smuzhiyun #endif/* !MAX_RECVBUF_SZ*/ 60*4882a593Smuzhiyun 61*4882a593Smuzhiyun #elif defined(CONFIG_PCI_HCI) 62*4882a593Smuzhiyun /*#ifndef CONFIG_MINIMAL_MEMORY_USAGE 63*4882a593Smuzhiyun #define MAX_RECVBUF_SZ (9100) 64*4882a593Smuzhiyun #else*/ 65*4882a593Smuzhiyun #define MAX_RECVBUF_SZ (4096 + RX_FIFO_EXPANDING) /* about 4K */ 66*4882a593Smuzhiyun /*#endif*/ 67*4882a593Smuzhiyun 68*4882a593Smuzhiyun #elif defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) 69*4882a593Smuzhiyun #define MAX_RECVBUF_SZ (16384 + RX_FIFO_EXPANDING) 70*4882a593Smuzhiyun #endif 71*4882a593Smuzhiyun 72*4882a593Smuzhiyun void init_hal_spec_rtl8821c(PADAPTER); 73*4882a593Smuzhiyun /* MP Functions */ 74*4882a593Smuzhiyun #ifdef CONFIG_MP_INCLUDED 75*4882a593Smuzhiyun void rtl8821c_prepare_mp_txdesc(PADAPTER, struct mp_priv *); /* rtw_mp.c */ 76*4882a593Smuzhiyun void rtl8821c_mp_config_rfpath(PADAPTER); /* hal_mp.c */ 77*4882a593Smuzhiyun #endif 78*4882a593Smuzhiyun void rtl8821c_dl_rsvd_page(PADAPTER adapter, u8 mstatus); 79*4882a593Smuzhiyun 80*4882a593Smuzhiyun #ifdef CONFIG_PCI_HCI 81*4882a593Smuzhiyun u16 get_txbd_rw_reg(u16 q_idx); 82*4882a593Smuzhiyun #endif 83*4882a593Smuzhiyun 84*4882a593Smuzhiyun #endif /* _RTL8821C_HAL_H_ */ 85