htt_isoc.h 39 KB

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