rx_msdu_start.h 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131
  1. /*
  2. * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. #ifndef _RX_MSDU_START_H_
  19. #define _RX_MSDU_START_H_
  20. #if !defined(__ASSEMBLER__)
  21. #endif
  22. // ################ START SUMMARY #################
  23. //
  24. // Dword Fields
  25. // 0 rxpcu_mpdu_filter_in_category[1:0], sw_frame_group_id[8:2], reserved_0[15:9], phy_ppdu_id[31:16]
  26. // 1 msdu_length[13:0], reserved_1a[14], ipsec_esp[15], l3_offset[22:16], ipsec_ah[23], l4_offset[31:24]
  27. // 2 msdu_number[7:0], decap_format[9:8], ipv4_proto[10], ipv6_proto[11], tcp_proto[12], udp_proto[13], ip_frag[14], tcp_only_ack[15], da_is_bcast_mcast[16], toeplitz_hash_sel[18:17], ip_fixed_header_valid[19], ip_extn_header_valid[20], tcp_udp_header_valid[21], mesh_control_present[22], reserved_2a[23], ip4_protocol_ip6_next_header[31:24]
  28. // 3 toeplitz_hash_2_or_4[31:0]
  29. // 4 flow_id_toeplitz[31:0]
  30. // 5 user_rssi[7:0], pkt_type[11:8], stbc[12], sgi[14:13], rate_mcs[18:15], receive_bandwidth[20:19], reception_type[23:21], mimo_ss_bitmap[31:24]
  31. // 6 ppdu_start_timestamp[31:0]
  32. // 7 sw_phy_meta_data[31:0]
  33. //
  34. // ################ END SUMMARY #################
  35. #define NUM_OF_DWORDS_RX_MSDU_START 8
  36. struct rx_msdu_start {
  37. uint32_t rxpcu_mpdu_filter_in_category : 2, //[1:0]
  38. sw_frame_group_id : 7, //[8:2]
  39. reserved_0 : 7, //[15:9]
  40. phy_ppdu_id : 16; //[31:16]
  41. uint32_t msdu_length : 14, //[13:0]
  42. reserved_1a : 1, //[14]
  43. ipsec_esp : 1, //[15]
  44. l3_offset : 7, //[22:16]
  45. ipsec_ah : 1, //[23]
  46. l4_offset : 8; //[31:24]
  47. uint32_t msdu_number : 8, //[7:0]
  48. decap_format : 2, //[9:8]
  49. ipv4_proto : 1, //[10]
  50. ipv6_proto : 1, //[11]
  51. tcp_proto : 1, //[12]
  52. udp_proto : 1, //[13]
  53. ip_frag : 1, //[14]
  54. tcp_only_ack : 1, //[15]
  55. da_is_bcast_mcast : 1, //[16]
  56. toeplitz_hash_sel : 2, //[18:17]
  57. ip_fixed_header_valid : 1, //[19]
  58. ip_extn_header_valid : 1, //[20]
  59. tcp_udp_header_valid : 1, //[21]
  60. mesh_control_present : 1, //[22]
  61. reserved_2a : 1, //[23]
  62. ip4_protocol_ip6_next_header : 8; //[31:24]
  63. uint32_t toeplitz_hash_2_or_4 : 32; //[31:0]
  64. uint32_t flow_id_toeplitz : 32; //[31:0]
  65. uint32_t user_rssi : 8, //[7:0]
  66. pkt_type : 4, //[11:8]
  67. stbc : 1, //[12]
  68. sgi : 2, //[14:13]
  69. rate_mcs : 4, //[18:15]
  70. receive_bandwidth : 2, //[20:19]
  71. reception_type : 3, //[23:21]
  72. mimo_ss_bitmap : 8; //[31:24]
  73. uint32_t ppdu_start_timestamp : 32; //[31:0]
  74. uint32_t sw_phy_meta_data : 32; //[31:0]
  75. };
  76. /*
  77. rxpcu_mpdu_filter_in_category
  78. Field indicates what the reason was that this MPDU frame
  79. was allowed to come into the receive path by RXPCU
  80. <enum 0 rxpcu_filter_pass> This MPDU passed the normal
  81. frame filter programming of rxpcu
  82. <enum 1 rxpcu_monitor_client> This MPDU did NOT pass the
  83. regular frame filter and would have been dropped, were it
  84. not for the frame fitting into the 'monitor_client'
  85. category.
  86. <enum 2 rxpcu_monitor_other> This MPDU did NOT pass the
  87. regular frame filter and also did not pass the
  88. rxpcu_monitor_client filter. It would have been dropped
  89. accept that it did pass the 'monitor_other' category.
  90. <legal 0-2>
  91. sw_frame_group_id
  92. SW processes frames based on certain classifications.
  93. This field indicates to what sw classification this MPDU is
  94. mapped.
  95. The classification is given in priority order
  96. <enum 0 sw_frame_group_NDP_frame>
  97. <enum 1 sw_frame_group_Multicast_data>
  98. <enum 2 sw_frame_group_Unicast_data>
  99. <enum 3 sw_frame_group_Null_data > This includes mpdus
  100. of type Data Null as well as QoS Data Null
  101. <enum 4 sw_frame_group_mgmt_0000 >
  102. <enum 5 sw_frame_group_mgmt_0001 >
  103. <enum 6 sw_frame_group_mgmt_0010 >
  104. <enum 7 sw_frame_group_mgmt_0011 >
  105. <enum 8 sw_frame_group_mgmt_0100 >
  106. <enum 9 sw_frame_group_mgmt_0101 >
  107. <enum 10 sw_frame_group_mgmt_0110 >
  108. <enum 11 sw_frame_group_mgmt_0111 >
  109. <enum 12 sw_frame_group_mgmt_1000 >
  110. <enum 13 sw_frame_group_mgmt_1001 >
  111. <enum 14 sw_frame_group_mgmt_1010 >
  112. <enum 15 sw_frame_group_mgmt_1011 >
  113. <enum 16 sw_frame_group_mgmt_1100 >
  114. <enum 17 sw_frame_group_mgmt_1101 >
  115. <enum 18 sw_frame_group_mgmt_1110 >
  116. <enum 19 sw_frame_group_mgmt_1111 >
  117. <enum 20 sw_frame_group_ctrl_0000 >
  118. <enum 21 sw_frame_group_ctrl_0001 >
  119. <enum 22 sw_frame_group_ctrl_0010 >
  120. <enum 23 sw_frame_group_ctrl_0011 >
  121. <enum 24 sw_frame_group_ctrl_0100 >
  122. <enum 25 sw_frame_group_ctrl_0101 >
  123. <enum 26 sw_frame_group_ctrl_0110 >
  124. <enum 27 sw_frame_group_ctrl_0111 >
  125. <enum 28 sw_frame_group_ctrl_1000 >
  126. <enum 29 sw_frame_group_ctrl_1001 >
  127. <enum 30 sw_frame_group_ctrl_1010 >
  128. <enum 31 sw_frame_group_ctrl_1011 >
  129. <enum 32 sw_frame_group_ctrl_1100 >
  130. <enum 33 sw_frame_group_ctrl_1101 >
  131. <enum 34 sw_frame_group_ctrl_1110 >
  132. <enum 35 sw_frame_group_ctrl_1111 >
  133. <enum 36 sw_frame_group_unsupported> This covers type 3
  134. and protocol version != 0
  135. <legal 0-37>
  136. reserved_0
  137. <legal 0>
  138. phy_ppdu_id
  139. A ppdu counter value that PHY increments for every PPDU
  140. received. The counter value wraps around
  141. <legal all>
  142. msdu_length
  143. MSDU length in bytes after decapsulation.
  144. This field is still valid for MPDU frames without
  145. reserved_1a
  146. <legal 0>
  147. ipsec_esp
  148. Set if IPv4/v6 packet is using IPsec ESP
  149. l3_offset
  150. Depending upon mode bit, this field either indicates the
  151. L3 offset in bytes from the start of the RX_HEADER or the IP
  152. offset in bytes from the start of the packet after
  153. decapsulation.  The latter is only valid if ipv4_proto or
  154. ipv6_proto is set.
  155. ipsec_ah
  156. Set if IPv4/v6 packet is using IPsec AH
  157. l4_offset
  158. Depending upon mode bit, this field either indicates the
  159. L4 offset nin bytes from the start of RX_HEADER(only valid
  160. if either ipv4_proto or ipv6_proto is set to 1) or indicates
  161. the offset in bytes to the start of TCP or UDP header from
  162. the start of the IP header after decapsulation(Only valid if
  163. tcp_proto or udp_proto is set).  The value 0 indicates that
  164. the offset is longer than 127 bytes.
  165. msdu_number
  166. Indicates the MSDU number within a MPDU. This value is
  167. reset to zero at the start of each MPDU. If the number of
  168. MSDU exceeds 255 this number will wrap using modulo 256.
  169. decap_format
  170. Indicates the format after decapsulation:
  171. <enum 0 RAW> No encapsulation
  172. <enum 1 Native_WiFi>
  173. <enum 2 Ethernet> Ethernet 2 (DIX) or 802.3 (uses
  174. SNAP/LLC)
  175. <enum 3 802_3> Indicate Ethernet
  176. <legal all>
  177. ipv4_proto
  178. Set if L2 layer indicates IPv4 protocol.
  179. ipv6_proto
  180. Set if L2 layer indicates IPv6 protocol.
  181. tcp_proto
  182. Set if the ipv4_proto or ipv6_proto are set and the IP
  183. protocol indicates TCP.
  184. udp_proto
  185. Set if the ipv4_proto or ipv6_proto are set and the IP
  186. protocol indicates UDP.
  187. ip_frag
  188. Indicates that either the IP More frag bit is set or IP
  189. frag number is non-zero. If set indicates that this is a
  190. fragmented IP packet.
  191. tcp_only_ack
  192. Set if only the TCP Ack bit is set in the TCP flags and
  193. if the TCP payload is 0.
  194. da_is_bcast_mcast
  195. The destination address is broadcast or multicast.
  196. toeplitz_hash_sel
  197. Actual choosen Hash.
  198. 0 -> Toeplitz hash of 2-tuple (IP source address, IP
  199. destination address)1 -> Toeplitz hash of 4-tuple (IP source
  200. address, IP destination address, L4 (TCP/UDP) source port,
  201. L4 (TCP/UDP) destination port)
  202. 2 -> Toeplitz of flow_id
  203. 3 -> Zero is used
  204. <legal all>
  205. ip_fixed_header_valid
  206. Fixed 20-byte IPv4 header or 40-byte IPv6 header parsed
  207. fully within first 256 bytes of the packet
  208. ip_extn_header_valid
  209. IPv6/IPv6 header, including IPv4 options and
  210. recognizable extension headers parsed fully within first 256
  211. bytes of the packet
  212. tcp_udp_header_valid
  213. Fixed 20-byte TCP (excluding TCP options) or 8-byte UDP
  214. header parsed fully within first 256 bytes of the packet
  215. mesh_control_present
  216. When set, this MSDU includes the 'Mesh Control' field
  217. <legal all>
  218. reserved_2a
  219. <legal 0>
  220. ip4_protocol_ip6_next_header
  221. For IPv4 this is the 8 bit protocol field (when
  222. ipv4_proto is set). For IPv6 this is the 8 bit next_header
  223. field (when ipv6_proto is set).
  224. toeplitz_hash_2_or_4
  225. Controlled by RxOLE register - If register bit set to 0,
  226. Toeplitz hash is computed over 2-tuple IPv4 or IPv6 src/dest
  227. addresses; otherwise, toeplitz hash is computed over 4-tuple
  228. IPv4 or IPv6 src/dest addresses and src/dest ports
  229. flow_id_toeplitz
  230. Toeplitz hash of 5-tuple
  231. {IP source address, IP destination address, IP source
  232. port, IP destination port, L4 protocol} in case of
  233. non-IPSec.
  234. In case of IPSec - Toeplitz hash of 4-tuple
  235. {IP source address, IP destination address, SPI, L4
  236. protocol}
  237. The relevant Toeplitz key registers are provided in
  238. RxOLE's instance of common parser module. These registers
  239. are separate from the Toeplitz keys used by ASE/FSE modules
  240. inside RxOLE.The actual value will be passed on from common
  241. parser module to RxOLE in one of the WHO_* TLVs.
  242. <legal all>
  243. user_rssi
  244. RSSI for this user
  245. <legal all>
  246. pkt_type
  247. Packet type:
  248. <enum 0 dot11a>802.11a PPDU type
  249. <enum 1 dot11b>802.11b PPDU type
  250. <enum 2 dot11n_mm>802.11n Mixed Mode PPDU type
  251. <enum 3 dot11ac>802.11ac PPDU type
  252. <enum 4 dot11ax>802.11ax PPDU type
  253. stbc
  254. When set, use STBC transmission rates
  255. sgi
  256. Field only valid when pkt type is HT, VHT or HE.
  257. <enum 0 0_8_us_sgi > Legacy normal GI. Can also be
  258. used for HE
  259. <enum 1 0_4_us_sgi > Legacy short GI. Can also be
  260. used for HE
  261. <enum 2 1_6_us_sgi > HE related GI
  262. <enum 3 3_2_us_sgi > HE related GI
  263. <legal 0 - 3>
  264. rate_mcs
  265. For details, refer to MCS_TYPE description
  266. Note: This is rate in case of 11a/11b
  267. <legal all>
  268. receive_bandwidth
  269. Full receive Bandwidth
  270. <enum 0 full_rx_bw_20_mhz>
  271. <enum 1 full_rx_bw_40_mhz>
  272. <enum 2 full_rx_bw_80_mhz>
  273. <enum 3 full_rx_bw_160_mhz>
  274. <legal 0-3>
  275. reception_type
  276. Indicates what type of reception this is.
  277. <enum 0 reception_type_SU > Basic SU reception (not
  278. part of OFDMA or MIMO)
  279. <enum 1 reception_type_MU_MIMO > This is related to
  280. DL type of reception
  281. <enum 2 reception_type_MU_OFDMA > This is related
  282. to DL type of reception
  283. <enum 3 reception_type_MU_OFDMA_MIMO > This is
  284. related to DL type of reception
  285. <enum 4 reception_type_UL_MU_MIMO > This is related
  286. to UL type of reception
  287. <enum 5 reception_type_UL_MU_OFDMA > This is
  288. related to UL type of reception
  289. <enum 6 reception_type_UL_MU_OFDMA_MIMO > This is
  290. related to UL type of reception
  291. <legal 0-6>
  292. mimo_ss_bitmap
  293. Field only valid when Reception_type =
  294. reception_type_MU_MIMO or reception_type_MU_OFDMA_MIMO
  295. Bitmap, with each bit indicating if the related spatial
  296. stream is used for this STA
  297. LSB related to SS 0
  298. 0: spatial stream not used for this reception
  299. 1: spatial stream used for this reception
  300. <legal all>
  301. ppdu_start_timestamp
  302. Timestamp that indicates when the PPDU that contained
  303. this MPDU started on the medium.
  304. <legal all>
  305. sw_phy_meta_data
  306. SW programmed Meta data provided by the PHY.
  307. Can be used for SW to indicate the channel the device is
  308. on.
  309. <legal all>
  310. */
  311. /* Description RX_MSDU_START_0_RXPCU_MPDU_FILTER_IN_CATEGORY
  312. Field indicates what the reason was that this MPDU frame
  313. was allowed to come into the receive path by RXPCU
  314. <enum 0 rxpcu_filter_pass> This MPDU passed the normal
  315. frame filter programming of rxpcu
  316. <enum 1 rxpcu_monitor_client> This MPDU did NOT pass the
  317. regular frame filter and would have been dropped, were it
  318. not for the frame fitting into the 'monitor_client'
  319. category.
  320. <enum 2 rxpcu_monitor_other> This MPDU did NOT pass the
  321. regular frame filter and also did not pass the
  322. rxpcu_monitor_client filter. It would have been dropped
  323. accept that it did pass the 'monitor_other' category.
  324. <legal 0-2>
  325. */
  326. #define RX_MSDU_START_0_RXPCU_MPDU_FILTER_IN_CATEGORY_OFFSET 0x00000000
  327. #define RX_MSDU_START_0_RXPCU_MPDU_FILTER_IN_CATEGORY_LSB 0
  328. #define RX_MSDU_START_0_RXPCU_MPDU_FILTER_IN_CATEGORY_MASK 0x00000003
  329. /* Description RX_MSDU_START_0_SW_FRAME_GROUP_ID
  330. SW processes frames based on certain classifications.
  331. This field indicates to what sw classification this MPDU is
  332. mapped.
  333. The classification is given in priority order
  334. <enum 0 sw_frame_group_NDP_frame>
  335. <enum 1 sw_frame_group_Multicast_data>
  336. <enum 2 sw_frame_group_Unicast_data>
  337. <enum 3 sw_frame_group_Null_data > This includes mpdus
  338. of type Data Null as well as QoS Data Null
  339. <enum 4 sw_frame_group_mgmt_0000 >
  340. <enum 5 sw_frame_group_mgmt_0001 >
  341. <enum 6 sw_frame_group_mgmt_0010 >
  342. <enum 7 sw_frame_group_mgmt_0011 >
  343. <enum 8 sw_frame_group_mgmt_0100 >
  344. <enum 9 sw_frame_group_mgmt_0101 >
  345. <enum 10 sw_frame_group_mgmt_0110 >
  346. <enum 11 sw_frame_group_mgmt_0111 >
  347. <enum 12 sw_frame_group_mgmt_1000 >
  348. <enum 13 sw_frame_group_mgmt_1001 >
  349. <enum 14 sw_frame_group_mgmt_1010 >
  350. <enum 15 sw_frame_group_mgmt_1011 >
  351. <enum 16 sw_frame_group_mgmt_1100 >
  352. <enum 17 sw_frame_group_mgmt_1101 >
  353. <enum 18 sw_frame_group_mgmt_1110 >
  354. <enum 19 sw_frame_group_mgmt_1111 >
  355. <enum 20 sw_frame_group_ctrl_0000 >
  356. <enum 21 sw_frame_group_ctrl_0001 >
  357. <enum 22 sw_frame_group_ctrl_0010 >
  358. <enum 23 sw_frame_group_ctrl_0011 >
  359. <enum 24 sw_frame_group_ctrl_0100 >
  360. <enum 25 sw_frame_group_ctrl_0101 >
  361. <enum 26 sw_frame_group_ctrl_0110 >
  362. <enum 27 sw_frame_group_ctrl_0111 >
  363. <enum 28 sw_frame_group_ctrl_1000 >
  364. <enum 29 sw_frame_group_ctrl_1001 >
  365. <enum 30 sw_frame_group_ctrl_1010 >
  366. <enum 31 sw_frame_group_ctrl_1011 >
  367. <enum 32 sw_frame_group_ctrl_1100 >
  368. <enum 33 sw_frame_group_ctrl_1101 >
  369. <enum 34 sw_frame_group_ctrl_1110 >
  370. <enum 35 sw_frame_group_ctrl_1111 >
  371. <enum 36 sw_frame_group_unsupported> This covers type 3
  372. and protocol version != 0
  373. <legal 0-37>
  374. */
  375. #define RX_MSDU_START_0_SW_FRAME_GROUP_ID_OFFSET 0x00000000
  376. #define RX_MSDU_START_0_SW_FRAME_GROUP_ID_LSB 2
  377. #define RX_MSDU_START_0_SW_FRAME_GROUP_ID_MASK 0x000001fc
  378. /* Description RX_MSDU_START_0_RESERVED_0
  379. <legal 0>
  380. */
  381. #define RX_MSDU_START_0_RESERVED_0_OFFSET 0x00000000
  382. #define RX_MSDU_START_0_RESERVED_0_LSB 9
  383. #define RX_MSDU_START_0_RESERVED_0_MASK 0x0000fe00
  384. /* Description RX_MSDU_START_0_PHY_PPDU_ID
  385. A ppdu counter value that PHY increments for every PPDU
  386. received. The counter value wraps around
  387. <legal all>
  388. */
  389. #define RX_MSDU_START_0_PHY_PPDU_ID_OFFSET 0x00000000
  390. #define RX_MSDU_START_0_PHY_PPDU_ID_LSB 16
  391. #define RX_MSDU_START_0_PHY_PPDU_ID_MASK 0xffff0000
  392. /* Description RX_MSDU_START_1_MSDU_LENGTH
  393. MSDU length in bytes after decapsulation.
  394. This field is still valid for MPDU frames without
  395. */
  396. #define RX_MSDU_START_1_MSDU_LENGTH_OFFSET 0x00000004
  397. #define RX_MSDU_START_1_MSDU_LENGTH_LSB 0
  398. #define RX_MSDU_START_1_MSDU_LENGTH_MASK 0x00003fff
  399. /* Description RX_MSDU_START_1_RESERVED_1A
  400. <legal 0>
  401. */
  402. #define RX_MSDU_START_1_RESERVED_1A_OFFSET 0x00000004
  403. #define RX_MSDU_START_1_RESERVED_1A_LSB 14
  404. #define RX_MSDU_START_1_RESERVED_1A_MASK 0x00004000
  405. /* Description RX_MSDU_START_1_IPSEC_ESP
  406. Set if IPv4/v6 packet is using IPsec ESP
  407. */
  408. #define RX_MSDU_START_1_IPSEC_ESP_OFFSET 0x00000004
  409. #define RX_MSDU_START_1_IPSEC_ESP_LSB 15
  410. #define RX_MSDU_START_1_IPSEC_ESP_MASK 0x00008000
  411. /* Description RX_MSDU_START_1_L3_OFFSET
  412. Depending upon mode bit, this field either indicates the
  413. L3 offset in bytes from the start of the RX_HEADER or the IP
  414. offset in bytes from the start of the packet after
  415. decapsulation.  The latter is only valid if ipv4_proto or
  416. ipv6_proto is set.
  417. */
  418. #define RX_MSDU_START_1_L3_OFFSET_OFFSET 0x00000004
  419. #define RX_MSDU_START_1_L3_OFFSET_LSB 16
  420. #define RX_MSDU_START_1_L3_OFFSET_MASK 0x007f0000
  421. /* Description RX_MSDU_START_1_IPSEC_AH
  422. Set if IPv4/v6 packet is using IPsec AH
  423. */
  424. #define RX_MSDU_START_1_IPSEC_AH_OFFSET 0x00000004
  425. #define RX_MSDU_START_1_IPSEC_AH_LSB 23
  426. #define RX_MSDU_START_1_IPSEC_AH_MASK 0x00800000
  427. /* Description RX_MSDU_START_1_L4_OFFSET
  428. Depending upon mode bit, this field either indicates the
  429. L4 offset nin bytes from the start of RX_HEADER(only valid
  430. if either ipv4_proto or ipv6_proto is set to 1) or indicates
  431. the offset in bytes to the start of TCP or UDP header from
  432. the start of the IP header after decapsulation(Only valid if
  433. tcp_proto or udp_proto is set).  The value 0 indicates that
  434. the offset is longer than 127 bytes.
  435. */
  436. #define RX_MSDU_START_1_L4_OFFSET_OFFSET 0x00000004
  437. #define RX_MSDU_START_1_L4_OFFSET_LSB 24
  438. #define RX_MSDU_START_1_L4_OFFSET_MASK 0xff000000
  439. /* Description RX_MSDU_START_2_MSDU_NUMBER
  440. Indicates the MSDU number within a MPDU. This value is
  441. reset to zero at the start of each MPDU. If the number of
  442. MSDU exceeds 255 this number will wrap using modulo 256.
  443. */
  444. #define RX_MSDU_START_2_MSDU_NUMBER_OFFSET 0x00000008
  445. #define RX_MSDU_START_2_MSDU_NUMBER_LSB 0
  446. #define RX_MSDU_START_2_MSDU_NUMBER_MASK 0x000000ff
  447. /* Description RX_MSDU_START_2_DECAP_FORMAT
  448. Indicates the format after decapsulation:
  449. <enum 0 RAW> No encapsulation
  450. <enum 1 Native_WiFi>
  451. <enum 2 Ethernet> Ethernet 2 (DIX) or 802.3 (uses
  452. SNAP/LLC)
  453. <enum 3 802_3> Indicate Ethernet
  454. <legal all>
  455. */
  456. #define RX_MSDU_START_2_DECAP_FORMAT_OFFSET 0x00000008
  457. #define RX_MSDU_START_2_DECAP_FORMAT_LSB 8
  458. #define RX_MSDU_START_2_DECAP_FORMAT_MASK 0x00000300
  459. /* Description RX_MSDU_START_2_IPV4_PROTO
  460. Set if L2 layer indicates IPv4 protocol.
  461. */
  462. #define RX_MSDU_START_2_IPV4_PROTO_OFFSET 0x00000008
  463. #define RX_MSDU_START_2_IPV4_PROTO_LSB 10
  464. #define RX_MSDU_START_2_IPV4_PROTO_MASK 0x00000400
  465. /* Description RX_MSDU_START_2_IPV6_PROTO
  466. Set if L2 layer indicates IPv6 protocol.
  467. */
  468. #define RX_MSDU_START_2_IPV6_PROTO_OFFSET 0x00000008
  469. #define RX_MSDU_START_2_IPV6_PROTO_LSB 11
  470. #define RX_MSDU_START_2_IPV6_PROTO_MASK 0x00000800
  471. /* Description RX_MSDU_START_2_TCP_PROTO
  472. Set if the ipv4_proto or ipv6_proto are set and the IP
  473. protocol indicates TCP.
  474. */
  475. #define RX_MSDU_START_2_TCP_PROTO_OFFSET 0x00000008
  476. #define RX_MSDU_START_2_TCP_PROTO_LSB 12
  477. #define RX_MSDU_START_2_TCP_PROTO_MASK 0x00001000
  478. /* Description RX_MSDU_START_2_UDP_PROTO
  479. Set if the ipv4_proto or ipv6_proto are set and the IP
  480. protocol indicates UDP.
  481. */
  482. #define RX_MSDU_START_2_UDP_PROTO_OFFSET 0x00000008
  483. #define RX_MSDU_START_2_UDP_PROTO_LSB 13
  484. #define RX_MSDU_START_2_UDP_PROTO_MASK 0x00002000
  485. /* Description RX_MSDU_START_2_IP_FRAG
  486. Indicates that either the IP More frag bit is set or IP
  487. frag number is non-zero. If set indicates that this is a
  488. fragmented IP packet.
  489. */
  490. #define RX_MSDU_START_2_IP_FRAG_OFFSET 0x00000008
  491. #define RX_MSDU_START_2_IP_FRAG_LSB 14
  492. #define RX_MSDU_START_2_IP_FRAG_MASK 0x00004000
  493. /* Description RX_MSDU_START_2_TCP_ONLY_ACK
  494. Set if only the TCP Ack bit is set in the TCP flags and
  495. if the TCP payload is 0.
  496. */
  497. #define RX_MSDU_START_2_TCP_ONLY_ACK_OFFSET 0x00000008
  498. #define RX_MSDU_START_2_TCP_ONLY_ACK_LSB 15
  499. #define RX_MSDU_START_2_TCP_ONLY_ACK_MASK 0x00008000
  500. /* Description RX_MSDU_START_2_DA_IS_BCAST_MCAST
  501. The destination address is broadcast or multicast.
  502. */
  503. #define RX_MSDU_START_2_DA_IS_BCAST_MCAST_OFFSET 0x00000008
  504. #define RX_MSDU_START_2_DA_IS_BCAST_MCAST_LSB 16
  505. #define RX_MSDU_START_2_DA_IS_BCAST_MCAST_MASK 0x00010000
  506. /* Description RX_MSDU_START_2_TOEPLITZ_HASH_SEL
  507. Actual choosen Hash.
  508. 0 -> Toeplitz hash of 2-tuple (IP source address, IP
  509. destination address)1 -> Toeplitz hash of 4-tuple (IP source
  510. address, IP destination address, L4 (TCP/UDP) source port,
  511. L4 (TCP/UDP) destination port)
  512. 2 -> Toeplitz of flow_id
  513. 3 -> Zero is used
  514. <legal all>
  515. */
  516. #define RX_MSDU_START_2_TOEPLITZ_HASH_SEL_OFFSET 0x00000008
  517. #define RX_MSDU_START_2_TOEPLITZ_HASH_SEL_LSB 17
  518. #define RX_MSDU_START_2_TOEPLITZ_HASH_SEL_MASK 0x00060000
  519. /* Description RX_MSDU_START_2_IP_FIXED_HEADER_VALID
  520. Fixed 20-byte IPv4 header or 40-byte IPv6 header parsed
  521. fully within first 256 bytes of the packet
  522. */
  523. #define RX_MSDU_START_2_IP_FIXED_HEADER_VALID_OFFSET 0x00000008
  524. #define RX_MSDU_START_2_IP_FIXED_HEADER_VALID_LSB 19
  525. #define RX_MSDU_START_2_IP_FIXED_HEADER_VALID_MASK 0x00080000
  526. /* Description RX_MSDU_START_2_IP_EXTN_HEADER_VALID
  527. IPv6/IPv6 header, including IPv4 options and
  528. recognizable extension headers parsed fully within first 256
  529. bytes of the packet
  530. */
  531. #define RX_MSDU_START_2_IP_EXTN_HEADER_VALID_OFFSET 0x00000008
  532. #define RX_MSDU_START_2_IP_EXTN_HEADER_VALID_LSB 20
  533. #define RX_MSDU_START_2_IP_EXTN_HEADER_VALID_MASK 0x00100000
  534. /* Description RX_MSDU_START_2_TCP_UDP_HEADER_VALID
  535. Fixed 20-byte TCP (excluding TCP options) or 8-byte UDP
  536. header parsed fully within first 256 bytes of the packet
  537. */
  538. #define RX_MSDU_START_2_TCP_UDP_HEADER_VALID_OFFSET 0x00000008
  539. #define RX_MSDU_START_2_TCP_UDP_HEADER_VALID_LSB 21
  540. #define RX_MSDU_START_2_TCP_UDP_HEADER_VALID_MASK 0x00200000
  541. /* Description RX_MSDU_START_2_MESH_CONTROL_PRESENT
  542. When set, this MSDU includes the 'Mesh Control' field
  543. <legal all>
  544. */
  545. #define RX_MSDU_START_2_MESH_CONTROL_PRESENT_OFFSET 0x00000008
  546. #define RX_MSDU_START_2_MESH_CONTROL_PRESENT_LSB 22
  547. #define RX_MSDU_START_2_MESH_CONTROL_PRESENT_MASK 0x00400000
  548. /* Description RX_MSDU_START_2_RESERVED_2A
  549. <legal 0>
  550. */
  551. #define RX_MSDU_START_2_RESERVED_2A_OFFSET 0x00000008
  552. #define RX_MSDU_START_2_RESERVED_2A_LSB 23
  553. #define RX_MSDU_START_2_RESERVED_2A_MASK 0x00800000
  554. /* Description RX_MSDU_START_2_IP4_PROTOCOL_IP6_NEXT_HEADER
  555. For IPv4 this is the 8 bit protocol field (when
  556. ipv4_proto is set). For IPv6 this is the 8 bit next_header
  557. field (when ipv6_proto is set).
  558. */
  559. #define RX_MSDU_START_2_IP4_PROTOCOL_IP6_NEXT_HEADER_OFFSET 0x00000008
  560. #define RX_MSDU_START_2_IP4_PROTOCOL_IP6_NEXT_HEADER_LSB 24
  561. #define RX_MSDU_START_2_IP4_PROTOCOL_IP6_NEXT_HEADER_MASK 0xff000000
  562. /* Description RX_MSDU_START_3_TOEPLITZ_HASH_2_OR_4
  563. Controlled by RxOLE register - If register bit set to 0,
  564. Toeplitz hash is computed over 2-tuple IPv4 or IPv6 src/dest
  565. addresses; otherwise, toeplitz hash is computed over 4-tuple
  566. IPv4 or IPv6 src/dest addresses and src/dest ports
  567. */
  568. #define RX_MSDU_START_3_TOEPLITZ_HASH_2_OR_4_OFFSET 0x0000000c
  569. #define RX_MSDU_START_3_TOEPLITZ_HASH_2_OR_4_LSB 0
  570. #define RX_MSDU_START_3_TOEPLITZ_HASH_2_OR_4_MASK 0xffffffff
  571. /* Description RX_MSDU_START_4_FLOW_ID_TOEPLITZ
  572. Toeplitz hash of 5-tuple
  573. {IP source address, IP destination address, IP source
  574. port, IP destination port, L4 protocol} in case of
  575. non-IPSec.
  576. In case of IPSec - Toeplitz hash of 4-tuple
  577. {IP source address, IP destination address, SPI, L4
  578. protocol}
  579. The relevant Toeplitz key registers are provided in
  580. RxOLE's instance of common parser module. These registers
  581. are separate from the Toeplitz keys used by ASE/FSE modules
  582. inside RxOLE.The actual value will be passed on from common
  583. parser module to RxOLE in one of the WHO_* TLVs.
  584. <legal all>
  585. */
  586. #define RX_MSDU_START_4_FLOW_ID_TOEPLITZ_OFFSET 0x00000010
  587. #define RX_MSDU_START_4_FLOW_ID_TOEPLITZ_LSB 0
  588. #define RX_MSDU_START_4_FLOW_ID_TOEPLITZ_MASK 0xffffffff
  589. /* Description RX_MSDU_START_5_USER_RSSI
  590. RSSI for this user
  591. <legal all>
  592. */
  593. #define RX_MSDU_START_5_USER_RSSI_OFFSET 0x00000014
  594. #define RX_MSDU_START_5_USER_RSSI_LSB 0
  595. #define RX_MSDU_START_5_USER_RSSI_MASK 0x000000ff
  596. /* Description RX_MSDU_START_5_PKT_TYPE
  597. Packet type:
  598. <enum 0 dot11a>802.11a PPDU type
  599. <enum 1 dot11b>802.11b PPDU type
  600. <enum 2 dot11n_mm>802.11n Mixed Mode PPDU type
  601. <enum 3 dot11ac>802.11ac PPDU type
  602. <enum 4 dot11ax>802.11ax PPDU type
  603. */
  604. #define RX_MSDU_START_5_PKT_TYPE_OFFSET 0x00000014
  605. #define RX_MSDU_START_5_PKT_TYPE_LSB 8
  606. #define RX_MSDU_START_5_PKT_TYPE_MASK 0x00000f00
  607. /* Description RX_MSDU_START_5_STBC
  608. When set, use STBC transmission rates
  609. */
  610. #define RX_MSDU_START_5_STBC_OFFSET 0x00000014
  611. #define RX_MSDU_START_5_STBC_LSB 12
  612. #define RX_MSDU_START_5_STBC_MASK 0x00001000
  613. /* Description RX_MSDU_START_5_SGI
  614. Field only valid when pkt type is HT, VHT or HE.
  615. <enum 0 0_8_us_sgi > Legacy normal GI. Can also be
  616. used for HE
  617. <enum 1 0_4_us_sgi > Legacy short GI. Can also be
  618. used for HE
  619. <enum 2 1_6_us_sgi > HE related GI
  620. <enum 3 3_2_us_sgi > HE related GI
  621. <legal 0 - 3>
  622. */
  623. #define RX_MSDU_START_5_SGI_OFFSET 0x00000014
  624. #define RX_MSDU_START_5_SGI_LSB 13
  625. #define RX_MSDU_START_5_SGI_MASK 0x00006000
  626. /* Description RX_MSDU_START_5_RATE_MCS
  627. For details, refer to MCS_TYPE description
  628. Note: This is rate in case of 11a/11b
  629. <legal all>
  630. */
  631. #define RX_MSDU_START_5_RATE_MCS_OFFSET 0x00000014
  632. #define RX_MSDU_START_5_RATE_MCS_LSB 15
  633. #define RX_MSDU_START_5_RATE_MCS_MASK 0x00078000
  634. /* Description RX_MSDU_START_5_RECEIVE_BANDWIDTH
  635. Full receive Bandwidth
  636. <enum 0 full_rx_bw_20_mhz>
  637. <enum 1 full_rx_bw_40_mhz>
  638. <enum 2 full_rx_bw_80_mhz>
  639. <enum 3 full_rx_bw_160_mhz>
  640. <legal 0-3>
  641. */
  642. #define RX_MSDU_START_5_RECEIVE_BANDWIDTH_OFFSET 0x00000014
  643. #define RX_MSDU_START_5_RECEIVE_BANDWIDTH_LSB 19
  644. #define RX_MSDU_START_5_RECEIVE_BANDWIDTH_MASK 0x00180000
  645. /* Description RX_MSDU_START_5_RECEPTION_TYPE
  646. Indicates what type of reception this is.
  647. <enum 0 reception_type_SU > Basic SU reception (not
  648. part of OFDMA or MIMO)
  649. <enum 1 reception_type_MU_MIMO > This is related to
  650. DL type of reception
  651. <enum 2 reception_type_MU_OFDMA > This is related
  652. to DL type of reception
  653. <enum 3 reception_type_MU_OFDMA_MIMO > This is
  654. related to DL type of reception
  655. <enum 4 reception_type_UL_MU_MIMO > This is related
  656. to UL type of reception
  657. <enum 5 reception_type_UL_MU_OFDMA > This is
  658. related to UL type of reception
  659. <enum 6 reception_type_UL_MU_OFDMA_MIMO > This is
  660. related to UL type of reception
  661. <legal 0-6>
  662. */
  663. #define RX_MSDU_START_5_RECEPTION_TYPE_OFFSET 0x00000014
  664. #define RX_MSDU_START_5_RECEPTION_TYPE_LSB 21
  665. #define RX_MSDU_START_5_RECEPTION_TYPE_MASK 0x00e00000
  666. /* Description RX_MSDU_START_5_MIMO_SS_BITMAP
  667. Field only valid when Reception_type =
  668. reception_type_MU_MIMO or reception_type_MU_OFDMA_MIMO
  669. Bitmap, with each bit indicating if the related spatial
  670. stream is used for this STA
  671. LSB related to SS 0
  672. 0: spatial stream not used for this reception
  673. 1: spatial stream used for this reception
  674. <legal all>
  675. */
  676. #define RX_MSDU_START_5_MIMO_SS_BITMAP_OFFSET 0x00000014
  677. #define RX_MSDU_START_5_MIMO_SS_BITMAP_LSB 24
  678. #define RX_MSDU_START_5_MIMO_SS_BITMAP_MASK 0xff000000
  679. /* Description RX_MSDU_START_6_PPDU_START_TIMESTAMP
  680. Timestamp that indicates when the PPDU that contained
  681. this MPDU started on the medium.
  682. <legal all>
  683. */
  684. #define RX_MSDU_START_6_PPDU_START_TIMESTAMP_OFFSET 0x00000018
  685. #define RX_MSDU_START_6_PPDU_START_TIMESTAMP_LSB 0
  686. #define RX_MSDU_START_6_PPDU_START_TIMESTAMP_MASK 0xffffffff
  687. /* Description RX_MSDU_START_7_SW_PHY_META_DATA
  688. SW programmed Meta data provided by the PHY.
  689. Can be used for SW to indicate the channel the device is
  690. on.
  691. <legal all>
  692. */
  693. #define RX_MSDU_START_7_SW_PHY_META_DATA_OFFSET 0x0000001c
  694. #define RX_MSDU_START_7_SW_PHY_META_DATA_LSB 0
  695. #define RX_MSDU_START_7_SW_PHY_META_DATA_MASK 0xffffffff
  696. #endif // _RX_MSDU_START_H_