rtl8723d_recv.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2007 - 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 __RTL8723D_RECV_H__
  16. #define __RTL8723D_RECV_H__
  17. #define RECV_BLK_SZ 512
  18. #define RECV_BLK_CNT 16
  19. #define RECV_BLK_TH RECV_BLK_CNT
  20. #if defined(CONFIG_USB_HCI)
  21. #ifndef MAX_RECVBUF_SZ
  22. #ifdef PLATFORM_OS_CE
  23. #define MAX_RECVBUF_SZ (8192+1024) /* 8K+1k */
  24. #else
  25. #ifndef CONFIG_MINIMAL_MEMORY_USAGE
  26. /* #define MAX_RECVBUF_SZ (32768) */ /* 32k */
  27. /* #define MAX_RECVBUF_SZ (16384) */ /* 16K */
  28. /* #define MAX_RECVBUF_SZ (10240) */ /* 10K */
  29. #ifdef CONFIG_PLATFORM_MSTAR
  30. #define MAX_RECVBUF_SZ (8192) /* 8K */
  31. #else
  32. #define MAX_RECVBUF_SZ (15360) /* 15k < 16k */
  33. #endif
  34. /* #define MAX_RECVBUF_SZ (8192+1024) */ /* 8K+1k */
  35. #else
  36. #define MAX_RECVBUF_SZ (4000) /* about 4K */
  37. #endif
  38. #endif
  39. #endif /* !MAX_RECVBUF_SZ */
  40. #elif defined(CONFIG_PCI_HCI)
  41. /* #ifndef CONFIG_MINIMAL_MEMORY_USAGE */
  42. /* #define MAX_RECVBUF_SZ (9100) */
  43. /* #else */
  44. #define MAX_RECVBUF_SZ (4000) /* about 4K
  45. * #endif */
  46. #elif defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
  47. #define MAX_RECVBUF_SZ (RX_DMA_BOUNDARY_8723D + 1)
  48. #endif
  49. /* Rx smooth factor */
  50. #define Rx_Smooth_Factor (20)
  51. #ifdef CONFIG_SDIO_HCI
  52. #ifndef CONFIG_SDIO_RX_COPY
  53. #undef MAX_RECVBUF_SZ
  54. #define MAX_RECVBUF_SZ (RX_DMA_SIZE_8723D - RX_DMA_RESERVED_SIZE_8723D)
  55. #endif /* !CONFIG_SDIO_RX_COPY */
  56. #endif /* CONFIG_SDIO_HCI */
  57. /*-----------------------------------------------------------------*/
  58. /* RTL8723D RX BUFFER DESC */
  59. /*-----------------------------------------------------------------*/
  60. /*DWORD 0*/
  61. #define SET_RX_BUFFER_DESC_DATA_LENGTH_8723D(__pRxStatusDesc, __Value) SET_BITS_TO_LE_4BYTE(__pRxStatusDesc, 0, 14, __Value)
  62. #define SET_RX_BUFFER_DESC_LS_8723D(__pRxStatusDesc, __Value) SET_BITS_TO_LE_4BYTE(__pRxStatusDesc, 15, 1, __Value)
  63. #define SET_RX_BUFFER_DESC_FS_8723D(__pRxStatusDesc, __Value) SET_BITS_TO_LE_4BYTE(__pRxStatusDesc, 16, 1, __Value)
  64. #define SET_RX_BUFFER_DESC_TOTAL_LENGTH_8723D(__pRxStatusDesc, __Value) SET_BITS_TO_LE_4BYTE(__pRxStatusDesc, 16, 15, __Value)
  65. #define GET_RX_BUFFER_DESC_OWN_8723D(__pRxStatusDesc) LE_BITS_TO_4BYTE(__pRxStatusDesc, 31, 1)
  66. #define GET_RX_BUFFER_DESC_LS_8723D(__pRxStatusDesc) LE_BITS_TO_4BYTE(__pRxStatusDesc, 15, 1)
  67. #define GET_RX_BUFFER_DESC_FS_8723D(__pRxStatusDesc) LE_BITS_TO_4BYTE(__pRxStatusDesc, 16, 1)
  68. #ifdef USING_RX_TAG
  69. #define GET_RX_BUFFER_DESC_RX_TAG_8723D(__pRxStatusDesc) LE_BITS_TO_4BYTE(__pRxStatusDesc, 16, 13)
  70. #else
  71. #define GET_RX_BUFFER_DESC_TOTAL_LENGTH_8723D(__pRxStatusDesc) LE_BITS_TO_4BYTE(__pRxStatusDesc, 16, 15)
  72. #endif
  73. /*DWORD 1*/
  74. #define SET_RX_BUFFER_PHYSICAL_LOW_8723D(__pRxStatusDesc, __Value) SET_BITS_TO_LE_4BYTE(__pRxStatusDesc+4, 0, 32, __Value)
  75. /*DWORD 2*/
  76. #ifdef CONFIG_64BIT_DMA
  77. #define SET_RX_BUFFER_PHYSICAL_HIGH_8723D(__pRxStatusDesc, __Value) SET_BITS_TO_LE_4BYTE(__pRxStatusDesc+8, 0, 32, __Value)
  78. #else
  79. #define SET_RX_BUFFER_PHYSICAL_HIGH_8723D(__pRxStatusDesc, __Value)
  80. #endif
  81. #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
  82. s32 rtl8723ds_init_recv_priv(PADAPTER padapter);
  83. void rtl8723ds_free_recv_priv(PADAPTER padapter);
  84. s32 rtl8723ds_recv_hdl(_adapter *padapter);
  85. #endif
  86. #ifdef CONFIG_USB_HCI
  87. int rtl8723du_init_recv_priv(_adapter *padapter);
  88. void rtl8723du_free_recv_priv(_adapter *padapter);
  89. void rtl8723du_init_recvbuf(_adapter *padapter, struct recv_buf *precvbuf);
  90. #endif
  91. #ifdef CONFIG_PCI_HCI
  92. s32 rtl8723de_init_recv_priv(PADAPTER padapter);
  93. void rtl8723de_free_recv_priv(PADAPTER padapter);
  94. #endif
  95. void rtl8723d_query_rx_desc_status(union recv_frame *precvframe, u8 *pdesc);
  96. #endif /* __RTL8723D_RECV_H__ */