rtl8710b_recv.h 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 __RTL8710B_RECV_H__
  16. #define __RTL8710B_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. #ifdef CONFIG_MINIMAL_MEMORY_USAGE
  26. #define MAX_RECVBUF_SZ (4000) /* about 4K */
  27. #else
  28. #ifdef CONFIG_PLATFORM_MSTAR
  29. #define MAX_RECVBUF_SZ (8192) /* 8K */
  30. #elif defined(CONFIG_PLATFORM_HISILICON)
  31. #define MAX_RECVBUF_SZ (16384) /* 16k */
  32. #else
  33. #define MAX_RECVBUF_SZ (15360) /* 15k < 16k */
  34. /* #define MAX_RECVBUF_SZ (32768) */ /* 32k */
  35. /* #define MAX_RECVBUF_SZ (20480) */ /* 20K */
  36. /* #define MAX_RECVBUF_SZ (10240) */ /* 10K */
  37. /* #define MAX_RECVBUF_SZ (16384) */ /* 16k - 92E RX BUF :16K */
  38. #endif
  39. #endif
  40. #endif
  41. #endif /* !MAX_RECVBUF_SZ */
  42. #endif
  43. /* Rx smooth factor */
  44. #define Rx_Smooth_Factor (20)
  45. /*-----------------------------------------------------------------*/
  46. /* RTL8710B RX BUFFER DESC */
  47. /*-----------------------------------------------------------------*/
  48. /*DWORD 0*/
  49. #define SET_RX_BUFFER_DESC_DATA_LENGTH_8710B(__pRxStatusDesc, __Value) SET_BITS_TO_LE_4BYTE(__pRxStatusDesc, 0, 14, __Value)
  50. #define SET_RX_BUFFER_DESC_LS_8710B(__pRxStatusDesc, __Value) SET_BITS_TO_LE_4BYTE(__pRxStatusDesc, 15, 1, __Value)
  51. #define SET_RX_BUFFER_DESC_FS_8710B(__pRxStatusDesc, __Value) SET_BITS_TO_LE_4BYTE(__pRxStatusDesc, 16, 1, __Value)
  52. #define SET_RX_BUFFER_DESC_TOTAL_LENGTH_8710B(__pRxStatusDesc, __Value) SET_BITS_TO_LE_4BYTE(__pRxStatusDesc, 16, 15, __Value)
  53. #define GET_RX_BUFFER_DESC_OWN_8710B(__pRxStatusDesc) LE_BITS_TO_4BYTE(__pRxStatusDesc, 31, 1)
  54. #define GET_RX_BUFFER_DESC_LS_8710B(__pRxStatusDesc) LE_BITS_TO_4BYTE(__pRxStatusDesc, 15, 1)
  55. #define GET_RX_BUFFER_DESC_FS_8710B(__pRxStatusDesc) LE_BITS_TO_4BYTE(__pRxStatusDesc, 16, 1)
  56. #ifdef USING_RX_TAG
  57. #define GET_RX_BUFFER_DESC_RX_TAG_8710B(__pRxStatusDesc) LE_BITS_TO_4BYTE(__pRxStatusDesc, 16, 13)
  58. #else
  59. #define GET_RX_BUFFER_DESC_TOTAL_LENGTH_8710B(__pRxStatusDesc) LE_BITS_TO_4BYTE(__pRxStatusDesc, 16, 15)
  60. #endif
  61. /*DWORD 1*/
  62. #define SET_RX_BUFFER_PHYSICAL_LOW_8710B(__pRxStatusDesc, __Value) SET_BITS_TO_LE_4BYTE(__pRxStatusDesc+4, 0, 32, __Value)
  63. /*DWORD 2*/
  64. #ifdef CONFIG_64BIT_DMA
  65. #define SET_RX_BUFFER_PHYSICAL_HIGH_8710B(__pRxStatusDesc, __Value) SET_BITS_TO_LE_4BYTE(__pRxStatusDesc+8, 0, 32, __Value)
  66. #else
  67. #define SET_RX_BUFFER_PHYSICAL_HIGH_8710B(__pRxStatusDesc, __Value)
  68. #endif
  69. #ifdef CONFIG_USB_HCI
  70. int rtl8710bu_init_recv_priv(_adapter *padapter);
  71. void rtl8710bu_free_recv_priv(_adapter *padapter);
  72. void rtl8710bu_init_recvbuf(_adapter *padapter, struct recv_buf *precvbuf);
  73. #endif
  74. void rtl8710b_query_rx_desc_status(union recv_frame *precvframe, u8 *pdesc);
  75. #endif /* __RTL8710B_RECV_H__ */