phydm_types.h 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  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. /*Define Different SW team support*/
  23. #define ODM_AP 0x01 /*BIT0*/
  24. #define ODM_CE 0x04 /*BIT2*/
  25. #define ODM_WIN 0x08 /*BIT3*/
  26. #define ODM_ADSL 0x10 /*BIT4*/
  27. #define ODM_IOT 0x20 /*BIT5*/
  28. /*Deifne HW endian support*/
  29. #define ODM_ENDIAN_BIG 0
  30. #define ODM_ENDIAN_LITTLE 1
  31. #if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
  32. #define GET_PDM_ODM(__padapter) ((struct PHY_DM_STRUCT*)(&((GET_HAL_DATA(__padapter))->DM_OutSrc)))
  33. #elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
  34. #define GET_PDM_ODM(__padapter) ((struct PHY_DM_STRUCT*)(&((GET_HAL_DATA(__padapter))->odmpriv)))
  35. #endif
  36. #if (DM_ODM_SUPPORT_TYPE != ODM_WIN)
  37. #define RT_PCI_INTERFACE 1
  38. #define RT_USB_INTERFACE 2
  39. #define RT_SDIO_INTERFACE 3
  40. #endif
  41. enum hal_status {
  42. HAL_STATUS_SUCCESS,
  43. HAL_STATUS_FAILURE,
  44. /*RT_STATUS_PENDING,
  45. RT_STATUS_RESOURCE,
  46. RT_STATUS_INVALID_CONTEXT,
  47. RT_STATUS_INVALID_PARAMETER,
  48. RT_STATUS_NOT_SUPPORT,
  49. RT_STATUS_OS_API_FAILED,*/
  50. };
  51. #if (DM_ODM_SUPPORT_TYPE == ODM_AP)
  52. #define MP_DRIVER 0
  53. #endif
  54. #if (DM_ODM_SUPPORT_TYPE != ODM_WIN)
  55. #define VISTA_USB_RX_REVISE 0
  56. /*
  57. * Declare for ODM spin lock defintion temporarily fro compile pass.
  58. * */
  59. enum rt_spinlock_type {
  60. RT_TX_SPINLOCK = 1,
  61. RT_RX_SPINLOCK = 2,
  62. RT_RM_SPINLOCK = 3,
  63. RT_CAM_SPINLOCK = 4,
  64. RT_SCAN_SPINLOCK = 5,
  65. RT_LOG_SPINLOCK = 7,
  66. RT_BW_SPINLOCK = 8,
  67. RT_CHNLOP_SPINLOCK = 9,
  68. RT_RF_OPERATE_SPINLOCK = 10,
  69. RT_INITIAL_SPINLOCK = 11,
  70. RT_RF_STATE_SPINLOCK = 12, /* For RF state. Added by Bruce, 2007-10-30. */
  71. #if VISTA_USB_RX_REVISE
  72. RT_USBRX_CONTEXT_SPINLOCK = 13,
  73. RT_USBRX_POSTPROC_SPINLOCK = 14, /* protect data of adapter->IndicateW/ IndicateR */
  74. #endif
  75. /* Shall we define Ndis 6.2 SpinLock Here ? */
  76. RT_PORT_SPINLOCK = 16,
  77. RT_VNIC_SPINLOCK = 17,
  78. RT_HVL_SPINLOCK = 18,
  79. RT_H2C_SPINLOCK = 20, /* For H2C cmd. Added by tynli. 2009.11.09. */
  80. rt_bt_data_spinlock = 25,
  81. RT_WAPI_OPTION_SPINLOCK = 26,
  82. RT_WAPI_RX_SPINLOCK = 27,
  83. /* add for 92D CCK control issue */
  84. RT_CCK_PAGEA_SPINLOCK = 28,
  85. RT_BUFFER_SPINLOCK = 29,
  86. RT_CHANNEL_AND_BANDWIDTH_SPINLOCK = 30,
  87. RT_GEN_TEMP_BUF_SPINLOCK = 31,
  88. RT_AWB_SPINLOCK = 32,
  89. RT_FW_PS_SPINLOCK = 33,
  90. RT_HW_TIMER_SPIN_LOCK = 34,
  91. RT_MPT_WI_SPINLOCK = 35,
  92. RT_P2P_SPIN_LOCK = 36, /* Protect P2P context */
  93. RT_DBG_SPIN_LOCK = 37,
  94. RT_IQK_SPINLOCK = 38,
  95. RT_PENDED_OID_SPINLOCK = 39,
  96. RT_CHNLLIST_SPINLOCK = 40,
  97. RT_INDIC_SPINLOCK = 41, /* protect indication */
  98. RT_RFD_SPINLOCK = 42,
  99. RT_SYNC_IO_CNT_SPINLOCK = 43,
  100. RT_LAST_SPINLOCK,
  101. };
  102. #endif
  103. #if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
  104. #define sta_info _RT_WLAN_STA
  105. #define __func__ __FUNCTION__
  106. #define PHYDM_TESTCHIP_SUPPORT TESTCHIP_SUPPORT
  107. #define MASKH3BYTES 0xffffff00
  108. #define SUCCESS 0
  109. #define FAIL (-1)
  110. #define u8 u1Byte
  111. #define s8 s1Byte
  112. #define u16 u2Byte
  113. #define s16 s2Byte
  114. #define u32 u4Byte
  115. #define s32 s4Byte
  116. #define u64 u8Byte
  117. #define s64 s8Byte
  118. #define timer_list _RT_TIMER
  119. #elif (DM_ODM_SUPPORT_TYPE == ODM_AP)
  120. /* To let ADSL/AP project compile ok; it should be removed after all conflict are solved. Added by Annie, 2011-10-07. */
  121. #define ADSL_AP_BUILD_WORKAROUND
  122. #define AP_BUILD_WORKAROUND
  123. #ifdef AP_BUILD_WORKAROUND
  124. #include "../typedef.h"
  125. #else
  126. typedef void void, *void *;
  127. typedef unsigned char boolean, *boolean *;
  128. typedef unsigned char u8, *u8 *;
  129. typedef unsigned short u16, *u16 *;
  130. typedef unsigned int u32, *u32 *;
  131. typedef unsigned long long u64, *u64 *;
  132. #if 1
  133. /* In ARM platform, system would use the type -- "char" as "unsigned char"
  134. * And we only use s8/s8* as INT8 now, so changes the type of s8.*/
  135. typedef signed char s8, *s8 *;
  136. #else
  137. typedef char s8, *s8 *;
  138. #endif
  139. typedef short s16, *s16 *;
  140. typedef long s32, *s32 *;
  141. typedef long long s64, *s64 *;
  142. #endif
  143. #ifdef CONFIG_PCI_HCI
  144. #define DEV_BUS_TYPE RT_PCI_INTERFACE
  145. #endif
  146. #define _TRUE 1
  147. #define _FALSE 0
  148. #if (defined(TESTCHIP_SUPPORT))
  149. #define PHYDM_TESTCHIP_SUPPORT 1
  150. #else
  151. #define PHYDM_TESTCHIP_SUPPORT 0
  152. #endif
  153. #define sta_info stat_info
  154. #define boolean bool
  155. #elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
  156. #include <drv_types.h>
  157. #if 0
  158. typedef u8 u8, *u8 *;
  159. typedef u16 u16, *u16 *;
  160. typedef u32 u32, *u32 *;
  161. typedef u64 u64, *u64 *;
  162. typedef s8 s8, *s8 *;
  163. typedef s16 s16, *s16 *;
  164. typedef s32 s32, *s32 *;
  165. typedef s64 s64, *s64 *;
  166. #elif 0
  167. #define u8 u8
  168. #define u8 *u8*
  169. #define u16 u16
  170. #define u16 *u16*
  171. #define u32 u32
  172. #define u32 *u32*
  173. #define u64 u64
  174. #define u64* u64*
  175. #define s8 s8
  176. #define s8* s8*
  177. #define s16 s16
  178. #define s16* s16*
  179. #define s32 s32
  180. #define s32* s32*
  181. #define s64 s64
  182. #define s64* s64*
  183. #endif
  184. #ifdef CONFIG_USB_HCI
  185. #define DEV_BUS_TYPE RT_USB_INTERFACE
  186. #elif defined(CONFIG_PCI_HCI)
  187. #define DEV_BUS_TYPE RT_PCI_INTERFACE
  188. #elif defined(CONFIG_SDIO_HCI)
  189. #define DEV_BUS_TYPE RT_SDIO_INTERFACE
  190. #elif defined(CONFIG_GSPI_HCI)
  191. #define DEV_BUS_TYPE RT_SDIO_INTERFACE
  192. #endif
  193. #if defined(CONFIG_LITTLE_ENDIAN)
  194. #define ODM_ENDIAN_TYPE ODM_ENDIAN_LITTLE
  195. #elif defined (CONFIG_BIG_ENDIAN)
  196. #define ODM_ENDIAN_TYPE ODM_ENDIAN_BIG
  197. #endif
  198. #define boolean bool
  199. #define true _TRUE
  200. #define false _FALSE
  201. #define SET_TX_DESC_ANTSEL_A_88E(__ptx_desc, __value) SET_BITS_TO_LE_4BYTE(__ptx_desc+8, 24, 1, __value)
  202. #define SET_TX_DESC_ANTSEL_B_88E(__ptx_desc, __value) SET_BITS_TO_LE_4BYTE(__ptx_desc+8, 25, 1, __value)
  203. #define SET_TX_DESC_ANTSEL_C_88E(__ptx_desc, __value) SET_BITS_TO_LE_4BYTE(__ptx_desc+28, 29, 1, __value)
  204. /* define useless flag to avoid compile warning */
  205. #define USE_WORKITEM 0
  206. #define FOR_BRAZIL_PRETEST 0
  207. #define FPGA_TWO_MAC_VERIFICATION 0
  208. #define RTL8881A_SUPPORT 0
  209. #if (defined(TESTCHIP_SUPPORT))
  210. #define PHYDM_TESTCHIP_SUPPORT 1
  211. #else
  212. #define PHYDM_TESTCHIP_SUPPORT 0
  213. #endif
  214. #endif
  215. #define READ_NEXT_PAIR(v1, v2, i) do { if (i+2 >= array_len) break; i += 2; v1 = array[i]; v2 = array[i+1]; } while (0)
  216. #define COND_ELSE 2
  217. #define COND_ENDIF 3
  218. #define MASKBYTE0 0xff
  219. #define MASKBYTE1 0xff00
  220. #define MASKBYTE2 0xff0000
  221. #define MASKBYTE3 0xff000000
  222. #define MASKHWORD 0xffff0000
  223. #define MASKLWORD 0x0000ffff
  224. #define MASKDWORD 0xffffffff
  225. #define MASK7BITS 0x7f
  226. #define MASK12BITS 0xfff
  227. #define MASKH4BITS 0xf0000000
  228. #define MASK20BITS 0xfffff
  229. #define MASKOFDM_D 0xffc00000
  230. #define MASKCCK 0x3f3f3f3f
  231. #define RFREGOFFSETMASK 0xfffff
  232. #define MASKH3BYTES 0xffffff00
  233. #define MASKL3BYTES 0x00ffffff
  234. #define MASKBYTE2HIGHNIBBLE 0x00f00000
  235. #define MASKBYTE3LOWNIBBLE 0x0f000000
  236. #define MASKL3BYTES 0x00ffffff
  237. #define RFREGOFFSETMASK 0xfffff
  238. #include "phydm_features.h"
  239. #endif /* __ODM_TYPES_H__ */