htc.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. /*
  2. * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. #ifndef __HTC_H__
  27. #define __HTC_H__
  28. #ifndef ATH_TARGET
  29. #include "athstartpack.h"
  30. #endif
  31. #undef MS
  32. #define MS(_v, _f) (((_v) & _f ## _MASK) >> _f ## _LSB)
  33. #undef SM
  34. #define SM(_v, _f) (((_v) << _f ## _LSB) & _f ## _MASK)
  35. #undef WO
  36. #define WO(_f) ((_f ## _OFFSET) >> 2)
  37. #undef GET_FIELD
  38. #define GET_FIELD(_addr, _f) MS(*((A_UINT32 *)(_addr) + WO(_f)), _f)
  39. #undef SET_FIELD
  40. #define SET_FIELD(_addr, _f, _val) \
  41. (*((A_UINT32 *)(_addr) + WO(_f)) = \
  42. (*((A_UINT32 *)(_addr) + WO(_f)) & ~_f ## _MASK) | SM(_val, _f))
  43. #define HTC_GET_FIELD(_msg_buf, _msg_type, _f) \
  44. GET_FIELD(_msg_buf, _msg_type ## _ ## _f)
  45. #define HTC_SET_FIELD(_msg_buf, _msg_type, _f, _val) \
  46. SET_FIELD(_msg_buf, _msg_type ## _ ## _f, _val)
  47. #define HTC_WRITE32(_addr, _val) \
  48. (*(A_UINT32 *)(_addr) = (_val))
  49. #ifndef A_OFFSETOF
  50. #define A_OFFSETOF(type,field) (unsigned long)(&(((type *)NULL)->field))
  51. #endif
  52. #define ASSEMBLE_UNALIGNED_UINT16(p,highbyte,lowbyte) \
  53. (((A_UINT16)(((A_UINT8 *)(p))[(highbyte)])) << 8 | (A_UINT16)(((A_UINT8 *)(p))[(lowbyte)]))
  54. /****** DANGER DANGER ***************
  55. *
  56. * The frame header length and message formats defined herein were
  57. * selected to accommodate optimal alignment for target processing. This reduces code
  58. * size and improves performance.
  59. *
  60. * Any changes to the header length may alter the alignment and cause exceptions
  61. * on the target. When adding to the message structures insure that fields are
  62. * properly aligned.
  63. *
  64. */
  65. /* HTC frame header */
  66. typedef PREPACK struct _HTC_FRAME_HDR {
  67. /* do not remove or re-arrange these fields, these are minimally required
  68. * to take advantage of 4-byte lookaheads in some hardware implementations */
  69. A_UINT32 EndpointID : 8, Flags : 8, PayloadLen : 16; /* length of data (including trailer) that follows the header */
  70. /***** end of 4-byte lookahead ****/
  71. A_UINT32 ControlBytes0 : 8,/*used for CRC check if CRC_CHECK flag set*/
  72. ControlBytes1 : 8, /*used for seq check if SEQ_CHECK flag set*/
  73. reserved : 16; /*used by bundle processing in SDIO systems*/
  74. /* message payload starts after the header */
  75. } POSTPACK HTC_FRAME_HDR;
  76. #define HTC_FRAME_HDR_ENDPOINTID_LSB 0
  77. #define HTC_FRAME_HDR_ENDPOINTID_MASK 0x000000ff
  78. #define HTC_FRAME_HDR_ENDPOINTID_OFFSET 0x00000000
  79. #define HTC_FRAME_HDR_FLAGS_LSB 8
  80. #define HTC_FRAME_HDR_FLAGS_MASK 0x0000ff00
  81. #define HTC_FRAME_HDR_FLAGS_OFFSET 0x00000000
  82. #define HTC_FRAME_HDR_PAYLOADLEN_LSB 16
  83. #define HTC_FRAME_HDR_PAYLOADLEN_MASK 0xffff0000
  84. #define HTC_FRAME_HDR_PAYLOADLEN_OFFSET 0x00000000
  85. #define HTC_FRAME_HDR_CONTROLBYTES0_LSB 0
  86. #define HTC_FRAME_HDR_CONTROLBYTES0_MASK 0x000000ff
  87. #define HTC_FRAME_HDR_CONTROLBYTES0_OFFSET 0x00000004
  88. #define HTC_FRAME_HDR_CONTROLBYTES1_LSB 8
  89. #define HTC_FRAME_HDR_CONTROLBYTES1_MASK 0x0000ff00
  90. #define HTC_FRAME_HDR_CONTROLBYTES1_OFFSET 0x00000004
  91. #define HTC_FRAME_HDR_RESERVED_LSB 16
  92. #define HTC_FRAME_HDR_RESERVED_MASK 0xffff0000
  93. #define HTC_FRAME_HDR_RESERVED_OFFSET 0x00000004
  94. /* frame header flags */
  95. /* send direction */
  96. #define HTC_FLAGS_NEED_CREDIT_UPDATE (1 << 0)
  97. #define HTC_FLAGS_SEND_BUNDLE (1 << 1) /* start or part of bundle */
  98. #define HTC_FLAGS_SEQ_CHECK (1 << 2) /* seq check on rx side */
  99. #define HTC_FLAGS_CRC CHECK (1 << 3) /* CRC check on rx side */
  100. /* receive direction */
  101. #define HTC_FLAGS_RECV_UNUSED_0 (1 << 0) /* bit 0 unused */
  102. #define HTC_FLAGS_RECV_TRAILER (1 << 1) /* bit 1 trailer data present */
  103. #define HTC_FLAGS_RECV_UNUSED_2 (1 << 0) /* bit 2 unused */
  104. #define HTC_FLAGS_RECV_UNUSED_3 (1 << 0) /* bit 3 unused */
  105. #define HTC_FLAGS_RECV_BUNDLE_CNT_MASK (0xF0) /* bits 7..4 */
  106. #define HTC_FLAGS_RECV_BUNDLE_CNT_SHIFT 4
  107. #define HTC_HDR_LENGTH (sizeof(HTC_FRAME_HDR))
  108. #define HTC_HDR_ALIGNMENT_PADDING \
  109. (((sizeof(HTC_FRAME_HDR) + 3) & (~0x3)) - sizeof(HTC_FRAME_HDR))
  110. #define HTC_MAX_TRAILER_LENGTH 255
  111. #define HTC_MAX_PAYLOAD_LENGTH (4096 - sizeof(HTC_FRAME_HDR))
  112. /* HTC control message IDs */
  113. #define HTC_MSG_READY_ID 1
  114. #define HTC_MSG_CONNECT_SERVICE_ID 2
  115. #define HTC_MSG_CONNECT_SERVICE_RESPONSE_ID 3
  116. #define HTC_MSG_SETUP_COMPLETE_ID 4
  117. #define HTC_MSG_SETUP_COMPLETE_EX_ID 5
  118. #define HTC_MSG_SEND_SUSPEND_COMPLETE 6
  119. #define HTC_MSG_NACK_SUSPEND 7
  120. #define HTC_MAX_CONTROL_MESSAGE_LENGTH 256
  121. /* base message ID header */
  122. typedef PREPACK struct {
  123. A_UINT32 MessageID : 16, reserved : 16;
  124. } POSTPACK HTC_UNKNOWN_MSG;
  125. #define HTC_UNKNOWN_MSG_MESSAGEID_LSB 0
  126. #define HTC_UNKNOWN_MSG_MESSAGEID_MASK 0x0000ffff
  127. #define HTC_UNKNOWN_MSG_MESSAGEID_OFFSET 0x00000000
  128. /* HTC ready message
  129. * direction : target-to-host */
  130. typedef PREPACK struct {
  131. A_UINT32 MessageID : 16, /* ID */
  132. CreditCount : 16; /* number of credits the target can offer */
  133. A_UINT32 CreditSize : 16, /* size of each credit */
  134. MaxEndpoints : 8, /* maximum number of endpoints the target has resources for */
  135. _Pad1 : 8;
  136. } POSTPACK HTC_READY_MSG;
  137. #define HTC_READY_MSG_MESSAGEID_LSB 0
  138. #define HTC_READY_MSG_MESSAGEID_MASK 0x0000ffff
  139. #define HTC_READY_MSG_MESSAGEID_OFFSET 0x00000000
  140. #define HTC_READY_MSG_CREDITCOUNT_LSB 16
  141. #define HTC_READY_MSG_CREDITCOUNT_MASK 0xffff0000
  142. #define HTC_READY_MSG_CREDITCOUNT_OFFSET 0x00000000
  143. #define HTC_READY_MSG_CREDITSIZE_LSB 0
  144. #define HTC_READY_MSG_CREDITSIZE_MASK 0x0000ffff
  145. #define HTC_READY_MSG_CREDITSIZE_OFFSET 0x00000004
  146. #define HTC_READY_MSG_MAXENDPOINTS_LSB 16
  147. #define HTC_READY_MSG_MAXENDPOINTS_MASK 0x00ff0000
  148. #define HTC_READY_MSG_MAXENDPOINTS_OFFSET 0x00000004
  149. /* extended HTC ready message */
  150. typedef PREPACK struct {
  151. HTC_READY_MSG Version2_0_Info; /* legacy version 2.0 information at the front... */
  152. /* extended information */
  153. A_UINT32 HTCVersion : 8, MaxMsgsPerHTCBundle : 8, reserved : 16;
  154. } POSTPACK HTC_READY_EX_MSG;
  155. #define HTC_READY_EX_MSG_HTCVERSION_LSB 0
  156. #define HTC_READY_EX_MSG_HTCVERSION_MASK 0x000000ff
  157. #define HTC_READY_EX_MSG_HTCVERSION_OFFSET sizeof(HTC_READY_MSG)
  158. #define HTC_READY_EX_MSG_MAXMSGSPERHTCBUNDLE_LSB 8
  159. #define HTC_READY_EX_MSG_MAXMSGSPERHTCBUNDLE_MASK 0x0000ff00
  160. #define HTC_READY_EX_MSG_MAXMSGSPERHTCBUNDLE_OFFSET sizeof(HTC_READY_MSG)
  161. #define HTC_VERSION_2P0 0x00
  162. #define HTC_VERSION_2P1 0x01 /* HTC 2.1 */
  163. #define HTC_SERVICE_META_DATA_MAX_LENGTH 128
  164. /* connect service
  165. * direction : host-to-target */
  166. typedef PREPACK struct {
  167. /* service ID of the service to connect to */
  168. A_UINT32 MessageID:16, service_id:16;
  169. A_UINT32 ConnectionFlags : 16, /* connection flags */
  170. #define HTC_CONNECT_FLAGS_REDUCE_CREDIT_DRIBBLE (1 << 2)
  171. /* reduce credit dribbling when
  172. the host needs credits */
  173. #define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_MASK (0x3)
  174. #define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_ONE_FOURTH 0x0
  175. #define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_ONE_HALF 0x1
  176. #define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_THREE_FOURTHS 0x2
  177. #define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_UNITY 0x3
  178. /* disable credit flow control on a specific service */
  179. #define HTC_CONNECT_FLAGS_DISABLE_CREDIT_FLOW_CTRL (1 << 3)
  180. /* enable htc schedule on a specific service */
  181. #define HTC_CONNECT_FLAGS_ENABLE_HTC_SCHEDULE (1 << 4)
  182. ServiceMetaLength : 8, /* length of meta data that follows */
  183. _Pad1 : 8;
  184. /* service-specific meta data starts after the header */
  185. } POSTPACK HTC_CONNECT_SERVICE_MSG;
  186. #define HTC_CONNECT_SERVICE_MSG_MESSAGEID_LSB 0
  187. #define HTC_CONNECT_SERVICE_MSG_MESSAGEID_MASK 0x0000ffff
  188. #define HTC_CONNECT_SERVICE_MSG_MESSAGEID_OFFSET 0x00000000
  189. #define HTC_CONNECT_SERVICE_MSG_SERVICE_ID_LSB 16
  190. #define HTC_CONNECT_SERVICE_MSG_SERVICE_ID_MASK 0xffff0000
  191. #define HTC_CONNECT_SERVICE_MSG_SERVICE_ID_OFFSET 0x00000000
  192. #define HTC_CONNECT_SERVICE_MSG_CONNECTIONFLAGS_LSB 0
  193. #define HTC_CONNECT_SERVICE_MSG_CONNECTIONFLAGS_MASK 0x0000ffff
  194. #define HTC_CONNECT_SERVICE_MSG_CONNECTIONFLAGS_OFFSET 0x00000004
  195. #define HTC_CONNECT_SERVICE_MSG_SERVICEMETALENGTH_LSB 16
  196. #define HTC_CONNECT_SERVICE_MSG_SERVICEMETALENGTH_MASK 0x00ff0000
  197. #define HTC_CONNECT_SERVICE_MSG_SERVICEMETALENGTH_OFFSET 0x00000004
  198. #define HTC_SET_RECV_ALLOC_SHIFT 8
  199. #define HTC_SET_RECV_ALLOC_MASK 0xFF00
  200. #define HTC_CONNECT_FLAGS_SET_RECV_ALLOCATION(value) (((A_UINT8)value) << HTC_SET_RECV_ALLOC_SHIFT)
  201. #define HTC_CONNECT_FLAGS_GET_RECV_ALLOCATION(value) (A_UINT8)(((value) & HTC_SET_RECV_ALLOC_MASK) >> HTC_SET_RECV_ALLOC_SHIFT)
  202. /* connect response
  203. * direction : target-to-host */
  204. typedef PREPACK struct {
  205. /* service ID that the connection request was made */
  206. A_UINT32 MessageID:16, service_id:16;
  207. A_UINT32 Status : 8, /* service connection status */
  208. EndpointID : 8, /* assigned endpoint ID */
  209. MaxMsgSize : 16; /* maximum expected message size on this endpoint */
  210. A_UINT32 ServiceMetaLength : 8, /* length of meta data that follows */
  211. _Pad1 : 8, reserved : 16;
  212. /* service-specific meta data starts after the header */
  213. } POSTPACK HTC_CONNECT_SERVICE_RESPONSE_MSG;
  214. #define HTC_CONNECT_SERVICE_RESPONSE_MSG_MESSAGEID_LSB 0
  215. #define HTC_CONNECT_SERVICE_RESPONSE_MSG_MESSAGEID_MASK 0x0000ffff
  216. #define HTC_CONNECT_SERVICE_RESPONSE_MSG_MESSAGEID_OFFSET 0x00000000
  217. #define HTC_CONNECT_SERVICE_RESPONSE_MSG_SERVICEID_LSB 16
  218. #define HTC_CONNECT_SERVICE_RESPONSE_MSG_SERVICEID_MASK 0xffff0000
  219. #define HTC_CONNECT_SERVICE_RESPONSE_MSG_SERVICEID_OFFSET 0x00000000
  220. #define HTC_CONNECT_SERVICE_RESPONSE_MSG_STATUS_LSB 0
  221. #define HTC_CONNECT_SERVICE_RESPONSE_MSG_STATUS_MASK 0x000000ff
  222. #define HTC_CONNECT_SERVICE_RESPONSE_MSG_STATUS_OFFSET 0x00000004
  223. #define HTC_CONNECT_SERVICE_RESPONSE_MSG_ENDPOINTID_LSB 8
  224. #define HTC_CONNECT_SERVICE_RESPONSE_MSG_ENDPOINTID_MASK 0x0000ff00
  225. #define HTC_CONNECT_SERVICE_RESPONSE_MSG_ENDPOINTID_OFFSET 0x00000004
  226. #define HTC_CONNECT_SERVICE_RESPONSE_MSG_MAXMSGSIZE_LSB 16
  227. #define HTC_CONNECT_SERVICE_RESPONSE_MSG_MAXMSGSIZE_MASK 0xffff0000
  228. #define HTC_CONNECT_SERVICE_RESPONSE_MSG_MAXMSGSIZE_OFFSET 0x00000004
  229. #define HTC_CONNECT_SERVICE_RESPONSE_MSG_SERVICEMETALENGTH_LSB 0
  230. #define HTC_CONNECT_SERVICE_RESPONSE_MSG_SERVICEMETALENGTH_MASK 0x000000ff
  231. #define HTC_CONNECT_SERVICE_RESPONSE_MSG_SERVICEMETALENGTH_OFFSET 0x00000008
  232. typedef PREPACK struct {
  233. A_UINT32 MessageID : 16, reserved : 16;
  234. /* currently, no other fields */
  235. } POSTPACK HTC_SETUP_COMPLETE_MSG;
  236. #define HTC_SETUP_COMPLETE_MSG_MESSAGEID_LSB 0
  237. #define HTC_SETUP_COMPLETE_MSG_MESSAGEID_MASK 0x0000ffff
  238. #define HTC_SETUP_COMPLETE_MSG_MESSAGEID_OFFSET 0x00000000
  239. /* extended setup completion message */
  240. typedef PREPACK struct {
  241. A_UINT32 MessageID : 16, reserved : 16;
  242. A_UINT32 SetupFlags : 32;
  243. A_UINT32 MaxMsgsPerBundledRecv : 8, Rsvd0 : 8, Rsvd1 : 8, Rsvd2 : 8;
  244. } POSTPACK HTC_SETUP_COMPLETE_EX_MSG;
  245. #define HTC_SETUP_COMPLETE_EX_MSG_MESSAGEID_LSB 0
  246. #define HTC_SETUP_COMPLETE_EX_MSG_MESSAGEID_MASK 0x0000ffff
  247. #define HTC_SETUP_COMPLETE_EX_MSG_MESSAGEID_OFFSET 0x00000000
  248. #define HTC_SETUP_COMPLETE_EX_MSG_SETUPFLAGS_LSB 0
  249. #define HTC_SETUP_COMPLETE_EX_MSG_SETUPFLAGS_MASK 0xffffffff
  250. #define HTC_SETUP_COMPLETE_EX_MSG_SETUPFLAGS_OFFSET 0x00000004
  251. #define HTC_SETUP_COMPLETE_EX_MSG_MAXMSGSPERBUNDLEDRECV_LSB 0
  252. #define HTC_SETUP_COMPLETE_EX_MSG_MAXMSGSPERBUNDLEDRECV_MASK 0x000000ff
  253. #define HTC_SETUP_COMPLETE_EX_MSG_MAXMSGSPERBUNDLEDRECV_OFFSET 0x00000008
  254. #define HTC_SETUP_COMPLETE_EX_MSG_RSVD0_LSB 8
  255. #define HTC_SETUP_COMPLETE_EX_MSG_RSVD0_MASK 0x0000ff00
  256. #define HTC_SETUP_COMPLETE_EX_MSG_RSVD0_OFFSET 0x00000008
  257. #define HTC_SETUP_COMPLETE_EX_MSG_RSVD1_LSB 16
  258. #define HTC_SETUP_COMPLETE_EX_MSG_RSVD1_MASK 0x00ff0000
  259. #define HTC_SETUP_COMPLETE_EX_MSG_RSVD1_OFFSET 0x00000008
  260. #define HTC_SETUP_COMPLETE_EX_MSG_RSVD2_LSB 24
  261. #define HTC_SETUP_COMPLETE_EX_MSG_RSVD2_MASK 0xff000000
  262. #define HTC_SETUP_COMPLETE_EX_MSG_RSVD2_OFFSET 0x00000008
  263. #define HTC_SETUP_COMPLETE_FLAGS_ENABLE_BUNDLE_RECV (1 << 0) /* enable recv bundling from target */
  264. #define HTC_SETUP_COMPLETE_FLAGS_DISABLE_TX_CREDIT_FLOW (1 << 1) /* disable credit based flow control,
  265. only supported on some interconnects */
  266. /* connect response status codes */
  267. #define HTC_SERVICE_SUCCESS 0 /* success */
  268. #define HTC_SERVICE_NOT_FOUND 1 /* service could not be found */
  269. #define HTC_SERVICE_FAILED 2 /* specific service failed the connect */
  270. #define HTC_SERVICE_NO_RESOURCES 3 /* no resources (i.e. no more endpoints) */
  271. #define HTC_SERVICE_NO_MORE_EP 4 /* specific service is not allowing any more
  272. endpoints */
  273. /* report record IDs */
  274. #define HTC_RECORD_NULL 0
  275. #define HTC_RECORD_CREDITS 1
  276. #define HTC_RECORD_LOOKAHEAD 2
  277. #define HTC_RECORD_LOOKAHEAD_BUNDLE 3
  278. typedef PREPACK struct {
  279. A_UINT32 RecordID : 8, /* Record ID */
  280. Length : 8, /* Length of record */
  281. reserved : 16;
  282. } POSTPACK HTC_RECORD_HDR;
  283. #define HTC_RECORD_HDR_RECORDID_LSB 0
  284. #define HTC_RECORD_HDR_RECORDID_MASK 0x000000ff
  285. #define HTC_RECORD_HDR_RECORDID_OFFSET 0x00000000
  286. #define HTC_RECORD_HDR_LENGTH_LSB 8
  287. #define HTC_RECORD_HDR_LENGTH_MASK 0x0000ff00
  288. #define HTC_RECORD_HDR_LENGTH_OFFSET 0x00000000
  289. typedef PREPACK struct {
  290. A_UINT32 EndpointID : 8, /* Endpoint that owns these credits */
  291. Credits : 8, /* credits to report since last report */
  292. reserved : 16;
  293. } POSTPACK HTC_CREDIT_REPORT;
  294. #define HTC_CREDIT_REPORT_ENDPOINTID_LSB 0
  295. #define HTC_CREDIT_REPORT_ENDPOINTID_MASK 0x000000ff
  296. #define HTC_CREDIT_REPORT_ENDPOINTID_OFFSET 0x00000000
  297. #define HTC_CREDIT_REPORT_CREDITS_LSB 8
  298. #define HTC_CREDIT_REPORT_CREDITS_MASK 0x0000ff00
  299. #define HTC_CREDIT_REPORT_CREDITS_OFFSET 0x00000000
  300. typedef PREPACK struct {
  301. A_UINT32 PreValid : 8, /* pre valid guard */
  302. reserved0 : 24;
  303. A_UINT32 LookAhead0 : 8, /* 4 byte lookahead */
  304. LookAhead1 : 8, LookAhead2 : 8, LookAhead3 : 8;
  305. A_UINT32 PostValid : 8, /* post valid guard */
  306. reserved1 : 24;
  307. /* NOTE: the LookAhead array is guarded by a PreValid and Post Valid guard bytes.
  308. * The PreValid bytes must equal the inverse of the PostValid byte */
  309. } POSTPACK HTC_LOOKAHEAD_REPORT;
  310. #define HTC_LOOKAHEAD_REPORT_PREVALID_LSB 0
  311. #define HTC_LOOKAHEAD_REPORT_PREVALID_MASK 0x000000ff
  312. #define HTC_LOOKAHEAD_REPORT_PREVALID_OFFSET 0x00000000
  313. #define HTC_LOOKAHEAD_REPORT_LOOKAHEAD0_LSB 0
  314. #define HTC_LOOKAHEAD_REPORT_LOOKAHEAD0_MASK 0x000000ff
  315. #define HTC_LOOKAHEAD_REPORT_LOOKAHEAD0_OFFSET 0x00000004
  316. #define HTC_LOOKAHEAD_REPORT_LOOKAHEAD1_LSB 8
  317. #define HTC_LOOKAHEAD_REPORT_LOOKAHEAD1_MASK 0x0000ff00
  318. #define HTC_LOOKAHEAD_REPORT_LOOKAHEAD1_OFFSET 0x00000004
  319. #define HTC_LOOKAHEAD_REPORT_LOOKAHEAD2_LSB 16
  320. #define HTC_LOOKAHEAD_REPORT_LOOKAHEAD2_MASK 0x00ff0000
  321. #define HTC_LOOKAHEAD_REPORT_LOOKAHEAD2_OFFSET 0x00000004
  322. #define HTC_LOOKAHEAD_REPORT_LOOKAHEAD3_LSB 24
  323. #define HTC_LOOKAHEAD_REPORT_LOOKAHEAD3_MASK 0xff000000
  324. #define HTC_LOOKAHEAD_REPORT_LOOKAHEAD3_OFFSET 0x00000004
  325. #define HTC_LOOKAHEAD_REPORT_POSTVALID_LSB 0
  326. #define HTC_LOOKAHEAD_REPORT_POSTVALID_MASK 0x000000ff
  327. #define HTC_LOOKAHEAD_REPORT_POSTVALID_OFFSET 0x00000008
  328. typedef PREPACK struct {
  329. A_UINT32 LookAhead0 : 8, /* 4 byte lookahead */
  330. LookAhead1 : 8, LookAhead2 : 8, LookAhead3 : 8;
  331. } POSTPACK HTC_BUNDLED_LOOKAHEAD_REPORT;
  332. #define HTC_BUNDLED_LOOKAHEAD_REPORT_LOOKAHEAD0_LSB 0
  333. #define HTC_BUNDLED_LOOKAHEAD_REPORT_LOOKAHEAD0_MASK 0x000000ff
  334. #define HTC_BUNDLED_LOOKAHEAD_REPORT_LOOKAHEAD0_OFFSET 0x00000000
  335. #define HTC_BUNDLED_LOOKAHEAD_REPORT_LOOKAHEAD1_LSB 8
  336. #define HTC_BUNDLED_LOOKAHEAD_REPORT_LOOKAHEAD1_MASK 0x0000ff00
  337. #define HTC_BUNDLED_LOOKAHEAD_REPORT_LOOKAHEAD1_OFFSET 0x00000000
  338. #define HTC_BUNDLED_LOOKAHEAD_REPORT_LOOKAHEAD2_LSB 16
  339. #define HTC_BUNDLED_LOOKAHEAD_REPORT_LOOKAHEAD2_MASK 0x00ff0000
  340. #define HTC_BUNDLED_LOOKAHEAD_REPORT_LOOKAHEAD2_OFFSET 0x00000000
  341. #define HTC_BUNDLED_LOOKAHEAD_REPORT_LOOKAHEAD3_LSB 24
  342. #define HTC_BUNDLED_LOOKAHEAD_REPORT_LOOKAHEAD3_MASK 0xff000000
  343. #define HTC_BUNDLED_LOOKAHEAD_REPORT_LOOKAHEAD3_OFFSET 0x00000000
  344. #ifndef ATH_TARGET
  345. #include "athendpack.h"
  346. #endif
  347. #endif /* __HTC_H__ */