odm_types.h 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  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 __ODM_TYPES_H__
  21. #define __ODM_TYPES_H__
  22. //
  23. // Define Different SW team support
  24. //
  25. #define ODM_AP 0x01 //BIT0
  26. #define ODM_ADSL 0x02 //BIT1
  27. #define ODM_CE 0x04 //BIT2
  28. #define ODM_WIN 0x08 //BIT3
  29. #define DM_ODM_SUPPORT_TYPE ODM_CE
  30. // Deifne HW endian support
  31. #define ODM_ENDIAN_BIG 0
  32. #define ODM_ENDIAN_LITTLE 1
  33. #if (DM_ODM_SUPPORT_TYPE != ODM_WIN)
  34. #define RT_PCI_INTERFACE 1
  35. #define RT_USB_INTERFACE 2
  36. #define RT_SDIO_INTERFACE 3
  37. #endif
  38. typedef enum _HAL_STATUS{
  39. HAL_STATUS_SUCCESS,
  40. HAL_STATUS_FAILURE,
  41. /*RT_STATUS_PENDING,
  42. RT_STATUS_RESOURCE,
  43. RT_STATUS_INVALID_CONTEXT,
  44. RT_STATUS_INVALID_PARAMETER,
  45. RT_STATUS_NOT_SUPPORT,
  46. RT_STATUS_OS_API_FAILED,*/
  47. }HAL_STATUS,*PHAL_STATUS;
  48. #if (DM_ODM_SUPPORT_TYPE == ODM_CE)
  49. typedef enum _RT_SPINLOCK_TYPE{
  50. RT_TEMP =1,
  51. }RT_SPINLOCK_TYPE;
  52. #elif( (DM_ODM_SUPPORT_TYPE == ODM_AP) ||(DM_ODM_SUPPORT_TYPE == ODM_ADSL))
  53. #define VISTA_USB_RX_REVISE 0
  54. //
  55. // Declare for ODM spin lock defintion temporarily fro compile pass.
  56. //
  57. typedef enum _RT_SPINLOCK_TYPE{
  58. RT_TX_SPINLOCK = 1,
  59. RT_RX_SPINLOCK = 2,
  60. RT_RM_SPINLOCK = 3,
  61. RT_CAM_SPINLOCK = 4,
  62. RT_SCAN_SPINLOCK = 5,
  63. RT_LOG_SPINLOCK = 7,
  64. RT_BW_SPINLOCK = 8,
  65. RT_CHNLOP_SPINLOCK = 9,
  66. RT_RF_OPERATE_SPINLOCK = 10,
  67. RT_INITIAL_SPINLOCK = 11,
  68. RT_RF_STATE_SPINLOCK = 12, // For RF state. Added by Bruce, 2007-10-30.
  69. #if VISTA_USB_RX_REVISE
  70. RT_USBRX_CONTEXT_SPINLOCK = 13,
  71. RT_USBRX_POSTPROC_SPINLOCK = 14, // protect data of Adapter->IndicateW/ IndicateR
  72. #endif
  73. //Shall we define Ndis 6.2 SpinLock Here ?
  74. RT_PORT_SPINLOCK=16,
  75. RT_H2C_SPINLOCK = 20, // For H2C cmd. Added by tynli. 2009.11.09.
  76. RT_BTData_SPINLOCK=25,
  77. RT_WAPI_OPTION_SPINLOCK=26,
  78. RT_WAPI_RX_SPINLOCK=27,
  79. // add for 92D CCK control issue
  80. RT_CCK_PAGEA_SPINLOCK = 28,
  81. RT_BUFFER_SPINLOCK = 29,
  82. RT_CHANNEL_AND_BANDWIDTH_SPINLOCK = 30,
  83. RT_GEN_TEMP_BUF_SPINLOCK = 31,
  84. RT_AWB_SPINLOCK = 32,
  85. RT_FW_PS_SPINLOCK = 33,
  86. RT_HW_TIMER_SPIN_LOCK = 34,
  87. RT_MPT_WI_SPINLOCK = 35
  88. }RT_SPINLOCK_TYPE;
  89. #endif
  90. #if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
  91. #define STA_INFO_T RT_WLAN_STA
  92. #define PSTA_INFO_T PRT_WLAN_STA
  93. // typedef unsigned long u4Byte,*pu4Byte;
  94. #define CONFIG_HW_ANTENNA_DIVERSITY
  95. #define CONFIG_SW_ANTENNA_DIVERSITY
  96. #elif (DM_ODM_SUPPORT_TYPE == ODM_AP)
  97. // To let ADSL/AP project compile ok; it should be removed after all conflict are solved. Added by Annie, 2011-10-07.
  98. #define ADSL_AP_BUILD_WORKAROUND
  99. #define AP_BUILD_WORKAROUND
  100. //
  101. #ifdef AP_BUILD_WORKAROUND
  102. #include "../typedef.h"
  103. #else
  104. typedef void VOID,*PVOID;
  105. typedef unsigned char BOOLEAN,*PBOOLEAN;
  106. typedef unsigned char u1Byte,*pu1Byte;
  107. typedef unsigned short u2Byte,*pu2Byte;
  108. typedef unsigned int u4Byte,*pu4Byte;
  109. typedef unsigned long long u8Byte,*pu8Byte;
  110. typedef char s1Byte,*ps1Byte;
  111. typedef short s2Byte,*ps2Byte;
  112. typedef long s4Byte,*ps4Byte;
  113. typedef long long s8Byte,*ps8Byte;
  114. #endif
  115. typedef struct rtl8192cd_priv *prtl8192cd_priv;
  116. typedef struct stat_info STA_INFO_T,*PSTA_INFO_T;
  117. #if defined (LINUX_VERSION_CODE) && (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0))
  118. typedef struct legacy_timer_emu RT_TIMER, *PRT_TIMER;
  119. #else
  120. typedef struct timer_list RT_TIMER, *PRT_TIMER;
  121. #endif
  122. typedef void * RT_TIMER_CALL_BACK;
  123. #define DEV_BUS_TYPE RT_PCI_INTERFACE
  124. #define _TRUE 1
  125. #define _FALSE 0
  126. #elif (DM_ODM_SUPPORT_TYPE == ODM_ADSL)
  127. // To let ADSL/AP project compile ok; it should be removed after all conflict are solved. Added by Annie, 2011-10-07.
  128. #define ADSL_AP_BUILD_WORKAROUND
  129. #define ADSL_BUILD_WORKAROUND
  130. //
  131. typedef unsigned char BOOLEAN,*PBOOLEAN;
  132. typedef unsigned char u1Byte,*pu1Byte;
  133. typedef unsigned short u2Byte,*pu2Byte;
  134. typedef unsigned int u4Byte,*pu4Byte;
  135. typedef unsigned long long u8Byte,*pu8Byte;
  136. typedef char s1Byte,*ps1Byte;
  137. typedef short s2Byte,*ps2Byte;
  138. typedef long s4Byte,*ps4Byte;
  139. typedef long long s8Byte,*ps8Byte;
  140. typedef struct rtl8192cd_priv *prtl8192cd_priv;
  141. typedef struct stat_info STA_INFO_T,*PSTA_INFO_T;
  142. typedef struct timer_list RT_TIMER, *PRT_TIMER;
  143. typedef void * RT_TIMER_CALL_BACK;
  144. #define DEV_BUS_TYPE RT_PCI_INTERFACE
  145. #define _TRUE 1
  146. #define _FALSE 0
  147. #elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
  148. #include <drv_types.h>
  149. #if 0
  150. typedef u8 u1Byte, *pu1Byte;
  151. typedef u16 u2Byte,*pu2Byte;
  152. typedef u32 u4Byte,*pu4Byte;
  153. typedef u64 u8Byte,*pu8Byte;
  154. typedef s8 s1Byte,*ps1Byte;
  155. typedef s16 s2Byte,*ps2Byte;
  156. typedef s32 s4Byte,*ps4Byte;
  157. typedef s64 s8Byte,*ps8Byte;
  158. #else
  159. #define u1Byte u8
  160. #define pu1Byte u8*
  161. #define u2Byte u16
  162. #define pu2Byte u16*
  163. #define u4Byte u32
  164. #define pu4Byte u32*
  165. #define u8Byte u64
  166. #define pu8Byte u64*
  167. #define s1Byte s8
  168. #define ps1Byte s8*
  169. #define s2Byte s16
  170. #define ps2Byte s16*
  171. #define s4Byte s32
  172. #define ps4Byte s32*
  173. #define s8Byte s64
  174. #define ps8Byte s64*
  175. #endif
  176. #ifdef CONFIG_USB_HCI
  177. #define DEV_BUS_TYPE RT_USB_INTERFACE
  178. #elif defined(CONFIG_PCI_HCI)
  179. #define DEV_BUS_TYPE RT_PCI_INTERFACE
  180. #elif defined(CONFIG_SDIO_HCI)
  181. #define DEV_BUS_TYPE RT_SDIO_INTERFACE
  182. #elif defined(CONFIG_GSPI_HCI)
  183. #define DEV_BUS_TYPE RT_SDIO_INTERFACE
  184. #endif
  185. #if defined(CONFIG_LITTLE_ENDIAN)
  186. #define ODM_ENDIAN_TYPE ODM_ENDIAN_LITTLE
  187. #elif defined (CONFIG_BIG_ENDIAN)
  188. #define ODM_ENDIAN_TYPE ODM_ENDIAN_BIG
  189. #endif
  190. #if defined (LINUX_VERSION_CODE) && (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0))
  191. typedef struct legacy_timer_emu RT_TIMER, *PRT_TIMER;
  192. #else
  193. typedef struct timer_list RT_TIMER, *PRT_TIMER;
  194. #endif
  195. typedef void * RT_TIMER_CALL_BACK;
  196. #define STA_INFO_T struct sta_info
  197. #define PSTA_INFO_T struct sta_info *
  198. #define TRUE _TRUE
  199. #define FALSE _FALSE
  200. #define SET_TX_DESC_ANTSEL_A_88E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+8, 24, 1, __Value)
  201. #define SET_TX_DESC_ANTSEL_B_88E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+8, 25, 1, __Value)
  202. #define SET_TX_DESC_ANTSEL_C_88E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+28, 29, 1, __Value)
  203. //define useless flag to avoid compile warning
  204. #define USE_WORKITEM 0
  205. #define FOR_BRAZIL_PRETEST 0
  206. #define BT_30_SUPPORT 0
  207. #define FPGA_TWO_MAC_VERIFICATION 0
  208. #endif
  209. #endif // __ODM_TYPES_H__