HalVerDef.h 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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 __HAL_VERSION_DEF_H__
  21. #define __HAL_VERSION_DEF_H__
  22. #define TRUE _TRUE
  23. #define FALSE _FALSE
  24. // HAL_IC_TYPE_E
  25. typedef enum tag_HAL_IC_Type_Definition
  26. {
  27. CHIP_8192S = 0,
  28. CHIP_8188C = 1,
  29. CHIP_8192C = 2,
  30. CHIP_8192D = 3,
  31. CHIP_8723A = 4,
  32. CHIP_8188E = 5,
  33. CHIP_8812 = 6,
  34. CHIP_8821 = 7,
  35. CHIP_8723B = 8,
  36. CHIP_8192E = 9,
  37. }HAL_IC_TYPE_E;
  38. //HAL_CHIP_TYPE_E
  39. typedef enum tag_HAL_CHIP_Type_Definition
  40. {
  41. TEST_CHIP = 0,
  42. NORMAL_CHIP = 1,
  43. FPGA = 2,
  44. }HAL_CHIP_TYPE_E;
  45. //HAL_CUT_VERSION_E
  46. typedef enum tag_HAL_Cut_Version_Definition
  47. {
  48. A_CUT_VERSION = 0,
  49. B_CUT_VERSION = 1,
  50. C_CUT_VERSION = 2,
  51. D_CUT_VERSION = 3,
  52. E_CUT_VERSION = 4,
  53. F_CUT_VERSION = 5,
  54. G_CUT_VERSION = 6,
  55. }HAL_CUT_VERSION_E;
  56. // HAL_Manufacturer
  57. typedef enum tag_HAL_Manufacturer_Version_Definition
  58. {
  59. CHIP_VENDOR_TSMC = 0,
  60. CHIP_VENDOR_UMC = 1,
  61. CHIP_VENDOR_SMIC = 2,
  62. }HAL_VENDOR_E;
  63. typedef enum tag_HAL_RF_Type_Definition
  64. {
  65. RF_TYPE_1T1R = 0,
  66. RF_TYPE_1T2R = 1,
  67. RF_TYPE_2T2R = 2,
  68. RF_TYPE_2T3R = 3,
  69. RF_TYPE_2T4R = 4,
  70. RF_TYPE_3T3R = 5,
  71. RF_TYPE_3T4R = 6,
  72. RF_TYPE_4T4R = 7,
  73. }HAL_RF_TYPE_E;
  74. typedef struct tag_HAL_VERSION
  75. {
  76. HAL_IC_TYPE_E ICType;
  77. HAL_CHIP_TYPE_E ChipType;
  78. HAL_CUT_VERSION_E CUTVersion;
  79. HAL_VENDOR_E VendorType;
  80. HAL_RF_TYPE_E RFType;
  81. u8 ROMVer;
  82. }HAL_VERSION,*PHAL_VERSION;
  83. //VERSION_8192C VersionID;
  84. //HAL_VERSION VersionID;
  85. // Get element
  86. #define GET_CVID_IC_TYPE(version) ((HAL_IC_TYPE_E)(((HAL_VERSION)version).ICType) )
  87. #define GET_CVID_CHIP_TYPE(version) ((HAL_CHIP_TYPE_E)(((HAL_VERSION)version).ChipType) )
  88. #define GET_CVID_RF_TYPE(version) ((HAL_RF_TYPE_E)(((HAL_VERSION)version).RFType))
  89. #define GET_CVID_MANUFACTUER(version) ((HAL_VENDOR_E)(((HAL_VERSION)version).VendorType))
  90. #define GET_CVID_CUT_VERSION(version) ((HAL_CUT_VERSION_E)(((HAL_VERSION)version).CUTVersion))
  91. #define GET_CVID_ROM_VERSION(version) ((((HAL_VERSION)version).ROMVer) & ROM_VERSION_MASK)
  92. //----------------------------------------------------------------------------
  93. //Common Macro. --
  94. //----------------------------------------------------------------------------
  95. //HAL_VERSION VersionID
  96. // HAL_IC_TYPE_E
  97. #define IS_81XXC(version) (((GET_CVID_IC_TYPE(version) == CHIP_8192C)||(GET_CVID_IC_TYPE(version) == CHIP_8188C))? TRUE : FALSE)
  98. #define IS_8723_SERIES(version) ((GET_CVID_IC_TYPE(version) == CHIP_8723A)? TRUE : FALSE)
  99. #define IS_92D(version) ((GET_CVID_IC_TYPE(version) == CHIP_8192D)? TRUE : FALSE)
  100. #define IS_8188E(version) ((GET_CVID_IC_TYPE(version) == CHIP_8188E)? TRUE : FALSE)
  101. #define IS_8192E(version) ((GET_CVID_IC_TYPE(version) == CHIP_8192E)? TRUE : FALSE)
  102. #define IS_8812_SERIES(version) ((GET_CVID_IC_TYPE(version) == CHIP_8812)? TRUE : FALSE)
  103. #define IS_8821_SERIES(version) ((GET_CVID_IC_TYPE(version) == CHIP_8821)? TRUE : FALSE)
  104. #define IS_8723B_SERIES(version) ((GET_CVID_IC_TYPE(version) == CHIP_8723B)? TRUE : FALSE)
  105. //HAL_CHIP_TYPE_E
  106. #define IS_TEST_CHIP(version) ((GET_CVID_CHIP_TYPE(version)==TEST_CHIP)? TRUE: FALSE)
  107. #define IS_NORMAL_CHIP(version) ((GET_CVID_CHIP_TYPE(version)==NORMAL_CHIP)? TRUE: FALSE)
  108. //HAL_CUT_VERSION_E
  109. #define IS_A_CUT(version) ((GET_CVID_CUT_VERSION(version) == A_CUT_VERSION) ? TRUE : FALSE)
  110. #define IS_B_CUT(version) ((GET_CVID_CUT_VERSION(version) == B_CUT_VERSION) ? TRUE : FALSE)
  111. #define IS_C_CUT(version) ((GET_CVID_CUT_VERSION(version) == C_CUT_VERSION) ? TRUE : FALSE)
  112. #define IS_D_CUT(version) ((GET_CVID_CUT_VERSION(version) == D_CUT_VERSION) ? TRUE : FALSE)
  113. #define IS_E_CUT(version) ((GET_CVID_CUT_VERSION(version) == E_CUT_VERSION) ? TRUE : FALSE)
  114. //HAL_VENDOR_E
  115. #define IS_CHIP_VENDOR_TSMC(version) ((GET_CVID_MANUFACTUER(version) == CHIP_VENDOR_TSMC)? TRUE: FALSE)
  116. #define IS_CHIP_VENDOR_UMC(version) ((GET_CVID_MANUFACTUER(version) == CHIP_VENDOR_UMC)? TRUE: FALSE)
  117. #define IS_CHIP_VENDOR_SMIC(version) ((GET_CVID_MANUFACTUER(version) == CHIP_VENDOR_SMIC)? TRUE: FALSE)
  118. //HAL_RF_TYPE_E
  119. #define IS_1T1R(version) ((GET_CVID_RF_TYPE(version) == RF_TYPE_1T1R)? TRUE : FALSE )
  120. #define IS_1T2R(version) ((GET_CVID_RF_TYPE(version) == RF_TYPE_1T2R)? TRUE : FALSE)
  121. #define IS_2T2R(version) ((GET_CVID_RF_TYPE(version) == RF_TYPE_2T2R)? TRUE : FALSE)
  122. //----------------------------------------------------------------------------
  123. //Chip version Macro. --
  124. //----------------------------------------------------------------------------
  125. #define IS_81XXC_TEST_CHIP(version) ((IS_81XXC(version) && (!IS_NORMAL_CHIP(version)))? TRUE: FALSE)
  126. #define IS_92C_SERIAL(version) ((IS_81XXC(version) && IS_2T2R(version)) ? TRUE : FALSE)
  127. #define IS_81xxC_VENDOR_UMC_A_CUT(version) (IS_81XXC(version)?(IS_CHIP_VENDOR_UMC(version) ? (IS_A_CUT(version) ? TRUE : FALSE) : FALSE): FALSE)
  128. #define IS_81xxC_VENDOR_UMC_B_CUT(version) (IS_81XXC(version)?(IS_CHIP_VENDOR_UMC(version) ? (IS_B_CUT(version) ? TRUE : FALSE) : FALSE): FALSE)
  129. #define IS_81xxC_VENDOR_UMC_C_CUT(version) (IS_81XXC(version)?(IS_CHIP_VENDOR_UMC(version) ? (IS_C_CUT(version) ? TRUE : FALSE) : FALSE): FALSE)
  130. #define IS_NORMAL_CHIP92D(version) (( IS_92D(version))?((GET_CVID_CHIP_TYPE(version)==NORMAL_CHIP)? TRUE: FALSE):FALSE)
  131. #define IS_92D_SINGLEPHY(version) ((IS_92D(version)) ? (IS_2T2R(version) ? TRUE: FALSE) : FALSE)
  132. #define IS_92D_C_CUT(version) ((IS_92D(version)) ? (IS_C_CUT(version) ? TRUE : FALSE) : FALSE)
  133. #define IS_92D_D_CUT(version) ((IS_92D(version)) ? (IS_D_CUT(version) ? TRUE : FALSE) : FALSE)
  134. #define IS_92D_E_CUT(version) ((IS_92D(version)) ? (IS_E_CUT(version) ? TRUE : FALSE) : FALSE)
  135. #define IS_8723A_A_CUT(version) ((IS_8723_SERIES(version)) ? ( IS_A_CUT(version)?TRUE : FALSE) : FALSE)
  136. #define IS_8723A_B_CUT(version) ((IS_8723_SERIES(version)) ? ( IS_B_CUT(version)?TRUE : FALSE) : FALSE)
  137. #define IS_VENDOR_8812A_TEST_CHIP(_Adapter) ((IS_8812_SERIES(GET_HAL_DATA(_Adapter)->VersionID)) ? ((IS_NORMAL_CHIP(GET_HAL_DATA(_Adapter)->VersionID)) ? FALSE : TRUE) : FALSE)
  138. #define IS_VENDOR_8812A_MP_CHIP(_Adapter) ((IS_8812_SERIES(GET_HAL_DATA(_Adapter)->VersionID)) ? ((IS_NORMAL_CHIP(GET_HAL_DATA(_Adapter)->VersionID)) ? TRUE : FALSE) : FALSE)
  139. #define IS_VENDOR_8812A_C_CUT(_Adapter) ((IS_8812_SERIES(GET_HAL_DATA(_Adapter)->VersionID)) ? ((GET_CVID_CUT_VERSION(GET_HAL_DATA(_Adapter)->VersionID) == C_CUT_VERSION) ? TRUE : FALSE) : FALSE)
  140. #define IS_VENDOR_8821A_TEST_CHIP(_Adapter) ((IS_8821_SERIES(GET_HAL_DATA(_Adapter)->VersionID)) ? ((IS_NORMAL_CHIP(GET_HAL_DATA(_Adapter)->VersionID)) ? FALSE : TRUE) : FALSE)
  141. #define IS_VENDOR_8821A_MP_CHIP(_Adapter) ((IS_8821_SERIES(GET_HAL_DATA(_Adapter)->VersionID)) ? ((IS_NORMAL_CHIP(GET_HAL_DATA(_Adapter)->VersionID)) ? TRUE : FALSE) : FALSE)
  142. #endif