htt_isoc.h 48 KB

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