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