halmac_2_platform.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2015 - 2018 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. ******************************************************************************/
  15. #ifndef _HALMAC_2_PLATFORM_H_
  16. #define _HALMAC_2_PLATFORM_H_
  17. /*[Driver] always set BUILD_TEST =0*/
  18. #define BUILD_TEST 0
  19. #if BUILD_TEST
  20. #include "../Platform/App/Test/halmac_2_platformapi.h"
  21. #else
  22. /*[Driver] use their own header files*/
  23. #include <drv_conf.h> /* for basic_types.h and osdep_service.h */
  24. #include <basic_types.h> /* u8, u16, u32 and etc.*/
  25. #include <osdep_service.h> /* __BIG_ENDIAN, __LITTLE_ENDIAN, _sema, _mutex */
  26. #endif
  27. /*[Driver] provide the define of NULL, u8, u16, u32*/
  28. #ifndef NULL
  29. #define NULL ((void *)0)
  30. #endif
  31. #define HALMAC_INLINE inline
  32. /*
  33. * Ignore following typedef because Linux already have these
  34. * u8, u16, u32, s8, s16, s32
  35. * __le16, __le32, __be16, __be32
  36. */
  37. #define HALMAC_PLATFORM_LITTLE_ENDIAN 1
  38. #define HALMAC_PLATFORM_BIG_ENDIAN 0
  39. /* Note : Named HALMAC_PLATFORM_LITTLE_ENDIAN / HALMAC_PLATFORM_BIG_ENDIAN
  40. * is not mandatory. But Little endian must be '1'. Big endian must be '0'
  41. */
  42. /*[Driver] config the system endian*/
  43. #ifdef __LITTLE_ENDIAN
  44. #define HALMAC_SYSTEM_ENDIAN HALMAC_PLATFORM_LITTLE_ENDIAN
  45. #else /* !__LITTLE_ENDIAN */
  46. #define HALMAC_SYSTEM_ENDIAN HALMAC_PLATFORM_BIG_ENDIAN
  47. #endif /* !__LITTLE_ENDIAN */
  48. /*[Driver] config if the operating platform*/
  49. #define HALMAC_PLATFORM_WINDOWS 0
  50. #define HALMAC_PLATFORM_LINUX 1
  51. #define HALMAC_PLATFORM_AP 0
  52. /*[Driver] must set HALMAC_PLATFORM_TESTPROGRAM = 0*/
  53. #define HALMAC_PLATFORM_TESTPROGRAM 0
  54. /*[Driver] config if enable the dbg msg or notl*/
  55. #define HALMAC_DBG_MSG_ENABLE 1
  56. #define HALMAC_MSG_LEVEL_TRACE 3
  57. #define HALMAC_MSG_LEVEL_WARNING 2
  58. #define HALMAC_MSG_LEVEL_ERR 1
  59. #define HALMAC_MSG_LEVEL_NO_LOG 0
  60. /*[Driver] config halmac msg level
  61. * Use HALMAC_MSG_LEVEL_XXXX
  62. */
  63. #define HALMAC_MSG_LEVEL HALMAC_MSG_LEVEL_TRACE
  64. /*[Driver] define the Rx FIFO expanding mode packet size unit for 8821C and 8822B */
  65. /*Should be 8 Byte alignment*/
  66. #define HALMAC_RX_FIFO_EXPANDING_MODE_PKT_SIZE 80 /*Bytes*/
  67. #define HALMAC_USE_TYPEDEF 0
  68. /*[Driver] provide the type mutex*/
  69. /* Mutex type */
  70. typedef _mutex HALMAC_MUTEX;
  71. #endif /* _HALMAC_2_PLATFORM_H_ */