rtl8821c_hal.h 2.8 KB

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