htt_isoc.h 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276
  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. /**
  27. * @file htt_isoc.h
  28. *
  29. * @details
  30. * This file defines the target --> host messages that configure the
  31. * host data-path SW with the information required for data transfers
  32. * to and from the target.
  33. */
  34. #ifndef _HTT_ISOC_H_
  35. #define _HTT_ISOC_H_
  36. #include <a_types.h> /* A_UINT32, A_UINT8 */
  37. #include <a_osapi.h> /* A_COMPILE_TIME_ASSERT */
  38. #ifdef ATHR_WIN_NWF
  39. #pragma warning( disable:4214 ) //bit field types other than int
  40. #endif
  41. #include "htt_common.h"
  42. /*=== definitions that apply to all messages ================================*/
  43. typedef enum htt_isoc_t2h_msg_type {
  44. /* 0x0 reserved for VERSION message (probably not needed) */
  45. /* PEER_INFO - specify ID and parameters of a new peer */
  46. HTT_ISOC_T2H_MSG_TYPE_PEER_INFO = 0x1,
  47. /* PEER_UNMAP - deallocate the ID that refers to a peer */
  48. HTT_ISOC_T2H_MSG_TYPE_PEER_UNMAP = 0x2,
  49. /* ADDBA - start rx aggregation for the specified peer-TID */
  50. HTT_ISOC_T2H_MSG_TYPE_RX_ADDBA = 0x3,
  51. /* DELBA - stop rx aggregation for the specified peer-TID */
  52. HTT_ISOC_T2H_MSG_TYPE_RX_DELBA = 0x4,
  53. /* TX_COMPL_IND - over-the-air tx completion notification for a tx frame */
  54. HTT_ISOC_T2H_MSG_TYPE_TX_COMPL_IND = 0x5,
  55. /* SEC_IND - notification of the type of security used for a new peer */
  56. HTT_ISOC_T2H_MSG_TYPE_SEC_IND = 0x6,
  57. /* PEER_TX_READY - the target is ready to transmit to a new peer */
  58. HTT_ISOC_T2H_MSG_TYPE_PEER_TX_READY = 0x7,
  59. /* RX_ERR - notification that an rx frame was discarded due to errors */
  60. HTT_ISOC_T2H_MSG_TYPE_RX_ERR = 0x8,
  61. /*NLO_MATCH - notification that target found NLO match */
  62. HTT_ISOC_T2H_MSG_TYPE_NLO_MATCH = 0x9,
  63. /*NLO_SCAN_END - notification that target NLO SCAN END 1:1 map with NLO_MATCH*/
  64. HTT_ISOC_T2H_MSG_TYPE_NLO_SCAN_END = 0xA,
  65. /* keep this last */
  66. HTT_ISOC_T2H_NUM_MSGS
  67. } htt_isoc_t2h_msg_type;
  68. /*
  69. * HTT ISOC target to host message type -
  70. * stored in bits 7:0 of the first word of the message
  71. */
  72. #define HTT_ISOC_T2H_MSG_TYPE_M 0xff
  73. #define HTT_ISOC_T2H_MSG_TYPE_S 0
  74. #define HTT_ISOC_T2H_MSG_TYPE_SET(msg_addr, msg_type) \
  75. (*((A_UINT8 *) msg_addr) = (msg_type))
  76. #define HTT_ISOC_T2H_MSG_TYPE_GET(msg_addr) \
  77. (*((A_UINT8 *) msg_addr))
  78. #ifndef INLINE
  79. #ifdef QCA_SUPPORT_INTEGRATED_SOC
  80. /* host SW */
  81. #define INLINE inline
  82. #else
  83. /* target FW */
  84. #define INLINE __inline
  85. #endif
  86. #define HTT_ISOC_INLINE_DEF
  87. #endif /* INLINE */
  88. static INLINE void
  89. htt_isoc_t2h_field_set(
  90. A_UINT32 *msg_addr32,
  91. unsigned offset32,
  92. unsigned mask,
  93. unsigned shift,
  94. unsigned value)
  95. {
  96. /* sanity check: make sure the value fits within the field */
  97. //adf_os_assert(value << shift == (value << shift) | mask);
  98. msg_addr32 += offset32;
  99. /* clear the field */
  100. *msg_addr32 &= ~mask;
  101. /* write the new value */
  102. *msg_addr32 |= (value << shift);
  103. }
  104. #ifdef HTT_ISOC_INLINE_DEF
  105. #undef HTT_ISOC_INLINE_DEF
  106. #undef INLINE
  107. #endif
  108. #define HTT_ISOC_T2H_FIELD_GET(msg_addr32, offset32, mask, shift) \
  109. (((*(msg_addr32 + offset32)) & mask) >> shift)
  110. typedef enum {
  111. /* ASSOC - "real" peer from STA-AP association */
  112. HTT_ISOC_T2H_PEER_TYPE_ASSOC = 0x0,
  113. /* SELF - self-peer for unicast tx to unassociated peer */
  114. HTT_ISOC_T2H_PEER_TYPE_SELF = 0x1,
  115. /* BSSID - reserved for FW use for BT-AMP+IBSS */
  116. HTT_ISOC_T2H_PEER_TYPE_BSSID = 0x2,
  117. /* BCAST - self-peer for multicast / broadcast tx */
  118. HTT_ISOC_T2H_PEER_TYPE_BCAST = 0x3
  119. } HTT_ISOC_T2H_PEER_TYPE_ENUM;
  120. enum {
  121. HTT_ISOC_NON_QOS = 0,
  122. HTT_ISOC_QOS = 1
  123. };
  124. enum {
  125. HTT_ISOC_RMF_DISABLED = 0,
  126. HTT_ISOC_RMF_ENABLED = 1
  127. };
  128. enum {
  129. HTT_ISOC_TID_MGMT = 7
  130. };
  131. /*=== definitions for specific messages =====================================*/
  132. /*=== PEER_INFO message ===*/
  133. /**
  134. * @brief target -> host peer info message definition
  135. *
  136. * @details
  137. * The following diagram shows the format of the peer info message sent
  138. * from the target to the host. This layout assumes the target operates
  139. * as little-endian.
  140. *
  141. * |31 25|24|23 18|17|16|15 11|10|9|8|7|6| 0|
  142. * |-----------------------------------------------------------------------|
  143. * | mgmt DPU idx | bcast DPU idx | DPU idx | msg type |
  144. * |-----------------------------------------------------------------------|
  145. * | mgmt DPU sig |bcast DPU sig | DPU sig | peer ID |
  146. * |-----------------------------------------------------------------------|
  147. * | MAC addr 1 | MAC addr 0 | vdev ID | |R| peer type |
  148. * |-----------------------------------------------------------------------|
  149. * | MAC addr 5 | MAC addr 4 | MAC addr 3 | MAC addr 2 |
  150. * |-----------------------------------------------------------------------|
  151. *
  152. *
  153. * The following field definitions describe the format of the peer info
  154. * message sent from the target to the host.
  155. *
  156. * WORD 0:
  157. * - MSG_TYPE
  158. * Bits 7:0
  159. * Purpose: identifies this as peer info message
  160. * Value: 0x1
  161. * - DPU_IDX
  162. * Bits 15:8
  163. * Purpose: specify the DPU index (a.k.a. security key ID) to use for
  164. * unicast data frames sent to this peer
  165. * Value: key ID
  166. * - BCAST_DPU_IDX
  167. * Bits 23:16
  168. * Purpose: specify the DPU index (a.k.a. security key ID) to use for
  169. * broadcast data frames sent by this (self) peer
  170. * Value: key ID
  171. * - MGMT_DPU_IDX
  172. * Bits 31:24
  173. * Purpose: specify the DPU index (a.k.a. security key ID) to use for
  174. * unicast management frames sent by this (self) peer
  175. * Value: key ID
  176. * WORD 1:
  177. * - PEER_ID
  178. * Bits 10:0
  179. * Purpose: The ID that the target has allocated to refer to the peer
  180. * - DPU_SIG
  181. * Bits 17:11
  182. * Purpose: specify the DPU signature (a.k.a. security key validity
  183. * magic number) to specify for unicast data frames sent to this peer
  184. * - BCAST_DPU_SIG
  185. * Bits 24:18
  186. * Purpose: specify the DPU signature (a.k.a. security key validity
  187. * magic number) to specify for broadcast data frames sent by this
  188. * (self) peer
  189. * - MGMT_DPU_SIG
  190. * Bits 31:25
  191. * Purpose: specify the DPU signature (a.k.a. security key validity
  192. * magic number) to specify for unicast management frames sent by this
  193. * (self) peer
  194. * WORD 2:
  195. * - PEER_TYPE
  196. * Bits 5:0
  197. * Purpose: specify whether the peer in question is a real peer or
  198. * one of the types of "self-peer" created for the vdev
  199. * Value: HTT_ISOC_T2H_PEER_TYPE enum
  200. * - RMF_ENABLED (R)
  201. * Bit 6
  202. * Purpose: specify whether the peer in question has enable robust
  203. * management frames, to encrypt certain managment frames
  204. * Value: HTT_ISOC_RMF enum
  205. * Value: HTT_ISOC_NON_QOS or HTT_ISOC_QOS
  206. * - VDEV_ID
  207. * Bits 15:8
  208. * Purpose: For a real peer, the vdev ID indicates which virtual device
  209. * the peer is associated with. For a self-peer, the vdev ID shows
  210. * which virtual device the self-peer represents.
  211. * - MAC_ADDR_L16
  212. * Bits 31:16
  213. * Purpose: Identifies which peer the peer ID is for.
  214. * Value: lower 2 bytes of the peer's MAC address
  215. * For a self-peer, the peer's MAC address is the MAC address of the
  216. * vdev the self-peer represents.
  217. * WORD 3:
  218. * - MAC_ADDR_U32
  219. * Bits 31:0
  220. * Purpose: Identifies which peer the peer ID is for.
  221. * Value: upper 4 bytes of the peer's MAC address
  222. * For a self-peer, the peer's MAC address is the MAC address of the
  223. * vdev the self-peer represents.
  224. */
  225. typedef struct htt_isoc_t2h_peer_info_s {
  226. /* word 0 */
  227. A_UINT32
  228. msg_type: 8, /* HTT_ISOC_T2H_MSG_TYPE_PEER_INFO */
  229. dpu_idx: 8,
  230. bcast_dpu_idx: 8,
  231. mgmt_dpu_idx: 8;
  232. /* word 1 */
  233. A_UINT32
  234. peer_id: 11,
  235. dpu_sig: 7,
  236. bcast_dpu_sig: 7,
  237. mgmt_dpu_sig: 7;
  238. /* word 2 */
  239. A_UINT32
  240. peer_type: 6,
  241. rmf_enabled: 1,
  242. reserved0: 1,
  243. vdev_id: 8,
  244. mac_addr_l16: 16;
  245. /* word 3 */
  246. A_UINT32 mac_addr_u32;
  247. } htt_isoc_t2h_peer_info_t;
  248. /* word 0 */
  249. #define HTT_ISOC_T2H_PEER_INFO_DPU_IDX_OFFSET32 0
  250. #define HTT_ISOC_T2H_PEER_INFO_DPU_IDX_M 0x0000ff00
  251. #define HTT_ISOC_T2H_PEER_INFO_DPU_IDX_S 8
  252. #define HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_IDX_OFFSET32 0
  253. #define HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_IDX_M 0x00ff0000
  254. #define HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_IDX_S 16
  255. #define HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_IDX_OFFSET32 0
  256. #define HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_IDX_M 0xff000000
  257. #define HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_IDX_S 24
  258. /* word 1 */
  259. #define HTT_ISOC_T2H_PEER_INFO_PEER_ID_OFFSET32 1
  260. #define HTT_ISOC_T2H_PEER_INFO_PEER_ID_M 0x000007ff
  261. #define HTT_ISOC_T2H_PEER_INFO_PEER_ID_S 0
  262. #define HTT_ISOC_T2H_PEER_INFO_DPU_SIG_OFFSET32 1
  263. #define HTT_ISOC_T2H_PEER_INFO_DPU_SIG_M 0x0003f800
  264. #define HTT_ISOC_T2H_PEER_INFO_DPU_SIG_S 11
  265. #define HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_SIG_OFFSET32 1
  266. #define HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_SIG_M 0x01fc0000
  267. #define HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_SIG_S 18
  268. #define HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_SIG_OFFSET32 1
  269. #define HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_SIG_M 0xfe000000
  270. #define HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_SIG_S 25
  271. /* word 2 */
  272. #define HTT_ISOC_T2H_PEER_INFO_PEER_TYPE_OFFSET32 2
  273. #define HTT_ISOC_T2H_PEER_INFO_PEER_TYPE_M 0x0000003f
  274. #define HTT_ISOC_T2H_PEER_INFO_PEER_TYPE_S 0
  275. #define HTT_ISOC_T2H_PEER_INFO_RMF_ENABLED_OFFSET32 2
  276. #define HTT_ISOC_T2H_PEER_INFO_RMF_ENABLED_M 0x00000040
  277. #define HTT_ISOC_T2H_PEER_INFO_RMF_ENABLED_S 6
  278. #define HTT_ISOC_T2H_PEER_INFO_VDEV_ID_OFFSET32 2
  279. #define HTT_ISOC_T2H_PEER_INFO_VDEV_ID_M 0x0000ff00
  280. #define HTT_ISOC_T2H_PEER_INFO_VDEV_ID_S 8
  281. #define HTT_ISOC_T2H_PEER_INFO_MAC_ADDR_L16_OFFSET32 2
  282. #define HTT_ISOC_T2H_PEER_INFO_MAC_ADDR_L16_M 0xffff0000
  283. #define HTT_ISOC_T2H_PEER_INFO_MAC_ADDR_L16_S 16
  284. /* word 3 */
  285. #define HTT_ISOC_T2H_PEER_INFO_MAC_ADDR_U32_OFFSET32 3
  286. #define HTT_ISOC_T2H_PEER_INFO_MAC_ADDR_U32_M 0xffffffff
  287. #define HTT_ISOC_T2H_PEER_INFO_MAC_ADDR_U32_S 0
  288. /* general field access macros */
  289. #define HTT_ISOC_T2H_PEER_INFO_FIELD_SET(field, msg_addr, value) \
  290. htt_isoc_t2h_field_set( \
  291. ((A_UINT32 *) msg_addr), \
  292. HTT_ISOC_T2H_PEER_INFO_ ## field ## _OFFSET32, \
  293. HTT_ISOC_T2H_PEER_INFO_ ## field ## _M, \
  294. HTT_ISOC_T2H_PEER_INFO_ ## field ## _S, \
  295. value)
  296. #define HTT_ISOC_T2H_PEER_INFO_FIELD_GET(field, msg_addr) \
  297. HTT_ISOC_T2H_FIELD_GET( \
  298. ((A_UINT32 *) msg_addr), \
  299. HTT_ISOC_T2H_PEER_INFO_ ## field ## _OFFSET32, \
  300. HTT_ISOC_T2H_PEER_INFO_ ## field ## _M, \
  301. HTT_ISOC_T2H_PEER_INFO_ ## field ## _S)
  302. /* access macros for specific fields */
  303. #define HTT_ISOC_T2H_PEER_INFO_DPU_IDX_SET(msg_addr, value) \
  304. HTT_ISOC_T2H_PEER_INFO_FIELD_SET(DPU_IDX, msg_addr, value)
  305. #define HTT_ISOC_T2H_PEER_INFO_DPU_IDX_GET(msg_addr) \
  306. HTT_ISOC_T2H_PEER_INFO_FIELD_GET(DPU_IDX, msg_addr)
  307. A_COMPILE_TIME_ASSERT(HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_IDX_M_Size_Check, \
  308. (HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_IDX_M >> HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_IDX_S)\
  309. <= ((A_UINT8)~((A_UINT8)0)));
  310. #define HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_IDX_SET(msg_addr, value) \
  311. HTT_ISOC_T2H_PEER_INFO_FIELD_SET(BCAST_DPU_IDX, msg_addr, value)
  312. #define HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_IDX_GET(msg_addr) \
  313. (A_UINT8)(HTT_ISOC_T2H_PEER_INFO_FIELD_GET(BCAST_DPU_IDX, msg_addr))
  314. A_COMPILE_TIME_ASSERT(HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_IDX_M_Size_Check,\
  315. (HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_IDX_M >> HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_IDX_S) \
  316. <= ((A_UINT8)~((A_UINT8)0)));
  317. #define HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_IDX_SET(msg_addr, value) \
  318. HTT_ISOC_T2H_PEER_INFO_FIELD_SET(MGMT_DPU_IDX, msg_addr, value)
  319. #define HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_IDX_GET(msg_addr) \
  320. (A_UINT8)(HTT_ISOC_T2H_PEER_INFO_FIELD_GET(MGMT_DPU_IDX, msg_addr))
  321. #define HTT_ISOC_T2H_PEER_INFO_PEER_ID_SET(msg_addr, value) \
  322. HTT_ISOC_T2H_PEER_INFO_FIELD_SET(PEER_ID, msg_addr, value)
  323. #define HTT_ISOC_T2H_PEER_INFO_PEER_ID_GET(msg_addr) \
  324. HTT_ISOC_T2H_PEER_INFO_FIELD_GET(PEER_ID, msg_addr)
  325. A_COMPILE_TIME_ASSERT(HTT_ISOC_T2H_PEER_INFO_DPU_SIG_M_Size_Check,\
  326. (HTT_ISOC_T2H_PEER_INFO_DPU_SIG_M >> HTT_ISOC_T2H_PEER_INFO_DPU_SIG_S)\
  327. <= ((A_UINT8)~((A_UINT8)0)));
  328. #define HTT_ISOC_T2H_PEER_INFO_DPU_SIG_SET(msg_addr, value) \
  329. HTT_ISOC_T2H_PEER_INFO_FIELD_SET(DPU_SIG, msg_addr, value)
  330. #define HTT_ISOC_T2H_PEER_INFO_DPU_SIG_GET(msg_addr) \
  331. (A_UINT8)(HTT_ISOC_T2H_PEER_INFO_FIELD_GET(DPU_SIG, msg_addr))
  332. A_COMPILE_TIME_ASSERT(HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_SIG_M_Size_Check,\
  333. (HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_SIG_M >> HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_SIG_S)\
  334. <= ((A_UINT8)~((A_UINT8)0)));
  335. #define HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_SIG_SET(msg_addr, value) \
  336. HTT_ISOC_T2H_PEER_INFO_FIELD_SET(BCAST_DPU_SIG, msg_addr, value)
  337. #define HTT_ISOC_T2H_PEER_INFO_BCAST_DPU_SIG_GET(msg_addr) \
  338. (A_UINT8)(HTT_ISOC_T2H_PEER_INFO_FIELD_GET(BCAST_DPU_SIG, msg_addr))
  339. #define HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_SIG_SET(msg_addr, value) \
  340. HTT_ISOC_T2H_PEER_INFO_FIELD_SET(MGMT_DPU_SIG, msg_addr, value)
  341. #define HTT_ISOC_T2H_PEER_INFO_MGMT_DPU_SIG_GET(msg_addr) \
  342. HTT_ISOC_T2H_PEER_INFO_FIELD_GET(MGMT_DPU_SIG, msg_addr)
  343. #define HTT_ISOC_T2H_PEER_INFO_PEER_TYPE_SET(msg_addr, value) \
  344. HTT_ISOC_T2H_PEER_INFO_FIELD_SET(PEER_TYPE, msg_addr, value)
  345. #define HTT_ISOC_T2H_PEER_INFO_PEER_TYPE_GET(msg_addr) \
  346. HTT_ISOC_T2H_PEER_INFO_FIELD_GET(PEER_TYPE, msg_addr)
  347. #define HTT_ISOC_T2H_PEER_INFO_QOS_CAPABLE_SET(msg_addr, value) \
  348. HTT_ISOC_T2H_PEER_INFO_FIELD_SET(QOS_CAPABLE, msg_addr, value)
  349. #define HTT_ISOC_T2H_PEER_INFO_QOS_CAPABLE_GET(msg_addr) \
  350. HTT_ISOC_T2H_PEER_INFO_FIELD_GET(QOS_CAPABLE, msg_addr)
  351. #define HTT_ISOC_T2H_PEER_INFO_RMF_ENABLED_SET(msg_addr, value) \
  352. HTT_ISOC_T2H_PEER_INFO_FIELD_SET(RMF_ENABLED, msg_addr, value)
  353. #define HTT_ISOC_T2H_PEER_INFO_RMF_ENABLED_GET(msg_addr) \
  354. HTT_ISOC_T2H_PEER_INFO_FIELD_GET(RMF_ENABLED, msg_addr)
  355. #define HTT_ISOC_T2H_PEER_INFO_VDEV_ID_SET(msg_addr, value) \
  356. HTT_ISOC_T2H_PEER_INFO_FIELD_SET(VDEV_ID, msg_addr, value)
  357. #define HTT_ISOC_T2H_PEER_INFO_VDEV_ID_GET(msg_addr) \
  358. HTT_ISOC_T2H_PEER_INFO_FIELD_GET(VDEV_ID, msg_addr)
  359. #define HTT_ISOC_T2H_PEER_INFO_MAC_ADDR_L16_SET(msg_addr, value) \
  360. HTT_ISOC_T2H_PEER_INFO_FIELD_SET(MAC_ADDR_L16, msg_addr, value)
  361. #define HTT_ISOC_T2H_PEER_INFO_MAC_ADDR_L16_GET(msg_addr) \
  362. HTT_ISOC_T2H_PEER_INFO_FIELD_GET(MAC_ADDR_L16, msg_addr)
  363. #define HTT_ISOC_T2H_PEER_INFO_MAC_ADDR_U32_SET(msg_addr, value) \
  364. HTT_ISOC_T2H_PEER_INFO_FIELD_SET(MAC_ADDR_U32, msg_addr, value)
  365. #define HTT_ISOC_T2H_PEER_INFO_MAC_ADDR_U32_GET(msg_addr) \
  366. HTT_ISOC_T2H_PEER_INFO_FIELD_GET(MAC_ADDR_U32, msg_addr)
  367. /*=== PEER_UNMAP message ===*/
  368. /**
  369. * @brief target -> host peer unmap message definition
  370. *
  371. * @details
  372. * The following diagram shows the format of the peer unmap message sent
  373. * from the target to the host. This layout assumes the target operates
  374. * as little-endian.
  375. *
  376. * |31 19|18 8|7 0|
  377. * |-----------------------------------------------------------------------|
  378. * | reserved | peer ID | msg type |
  379. * |-----------------------------------------------------------------------|
  380. *
  381. *
  382. * The following field definitions describe the format of the peer info
  383. * message sent from the target to the host.
  384. *
  385. * WORD 0:
  386. * - MSG_TYPE
  387. * Bits 7:0
  388. * Purpose: identifies this as peer unmap message
  389. * Value: 0x2
  390. * - PEER_ID
  391. * Bits 18:8
  392. * Purpose: The ID that the target has allocated to refer to the peer
  393. */
  394. typedef struct htt_isoc_t2h_peer_unmap_s {
  395. /* word 0 */
  396. A_UINT32
  397. msg_type: 8, /* HTT_ISOC_T2H_MSG_TYPE_PEER_UNMAP */
  398. peer_id: 11,
  399. reserved0: 13;
  400. } htt_isoc_t2h_peer_unmap_t;
  401. /* word 0 */
  402. #define HTT_ISOC_T2H_PEER_UNMAP_PEER_ID_OFFSET32 0
  403. #define HTT_ISOC_T2H_PEER_UNMAP_PEER_ID_M 0x0007ff00
  404. #define HTT_ISOC_T2H_PEER_UNMAP_PEER_ID_S 8
  405. /* general field access macros */
  406. #define HTT_ISOC_T2H_PEER_UNMAP_FIELD_SET(field, msg_addr, value) \
  407. htt_isoc_t2h_field_set( \
  408. ((A_UINT32 *) msg_addr), \
  409. HTT_ISOC_T2H_PEER_UNMAP_ ## field ## _OFFSET32, \
  410. HTT_ISOC_T2H_PEER_UNMAP_ ## field ## _M, \
  411. HTT_ISOC_T2H_PEER_UNMAP_ ## field ## _S, \
  412. value)
  413. #define HTT_ISOC_T2H_PEER_UNMAP_FIELD_GET(field, msg_addr) \
  414. HTT_ISOC_T2H_FIELD_GET( \
  415. ((A_UINT32 *) msg_addr), \
  416. HTT_ISOC_T2H_PEER_UNMAP_ ## field ## _OFFSET32, \
  417. HTT_ISOC_T2H_PEER_UNMAP_ ## field ## _M, \
  418. HTT_ISOC_T2H_PEER_UNMAP_ ## field ## _S)
  419. /* access macros for specific fields */
  420. A_COMPILE_TIME_ASSERT(HTT_ISOC_T2H_PEER_UNMAP_PEER_ID_M_Size_Check,\
  421. (HTT_ISOC_T2H_PEER_UNMAP_PEER_ID_M >> HTT_ISOC_T2H_PEER_UNMAP_PEER_ID_S)\
  422. < ((A_UINT16)~((A_UINT16)0)));
  423. #define HTT_ISOC_T2H_PEER_UNMAP_PEER_ID_SET(msg_addr, value) \
  424. HTT_ISOC_T2H_PEER_UNMAP_FIELD_SET(PEER_ID, msg_addr, value)
  425. #define HTT_ISOC_T2H_PEER_UNMAP_PEER_ID_GET(msg_addr) \
  426. (A_UINT16)(HTT_ISOC_T2H_PEER_UNMAP_FIELD_GET(PEER_ID, msg_addr))
  427. /*=== ADDBA message ===*/
  428. enum {
  429. htt_isoc_addba_success = 0,
  430. /* TBD: use different failure values to specify failure causes? */
  431. htt_isoc_addba_fail = 1,
  432. };
  433. /**
  434. * @brief target -> host ADDBA message definition
  435. *
  436. * @details
  437. * The following diagram shows the format of the rx ADDBA message sent
  438. * from the target to the host:
  439. *
  440. * |31 20|19 16|15 12|11 8|7 0|
  441. * |---------------------------------------------------------------------|
  442. * | peer ID | TID | window size | msg type |
  443. * |---------------------------------------------------------------------|
  444. * | reserved |S| start seq num |
  445. * |---------------------------------------------------------------------|
  446. *
  447. * The following field definitions describe the format of the ADDBA
  448. * message sent from the target to the host.
  449. *
  450. * WORD 0:
  451. * - MSG_TYPE
  452. * Bits 7:0
  453. * Purpose: identifies this as an ADDBA message
  454. * Value: 0x3
  455. * - WIN_SIZE
  456. * Bits 15:8
  457. * Purpose: Specifies the length of the block ack window (max = 64).
  458. * Value:
  459. * block ack window length specified by the received ADDBA
  460. * management message.
  461. * - TID
  462. * Bits 19:16
  463. * Purpose: Specifies which traffic identifier the ADDBA is for.
  464. * Value:
  465. * TID specified by the received ADDBA management message.
  466. * - PEER_ID
  467. * Bits 31:20
  468. * Purpose: Identifies which peer sent the ADDBA.
  469. * Value:
  470. * ID (hash value) used by the host for fast, direct lookup of
  471. * host SW peer info, including rx reorder states.
  472. * - START_SEQ_NUM
  473. * Bits 11:0
  474. * Purpose: Specifies the initial location of the block ack window
  475. * Value: start sequence value specified by the ADDBA-request message
  476. * - STATUS
  477. * Bit 12
  478. * Purpose: status of the WMI ADDBA request
  479. * Value: 0 - SUCCESS, 1 - FAILURE
  480. */
  481. typedef struct htt_isoc_t2h_addba_s {
  482. /* word 0 */
  483. A_UINT32 msg_type: 8, /* HTT_ISOC_T2H_MSG_TYPE_ADDBA */
  484. win_size: 8,
  485. tid: 4,
  486. peer_id: 12;
  487. /* word 1 */
  488. A_UINT32 start_seq_num: 12,
  489. status: 1,
  490. reserved0: 19;
  491. } htt_isoc_t2h_addba_t;
  492. /* word 0 */
  493. #define HTT_ISOC_T2H_ADDBA_WIN_SIZE_OFFSET32 0
  494. #define HTT_ISOC_T2H_ADDBA_WIN_SIZE_M 0x0000ff00
  495. #define HTT_ISOC_T2H_ADDBA_WIN_SIZE_S 8
  496. #define HTT_ISOC_T2H_ADDBA_TID_OFFSET32 0
  497. #define HTT_ISOC_T2H_ADDBA_TID_M 0x000f0000
  498. #define HTT_ISOC_T2H_ADDBA_TID_S 16
  499. #define HTT_ISOC_T2H_ADDBA_PEER_ID_OFFSET32 0
  500. #define HTT_ISOC_T2H_ADDBA_PEER_ID_M 0xfff00000
  501. #define HTT_ISOC_T2H_ADDBA_PEER_ID_S 20
  502. /* word 1 */
  503. #define HTT_ISOC_T2H_ADDBA_START_SEQ_NUM_OFFSET32 1
  504. #define HTT_ISOC_T2H_ADDBA_START_SEQ_NUM_M 0x00000fff
  505. #define HTT_ISOC_T2H_ADDBA_START_SEQ_NUM_S 0
  506. #define HTT_ISOC_T2H_ADDBA_STATUS_OFFSET32 1
  507. #define HTT_ISOC_T2H_ADDBA_STATUS_M 0x00001000
  508. #define HTT_ISOC_T2H_ADDBA_STATUS_S 12
  509. /* general field access macros */
  510. #define HTT_ISOC_T2H_ADDBA_FIELD_SET(field, msg_addr, value) \
  511. htt_isoc_t2h_field_set( \
  512. ((A_UINT32 *) msg_addr), \
  513. HTT_ISOC_T2H_ADDBA_ ## field ## _OFFSET32, \
  514. HTT_ISOC_T2H_ADDBA_ ## field ## _M, \
  515. HTT_ISOC_T2H_ADDBA_ ## field ## _S, \
  516. value)
  517. #define HTT_ISOC_T2H_ADDBA_FIELD_GET(field, msg_addr) \
  518. HTT_ISOC_T2H_FIELD_GET( \
  519. ((A_UINT32 *) msg_addr), \
  520. HTT_ISOC_T2H_ADDBA_ ## field ## _OFFSET32, \
  521. HTT_ISOC_T2H_ADDBA_ ## field ## _M, \
  522. HTT_ISOC_T2H_ADDBA_ ## field ## _S)
  523. /* access macros for specific fields */
  524. #define HTT_ISOC_T2H_ADDBA_WIN_SIZE_SET(msg_addr, value) \
  525. HTT_ISOC_T2H_ADDBA_FIELD_SET(WIN_SIZE, msg_addr, value)
  526. #define HTT_ISOC_T2H_ADDBA_WIN_SIZE_GET(msg_addr) \
  527. HTT_ISOC_T2H_ADDBA_FIELD_GET(WIN_SIZE, msg_addr)
  528. A_COMPILE_TIME_ASSERT(HTT_ISOC_T2H_ADDBA_TID_M_Size_Check,\
  529. (HTT_ISOC_T2H_ADDBA_TID_M >> HTT_ISOC_T2H_ADDBA_TID_S) \
  530. < ((A_UINT8)~((A_UINT8)0)));
  531. #define HTT_ISOC_T2H_ADDBA_TID_SET(msg_addr, value) \
  532. HTT_ISOC_T2H_ADDBA_FIELD_SET(TID, msg_addr, value)
  533. #define HTT_ISOC_T2H_ADDBA_TID_GET(msg_addr) \
  534. (A_UINT8)(HTT_ISOC_T2H_ADDBA_FIELD_GET(TID, msg_addr))
  535. #define HTT_ISOC_T2H_ADDBA_PEER_ID_SET(msg_addr, value) \
  536. HTT_ISOC_T2H_ADDBA_FIELD_SET(PEER_ID, msg_addr, value)
  537. #define HTT_ISOC_T2H_ADDBA_PEER_ID_GET(msg_addr) \
  538. HTT_ISOC_T2H_ADDBA_FIELD_GET(PEER_ID, msg_addr)
  539. #define HTT_ISOC_T2H_ADDBA_START_SEQ_NUM_SET(msg_addr, value) \
  540. HTT_ISOC_T2H_ADDBA_FIELD_SET(START_SEQ_NUM, msg_addr, value)
  541. #define HTT_ISOC_T2H_ADDBA_START_SEQ_NUM_GET(msg_addr) \
  542. HTT_ISOC_T2H_ADDBA_FIELD_GET(START_SEQ_NUM, msg_addr)
  543. #define HTT_ISOC_T2H_ADDBA_STATUS_SET(msg_addr, value) \
  544. HTT_ISOC_T2H_ADDBA_FIELD_SET(STATUS, msg_addr, value)
  545. #define HTT_ISOC_T2H_ADDBA_STATUS_GET(msg_addr) \
  546. HTT_ISOC_T2H_ADDBA_FIELD_GET(STATUS, msg_addr)
  547. /*=== DELBA message ===*/
  548. /**
  549. * @brief target -> host DELBA message definition
  550. *
  551. * @details
  552. * The following diagram shows the format of the rx DELBA message sent
  553. * from the target to the host:
  554. *
  555. * |31 20|19 16|15 12|11 8|7 0|
  556. * |---------------------------------------------------------------------|
  557. * | peer ID | TID | reserved |S| msg type |
  558. * |---------------------------------------------------------------------|
  559. *
  560. * The following field definitions describe the format of the ADDBA
  561. * message sent from the target to the host.
  562. *
  563. * WORD 0:
  564. * - MSG_TYPE
  565. * Bits 7:0
  566. * Purpose: identifies this as an DELBA message
  567. * Value: 0x4
  568. * - TID
  569. * Bits 19:16
  570. * Purpose: Specifies which traffic identifier the DELBA is for.
  571. * Value:
  572. * TID specified by the received DELBA management message.
  573. * - PEER_ID
  574. * Bits 31:20
  575. * Purpose: Identifies which peer sent the DELBA.
  576. * Value:
  577. * ID (hash value) used by the host for fast, direct lookup of
  578. * host SW peer info, including rx reorder states.
  579. * - STATUS
  580. * Bit 8
  581. * Purpose: status of the WMI DELBA request
  582. * Value: 0 - SUCCESS, 1 - FAILURE
  583. */
  584. typedef struct htt_isoc_t2h_delba_s {
  585. /* word 0 */
  586. A_UINT32
  587. msg_type: 8, /* HTT_ISOC_T2H_MSG_TYPE_DELBA */
  588. status: 1,
  589. reserved0: 7,
  590. tid: 4,
  591. peer_id: 12;
  592. } htt_isoc_t2h_delba_t;
  593. /* word 0 */
  594. #define HTT_ISOC_T2H_DELBA_TID_OFFSET32 0
  595. #define HTT_ISOC_T2H_DELBA_TID_M 0x000f0000
  596. #define HTT_ISOC_T2H_DELBA_TID_S 16
  597. #define HTT_ISOC_T2H_DELBA_PEER_ID_OFFSET32 0
  598. #define HTT_ISOC_T2H_DELBA_PEER_ID_M 0xfff00000
  599. #define HTT_ISOC_T2H_DELBA_PEER_ID_S 20
  600. #define HTT_ISOC_T2H_DELBA_STATUS_OFFSET32 0
  601. #define HTT_ISOC_T2H_DELBA_STATUS_M 0x00000100
  602. #define HTT_ISOC_T2H_DELBA_STATUS_S 8
  603. /* general field access macros */
  604. #define HTT_ISOC_T2H_DELBA_FIELD_SET(field, msg_addr, value) \
  605. htt_isoc_t2h_field_set( \
  606. ((A_UINT32 *) msg_addr), \
  607. HTT_ISOC_T2H_DELBA_ ## field ## _OFFSET32, \
  608. HTT_ISOC_T2H_DELBA_ ## field ## _M, \
  609. HTT_ISOC_T2H_DELBA_ ## field ## _S, \
  610. value)
  611. #define HTT_ISOC_T2H_DELBA_FIELD_GET(field, msg_addr) \
  612. HTT_ISOC_T2H_FIELD_GET( \
  613. ((A_UINT32 *) msg_addr), \
  614. HTT_ISOC_T2H_DELBA_ ## field ## _OFFSET32, \
  615. HTT_ISOC_T2H_DELBA_ ## field ## _M, \
  616. HTT_ISOC_T2H_DELBA_ ## field ## _S)
  617. /* access macros for specific fields */
  618. A_COMPILE_TIME_ASSERT(HTT_ISOC_T2H_DELBA_TID_M_Size_Check,\
  619. (HTT_ISOC_T2H_DELBA_TID_M >> HTT_ISOC_T2H_DELBA_TID_S) \
  620. < ((A_UINT8)~((A_UINT8)0)));
  621. #define HTT_ISOC_T2H_DELBA_TID_SET(msg_addr, value) \
  622. HTT_ISOC_T2H_DELBA_FIELD_SET(TID, msg_addr, value)
  623. #define HTT_ISOC_T2H_DELBA_TID_GET(msg_addr) \
  624. (A_UINT8)HTT_ISOC_T2H_DELBA_FIELD_GET(TID, msg_addr)
  625. #define HTT_ISOC_T2H_DELBA_PEER_ID_SET(msg_addr, value) \
  626. HTT_ISOC_T2H_DELBA_FIELD_SET(PEER_ID, msg_addr, value)
  627. #define HTT_ISOC_T2H_DELBA_PEER_ID_GET(msg_addr) \
  628. HTT_ISOC_T2H_DELBA_FIELD_GET(PEER_ID, msg_addr)
  629. #define HTT_ISOC_T2H_DELBA_STATUS_SET(msg_addr, value) \
  630. HTT_ISOC_T2H_DELBA_FIELD_SET(STATUS, msg_addr, value)
  631. #define HTT_ISOC_T2H_DELBA_STATUS_GET(msg_addr) \
  632. HTT_ISOC_T2H_DELBA_FIELD_GET(STATUS, msg_addr)
  633. /*=== SEC_IND message ===*/
  634. /**
  635. * @brief target -> host Security indication message definition
  636. *
  637. * @details
  638. * The following diagram shows the format of the SEC_IND message sent
  639. * from the target to the host. This layout assumes the target operates
  640. * as little-endian.
  641. *
  642. * |31 25|24|23 18|17|16|15 11|10|9|8|7|6| 0|
  643. * |-----------------------------------------------------------------------|
  644. * | is unicast | sec type | Peer id | msg type |
  645. * |-----------------------------------------------------------------------|
  646. * | mic key1 |
  647. * |-----------------------------------------------------------------------|
  648. * | mic key2 |
  649. * |-----------------------------------------------------------------------|
  650. *
  651. *
  652. * The following field definitions describe the format of the peer info
  653. * message sent from the target to the host.
  654. *
  655. * WORD 0:
  656. * - MSG_TYPE
  657. * Bits 7:0
  658. * Purpose: identifies this as SEC_IND message
  659. * Value: 0x6
  660. * - PEER_ID
  661. * Bits 15:8
  662. * Purpose: The ID that the target has allocated to refer to the peer
  663. * Value: Peer ID
  664. * - SEC_TYPE
  665. * Bits 23:16
  666. * Purpose: specify the security encryption type
  667. * Value: htt_sec_type
  668. * - is unicast
  669. * Bits 31:24
  670. * Purpose: specify unicast/bcast
  671. * Value: 1-unicast/0-bcast
  672. * WORD 1:
  673. * - MIC1
  674. * Bits 31:0
  675. * Purpose: Mickey1
  676. * WORD 2:
  677. * - MIC2
  678. * Bits 31:0
  679. * Purpose: Mickey2
  680. */
  681. typedef struct htt_isoc_t2h_sec_ind_s {
  682. /* word 0 */
  683. A_UINT32
  684. msg_type: 8, /* HTT_ISOC_T2H_MSG_TYPE_SEC_IND */
  685. peer_id: 8,
  686. sec_type: 8,
  687. is_unicast: 8;
  688. /* word 1 */
  689. A_UINT32 mic_key1;
  690. /* word 2 */
  691. A_UINT32 mic_key2;
  692. /* word 3 */
  693. A_UINT32 status;
  694. } htt_isoc_t2h_sec_ind_t;
  695. /* word 0 */
  696. #define HTT_ISOC_T2H_SEC_IND_PEER_ID_OFFSET32 0
  697. #define HTT_ISOC_T2H_SEC_IND_PEER_ID_M 0x0000ff00
  698. #define HTT_ISOC_T2H_SEC_IND_PEER_ID_S 8
  699. #define HTT_ISOC_T2H_SEC_IND_SEC_TYPE_OFFSET32 0
  700. #define HTT_ISOC_T2H_SEC_IND_SEC_TYPE_M 0x00ff0000
  701. #define HTT_ISOC_T2H_SEC_IND_SEC_TYPE_S 16
  702. #define HTT_ISOC_T2H_SEC_IND_IS_UNICAST_OFFSET32 0
  703. #define HTT_ISOC_T2H_SEC_IND_IS_UNICAST_M 0xff000000
  704. #define HTT_ISOC_T2H_SEC_IND_IS_UNICAST_S 24
  705. /* word 1 */
  706. #define HTT_ISOC_T2H_SEC_IND_MIC1_OFFSET32 1
  707. #define HTT_ISOC_T2H_SEC_IND_MIC1_M 0xffffffff
  708. #define HTT_ISOC_T2H_SEC_IND_MIC1_S 0
  709. /* word 2 */
  710. #define HTT_ISOC_T2H_SEC_IND_MIC2_OFFSET32 2
  711. #define HTT_ISOC_T2H_SEC_IND_MIC2_M 0xffffffff
  712. #define HTT_ISOC_T2H_SEC_IND_MIC2_S 0
  713. /* general field access macros */
  714. #define HTT_ISOC_T2H_SEC_IND_FIELD_SET(field, msg_addr, value) \
  715. htt_isoc_t2h_field_set( \
  716. ((A_UINT32 *) msg_addr), \
  717. HTT_ISOC_T2H_SEC_IND_ ## field ## _OFFSET32, \
  718. HTT_ISOC_T2H_SEC_IND_ ## field ## _M, \
  719. HTT_ISOC_T2H_SEC_IND_ ## field ## _S, \
  720. value)
  721. #define HTT_ISOC_T2H_SEC_IND_FIELD_GET(field, msg_addr) \
  722. HTT_ISOC_T2H_FIELD_GET( \
  723. ((A_UINT32 *) msg_addr), \
  724. HTT_ISOC_T2H_SEC_IND_ ## field ## _OFFSET32, \
  725. HTT_ISOC_T2H_SEC_IND_ ## field ## _M, \
  726. HTT_ISOC_T2H_SEC_IND_ ## field ## _S)
  727. /* access macros for specific fields */
  728. #define HTT_ISOC_T2H_SEC_IND_PEER_ID_SET(msg_addr, value) \
  729. HTT_ISOC_T2H_SEC_IND_FIELD_SET(PEER_ID, msg_addr, value)
  730. #define HTT_ISOC_T2H_SEC_IND_PEER_ID_GET(msg_addr) \
  731. HTT_ISOC_T2H_SEC_IND_FIELD_GET(PEER_ID, msg_addr)
  732. #define HTT_ISOC_T2H_SEC_IND_SEC_TYPE_SET(msg_addr, value) \
  733. HTT_ISOC_T2H_SEC_IND_FIELD_SET(SEC_TYPE, msg_addr, value)
  734. #define HTT_ISOC_T2H_SEC_IND_SEC_TYPE_GET(msg_addr) \
  735. HTT_ISOC_T2H_SEC_IND_FIELD_GET(SEC_TYPE, msg_addr)
  736. #define HTT_ISOC_T2H_SEC_IND_IS_UNICAST_SET(msg_addr, value) \
  737. HTT_ISOC_T2H_SEC_IND_FIELD_SET(IS_UNICAST, msg_addr, value)
  738. #define HTT_ISOC_T2H_SEC_IND_IS_UNICAST_GET(msg_addr) \
  739. HTT_ISOC_T2H_SEC_IND_FIELD_GET(IS_UNICAST, msg_addr)
  740. #define HTT_ISOC_T2H_SEC_IND_MIC1_SET(msg_addr, value) \
  741. HTT_ISOC_T2H_SEC_IND_FIELD_SET(MIC1, msg_addr, value)
  742. #define HTT_ISOC_T2H_SEC_IND_MIC1_GET(msg_addr) \
  743. HTT_ISOC_T2H_SEC_IND_FIELD_GET(MIC1, msg_addr)
  744. #define HTT_ISOC_T2H_SEC_IND_MIC2_SET(msg_addr, value) \
  745. HTT_ISOC_T2H_SEC_IND_FIELD_SET(MIC2, msg_addr, value)
  746. #define HTT_ISOC_T2H_SEC_IND_MIC2_GET(msg_addr) \
  747. HTT_ISOC_T2H_SEC_IND_FIELD_GET(MIC2, msg_addr)
  748. /*=== PEER_TX_READY message ===*/
  749. /**
  750. * @brief target -> host peer tx ready message definition
  751. *
  752. * @details
  753. * The following diagram shows the format of the peer tx ready message sent
  754. * from the target to the host. This layout assumes the target operates
  755. * as little-endian.
  756. *
  757. * |31 19|18 8|7 0|
  758. * |-----------------------------------------------------------------------|
  759. * | reserved | peer ID | msg type |
  760. * |-----------------------------------------------------------------------|
  761. *
  762. *
  763. * The following field definitions describe the format of the peer info
  764. * message sent from the target to the host.
  765. *
  766. * WORD 0:
  767. * - MSG_TYPE
  768. * Bits 7:0
  769. * Purpose: identifies this as peer tx ready message
  770. * Value: 0x7
  771. * - PEER_ID
  772. * Bits 18:8
  773. * Purpose: The ID assigned to the peer by the PEER_INFO message
  774. */
  775. typedef struct htt_isoc_t2h_peer_tx_ready_s {
  776. /* word 0 */
  777. A_UINT32
  778. msg_type: 8, /* HTT_ISOC_T2H_MSG_TYPE_PEER_TX_READY */
  779. peer_id: 11,
  780. reserved0: 13;
  781. } htt_isoc_t2h_peer_tx_ready_t;
  782. /* word 0 */
  783. #define HTT_ISOC_T2H_PEER_TX_READY_PEER_ID_OFFSET32 0
  784. #define HTT_ISOC_T2H_PEER_TX_READY_PEER_ID_M 0x0007ff00
  785. #define HTT_ISOC_T2H_PEER_TX_READY_PEER_ID_S 8
  786. /* general field access macros */
  787. #define HTT_ISOC_T2H_PEER_TX_READY_FIELD_SET(field, msg_addr, value) \
  788. htt_isoc_t2h_field_set( \
  789. ((A_UINT32 *) msg_addr), \
  790. HTT_ISOC_T2H_PEER_TX_READY_ ## field ## _OFFSET32, \
  791. HTT_ISOC_T2H_PEER_TX_READY_ ## field ## _M, \
  792. HTT_ISOC_T2H_PEER_TX_READY_ ## field ## _S, \
  793. value)
  794. #define HTT_ISOC_T2H_PEER_TX_READY_FIELD_GET(field, msg_addr) \
  795. HTT_ISOC_T2H_FIELD_GET( \
  796. ((A_UINT32 *) msg_addr), \
  797. HTT_ISOC_T2H_PEER_TX_READY_ ## field ## _OFFSET32, \
  798. HTT_ISOC_T2H_PEER_TX_READY_ ## field ## _M, \
  799. HTT_ISOC_T2H_PEER_TX_READY_ ## field ## _S)
  800. /* access macros for specific fields */
  801. A_COMPILE_TIME_ASSERT(HTT_ISOC_T2H_PEER_TX_READY_PEER_ID_M_Size_Check, (HTT_ISOC_T2H_PEER_TX_READY_PEER_ID_M >> HTT_ISOC_T2H_PEER_TX_READY_PEER_ID_S) < ((A_UINT16)~((A_UINT16)0)));
  802. #define HTT_ISOC_T2H_PEER_TX_READY_PEER_ID_SET(msg_addr, value) \
  803. HTT_ISOC_T2H_PEER_TX_READY_FIELD_SET(PEER_ID, msg_addr, value)
  804. #define HTT_ISOC_T2H_PEER_TX_READY_PEER_ID_GET(msg_addr) \
  805. ((A_UINT16)(HTT_ISOC_T2H_PEER_TX_READY_FIELD_GET(PEER_ID, msg_addr)))
  806. /*=== RX_ERR message ===*/
  807. /**
  808. * @brief target -> host rx error notification message definition
  809. *
  810. * @details
  811. * The following diagram shows the format of the rx err message sent
  812. * from the target to the host. This layout assumes the target operates
  813. * as little-endian.
  814. *
  815. * |31 16|15 8|7|6|5|4 0|
  816. * |---------------------------------------------------------------------|
  817. * | peer ID | rx err type | msg type |
  818. * |---------------------------------------------------------------------|
  819. * | reserved | rx err count |M| r | ext TID |
  820. * |---------------------------------------------------------------------|
  821. * M = multicast
  822. * r = reserved
  823. *
  824. * The following field definitions describe the format of the peer info
  825. * message sent from the target to the host.
  826. *
  827. * WORD 0:
  828. * - MSG_TYPE
  829. * Bits 7:0
  830. * Purpose: identifies this as an rx err message
  831. * Value: 0x8
  832. * - RX_ERR_TYPE
  833. * Bits 15:8
  834. * Purpose: specifies which type of rx error is being reported
  835. * Value: htt_rx_ind_mpdu_status enum
  836. * - PEER_ID
  837. * Bits 31:16
  838. * Purpose: specify which peer sent the frame that resulted in an error
  839. * WORD 1:
  840. * - EXT_TID
  841. * Bits 4:0
  842. * Purpose: specifies which traffic type had the rx error
  843. * Value: 0-15 for a real TID value, 16 for non-QoS data, 31 for unknown
  844. * - MCAST
  845. * Bit 6
  846. * Purpose: specify whether the rx error frame was unicast or multicast
  847. * Value: 0 -> unicast, 1 -> multicast
  848. * - L2_HDR_IS_80211
  849. * Bit 7
  850. * Purpose: specifies whether the included L2 header (if present) is in
  851. * 802.3 or 802.11 format
  852. * Value: 0 -> 802.3, 1 -> 802.11
  853. * - L2_HDR_BYTES
  854. * Bits 15:8
  855. * Purpose: Specify the size of the L2 header in this rx error report.
  856. * Value:
  857. * If no L2 header is included, this field shall be 0.
  858. * If a 802.3 + LLC/SNAP header is included, this field shall be
  859. * 14 (ethernet header) + 8 (LLC/SNAP).
  860. * If a 802.11 header is included, this field shall be 24 bytes for
  861. * a basic header, or 26 bytes if a QoS control field is included,
  862. * or 30 bytes if a 4th address is included, or 32 bytes if a 4th
  863. * address and a QoS control field are included, etc.
  864. * Though the L2 header included in the message needs to include
  865. * padding up to a 4-byte boundary, this L2 header size field need
  866. * not account for the padding following the L2 header.
  867. * - SEC_HDR_BYTES
  868. * Bits 23:16
  869. * Purpose: Specify the size of the security encapsulation header in
  870. * this rx error report.
  871. * Value:
  872. * If no security header is included, this field shall be 0.
  873. * If a security header is included, this field depends on the
  874. * security type, which can be inferred from the rx error type.
  875. * For TKIP MIC errors, the security header could be any of:
  876. * 8 - if IV / KeyID and Extended IV are included
  877. * 16 - if MIC is also included
  878. * 20 - if ICV is also included
  879. * - RX_ERR_CNT
  880. * Bits 31:24
  881. * Purpose: specifies how many rx errors are reported in this message
  882. * Value:
  883. * Rx error reports that include a L2 header and/or security header
  884. * will set this field to 1, to indicate that the error notification
  885. * is for a single frame.
  886. * Rx error reports that don't include a L2 header or security header
  887. * can use this field to send a single message to report multiple
  888. * erroneous rx frames.
  889. */
  890. typedef struct htt_isoc_t2h_rx_err_s {
  891. /* word 0 */
  892. A_UINT32
  893. msg_type: 8, /* HTT_ISOC_T2H_MSG_TYPE_RX_ERR */
  894. rx_err_type: 8,
  895. peer_id: 16;
  896. /* word 1 */
  897. A_UINT32
  898. ext_tid: 5,
  899. reserved1: 1,
  900. mcast: 1,
  901. l2_hdr_is_80211: 1,
  902. l2_hdr_bytes: 8,
  903. sec_hdr_bytes: 8,
  904. rx_err_cnt: 8;
  905. /* words 2 - M-1: L2 header */
  906. /* words M - N: security header */
  907. } htt_isoc_t2h_rx_err_t;
  908. /* This needs to be exact bytes for structure htt_isoc_t2h_rx_err_t
  909. * * Since it is shared between host and FW, sizeof may not be used.
  910. * * */
  911. #define HTT_ISOC_T2H_RX_ERR_BASE_BYTES 20
  912. /* word 0 */
  913. #define HTT_ISOC_T2H_RX_ERR_TYPE_OFFSET32 0
  914. #define HTT_ISOC_T2H_RX_ERR_TYPE_M 0x0000ff00
  915. #define HTT_ISOC_T2H_RX_ERR_TYPE_S 8
  916. #define HTT_ISOC_T2H_RX_ERR_PEER_ID_OFFSET32 0
  917. #define HTT_ISOC_T2H_RX_ERR_PEER_ID_M 0xffff0000
  918. #define HTT_ISOC_T2H_RX_ERR_PEER_ID_S 16
  919. /* word 1 */
  920. #define HTT_ISOC_T2H_RX_ERR_EXT_TID_OFFSET32 1
  921. #define HTT_ISOC_T2H_RX_ERR_EXT_TID_M 0x0000001f
  922. #define HTT_ISOC_T2H_RX_ERR_EXT_TID_S 0
  923. #define HTT_ISOC_T2H_RX_ERR_MCAST_OFFSET32 1
  924. #define HTT_ISOC_T2H_RX_ERR_MCAST_M 0x00000040
  925. #define HTT_ISOC_T2H_RX_ERR_MCAST_S 6
  926. #define HTT_ISOC_T2H_RX_ERR_L2_HDR_IS_80211_OFFSET32 1
  927. #define HTT_ISOC_T2H_RX_ERR_L2_HDR_IS_80211_M 0x00000080
  928. #define HTT_ISOC_T2H_RX_ERR_L2_HDR_IS_80211_S 7
  929. #define HTT_ISOC_T2H_RX_ERR_L2_HDR_BYTES_OFFSET32 1
  930. #define HTT_ISOC_T2H_RX_ERR_L2_HDR_BYTES_M 0x0000ff00
  931. #define HTT_ISOC_T2H_RX_ERR_L2_HDR_BYTES_S 8
  932. #define HTT_ISOC_T2H_RX_ERR_SEC_HDR_BYTES_OFFSET32 1
  933. #define HTT_ISOC_T2H_RX_ERR_SEC_HDR_BYTES_M 0x00ff0000
  934. #define HTT_ISOC_T2H_RX_ERR_SEC_HDR_BYTES_S 16
  935. #define HTT_ISOC_T2H_RX_ERR_CNT_OFFSET32 1
  936. #define HTT_ISOC_T2H_RX_ERR_CNT_M 0xff000000
  937. #define HTT_ISOC_T2H_RX_ERR_CNT_S 24
  938. /* general field access macros */
  939. #define HTT_ISOC_T2H_RX_ERR_FIELD_SET(field, msg_addr, value) \
  940. htt_isoc_t2h_field_set( \
  941. ((A_UINT32 *) msg_addr), \
  942. HTT_ISOC_T2H_RX_ERR_ ## field ## _OFFSET32, \
  943. HTT_ISOC_T2H_RX_ERR_ ## field ## _M, \
  944. HTT_ISOC_T2H_RX_ERR_ ## field ## _S, \
  945. value)
  946. #define HTT_ISOC_T2H_RX_ERR_FIELD_GET(field, msg_addr) \
  947. HTT_ISOC_T2H_FIELD_GET( \
  948. ((A_UINT32 *) msg_addr), \
  949. HTT_ISOC_T2H_RX_ERR_ ## field ## _OFFSET32, \
  950. HTT_ISOC_T2H_RX_ERR_ ## field ## _M, \
  951. HTT_ISOC_T2H_RX_ERR_ ## field ## _S)
  952. /* access macros for specific fields */
  953. #define HTT_ISOC_T2H_RX_ERR_TYPE_SET(msg_addr, value) \
  954. HTT_ISOC_T2H_RX_ERR_FIELD_SET(TYPE, msg_addr, value)
  955. #define HTT_ISOC_T2H_RX_ERR_TYPE_GET(msg_addr) \
  956. HTT_ISOC_T2H_RX_ERR_FIELD_GET(TYPE, msg_addr)
  957. A_COMPILE_TIME_ASSERT(HTT_ISOC_T2H_RX_ERR_PEER_ID_M_Size_Check, (HTT_ISOC_T2H_RX_ERR_PEER_ID_M >> HTT_ISOC_T2H_RX_ERR_PEER_ID_S) <= ((A_UINT16)~((A_UINT16)0)));
  958. #define HTT_ISOC_T2H_RX_ERR_PEER_ID_SET(msg_addr, value) \
  959. HTT_ISOC_T2H_RX_ERR_FIELD_SET(PEER_ID, msg_addr, value)
  960. #define HTT_ISOC_T2H_RX_ERR_PEER_ID_GET(msg_addr) \
  961. ((A_UINT16)HTT_ISOC_T2H_RX_ERR_FIELD_GET(PEER_ID, msg_addr))
  962. #define HTT_ISOC_T2H_RX_ERR_EXT_TID_SET(msg_addr, value) \
  963. HTT_ISOC_T2H_RX_ERR_FIELD_SET(EXT_TID, msg_addr, value)
  964. #define HTT_ISOC_T2H_RX_ERR_EXT_TID_GET(msg_addr) \
  965. HTT_ISOC_T2H_RX_ERR_FIELD_GET(EXT_TID, msg_addr)
  966. #define HTT_ISOC_T2H_RX_ERR_MCAST_SET(msg_addr, value) \
  967. HTT_ISOC_T2H_RX_ERR_FIELD_SET(MCAST, msg_addr, value)
  968. #define HTT_ISOC_T2H_RX_ERR_MCAST_GET(msg_addr) \
  969. HTT_ISOC_T2H_RX_ERR_FIELD_GET(MCAST, msg_addr)
  970. #define HTT_ISOC_T2H_RX_ERR_L2_HDR_IS_80211_SET(msg_addr, value) \
  971. HTT_ISOC_T2H_RX_ERR_FIELD_SET(L2_HDR_IS_80211, msg_addr, value)
  972. #define HTT_ISOC_T2H_RX_ERR_L2_HDR_IS_80211_GET(msg_addr) \
  973. HTT_ISOC_T2H_RX_ERR_FIELD_GET(L2_HDR_IS_80211, msg_addr)
  974. #define HTT_ISOC_T2H_RX_ERR_L2_HDR_BYTES_SET(msg_addr, value) \
  975. HTT_ISOC_T2H_RX_ERR_FIELD_SET(L2_HDR_BYTES, msg_addr, value)
  976. #define HTT_ISOC_T2H_RX_ERR_L2_HDR_BYTES_GET(msg_addr) \
  977. HTT_ISOC_T2H_RX_ERR_FIELD_GET(L2_HDR_BYTES, msg_addr)
  978. #define HTT_ISOC_T2H_RX_ERR_SEC_HDR_BYTES_SET(msg_addr, value) \
  979. HTT_ISOC_T2H_RX_ERR_FIELD_SET(SEC_HDR_BYTES, msg_addr, value)
  980. #define HTT_ISOC_T2H_RX_ERR_SEC_HDR_BYTES_GET(msg_addr) \
  981. HTT_ISOC_T2H_RX_ERR_FIELD_GET(SEC_HDR_BYTES, msg_addr)
  982. #define HTT_ISOC_T2H_RX_ERR_CNT_SET(msg_addr, value) \
  983. HTT_ISOC_T2H_RX_ERR_FIELD_SET(CNT, msg_addr, value)
  984. #define HTT_ISOC_T2H_RX_ERR_CNT_GET(msg_addr) \
  985. HTT_ISOC_T2H_RX_ERR_FIELD_GET(CNT, msg_addr)
  986. /*=== TX OTA complete indication message ===*/
  987. /**
  988. * @brief target -> tx complete indicate message
  989. *
  990. * @details
  991. * The following diagram shows the format of the tx complete indication message sent
  992. * from the target to the host. This layout assumes the target operates
  993. * as little-endian.
  994. *
  995. * |31 19|18 8|7 0|
  996. * |-----------------------------------------------------------------------|
  997. * | reserved | status | msg type |
  998. * |-----------------------------------------------------------------------|
  999. *
  1000. *
  1001. * The following field definitions describe the format of the peer info
  1002. * message sent from the target to the host.
  1003. *
  1004. * WORD 0:
  1005. * - MSG_TYPE
  1006. * Bits 7:0
  1007. * Purpose: identifies this as tx complete indication message
  1008. * Value: 0x7
  1009. * - status
  1010. * Bits 18:8
  1011. * Purpose: TX completion status
  1012. */
  1013. typedef struct htt_isoc_t2h_tx_compl_s {
  1014. /* word 0 */
  1015. A_UINT32
  1016. msg_type: 8, /* HTT_ISOC_T2H_MSG_TYPE_TX_COMPL_IND */
  1017. status: 11,
  1018. reserved0: 13;
  1019. } htt_isoc_t2h_tx_compl_t;
  1020. /* word 0 */
  1021. #define HTT_ISOC_T2H_TX_COMPL_IND_STATUS_OFFSET32 0
  1022. #define HTT_ISOC_T2H_TX_COMPL_IND_STATUS_M 0x0007ff00
  1023. #define HTT_ISOC_T2H_TX_COMPL_IND_STATUS_S 8
  1024. /* general field access macros */
  1025. #define HTT_ISOC_T2H_TX_COMPL_IND_FIELD_SET(field, msg_addr, value) \
  1026. htt_isoc_t2h_field_set( \
  1027. ((A_UINT32 *) msg_addr), \
  1028. HTT_ISOC_T2H_TX_COMPL_IND_ ## field ## _OFFSET32, \
  1029. HTT_ISOC_T2H_TX_COMPL_IND_ ## field ## _M, \
  1030. HTT_ISOC_T2H_TX_COMPL_IND_ ## field ## _S, \
  1031. value)
  1032. #define HTT_ISOC_T2H_TX_COMPL_IND_FIELD_GET(field, msg_addr) \
  1033. HTT_ISOC_T2H_FIELD_GET( \
  1034. ((A_UINT32 *) msg_addr), \
  1035. HTT_ISOC_T2H_TX_COMPL_IND_ ## field ## _OFFSET32, \
  1036. HTT_ISOC_T2H_TX_COMPL_IND_ ## field ## _M, \
  1037. HTT_ISOC_T2H_TX_COMPL_IND_ ## field ## _S)
  1038. /* access macros for specific fields */
  1039. #define HTT_ISOC_T2H_TX_COMPL_IND_STATUS_SET(msg_addr, value) \
  1040. HTT_ISOC_T2H_TX_COMPL_IND_FIELD_SET(STATUS, msg_addr, value)
  1041. #define HTT_ISOC_T2H_TX_COMPL_IND_STATUS_GET(msg_addr) \
  1042. HTT_ISOC_T2H_TX_COMPL_IND_FIELD_GET(STATUS, msg_addr)
  1043. #define HTT_TX_COMPL_IND_STAT_OK 0
  1044. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  1045. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  1046. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  1047. /*=== NLO indication message ===*/
  1048. /**
  1049. * @brief target -> NLO indicate message
  1050. *
  1051. * @details
  1052. * The following diagram shows the format of the NLO indication message sent
  1053. * from the target to the host. This layout assumes the target operates
  1054. * as little-endian.
  1055. *
  1056. * |31 8|7 0|
  1057. * |-----------------------------------------------------------------------|
  1058. * | reserved | msg type |
  1059. * |-----------------------------------------------------------------------|
  1060. *
  1061. *
  1062. * The following field definitions describe the format of NLO MATCH indication
  1063. * message sent from the target to the host.
  1064. *
  1065. * WORD 0:
  1066. * - MSG_TYPE
  1067. * Bits 7:0
  1068. * Purpose: identifies this as NLO indication message
  1069. * Value: 0x9 - HTT_ISOC_T2H_MSG_TYPE_NLO_MATCH
  1070. * Value: 0xA - HTT_ISOC_T2H_MSG_TYPE_NLO_SCAN_END
  1071. */
  1072. typedef struct htt_isoc_t2h_nlo_ind_s {
  1073. /* word 0 */
  1074. A_UINT32
  1075. msg_type: 8,
  1076. vdev_id: 8,
  1077. reserved0: 16;
  1078. } htt_isoc_t2h_nlo_ind_t;
  1079. /* word 0 */
  1080. #define HTT_ISOC_T2H_NLO_IND_VDEVID_OFFSET32 0
  1081. #define HTT_ISOC_T2H_NLO_IND_VDEVID_M 0x0000ff00
  1082. #define HTT_ISOC_T2H_NLO_IND_VDEVID_S 8
  1083. /* general field access macros */
  1084. #define HTT_ISOC_T2H_NLO_IND_FIELD_SET(field, msg_addr, value) \
  1085. htt_isoc_t2h_field_set( \
  1086. ((A_UINT32 *) msg_addr), \
  1087. HTT_ISOC_T2H_NLO_IND_ ## field ## _OFFSET32, \
  1088. HTT_ISOC_T2H_NLO_IND_ ## field ## _M, \
  1089. HTT_ISOC_T2H_NLO_IND_ ## field ## _S, \
  1090. value)
  1091. #define HTT_ISOC_T2H_NLO_IND_FIELD_GET(field, msg_addr) \
  1092. HTT_ISOC_T2H_FIELD_GET( \
  1093. ((A_UINT32 *) msg_addr), \
  1094. HTT_ISOC_T2H_NLO_IND_ ## field ## _OFFSET32, \
  1095. HTT_ISOC_T2H_NLO_IND_ ## field ## _M, \
  1096. HTT_ISOC_T2H_NLO_IND_ ## field ## _S)
  1097. /* access macros for specific fields */
  1098. #define HTT_ISOC_T2H_NLO_IND_VDEVID_SET(msg_addr, value) \
  1099. HTT_ISOC_T2H_NLO_IND_FIELD_SET(VDEVID, msg_addr, value)
  1100. #define HTT_ISOC_T2H_NLO_IND_VDEVID_GET(msg_addr) \
  1101. HTT_ISOC_T2H_NLO_IND_FIELD_GET(VDEVID, msg_addr)
  1102. #endif /* _HTT_ISOC_H_ */