rtl8192f_recv.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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 __RTL8192F_RECV_H__
  16. #define __RTL8192F_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 (32768) /* 32k */
  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. #define MAX_RECVBUF_SZ (4000) /* about 4K */
  42. #elif defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
  43. #define MAX_RECVBUF_SZ (RX_DMA_BOUNDARY_8192F + 1)
  44. #endif
  45. /* Rx smooth factor */
  46. #define Rx_Smooth_Factor (20)
  47. #ifdef CONFIG_SDIO_HCI
  48. #ifndef CONFIG_SDIO_RX_COPY
  49. #undef MAX_RECVBUF_SZ
  50. #define MAX_RECVBUF_SZ (RX_DMA_SIZE_8192F - RX_DMA_RESERVED_SIZE_8192F)
  51. #endif /* !CONFIG_SDIO_RX_COPY */
  52. #endif /* CONFIG_SDIO_HCI */
  53. /*-----------------------------------------------------------------*/
  54. /* RTL8192F RX BUFFER DESC */
  55. /*-----------------------------------------------------------------*/
  56. /*DWORD 0*/
  57. #define SET_RX_BUFFER_DESC_DATA_LENGTH_8192F(__pRxStatusDesc, __Value) SET_BITS_TO_LE_4BYTE(__pRxStatusDesc, 0, 14, __Value)
  58. #define SET_RX_BUFFER_DESC_LS_8192F(__pRxStatusDesc, __Value) SET_BITS_TO_LE_4BYTE(__pRxStatusDesc, 15, 1, __Value)
  59. #define SET_RX_BUFFER_DESC_FS_8192F(__pRxStatusDesc, __Value) SET_BITS_TO_LE_4BYTE(__pRxStatusDesc, 16, 1, __Value)
  60. #define SET_RX_BUFFER_DESC_TOTAL_LENGTH_8192F(__pRxStatusDesc, __Value) SET_BITS_TO_LE_4BYTE(__pRxStatusDesc, 16, 15, __Value)
  61. #define GET_RX_BUFFER_DESC_OWN_8192F(__pRxStatusDesc) LE_BITS_TO_4BYTE(__pRxStatusDesc, 31, 1)
  62. #define GET_RX_BUFFER_DESC_LS_8192F(__pRxStatusDesc) LE_BITS_TO_4BYTE(__pRxStatusDesc, 15, 1)
  63. #define GET_RX_BUFFER_DESC_FS_8192F(__pRxStatusDesc) LE_BITS_TO_4BYTE(__pRxStatusDesc, 16, 1)
  64. #ifdef USING_RX_TAG
  65. #define GET_RX_BUFFER_DESC_RX_TAG_8192F(__pRxStatusDesc) LE_BITS_TO_4BYTE(__pRxStatusDesc, 16, 13)
  66. #else
  67. #define GET_RX_BUFFER_DESC_TOTAL_LENGTH_8192F(__pRxStatusDesc) LE_BITS_TO_4BYTE(__pRxStatusDesc, 16, 15)
  68. #endif
  69. /*DWORD 1*/
  70. #define SET_RX_BUFFER_PHYSICAL_LOW_8192F(__pRxStatusDesc, __Value) SET_BITS_TO_LE_4BYTE(__pRxStatusDesc+4, 0, 32, __Value)
  71. /*DWORD 2*/
  72. #ifdef CONFIG_64BIT_DMA
  73. #define SET_RX_BUFFER_PHYSICAL_HIGH_8192F(__pRxStatusDesc, __Value) SET_BITS_TO_LE_4BYTE(__pRxStatusDesc+8, 0, 32, __Value)
  74. #else
  75. #define SET_RX_BUFFER_PHYSICAL_HIGH_8192F(__pRxStatusDesc, __Value)
  76. #endif
  77. #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
  78. s32 rtl8192fs_init_recv_priv(PADAPTER padapter);
  79. void rtl8192fs_free_recv_priv(PADAPTER padapter);
  80. s32 rtl8192fs_recv_hdl(_adapter *padapter);
  81. #endif
  82. #ifdef CONFIG_USB_HCI
  83. int rtl8192fu_init_recv_priv(_adapter *padapter);
  84. void rtl8192fu_free_recv_priv(_adapter *padapter);
  85. void rtl8192fu_init_recvbuf(_adapter *padapter, struct recv_buf *precvbuf);
  86. #endif
  87. #ifdef CONFIG_PCI_HCI
  88. s32 rtl8192fe_init_recv_priv(_adapter *padapter);
  89. void rtl8192fe_free_recv_priv(_adapter *padapter);
  90. #endif
  91. void rtl8192f_query_rx_desc_status(union recv_frame *precvframe, u8 *pdesc);
  92. #endif /* __RTL8192F_RECV_H__ */