rtl8821c_hal.h 2.6 KB

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