rtl8723d_recv.h 4.4 KB

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