rx_desc.h 40 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226
  1. /*
  2. * Copyright (c) 2005-2011 Atheros Communications Inc.
  3. * Copyright (c) 2011-2013 Qualcomm Atheros, Inc.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for any
  6. * purpose with or without fee is hereby granted, provided that the above
  7. * copyright notice and this permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  10. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  12. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  13. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  14. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  15. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  16. */
  17. #ifndef _RX_DESC_H_
  18. #define _RX_DESC_H_
  19. enum rx_attention_flags {
  20. RX_ATTENTION_FLAGS_FIRST_MPDU = 1 << 0,
  21. RX_ATTENTION_FLAGS_LAST_MPDU = 1 << 1,
  22. RX_ATTENTION_FLAGS_MCAST_BCAST = 1 << 2,
  23. RX_ATTENTION_FLAGS_PEER_IDX_INVALID = 1 << 3,
  24. RX_ATTENTION_FLAGS_PEER_IDX_TIMEOUT = 1 << 4,
  25. RX_ATTENTION_FLAGS_POWER_MGMT = 1 << 5,
  26. RX_ATTENTION_FLAGS_NON_QOS = 1 << 6,
  27. RX_ATTENTION_FLAGS_NULL_DATA = 1 << 7,
  28. RX_ATTENTION_FLAGS_MGMT_TYPE = 1 << 8,
  29. RX_ATTENTION_FLAGS_CTRL_TYPE = 1 << 9,
  30. RX_ATTENTION_FLAGS_MORE_DATA = 1 << 10,
  31. RX_ATTENTION_FLAGS_EOSP = 1 << 11,
  32. RX_ATTENTION_FLAGS_U_APSD_TRIGGER = 1 << 12,
  33. RX_ATTENTION_FLAGS_FRAGMENT = 1 << 13,
  34. RX_ATTENTION_FLAGS_ORDER = 1 << 14,
  35. RX_ATTENTION_FLAGS_CLASSIFICATION = 1 << 15,
  36. RX_ATTENTION_FLAGS_OVERFLOW_ERR = 1 << 16,
  37. RX_ATTENTION_FLAGS_MSDU_LENGTH_ERR = 1 << 17,
  38. RX_ATTENTION_FLAGS_TCP_UDP_CHKSUM_FAIL = 1 << 18,
  39. RX_ATTENTION_FLAGS_IP_CHKSUM_FAIL = 1 << 19,
  40. RX_ATTENTION_FLAGS_SA_IDX_INVALID = 1 << 20,
  41. RX_ATTENTION_FLAGS_DA_IDX_INVALID = 1 << 21,
  42. RX_ATTENTION_FLAGS_SA_IDX_TIMEOUT = 1 << 22,
  43. RX_ATTENTION_FLAGS_DA_IDX_TIMEOUT = 1 << 23,
  44. RX_ATTENTION_FLAGS_ENCRYPT_REQUIRED = 1 << 24,
  45. RX_ATTENTION_FLAGS_DIRECTED = 1 << 25,
  46. RX_ATTENTION_FLAGS_BUFFER_FRAGMENT = 1 << 26,
  47. RX_ATTENTION_FLAGS_MPDU_LENGTH_ERR = 1 << 27,
  48. RX_ATTENTION_FLAGS_TKIP_MIC_ERR = 1 << 28,
  49. RX_ATTENTION_FLAGS_DECRYPT_ERR = 1 << 29,
  50. RX_ATTENTION_FLAGS_FCS_ERR = 1 << 30,
  51. RX_ATTENTION_FLAGS_MSDU_DONE = 1 << 31,
  52. };
  53. struct rx_attention {
  54. __le32 flags; /* %RX_ATTENTION_FLAGS_ */
  55. } __packed;
  56. /*
  57. * first_mpdu
  58. * Indicates the first MSDU of the PPDU. If both first_mpdu
  59. * and last_mpdu are set in the MSDU then this is a not an
  60. * A-MPDU frame but a stand alone MPDU. Interior MPDU in an
  61. * A-MPDU shall have both first_mpdu and last_mpdu bits set to
  62. * 0. The PPDU start status will only be valid when this bit
  63. * is set.
  64. *
  65. * last_mpdu
  66. * Indicates the last MSDU of the last MPDU of the PPDU. The
  67. * PPDU end status will only be valid when this bit is set.
  68. *
  69. * mcast_bcast
  70. * Multicast / broadcast indicator. Only set when the MAC
  71. * address 1 bit 0 is set indicating mcast/bcast and the BSSID
  72. * matches one of the 4 BSSID registers. Only set when
  73. * first_msdu is set.
  74. *
  75. * peer_idx_invalid
  76. * Indicates no matching entries within the the max search
  77. * count. Only set when first_msdu is set.
  78. *
  79. * peer_idx_timeout
  80. * Indicates an unsuccessful search for the peer index due to
  81. * timeout. Only set when first_msdu is set.
  82. *
  83. * power_mgmt
  84. * Power management bit set in the 802.11 header. Only set
  85. * when first_msdu is set.
  86. *
  87. * non_qos
  88. * Set if packet is not a non-QoS data frame. Only set when
  89. * first_msdu is set.
  90. *
  91. * null_data
  92. * Set if frame type indicates either null data or QoS null
  93. * data format. Only set when first_msdu is set.
  94. *
  95. * mgmt_type
  96. * Set if packet is a management packet. Only set when
  97. * first_msdu is set.
  98. *
  99. * ctrl_type
  100. * Set if packet is a control packet. Only set when first_msdu
  101. * is set.
  102. *
  103. * more_data
  104. * Set if more bit in frame control is set. Only set when
  105. * first_msdu is set.
  106. *
  107. * eosp
  108. * Set if the EOSP (end of service period) bit in the QoS
  109. * control field is set. Only set when first_msdu is set.
  110. *
  111. * u_apsd_trigger
  112. * Set if packet is U-APSD trigger. Key table will have bits
  113. * per TID to indicate U-APSD trigger.
  114. *
  115. * fragment
  116. * Indicates that this is an 802.11 fragment frame. This is
  117. * set when either the more_frag bit is set in the frame
  118. * control or the fragment number is not zero. Only set when
  119. * first_msdu is set.
  120. *
  121. * order
  122. * Set if the order bit in the frame control is set. Only set
  123. * when first_msdu is set.
  124. *
  125. * classification
  126. * Indicates that this status has a corresponding MSDU that
  127. * requires FW processing. The OLE will have classification
  128. * ring mask registers which will indicate the ring(s) for
  129. * packets and descriptors which need FW attention.
  130. *
  131. * overflow_err
  132. * PCU Receive FIFO does not have enough space to store the
  133. * full receive packet. Enough space is reserved in the
  134. * receive FIFO for the status is written. This MPDU remaining
  135. * packets in the PPDU will be filtered and no Ack response
  136. * will be transmitted.
  137. *
  138. * msdu_length_err
  139. * Indicates that the MSDU length from the 802.3 encapsulated
  140. * length field extends beyond the MPDU boundary.
  141. *
  142. * tcp_udp_chksum_fail
  143. * Indicates that the computed checksum (tcp_udp_chksum) did
  144. * not match the checksum in the TCP/UDP header.
  145. *
  146. * ip_chksum_fail
  147. * Indicates that the computed checksum did not match the
  148. * checksum in the IP header.
  149. *
  150. * sa_idx_invalid
  151. * Indicates no matching entry was found in the address search
  152. * table for the source MAC address.
  153. *
  154. * da_idx_invalid
  155. * Indicates no matching entry was found in the address search
  156. * table for the destination MAC address.
  157. *
  158. * sa_idx_timeout
  159. * Indicates an unsuccessful search for the source MAC address
  160. * due to the expiring of the search timer.
  161. *
  162. * da_idx_timeout
  163. * Indicates an unsuccessful search for the destination MAC
  164. * address due to the expiring of the search timer.
  165. *
  166. * encrypt_required
  167. * Indicates that this data type frame is not encrypted even if
  168. * the policy for this MPDU requires encryption as indicated in
  169. * the peer table key type.
  170. *
  171. * directed
  172. * MPDU is a directed packet which means that the RA matched
  173. * our STA addresses. In proxySTA it means that the TA matched
  174. * an entry in our address search table with the corresponding
  175. * 'no_ack' bit is the address search entry cleared.
  176. *
  177. * buffer_fragment
  178. * Indicates that at least one of the rx buffers has been
  179. * fragmented. If set the FW should look at the rx_frag_info
  180. * descriptor described below.
  181. *
  182. * mpdu_length_err
  183. * Indicates that the MPDU was pre-maturely terminated
  184. * resulting in a truncated MPDU. Don't trust the MPDU length
  185. * field.
  186. *
  187. * tkip_mic_err
  188. * Indicates that the MPDU Michael integrity check failed
  189. *
  190. * decrypt_err
  191. * Indicates that the MPDU decrypt integrity check failed
  192. *
  193. * fcs_err
  194. * Indicates that the MPDU FCS check failed
  195. *
  196. * msdu_done
  197. * If set indicates that the RX packet data, RX header data, RX
  198. * PPDU start descriptor, RX MPDU start/end descriptor, RX MSDU
  199. * start/end descriptors and RX Attention descriptor are all
  200. * valid. This bit must be in the last octet of the
  201. * descriptor.
  202. */
  203. struct rx_frag_info {
  204. u8 ring0_more_count;
  205. u8 ring1_more_count;
  206. u8 ring2_more_count;
  207. u8 ring3_more_count;
  208. } __packed;
  209. /*
  210. * ring0_more_count
  211. * Indicates the number of more buffers associated with RX DMA
  212. * ring 0. Field is filled in by the RX_DMA.
  213. *
  214. * ring1_more_count
  215. * Indicates the number of more buffers associated with RX DMA
  216. * ring 1. Field is filled in by the RX_DMA.
  217. *
  218. * ring2_more_count
  219. * Indicates the number of more buffers associated with RX DMA
  220. * ring 2. Field is filled in by the RX_DMA.
  221. *
  222. * ring3_more_count
  223. * Indicates the number of more buffers associated with RX DMA
  224. * ring 3. Field is filled in by the RX_DMA.
  225. */
  226. enum htt_rx_mpdu_encrypt_type {
  227. HTT_RX_MPDU_ENCRYPT_WEP40 = 0,
  228. HTT_RX_MPDU_ENCRYPT_WEP104 = 1,
  229. HTT_RX_MPDU_ENCRYPT_TKIP_WITHOUT_MIC = 2,
  230. HTT_RX_MPDU_ENCRYPT_WEP128 = 3,
  231. HTT_RX_MPDU_ENCRYPT_TKIP_WPA = 4,
  232. HTT_RX_MPDU_ENCRYPT_WAPI = 5,
  233. HTT_RX_MPDU_ENCRYPT_AES_CCM_WPA2 = 6,
  234. HTT_RX_MPDU_ENCRYPT_NONE = 7,
  235. HTT_RX_MPDU_ENCRYPT_AES_CCM256_WPA2 = 8,
  236. HTT_RX_MPDU_ENCRYPT_AES_GCMP_WPA2 = 9,
  237. HTT_RX_MPDU_ENCRYPT_AES_GCMP256_WPA2 = 10,
  238. };
  239. #define RX_MPDU_START_INFO0_PEER_IDX_MASK 0x000007ff
  240. #define RX_MPDU_START_INFO0_PEER_IDX_LSB 0
  241. #define RX_MPDU_START_INFO0_SEQ_NUM_MASK 0x0fff0000
  242. #define RX_MPDU_START_INFO0_SEQ_NUM_LSB 16
  243. #define RX_MPDU_START_INFO0_ENCRYPT_TYPE_MASK 0xf0000000
  244. #define RX_MPDU_START_INFO0_ENCRYPT_TYPE_LSB 28
  245. #define RX_MPDU_START_INFO0_FROM_DS (1 << 11)
  246. #define RX_MPDU_START_INFO0_TO_DS (1 << 12)
  247. #define RX_MPDU_START_INFO0_ENCRYPTED (1 << 13)
  248. #define RX_MPDU_START_INFO0_RETRY (1 << 14)
  249. #define RX_MPDU_START_INFO0_TXBF_H_INFO (1 << 15)
  250. #define RX_MPDU_START_INFO1_TID_MASK 0xf0000000
  251. #define RX_MPDU_START_INFO1_TID_LSB 28
  252. #define RX_MPDU_START_INFO1_DIRECTED (1 << 16)
  253. struct rx_mpdu_start {
  254. __le32 info0;
  255. union {
  256. struct {
  257. __le32 pn31_0;
  258. __le32 info1; /* %RX_MPDU_START_INFO1_ */
  259. } __packed;
  260. struct {
  261. u8 pn[6];
  262. } __packed;
  263. } __packed;
  264. } __packed;
  265. /*
  266. * peer_idx
  267. * The index of the address search table which associated with
  268. * the peer table entry corresponding to this MPDU. Only valid
  269. * when first_msdu is set.
  270. *
  271. * fr_ds
  272. * Set if the from DS bit is set in the frame control. Only
  273. * valid when first_msdu is set.
  274. *
  275. * to_ds
  276. * Set if the to DS bit is set in the frame control. Only
  277. * valid when first_msdu is set.
  278. *
  279. * encrypted
  280. * Protected bit from the frame control. Only valid when
  281. * first_msdu is set.
  282. *
  283. * retry
  284. * Retry bit from the frame control. Only valid when
  285. * first_msdu is set.
  286. *
  287. * txbf_h_info
  288. * The MPDU data will contain H information. Primarily used
  289. * for debug.
  290. *
  291. * seq_num
  292. * The sequence number from the 802.11 header. Only valid when
  293. * first_msdu is set.
  294. *
  295. * encrypt_type
  296. * Indicates type of decrypt cipher used (as defined in the
  297. * peer table)
  298. * 0: WEP40
  299. * 1: WEP104
  300. * 2: TKIP without MIC
  301. * 3: WEP128
  302. * 4: TKIP (WPA)
  303. * 5: WAPI
  304. * 6: AES-CCM (WPA2)
  305. * 7: No cipher
  306. * Only valid when first_msdu_is set
  307. *
  308. * pn_31_0
  309. * Bits [31:0] of the PN number extracted from the IV field
  310. * WEP: IV = {key_id_octet, pn2, pn1, pn0}. Only pn[23:0] is
  311. * valid.
  312. * TKIP: IV = {pn5, pn4, pn3, pn2, key_id_octet, pn0,
  313. * WEPSeed[1], pn1}. Only pn[47:0] is valid.
  314. * AES-CCM: IV = {pn5, pn4, pn3, pn2, key_id_octet, 0x0, pn1,
  315. * pn0}. Only pn[47:0] is valid.
  316. * WAPI: IV = {key_id_octet, 0x0, pn15, pn14, pn13, pn12, pn11,
  317. * pn10, pn9, pn8, pn7, pn6, pn5, pn4, pn3, pn2, pn1, pn0}.
  318. * The ext_wapi_pn[127:48] in the rx_msdu_misc descriptor and
  319. * pn[47:0] are valid.
  320. * Only valid when first_msdu is set.
  321. *
  322. * pn_47_32
  323. * Bits [47:32] of the PN number. See description for
  324. * pn_31_0. The remaining PN fields are in the rx_msdu_end
  325. * descriptor
  326. *
  327. * pn
  328. * Use this field to access the pn without worrying about
  329. * byte-order and bitmasking/bitshifting.
  330. *
  331. * directed
  332. * See definition in RX attention descriptor
  333. *
  334. * reserved_2
  335. * Reserved: HW should fill with zero. FW should ignore.
  336. *
  337. * tid
  338. * The TID field in the QoS control field
  339. */
  340. #define RX_MPDU_END_INFO0_RESERVED_0_MASK 0x00001fff
  341. #define RX_MPDU_END_INFO0_RESERVED_0_LSB 0
  342. #define RX_MPDU_END_INFO0_POST_DELIM_CNT_MASK 0x0fff0000
  343. #define RX_MPDU_END_INFO0_POST_DELIM_CNT_LSB 16
  344. #define RX_MPDU_END_INFO0_OVERFLOW_ERR (1 << 13)
  345. #define RX_MPDU_END_INFO0_LAST_MPDU (1 << 14)
  346. #define RX_MPDU_END_INFO0_POST_DELIM_ERR (1 << 15)
  347. #define RX_MPDU_END_INFO0_MPDU_LENGTH_ERR (1 << 28)
  348. #define RX_MPDU_END_INFO0_TKIP_MIC_ERR (1 << 29)
  349. #define RX_MPDU_END_INFO0_DECRYPT_ERR (1 << 30)
  350. #define RX_MPDU_END_INFO0_FCS_ERR (1 << 31)
  351. struct rx_mpdu_end {
  352. __le32 info0;
  353. } __packed;
  354. /*
  355. * reserved_0
  356. * Reserved
  357. *
  358. * overflow_err
  359. * PCU Receive FIFO does not have enough space to store the
  360. * full receive packet. Enough space is reserved in the
  361. * receive FIFO for the status is written. This MPDU remaining
  362. * packets in the PPDU will be filtered and no Ack response
  363. * will be transmitted.
  364. *
  365. * last_mpdu
  366. * Indicates that this is the last MPDU of a PPDU.
  367. *
  368. * post_delim_err
  369. * Indicates that a delimiter FCS error occurred after this
  370. * MPDU before the next MPDU. Only valid when last_msdu is
  371. * set.
  372. *
  373. * post_delim_cnt
  374. * Count of the delimiters after this MPDU. This requires the
  375. * last MPDU to be held until all the EOF descriptors have been
  376. * received. This may be inefficient in the future when
  377. * ML-MIMO is used. Only valid when last_mpdu is set.
  378. *
  379. * mpdu_length_err
  380. * See definition in RX attention descriptor
  381. *
  382. * tkip_mic_err
  383. * See definition in RX attention descriptor
  384. *
  385. * decrypt_err
  386. * See definition in RX attention descriptor
  387. *
  388. * fcs_err
  389. * See definition in RX attention descriptor
  390. */
  391. #define RX_MSDU_START_INFO0_MSDU_LENGTH_MASK 0x00003fff
  392. #define RX_MSDU_START_INFO0_MSDU_LENGTH_LSB 0
  393. #define RX_MSDU_START_INFO0_IP_OFFSET_MASK 0x000fc000
  394. #define RX_MSDU_START_INFO0_IP_OFFSET_LSB 14
  395. #define RX_MSDU_START_INFO0_RING_MASK_MASK 0x00f00000
  396. #define RX_MSDU_START_INFO0_RING_MASK_LSB 20
  397. #define RX_MSDU_START_INFO0_TCP_UDP_OFFSET_MASK 0x7f000000
  398. #define RX_MSDU_START_INFO0_TCP_UDP_OFFSET_LSB 24
  399. #define RX_MSDU_START_INFO1_MSDU_NUMBER_MASK 0x000000ff
  400. #define RX_MSDU_START_INFO1_MSDU_NUMBER_LSB 0
  401. #define RX_MSDU_START_INFO1_DECAP_FORMAT_MASK 0x00000300
  402. #define RX_MSDU_START_INFO1_DECAP_FORMAT_LSB 8
  403. #define RX_MSDU_START_INFO1_SA_IDX_MASK 0x07ff0000
  404. #define RX_MSDU_START_INFO1_SA_IDX_LSB 16
  405. #define RX_MSDU_START_INFO1_IPV4_PROTO (1 << 10)
  406. #define RX_MSDU_START_INFO1_IPV6_PROTO (1 << 11)
  407. #define RX_MSDU_START_INFO1_TCP_PROTO (1 << 12)
  408. #define RX_MSDU_START_INFO1_UDP_PROTO (1 << 13)
  409. #define RX_MSDU_START_INFO1_IP_FRAG (1 << 14)
  410. #define RX_MSDU_START_INFO1_TCP_ONLY_ACK (1 << 15)
  411. #define RX_MSDU_START_INFO2_DA_IDX_MASK 0x000007ff
  412. #define RX_MSDU_START_INFO2_DA_IDX_LSB 0
  413. #define RX_MSDU_START_INFO2_IP_PROTO_FIELD_MASK 0x00ff0000
  414. #define RX_MSDU_START_INFO2_IP_PROTO_FIELD_LSB 16
  415. #define RX_MSDU_START_INFO2_DA_BCAST_MCAST BIT(11)
  416. /* The decapped header (rx_hdr_status) contains the following:
  417. * a) 802.11 header
  418. * [padding to 4 bytes]
  419. * b) HW crypto parameter
  420. * - 0 bytes for no security
  421. * - 4 bytes for WEP
  422. * - 8 bytes for TKIP, AES
  423. * [padding to 4 bytes]
  424. * c) A-MSDU subframe header (14 bytes) if appliable
  425. * d) LLC/SNAP (RFC1042, 8 bytes)
  426. *
  427. * In case of A-MSDU only first frame in sequence contains (a) and (b). */
  428. enum rx_msdu_decap_format {
  429. RX_MSDU_DECAP_RAW = 0,
  430. /* Note: QoS frames are reported as non-QoS. The rx_hdr_status in
  431. * htt_rx_desc contains the original decapped 802.11 header. */
  432. RX_MSDU_DECAP_NATIVE_WIFI = 1,
  433. /* Payload contains an ethernet header (struct ethhdr). */
  434. RX_MSDU_DECAP_ETHERNET2_DIX = 2,
  435. /* Payload contains two 48-bit addresses and 2-byte length (14 bytes
  436. * total), followed by an RFC1042 header (8 bytes). */
  437. RX_MSDU_DECAP_8023_SNAP_LLC = 3
  438. };
  439. struct rx_msdu_start_common {
  440. __le32 info0; /* %RX_MSDU_START_INFO0_ */
  441. __le32 flow_id_crc;
  442. __le32 info1; /* %RX_MSDU_START_INFO1_ */
  443. } __packed;
  444. struct rx_msdu_start_qca99x0 {
  445. __le32 info2; /* %RX_MSDU_START_INFO2_ */
  446. } __packed;
  447. struct rx_msdu_start {
  448. struct rx_msdu_start_common common;
  449. union {
  450. struct rx_msdu_start_qca99x0 qca99x0;
  451. } __packed;
  452. } __packed;
  453. /*
  454. * msdu_length
  455. * MSDU length in bytes after decapsulation. This field is
  456. * still valid for MPDU frames without A-MSDU. It still
  457. * represents MSDU length after decapsulation
  458. *
  459. * ip_offset
  460. * Indicates the IP offset in bytes from the start of the
  461. * packet after decapsulation. Only valid if ipv4_proto or
  462. * ipv6_proto is set.
  463. *
  464. * ring_mask
  465. * Indicates the destination RX rings for this MSDU.
  466. *
  467. * tcp_udp_offset
  468. * Indicates the offset in bytes to the start of TCP or UDP
  469. * header from the start of the IP header after decapsulation.
  470. * Only valid if tcp_prot or udp_prot is set. The value 0
  471. * indicates that the offset is longer than 127 bytes.
  472. *
  473. * reserved_0c
  474. * Reserved: HW should fill with zero. FW should ignore.
  475. *
  476. * flow_id_crc
  477. * The flow_id_crc runs CRC32 on the following information:
  478. * IPv4 option: dest_addr[31:0], src_addr [31:0], {24'b0,
  479. * protocol[7:0]}.
  480. * IPv6 option: dest_addr[127:0], src_addr [127:0], {24'b0,
  481. * next_header[7:0]}
  482. * UDP case: sort_port[15:0], dest_port[15:0]
  483. * TCP case: sort_port[15:0], dest_port[15:0],
  484. * {header_length[3:0], 6'b0, flags[5:0], window_size[15:0]},
  485. * {16'b0, urgent_ptr[15:0]}, all options except 32-bit
  486. * timestamp.
  487. *
  488. * msdu_number
  489. * Indicates the MSDU number within a MPDU. This value is
  490. * reset to zero at the start of each MPDU. If the number of
  491. * MSDU exceeds 255 this number will wrap using modulo 256.
  492. *
  493. * decap_format
  494. * Indicates the format after decapsulation:
  495. * 0: RAW: No decapsulation
  496. * 1: Native WiFi
  497. * 2: Ethernet 2 (DIX)
  498. * 3: 802.3 (SNAP/LLC)
  499. *
  500. * ipv4_proto
  501. * Set if L2 layer indicates IPv4 protocol.
  502. *
  503. * ipv6_proto
  504. * Set if L2 layer indicates IPv6 protocol.
  505. *
  506. * tcp_proto
  507. * Set if the ipv4_proto or ipv6_proto are set and the IP
  508. * protocol indicates TCP.
  509. *
  510. * udp_proto
  511. * Set if the ipv4_proto or ipv6_proto are set and the IP
  512. * protocol indicates UDP.
  513. *
  514. * ip_frag
  515. * Indicates that either the IP More frag bit is set or IP frag
  516. * number is non-zero. If set indicates that this is a
  517. * fragmented IP packet.
  518. *
  519. * tcp_only_ack
  520. * Set if only the TCP Ack bit is set in the TCP flags and if
  521. * the TCP payload is 0.
  522. *
  523. * sa_idx
  524. * The offset in the address table which matches the MAC source
  525. * address.
  526. *
  527. * reserved_2b
  528. * Reserved: HW should fill with zero. FW should ignore.
  529. */
  530. #define RX_MSDU_END_INFO0_REPORTED_MPDU_LENGTH_MASK 0x00003fff
  531. #define RX_MSDU_END_INFO0_REPORTED_MPDU_LENGTH_LSB 0
  532. #define RX_MSDU_END_INFO0_FIRST_MSDU (1 << 14)
  533. #define RX_MSDU_END_INFO0_LAST_MSDU (1 << 15)
  534. #define RX_MSDU_END_INFO0_PRE_DELIM_ERR (1 << 30)
  535. #define RX_MSDU_END_INFO0_RESERVED_3B (1 << 31)
  536. struct rx_msdu_end_common {
  537. __le16 ip_hdr_cksum;
  538. __le16 tcp_hdr_cksum;
  539. u8 key_id_octet;
  540. u8 classification_filter;
  541. u8 wapi_pn[10];
  542. __le32 info0;
  543. } __packed;
  544. #define RX_MSDU_END_INFO1_TCP_FLAG_MASK 0x000001ff
  545. #define RX_MSDU_END_INFO1_TCP_FLAG_LSB 0
  546. #define RX_MSDU_END_INFO1_L3_HDR_PAD_MASK 0x00001c00
  547. #define RX_MSDU_END_INFO1_L3_HDR_PAD_LSB 10
  548. #define RX_MSDU_END_INFO1_WINDOW_SIZE_MASK 0xffff0000
  549. #define RX_MSDU_END_INFO1_WINDOW_SIZE_LSB 16
  550. #define RX_MSDU_END_INFO1_IRO_ELIGIBLE BIT(9)
  551. #define RX_MSDU_END_INFO2_DA_OFFSET_MASK 0x0000003f
  552. #define RX_MSDU_END_INFO2_DA_OFFSET_LSB 0
  553. #define RX_MSDU_END_INFO2_SA_OFFSET_MASK 0x00000fc0
  554. #define RX_MSDU_END_INFO2_SA_OFFSET_LSB 6
  555. #define RX_MSDU_END_INFO2_TYPE_OFFSET_MASK 0x0003f000
  556. #define RX_MSDU_END_INFO2_TYPE_OFFSET_LSB 12
  557. struct rx_msdu_end_qca99x0 {
  558. __le32 ipv6_crc;
  559. __le32 tcp_seq_no;
  560. __le32 tcp_ack_no;
  561. __le32 info1;
  562. __le32 info2;
  563. } __packed;
  564. struct rx_msdu_end {
  565. struct rx_msdu_end_common common;
  566. union {
  567. struct rx_msdu_end_qca99x0 qca99x0;
  568. } __packed;
  569. } __packed;
  570. /*
  571. *ip_hdr_chksum
  572. * This can include the IP header checksum or the pseudo header
  573. * checksum used by TCP/UDP checksum.
  574. *
  575. *tcp_udp_chksum
  576. * The value of the computed TCP/UDP checksum. A mode bit
  577. * selects whether this checksum is the full checksum or the
  578. * partial checksum which does not include the pseudo header.
  579. *
  580. *key_id_octet
  581. * The key ID octet from the IV. Only valid when first_msdu is
  582. * set.
  583. *
  584. *classification_filter
  585. * Indicates the number classification filter rule
  586. *
  587. *ext_wapi_pn_63_48
  588. * Extension PN (packet number) which is only used by WAPI.
  589. * This corresponds to WAPI PN bits [63:48] (pn6 and pn7). The
  590. * WAPI PN bits [63:0] are in the pn field of the rx_mpdu_start
  591. * descriptor.
  592. *
  593. *ext_wapi_pn_95_64
  594. * Extension PN (packet number) which is only used by WAPI.
  595. * This corresponds to WAPI PN bits [95:64] (pn8, pn9, pn10 and
  596. * pn11).
  597. *
  598. *ext_wapi_pn_127_96
  599. * Extension PN (packet number) which is only used by WAPI.
  600. * This corresponds to WAPI PN bits [127:96] (pn12, pn13, pn14,
  601. * pn15).
  602. *
  603. *reported_mpdu_length
  604. * MPDU length before decapsulation. Only valid when
  605. * first_msdu is set. This field is taken directly from the
  606. * length field of the A-MPDU delimiter or the preamble length
  607. * field for non-A-MPDU frames.
  608. *
  609. *first_msdu
  610. * Indicates the first MSDU of A-MSDU. If both first_msdu and
  611. * last_msdu are set in the MSDU then this is a non-aggregated
  612. * MSDU frame: normal MPDU. Interior MSDU in an A-MSDU shall
  613. * have both first_mpdu and last_mpdu bits set to 0.
  614. *
  615. *last_msdu
  616. * Indicates the last MSDU of the A-MSDU. MPDU end status is
  617. * only valid when last_msdu is set.
  618. *
  619. *reserved_3a
  620. * Reserved: HW should fill with zero. FW should ignore.
  621. *
  622. *pre_delim_err
  623. * Indicates that the first delimiter had a FCS failure. Only
  624. * valid when first_mpdu and first_msdu are set.
  625. *
  626. *reserved_3b
  627. * Reserved: HW should fill with zero. FW should ignore.
  628. */
  629. #define HTT_RX_PPDU_START_PREAMBLE_LEGACY 0x04
  630. #define HTT_RX_PPDU_START_PREAMBLE_HT 0x08
  631. #define HTT_RX_PPDU_START_PREAMBLE_HT_WITH_TXBF 0x09
  632. #define HTT_RX_PPDU_START_PREAMBLE_VHT 0x0C
  633. #define HTT_RX_PPDU_START_PREAMBLE_VHT_WITH_TXBF 0x0D
  634. #define RX_PPDU_START_INFO0_IS_GREENFIELD (1 << 0)
  635. #define RX_PPDU_START_INFO1_L_SIG_RATE_MASK 0x0000000f
  636. #define RX_PPDU_START_INFO1_L_SIG_RATE_LSB 0
  637. #define RX_PPDU_START_INFO1_L_SIG_LENGTH_MASK 0x0001ffe0
  638. #define RX_PPDU_START_INFO1_L_SIG_LENGTH_LSB 5
  639. #define RX_PPDU_START_INFO1_L_SIG_TAIL_MASK 0x00fc0000
  640. #define RX_PPDU_START_INFO1_L_SIG_TAIL_LSB 18
  641. #define RX_PPDU_START_INFO1_PREAMBLE_TYPE_MASK 0xff000000
  642. #define RX_PPDU_START_INFO1_PREAMBLE_TYPE_LSB 24
  643. #define RX_PPDU_START_INFO1_L_SIG_RATE_SELECT (1 << 4)
  644. #define RX_PPDU_START_INFO1_L_SIG_PARITY (1 << 17)
  645. #define RX_PPDU_START_INFO2_HT_SIG_VHT_SIG_A_1_MASK 0x00ffffff
  646. #define RX_PPDU_START_INFO2_HT_SIG_VHT_SIG_A_1_LSB 0
  647. #define RX_PPDU_START_INFO3_HT_SIG_VHT_SIG_A_2_MASK 0x00ffffff
  648. #define RX_PPDU_START_INFO3_HT_SIG_VHT_SIG_A_2_LSB 0
  649. #define RX_PPDU_START_INFO3_TXBF_H_INFO (1 << 24)
  650. #define RX_PPDU_START_INFO4_VHT_SIG_B_MASK 0x1fffffff
  651. #define RX_PPDU_START_INFO4_VHT_SIG_B_LSB 0
  652. #define RX_PPDU_START_INFO5_SERVICE_MASK 0x0000ffff
  653. #define RX_PPDU_START_INFO5_SERVICE_LSB 0
  654. /* No idea what this flag means. It seems to be always set in rate. */
  655. #define RX_PPDU_START_RATE_FLAG BIT(3)
  656. struct rx_ppdu_start {
  657. struct {
  658. u8 pri20_mhz;
  659. u8 ext20_mhz;
  660. u8 ext40_mhz;
  661. u8 ext80_mhz;
  662. } rssi_chains[4];
  663. u8 rssi_comb;
  664. __le16 rsvd0;
  665. u8 info0; /* %RX_PPDU_START_INFO0_ */
  666. __le32 info1; /* %RX_PPDU_START_INFO1_ */
  667. __le32 info2; /* %RX_PPDU_START_INFO2_ */
  668. __le32 info3; /* %RX_PPDU_START_INFO3_ */
  669. __le32 info4; /* %RX_PPDU_START_INFO4_ */
  670. __le32 info5; /* %RX_PPDU_START_INFO5_ */
  671. } __packed;
  672. /*
  673. * rssi_chain0_pri20
  674. * RSSI of RX PPDU on chain 0 of primary 20 MHz bandwidth.
  675. * Value of 0x80 indicates invalid.
  676. *
  677. * rssi_chain0_sec20
  678. * RSSI of RX PPDU on chain 0 of secondary 20 MHz bandwidth.
  679. * Value of 0x80 indicates invalid.
  680. *
  681. * rssi_chain0_sec40
  682. * RSSI of RX PPDU on chain 0 of secondary 40 MHz bandwidth.
  683. * Value of 0x80 indicates invalid.
  684. *
  685. * rssi_chain0_sec80
  686. * RSSI of RX PPDU on chain 0 of secondary 80 MHz bandwidth.
  687. * Value of 0x80 indicates invalid.
  688. *
  689. * rssi_chain1_pri20
  690. * RSSI of RX PPDU on chain 1 of primary 20 MHz bandwidth.
  691. * Value of 0x80 indicates invalid.
  692. *
  693. * rssi_chain1_sec20
  694. * RSSI of RX PPDU on chain 1 of secondary 20 MHz bandwidth.
  695. * Value of 0x80 indicates invalid.
  696. *
  697. * rssi_chain1_sec40
  698. * RSSI of RX PPDU on chain 1 of secondary 40 MHz bandwidth.
  699. * Value of 0x80 indicates invalid.
  700. *
  701. * rssi_chain1_sec80
  702. * RSSI of RX PPDU on chain 1 of secondary 80 MHz bandwidth.
  703. * Value of 0x80 indicates invalid.
  704. *
  705. * rssi_chain2_pri20
  706. * RSSI of RX PPDU on chain 2 of primary 20 MHz bandwidth.
  707. * Value of 0x80 indicates invalid.
  708. *
  709. * rssi_chain2_sec20
  710. * RSSI of RX PPDU on chain 2 of secondary 20 MHz bandwidth.
  711. * Value of 0x80 indicates invalid.
  712. *
  713. * rssi_chain2_sec40
  714. * RSSI of RX PPDU on chain 2 of secondary 40 MHz bandwidth.
  715. * Value of 0x80 indicates invalid.
  716. *
  717. * rssi_chain2_sec80
  718. * RSSI of RX PPDU on chain 2 of secondary 80 MHz bandwidth.
  719. * Value of 0x80 indicates invalid.
  720. *
  721. * rssi_chain3_pri20
  722. * RSSI of RX PPDU on chain 3 of primary 20 MHz bandwidth.
  723. * Value of 0x80 indicates invalid.
  724. *
  725. * rssi_chain3_sec20
  726. * RSSI of RX PPDU on chain 3 of secondary 20 MHz bandwidth.
  727. * Value of 0x80 indicates invalid.
  728. *
  729. * rssi_chain3_sec40
  730. * RSSI of RX PPDU on chain 3 of secondary 40 MHz bandwidth.
  731. * Value of 0x80 indicates invalid.
  732. *
  733. * rssi_chain3_sec80
  734. * RSSI of RX PPDU on chain 3 of secondary 80 MHz bandwidth.
  735. * Value of 0x80 indicates invalid.
  736. *
  737. * rssi_comb
  738. * The combined RSSI of RX PPDU of all active chains and
  739. * bandwidths. Value of 0x80 indicates invalid.
  740. *
  741. * reserved_4a
  742. * Reserved: HW should fill with 0, FW should ignore.
  743. *
  744. * is_greenfield
  745. * Do we really support this?
  746. *
  747. * reserved_4b
  748. * Reserved: HW should fill with 0, FW should ignore.
  749. *
  750. * l_sig_rate
  751. * If l_sig_rate_select is 0:
  752. * 0x8: OFDM 48 Mbps
  753. * 0x9: OFDM 24 Mbps
  754. * 0xA: OFDM 12 Mbps
  755. * 0xB: OFDM 6 Mbps
  756. * 0xC: OFDM 54 Mbps
  757. * 0xD: OFDM 36 Mbps
  758. * 0xE: OFDM 18 Mbps
  759. * 0xF: OFDM 9 Mbps
  760. * If l_sig_rate_select is 1:
  761. * 0x8: CCK 11 Mbps long preamble
  762. * 0x9: CCK 5.5 Mbps long preamble
  763. * 0xA: CCK 2 Mbps long preamble
  764. * 0xB: CCK 1 Mbps long preamble
  765. * 0xC: CCK 11 Mbps short preamble
  766. * 0xD: CCK 5.5 Mbps short preamble
  767. * 0xE: CCK 2 Mbps short preamble
  768. *
  769. * l_sig_rate_select
  770. * Legacy signal rate select. If set then l_sig_rate indicates
  771. * CCK rates. If clear then l_sig_rate indicates OFDM rates.
  772. *
  773. * l_sig_length
  774. * Length of legacy frame in octets.
  775. *
  776. * l_sig_parity
  777. * Odd parity over l_sig_rate and l_sig_length
  778. *
  779. * l_sig_tail
  780. * Tail bits for Viterbi decoder
  781. *
  782. * preamble_type
  783. * Indicates the type of preamble ahead:
  784. * 0x4: Legacy (OFDM/CCK)
  785. * 0x8: HT
  786. * 0x9: HT with TxBF
  787. * 0xC: VHT
  788. * 0xD: VHT with TxBF
  789. * 0x80 - 0xFF: Reserved for special baseband data types such
  790. * as radar and spectral scan.
  791. *
  792. * ht_sig_vht_sig_a_1
  793. * If preamble_type == 0x8 or 0x9
  794. * HT-SIG (first 24 bits)
  795. * If preamble_type == 0xC or 0xD
  796. * VHT-SIG A (first 24 bits)
  797. * Else
  798. * Reserved
  799. *
  800. * reserved_6
  801. * Reserved: HW should fill with 0, FW should ignore.
  802. *
  803. * ht_sig_vht_sig_a_2
  804. * If preamble_type == 0x8 or 0x9
  805. * HT-SIG (last 24 bits)
  806. * If preamble_type == 0xC or 0xD
  807. * VHT-SIG A (last 24 bits)
  808. * Else
  809. * Reserved
  810. *
  811. * txbf_h_info
  812. * Indicates that the packet data carries H information which
  813. * is used for TxBF debug.
  814. *
  815. * reserved_7
  816. * Reserved: HW should fill with 0, FW should ignore.
  817. *
  818. * vht_sig_b
  819. * WiFi 1.0 and WiFi 2.0 will likely have this field to be all
  820. * 0s since the BB does not plan on decoding VHT SIG-B.
  821. *
  822. * reserved_8
  823. * Reserved: HW should fill with 0, FW should ignore.
  824. *
  825. * service
  826. * Service field from BB for OFDM, HT and VHT packets. CCK
  827. * packets will have service field of 0.
  828. *
  829. * reserved_9
  830. * Reserved: HW should fill with 0, FW should ignore.
  831. */
  832. #define RX_PPDU_END_FLAGS_PHY_ERR (1 << 0)
  833. #define RX_PPDU_END_FLAGS_RX_LOCATION (1 << 1)
  834. #define RX_PPDU_END_FLAGS_TXBF_H_INFO (1 << 2)
  835. #define RX_PPDU_END_INFO0_RX_ANTENNA_MASK 0x00ffffff
  836. #define RX_PPDU_END_INFO0_RX_ANTENNA_LSB 0
  837. #define RX_PPDU_END_INFO0_FLAGS_TX_HT_VHT_ACK (1 << 24)
  838. #define RX_PPDU_END_INFO0_BB_CAPTURED_CHANNEL (1 << 25)
  839. #define RX_PPDU_END_INFO1_PEER_IDX_MASK 0x1ffc
  840. #define RX_PPDU_END_INFO1_PEER_IDX_LSB 2
  841. #define RX_PPDU_END_INFO1_BB_DATA BIT(0)
  842. #define RX_PPDU_END_INFO1_PEER_IDX_VALID BIT(1)
  843. #define RX_PPDU_END_INFO1_PPDU_DONE BIT(15)
  844. struct rx_ppdu_end_common {
  845. __le32 evm_p0;
  846. __le32 evm_p1;
  847. __le32 evm_p2;
  848. __le32 evm_p3;
  849. __le32 evm_p4;
  850. __le32 evm_p5;
  851. __le32 evm_p6;
  852. __le32 evm_p7;
  853. __le32 evm_p8;
  854. __le32 evm_p9;
  855. __le32 evm_p10;
  856. __le32 evm_p11;
  857. __le32 evm_p12;
  858. __le32 evm_p13;
  859. __le32 evm_p14;
  860. __le32 evm_p15;
  861. __le32 tsf_timestamp;
  862. __le32 wb_timestamp;
  863. } __packed;
  864. struct rx_ppdu_end_qca988x {
  865. u8 locationing_timestamp;
  866. u8 phy_err_code;
  867. __le16 flags; /* %RX_PPDU_END_FLAGS_ */
  868. __le32 info0; /* %RX_PPDU_END_INFO0_ */
  869. __le16 bb_length;
  870. __le16 info1; /* %RX_PPDU_END_INFO1_ */
  871. } __packed;
  872. #define RX_PPDU_END_RTT_CORRELATION_VALUE_MASK 0x00ffffff
  873. #define RX_PPDU_END_RTT_CORRELATION_VALUE_LSB 0
  874. #define RX_PPDU_END_RTT_UNUSED_MASK 0x7f000000
  875. #define RX_PPDU_END_RTT_UNUSED_LSB 24
  876. #define RX_PPDU_END_RTT_NORMAL_MODE BIT(31)
  877. struct rx_ppdu_end_qca6174 {
  878. u8 locationing_timestamp;
  879. u8 phy_err_code;
  880. __le16 flags; /* %RX_PPDU_END_FLAGS_ */
  881. __le32 info0; /* %RX_PPDU_END_INFO0_ */
  882. __le32 rtt; /* %RX_PPDU_END_RTT_ */
  883. __le16 bb_length;
  884. __le16 info1; /* %RX_PPDU_END_INFO1_ */
  885. } __packed;
  886. #define RX_PKT_END_INFO0_RX_SUCCESS BIT(0)
  887. #define RX_PKT_END_INFO0_ERR_TX_INTERRUPT_RX BIT(3)
  888. #define RX_PKT_END_INFO0_ERR_OFDM_POWER_DROP BIT(4)
  889. #define RX_PKT_END_INFO0_ERR_OFDM_RESTART BIT(5)
  890. #define RX_PKT_END_INFO0_ERR_CCK_POWER_DROP BIT(6)
  891. #define RX_PKT_END_INFO0_ERR_CCK_RESTART BIT(7)
  892. #define RX_LOCATION_INFO_RTT_CORR_VAL_MASK 0x0001ffff
  893. #define RX_LOCATION_INFO_RTT_CORR_VAL_LSB 0
  894. #define RX_LOCATION_INFO_FAC_STATUS_MASK 0x000c0000
  895. #define RX_LOCATION_INFO_FAC_STATUS_LSB 18
  896. #define RX_LOCATION_INFO_PKT_BW_MASK 0x00700000
  897. #define RX_LOCATION_INFO_PKT_BW_LSB 20
  898. #define RX_LOCATION_INFO_RTT_TX_FRAME_PHASE_MASK 0x01800000
  899. #define RX_LOCATION_INFO_RTT_TX_FRAME_PHASE_LSB 23
  900. #define RX_LOCATION_INFO_CIR_STATUS BIT(17)
  901. #define RX_LOCATION_INFO_RTT_MAC_PHY_PHASE BIT(25)
  902. #define RX_LOCATION_INFO_RTT_TX_DATA_START_X BIT(26)
  903. #define RX_LOCATION_INFO_HW_IFFT_MODE BIT(30)
  904. #define RX_LOCATION_INFO_RX_LOCATION_VALID BIT(31)
  905. struct rx_pkt_end {
  906. __le32 info0; /* %RX_PKT_END_INFO0_ */
  907. __le32 phy_timestamp_1;
  908. __le32 phy_timestamp_2;
  909. } __packed;
  910. #define RX_LOCATION_INFO0_RTT_FAC_LEGACY_MASK 0x00003fff
  911. #define RX_LOCATION_INFO0_RTT_FAC_LEGACY_LSB 0
  912. #define RX_LOCATION_INFO0_RTT_FAC_VHT_MASK 0x1fff8000
  913. #define RX_LOCATION_INFO0_RTT_FAC_VHT_LSB 15
  914. #define RX_LOCATION_INFO0_RTT_STRONGEST_CHAIN_MASK 0xc0000000
  915. #define RX_LOCATION_INFO0_RTT_STRONGEST_CHAIN_LSB 30
  916. #define RX_LOCATION_INFO0_RTT_FAC_LEGACY_STATUS BIT(14)
  917. #define RX_LOCATION_INFO0_RTT_FAC_VHT_STATUS BIT(29)
  918. #define RX_LOCATION_INFO1_RTT_PREAMBLE_TYPE_MASK 0x0000000c
  919. #define RX_LOCATION_INFO1_RTT_PREAMBLE_TYPE_LSB 2
  920. #define RX_LOCATION_INFO1_PKT_BW_MASK 0x00000030
  921. #define RX_LOCATION_INFO1_PKT_BW_LSB 4
  922. #define RX_LOCATION_INFO1_SKIP_P_SKIP_BTCF_MASK 0x0000ff00
  923. #define RX_LOCATION_INFO1_SKIP_P_SKIP_BTCF_LSB 8
  924. #define RX_LOCATION_INFO1_RTT_MSC_RATE_MASK 0x000f0000
  925. #define RX_LOCATION_INFO1_RTT_MSC_RATE_LSB 16
  926. #define RX_LOCATION_INFO1_RTT_PBD_LEG_BW_MASK 0x00300000
  927. #define RX_LOCATION_INFO1_RTT_PBD_LEG_BW_LSB 20
  928. #define RX_LOCATION_INFO1_TIMING_BACKOFF_MASK 0x07c00000
  929. #define RX_LOCATION_INFO1_TIMING_BACKOFF_LSB 22
  930. #define RX_LOCATION_INFO1_RTT_TX_FRAME_PHASE_MASK 0x18000000
  931. #define RX_LOCATION_INFO1_RTT_TX_FRAME_PHASE_LSB 27
  932. #define RX_LOCATION_INFO1_RTT_CFR_STATUS BIT(0)
  933. #define RX_LOCATION_INFO1_RTT_CIR_STATUS BIT(1)
  934. #define RX_LOCATION_INFO1_RTT_GI_TYPE BIT(7)
  935. #define RX_LOCATION_INFO1_RTT_MAC_PHY_PHASE BIT(29)
  936. #define RX_LOCATION_INFO1_RTT_TX_DATA_START_X_PHASE BIT(30)
  937. #define RX_LOCATION_INFO1_RX_LOCATION_VALID BIT(31)
  938. struct rx_location_info {
  939. __le32 rx_location_info0; /* %RX_LOCATION_INFO0_ */
  940. __le32 rx_location_info1; /* %RX_LOCATION_INFO1_ */
  941. } __packed;
  942. enum rx_phy_ppdu_end_info0 {
  943. RX_PHY_PPDU_END_INFO0_ERR_RADAR = BIT(2),
  944. RX_PHY_PPDU_END_INFO0_ERR_RX_ABORT = BIT(3),
  945. RX_PHY_PPDU_END_INFO0_ERR_RX_NAP = BIT(4),
  946. RX_PHY_PPDU_END_INFO0_ERR_OFDM_TIMING = BIT(5),
  947. RX_PHY_PPDU_END_INFO0_ERR_OFDM_PARITY = BIT(6),
  948. RX_PHY_PPDU_END_INFO0_ERR_OFDM_RATE = BIT(7),
  949. RX_PHY_PPDU_END_INFO0_ERR_OFDM_LENGTH = BIT(8),
  950. RX_PHY_PPDU_END_INFO0_ERR_OFDM_RESTART = BIT(9),
  951. RX_PHY_PPDU_END_INFO0_ERR_OFDM_SERVICE = BIT(10),
  952. RX_PHY_PPDU_END_INFO0_ERR_OFDM_POWER_DROP = BIT(11),
  953. RX_PHY_PPDU_END_INFO0_ERR_CCK_BLOCKER = BIT(12),
  954. RX_PHY_PPDU_END_INFO0_ERR_CCK_TIMING = BIT(13),
  955. RX_PHY_PPDU_END_INFO0_ERR_CCK_HEADER_CRC = BIT(14),
  956. RX_PHY_PPDU_END_INFO0_ERR_CCK_RATE = BIT(15),
  957. RX_PHY_PPDU_END_INFO0_ERR_CCK_LENGTH = BIT(16),
  958. RX_PHY_PPDU_END_INFO0_ERR_CCK_RESTART = BIT(17),
  959. RX_PHY_PPDU_END_INFO0_ERR_CCK_SERVICE = BIT(18),
  960. RX_PHY_PPDU_END_INFO0_ERR_CCK_POWER_DROP = BIT(19),
  961. RX_PHY_PPDU_END_INFO0_ERR_HT_CRC = BIT(20),
  962. RX_PHY_PPDU_END_INFO0_ERR_HT_LENGTH = BIT(21),
  963. RX_PHY_PPDU_END_INFO0_ERR_HT_RATE = BIT(22),
  964. RX_PHY_PPDU_END_INFO0_ERR_HT_ZLF = BIT(23),
  965. RX_PHY_PPDU_END_INFO0_ERR_FALSE_RADAR_EXT = BIT(24),
  966. RX_PHY_PPDU_END_INFO0_ERR_GREEN_FIELD = BIT(25),
  967. RX_PHY_PPDU_END_INFO0_ERR_SPECTRAL_SCAN = BIT(26),
  968. RX_PHY_PPDU_END_INFO0_ERR_RX_DYN_BW = BIT(27),
  969. RX_PHY_PPDU_END_INFO0_ERR_LEG_HT_MISMATCH = BIT(28),
  970. RX_PHY_PPDU_END_INFO0_ERR_VHT_CRC = BIT(29),
  971. RX_PHY_PPDU_END_INFO0_ERR_VHT_SIGA = BIT(30),
  972. RX_PHY_PPDU_END_INFO0_ERR_VHT_LSIG = BIT(31),
  973. };
  974. enum rx_phy_ppdu_end_info1 {
  975. RX_PHY_PPDU_END_INFO1_ERR_VHT_NDP = BIT(0),
  976. RX_PHY_PPDU_END_INFO1_ERR_VHT_NSYM = BIT(1),
  977. RX_PHY_PPDU_END_INFO1_ERR_VHT_RX_EXT_SYM = BIT(2),
  978. RX_PHY_PPDU_END_INFO1_ERR_VHT_RX_SKIP_ID0 = BIT(3),
  979. RX_PHY_PPDU_END_INFO1_ERR_VHT_RX_SKIP_ID1_62 = BIT(4),
  980. RX_PHY_PPDU_END_INFO1_ERR_VHT_RX_SKIP_ID63 = BIT(5),
  981. RX_PHY_PPDU_END_INFO1_ERR_OFDM_LDPC_DECODER = BIT(6),
  982. RX_PHY_PPDU_END_INFO1_ERR_DEFER_NAP = BIT(7),
  983. RX_PHY_PPDU_END_INFO1_ERR_FDOMAIN_TIMEOUT = BIT(8),
  984. RX_PHY_PPDU_END_INFO1_ERR_LSIG_REL_CHECK = BIT(9),
  985. RX_PHY_PPDU_END_INFO1_ERR_BT_COLLISION = BIT(10),
  986. RX_PHY_PPDU_END_INFO1_ERR_MU_FEEDBACK = BIT(11),
  987. RX_PHY_PPDU_END_INFO1_ERR_TX_INTERRUPT_RX = BIT(12),
  988. RX_PHY_PPDU_END_INFO1_ERR_RX_CBF = BIT(13),
  989. };
  990. struct rx_phy_ppdu_end {
  991. __le32 info0; /* %RX_PHY_PPDU_END_INFO0_ */
  992. __le32 info1; /* %RX_PHY_PPDU_END_INFO1_ */
  993. } __packed;
  994. #define RX_PPDU_END_RX_TIMING_OFFSET_MASK 0x00000fff
  995. #define RX_PPDU_END_RX_TIMING_OFFSET_LSB 0
  996. #define RX_PPDU_END_RX_INFO_RX_ANTENNA_MASK 0x00ffffff
  997. #define RX_PPDU_END_RX_INFO_RX_ANTENNA_LSB 0
  998. #define RX_PPDU_END_RX_INFO_TX_HT_VHT_ACK BIT(24)
  999. #define RX_PPDU_END_RX_INFO_RX_PKT_END_VALID BIT(25)
  1000. #define RX_PPDU_END_RX_INFO_RX_PHY_PPDU_END_VALID BIT(26)
  1001. #define RX_PPDU_END_RX_INFO_RX_TIMING_OFFSET_VALID BIT(27)
  1002. #define RX_PPDU_END_RX_INFO_BB_CAPTURED_CHANNEL BIT(28)
  1003. #define RX_PPDU_END_RX_INFO_UNSUPPORTED_MU_NC BIT(29)
  1004. #define RX_PPDU_END_RX_INFO_OTP_TXBF_DISABLE BIT(30)
  1005. struct rx_ppdu_end_qca99x0 {
  1006. struct rx_pkt_end rx_pkt_end;
  1007. __le32 rx_location_info; /* %RX_LOCATION_INFO_ */
  1008. struct rx_phy_ppdu_end rx_phy_ppdu_end;
  1009. __le32 rx_timing_offset; /* %RX_PPDU_END_RX_TIMING_OFFSET_ */
  1010. __le32 rx_info; /* %RX_PPDU_END_RX_INFO_ */
  1011. __le16 bb_length;
  1012. __le16 info1; /* %RX_PPDU_END_INFO1_ */
  1013. } __packed;
  1014. struct rx_ppdu_end_qca9984 {
  1015. struct rx_pkt_end rx_pkt_end;
  1016. struct rx_location_info rx_location_info;
  1017. struct rx_phy_ppdu_end rx_phy_ppdu_end;
  1018. __le32 rx_timing_offset; /* %RX_PPDU_END_RX_TIMING_OFFSET_ */
  1019. __le32 rx_info; /* %RX_PPDU_END_RX_INFO_ */
  1020. __le16 bb_length;
  1021. __le16 info1; /* %RX_PPDU_END_INFO1_ */
  1022. } __packed;
  1023. struct rx_ppdu_end {
  1024. struct rx_ppdu_end_common common;
  1025. union {
  1026. struct rx_ppdu_end_qca988x qca988x;
  1027. struct rx_ppdu_end_qca6174 qca6174;
  1028. struct rx_ppdu_end_qca99x0 qca99x0;
  1029. struct rx_ppdu_end_qca9984 qca9984;
  1030. } __packed;
  1031. } __packed;
  1032. /*
  1033. * evm_p0
  1034. * EVM for pilot 0. Contain EVM for streams: 0, 1, 2 and 3.
  1035. *
  1036. * evm_p1
  1037. * EVM for pilot 1. Contain EVM for streams: 0, 1, 2 and 3.
  1038. *
  1039. * evm_p2
  1040. * EVM for pilot 2. Contain EVM for streams: 0, 1, 2 and 3.
  1041. *
  1042. * evm_p3
  1043. * EVM for pilot 3. Contain EVM for streams: 0, 1, 2 and 3.
  1044. *
  1045. * evm_p4
  1046. * EVM for pilot 4. Contain EVM for streams: 0, 1, 2 and 3.
  1047. *
  1048. * evm_p5
  1049. * EVM for pilot 5. Contain EVM for streams: 0, 1, 2 and 3.
  1050. *
  1051. * evm_p6
  1052. * EVM for pilot 6. Contain EVM for streams: 0, 1, 2 and 3.
  1053. *
  1054. * evm_p7
  1055. * EVM for pilot 7. Contain EVM for streams: 0, 1, 2 and 3.
  1056. *
  1057. * evm_p8
  1058. * EVM for pilot 8. Contain EVM for streams: 0, 1, 2 and 3.
  1059. *
  1060. * evm_p9
  1061. * EVM for pilot 9. Contain EVM for streams: 0, 1, 2 and 3.
  1062. *
  1063. * evm_p10
  1064. * EVM for pilot 10. Contain EVM for streams: 0, 1, 2 and 3.
  1065. *
  1066. * evm_p11
  1067. * EVM for pilot 11. Contain EVM for streams: 0, 1, 2 and 3.
  1068. *
  1069. * evm_p12
  1070. * EVM for pilot 12. Contain EVM for streams: 0, 1, 2 and 3.
  1071. *
  1072. * evm_p13
  1073. * EVM for pilot 13. Contain EVM for streams: 0, 1, 2 and 3.
  1074. *
  1075. * evm_p14
  1076. * EVM for pilot 14. Contain EVM for streams: 0, 1, 2 and 3.
  1077. *
  1078. * evm_p15
  1079. * EVM for pilot 15. Contain EVM for streams: 0, 1, 2 and 3.
  1080. *
  1081. * tsf_timestamp
  1082. * Receive TSF timestamp sampled on the rising edge of
  1083. * rx_clear. For PHY errors this may be the current TSF when
  1084. * phy_error is asserted if the rx_clear does not assert before
  1085. * the end of the PHY error.
  1086. *
  1087. * wb_timestamp
  1088. * WLAN/BT timestamp is a 1 usec resolution timestamp which
  1089. * does not get updated based on receive beacon like TSF. The
  1090. * same rules for capturing tsf_timestamp are used to capture
  1091. * the wb_timestamp.
  1092. *
  1093. * locationing_timestamp
  1094. * Timestamp used for locationing. This timestamp is used to
  1095. * indicate fractions of usec. For example if the MAC clock is
  1096. * running at 80 MHz, the timestamp will increment every 12.5
  1097. * nsec. The value starts at 0 and increments to 79 and
  1098. * returns to 0 and repeats. This information is valid for
  1099. * every PPDU. This information can be used in conjunction
  1100. * with wb_timestamp to capture large delta times.
  1101. *
  1102. * phy_err_code
  1103. * See the 1.10.8.1.2 for the list of the PHY error codes.
  1104. *
  1105. * phy_err
  1106. * Indicates a PHY error was detected for this PPDU.
  1107. *
  1108. * rx_location
  1109. * Indicates that location information was requested.
  1110. *
  1111. * txbf_h_info
  1112. * Indicates that the packet data carries H information which
  1113. * is used for TxBF debug.
  1114. *
  1115. * reserved_18
  1116. * Reserved: HW should fill with 0, FW should ignore.
  1117. *
  1118. * rx_antenna
  1119. * Receive antenna value
  1120. *
  1121. * tx_ht_vht_ack
  1122. * Indicates that a HT or VHT Ack/BA frame was transmitted in
  1123. * response to this receive packet.
  1124. *
  1125. * bb_captured_channel
  1126. * Indicates that the BB has captured a channel dump. FW can
  1127. * then read the channel dump memory. This may indicate that
  1128. * the channel was captured either based on PCU setting the
  1129. * capture_channel bit BB descriptor or FW setting the
  1130. * capture_channel mode bit.
  1131. *
  1132. * reserved_19
  1133. * Reserved: HW should fill with 0, FW should ignore.
  1134. *
  1135. * bb_length
  1136. * Indicates the number of bytes of baseband information for
  1137. * PPDUs where the BB descriptor preamble type is 0x80 to 0xFF
  1138. * which indicates that this is not a normal PPDU but rather
  1139. * contains baseband debug information.
  1140. *
  1141. * reserved_20
  1142. * Reserved: HW should fill with 0, FW should ignore.
  1143. *
  1144. * ppdu_done
  1145. * PPDU end status is only valid when ppdu_done bit is set.
  1146. * Every time HW sets this bit in memory FW/SW must clear this
  1147. * bit in memory. FW will initialize all the ppdu_done dword
  1148. * to 0.
  1149. */
  1150. #define FW_RX_DESC_INFO0_DISCARD (1 << 0)
  1151. #define FW_RX_DESC_INFO0_FORWARD (1 << 1)
  1152. #define FW_RX_DESC_INFO0_INSPECT (1 << 5)
  1153. #define FW_RX_DESC_INFO0_EXT_MASK 0xC0
  1154. #define FW_RX_DESC_INFO0_EXT_LSB 6
  1155. struct fw_rx_desc_base {
  1156. u8 info0;
  1157. } __packed;
  1158. #endif /* _RX_DESC_H_ */