rtl8821ce.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2015 - 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 _RTL8821CE_H_
  21. #define _RTL8821CE_H_
  22. #include <drv_types.h> /* PADAPTER */
  23. #include "../../hal_halmac.h" /* HALMAC_RX_FIFO_SIZE_8821C */
  24. #define TX_BD_NUM_8821CE 128
  25. #define RX_BD_NUM_8821CE 128
  26. #define TX_BD_NUM_8821CE_BCN 2
  27. #define TX_BD_NUM_8821CE_CMD 128
  28. #define RTL8821CE_SEG_NUM 1 /* 0:2 seg, 1: 4 seg, 2: 8 seg */
  29. #ifndef MAX_RECVBUF_SZ
  30. #ifdef PLATFORM_OS_CE
  31. #define MAX_RECVBUF_SZ (8192+1024)
  32. #else /* !PLATFORM_OS_CE */
  33. #ifndef CONFIG_MINIMAL_MEMORY_USAGE
  34. #define MAX_RECVBUF_SZ (32768)
  35. #else
  36. #define MAX_RECVBUF_SZ (4000)
  37. #endif
  38. #endif /* PLATFORM_OS_CE */
  39. #endif /* !MAX_RECVBUF_SZ */
  40. #define TX_BUFFER_SEG_NUM 1 /* 0:2 seg, 1: 4 seg, 2: 8 seg. */
  41. #define MAX_RECVBUF_SZ_8821C HALMAC_RX_FIFO_SIZE_8821C
  42. /* TX BD */
  43. #define SET_TXBUFFER_DESC_LEN_WITH_OFFSET(__pTxDesc, __Offset, __Valeu) \
  44. SET_BITS_TO_LE_4BYTE(__pTxDesc+(__Offset*8), 0, 16, __Valeu)
  45. #define SET_TXBUFFER_DESC_AMSDU_WITH_OFFSET(__pTxDesc, __Offset, __Valeu) \
  46. SET_BITS_TO_LE_4BYTE(__pTxDesc+(__Offset*8), 31, 1, __Valeu)
  47. #define SET_TXBUFFER_DESC_ADD_LOW_WITH_OFFSET(__pTxDesc, __Offset, __Valeu) \
  48. SET_BITS_TO_LE_4BYTE(__pTxDesc+(__Offset*8)+4, 0, 32, __Valeu)
  49. /* RX BD */
  50. #define SET_RX_BD_PHYSICAL_ADDR_LOW(__pRxBd, __Value) \
  51. SET_BITS_TO_LE_4BYTE(__pRxBd + 0x04, 0, 32, __Value)
  52. #define SET_RX_BD_RXBUFFSIZE(__pRxBd, __Value) \
  53. SET_BITS_TO_LE_4BYTE(__pRxBd + 0x00, 0, 14, __Value)
  54. #define SET_RX_BD_LS(__pRxBd, __Value) \
  55. SET_BITS_TO_LE_4BYTE(__pRxBd + 0x00, 14, 1, __Value)
  56. #define SET_RX_BD_FS(__pRxBd, __Value) \
  57. SET_BITS_TO_LE_4BYTE(__pRxBd + 0x00, 15, 1, __Value)
  58. #define SET_RX_BD_TOTALRXPKTSIZE(__pRxBd, __Value) \
  59. SET_BITS_TO_LE_4BYTE(__pRxBd + 0x00, 16, 13, __Value)
  60. /* rtl8821ce_halinit.c */
  61. u32 rtl8821ce_hal_init(PADAPTER);
  62. u32 rtl8821ce_hal_deinit(PADAPTER);
  63. void rtl8821ce_init_default_value(PADAPTER);
  64. /* rtl8821ce_halmac.c */
  65. int rtl8821ce_halmac_init_adapter(PADAPTER);
  66. /* rtl8821ce_io.c */
  67. /* rtl8821ce_led.c */
  68. void rtl8821ce_initswleds(PADAPTER);
  69. void rtl8821ce_deinitswleds(PADAPTER);
  70. /* rtl8821ce_xmit.c */
  71. #define OFFSET_SZ 0
  72. s32 rtl8821ce_init_xmit_priv(PADAPTER);
  73. void rtl8821ce_free_xmit_priv(PADAPTER);
  74. struct xmit_buf *rtl8821ce_dequeue_xmitbuf(struct rtw_tx_ring *);
  75. void rtl8821ce_fill_fake_txdesc(PADAPTER, u8 *pDesc, u32 BufferLen,
  76. u8 IsPsPoll, u8 IsBTQosNull, u8 bDataFrame);
  77. int rtl8821ce_init_txbd_ring(PADAPTER, unsigned int q_idx,
  78. unsigned int entries);
  79. void rtl8821ce_free_txbd_ring(PADAPTER, unsigned int prio);
  80. void rtl8821ce_tx_isr(PADAPTER, int prio);
  81. s32 rtl8821ce_mgnt_xmit(PADAPTER, struct xmit_frame *);
  82. s32 rtl8821ce_hal_xmit(PADAPTER, struct xmit_frame *);
  83. s32 rtl8821ce_hal_xmitframe_enqueue(PADAPTER, struct xmit_frame *);
  84. #ifdef CONFIG_XMIT_THREAD_MODE
  85. s32 rtl8821ce_xmit_buf_handler(PADAPTER);
  86. #endif
  87. void rtl8821ce_xmitframe_resume(PADAPTER);
  88. /* rtl8821ce_recv.c */
  89. s32 rtl8821ce_init_recv_priv(PADAPTER);
  90. void rtl8821ce_free_recv_priv(PADAPTER);
  91. int rtl8821ce_init_rxbd_ring(PADAPTER);
  92. void rtl8821ce_free_rxbd_ring(PADAPTER);
  93. /* rtl8821cs_ops.c */
  94. #endif /* _RTL8821CE_H_ */