hal_rx.h 83 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966
  1. /*
  2. * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for
  6. * any purpose with or without fee is hereby granted, provided that the
  7. * above copyright notice and this permission notice appear in all
  8. * copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  11. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  12. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  13. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  14. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  15. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  16. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  17. * PERFORMANCE OF THIS SOFTWARE.
  18. */
  19. #ifndef _HAL_RX_H_
  20. #define _HAL_RX_H_
  21. #include <hal_api.h>
  22. #include "hal_rx_hw_defines.h"
  23. #include "hal_hw_headers.h"
  24. /*************************************
  25. * Ring desc offset/shift/masks
  26. *************************************/
  27. #define HAL_INVALID_PPDU_ID 0xFFFFFFFF
  28. #define HAL_RX_OFFSET(block, field) block##_##field##_OFFSET
  29. #define HAL_RX_LSB(block, field) block##_##field##_LSB
  30. #define HAL_RX_MASK(block, field) block##_##field##_MASK
  31. #define HAL_RX_GET(_ptr, block, field) \
  32. (((*((volatile uint32_t *)_ptr + (HAL_RX_OFFSET(block, field)>>2))) & \
  33. HAL_RX_MASK(block, field)) >> \
  34. HAL_RX_LSB(block, field))
  35. #define HAL_RX_GET_64(_ptr, block, field) \
  36. (((*((volatile uint64_t *)(_ptr) + \
  37. (HAL_RX_OFFSET(block, field) >> 3))) & \
  38. HAL_RX_MASK(block, field)) >> \
  39. HAL_RX_LSB(block, field))
  40. #define HAL_RX_FLD_SET(_ptr, _wrd, _field, _val) \
  41. (*(uint32_t *)(((uint8_t *)_ptr) + \
  42. _wrd ## _ ## _field ## _OFFSET) |= \
  43. (((_val) << _wrd ## _ ## _field ## _LSB) & \
  44. _wrd ## _ ## _field ## _MASK))
  45. /* BUFFER_SIZE = 1536 data bytes + 384 RX TLV bytes + some spare bytes */
  46. #ifndef RX_DATA_BUFFER_SIZE
  47. #define RX_DATA_BUFFER_SIZE 2048
  48. #endif
  49. #ifndef RX_MONITOR_BUFFER_SIZE
  50. #define RX_MONITOR_BUFFER_SIZE 2048
  51. #endif
  52. #define RXDMA_OPTIMIZATION
  53. /* MONITOR STATUS BUFFER SIZE = 1408 data bytes, buffer allocation of 2k bytes
  54. * including buffer reservation, buffer alignment and skb shared info size.
  55. */
  56. #define RX_MON_STATUS_BASE_BUF_SIZE 2048
  57. #define RX_MON_STATUS_BUF_ALIGN 128
  58. #define RX_MON_STATUS_BUF_RESERVATION 128
  59. #define RX_MON_STATUS_BUF_SIZE (RX_MON_STATUS_BASE_BUF_SIZE - \
  60. (RX_MON_STATUS_BUF_RESERVATION + \
  61. RX_MON_STATUS_BUF_ALIGN + QDF_SHINFO_SIZE))
  62. #define NUM_OF_DWORDS_BUFFER_ADDR_INFO 2
  63. /* HAL_RX_NON_QOS_TID = NON_QOS_TID which is 16 */
  64. #define HAL_RX_NON_QOS_TID 16
  65. enum {
  66. HAL_HW_RX_DECAP_FORMAT_RAW = 0,
  67. HAL_HW_RX_DECAP_FORMAT_NWIFI,
  68. HAL_HW_RX_DECAP_FORMAT_ETH2,
  69. HAL_HW_RX_DECAP_FORMAT_8023,
  70. };
  71. /**
  72. * struct hal_wbm_err_desc_info: structure to hold wbm error codes and reasons
  73. *
  74. * @reo_psh_rsn: REO push reason
  75. * @reo_err_code: REO Error code
  76. * @rxdma_psh_rsn: RXDMA push reason
  77. * @rxdma_err_code: RXDMA Error code
  78. * @reserved_1: Reserved bits
  79. * @wbm_err_src: WBM error source
  80. * @pool_id: pool ID, indicates which rxdma pool
  81. * @reserved_2: Reserved bits
  82. */
  83. struct hal_wbm_err_desc_info {
  84. uint16_t reo_psh_rsn:2,
  85. reo_err_code:5,
  86. rxdma_psh_rsn:2,
  87. rxdma_err_code:5,
  88. reserved_1:2;
  89. uint8_t wbm_err_src:3,
  90. pool_id:2,
  91. msdu_continued:1,
  92. reserved_2:2;
  93. };
  94. /**
  95. * hal_rx_mon_dest_buf_info: Structure to hold rx mon dest buffer info
  96. * @first_buffer: First buffer of MSDU
  97. * @last_buffer: Last buffer of MSDU
  98. * @is_decap_raw: Is RAW Frame
  99. * @reserved_1: Reserved
  100. *
  101. * MSDU with continuation:
  102. * -----------------------------------------------------------
  103. * | first_buffer:1 | first_buffer: 0 | ... | first_buffer: 0 |
  104. * | last_buffer :0 | last_buffer : 0 | ... | last_buffer : 0 |
  105. * | is_decap_raw:1/0 | Same as earlier | Same as earlier|
  106. * -----------------------------------------------------------
  107. *
  108. * Single buffer MSDU:
  109. * ------------------
  110. * | first_buffer:1 |
  111. * | last_buffer :1 |
  112. * | is_decap_raw:1/0 |
  113. * ------------------
  114. */
  115. struct hal_rx_mon_dest_buf_info {
  116. uint8_t first_buffer:1,
  117. last_buffer:1,
  118. is_decap_raw:1,
  119. reserved_1:5;
  120. };
  121. /**
  122. * struct hal_rx_msdu_metadata:Structure to hold rx fast path information.
  123. *
  124. * @l3_hdr_pad: l3 header padding
  125. * @reserved: Reserved bits
  126. * @sa_sw_peer_id: sa sw peer id
  127. * @sa_idx: sa index
  128. * @da_idx: da index
  129. */
  130. struct hal_rx_msdu_metadata {
  131. uint32_t l3_hdr_pad:16,
  132. sa_sw_peer_id:16;
  133. uint32_t sa_idx:16,
  134. da_idx:16;
  135. };
  136. struct hal_proto_params {
  137. uint8_t tcp_proto;
  138. uint8_t udp_proto;
  139. uint8_t ipv6_proto;
  140. };
  141. /**
  142. * enum hal_reo_error_code: Enum which encapsulates "reo_push_reason"
  143. *
  144. * @ HAL_REO_ERROR_DETECTED: Packets arrived because of an error detected
  145. * @ HAL_REO_ROUTING_INSTRUCTION: Packets arrived because of REO routing
  146. */
  147. enum hal_reo_error_status {
  148. HAL_REO_ERROR_DETECTED = 0,
  149. HAL_REO_ROUTING_INSTRUCTION = 1,
  150. };
  151. /**
  152. * @msdu_flags: [0] first_msdu_in_mpdu
  153. * [1] last_msdu_in_mpdu
  154. * [2] msdu_continuation - MSDU spread across buffers
  155. * [23] sa_is_valid - SA match in peer table
  156. * [24] sa_idx_timeout - Timeout while searching for SA match
  157. * [25] da_is_valid - Used to identtify intra-bss forwarding
  158. * [26] da_is_MCBC
  159. * [27] da_idx_timeout - Timeout while searching for DA match
  160. *
  161. */
  162. struct hal_rx_msdu_desc_info {
  163. uint32_t msdu_flags;
  164. uint16_t msdu_len; /* 14 bits for length */
  165. };
  166. /**
  167. * enum hal_rx_msdu_desc_flags: Enum for flags in MSDU_DESC_INFO
  168. *
  169. * @ HAL_MSDU_F_FIRST_MSDU_IN_MPDU: First MSDU in MPDU
  170. * @ HAL_MSDU_F_LAST_MSDU_IN_MPDU: Last MSDU in MPDU
  171. * @ HAL_MSDU_F_MSDU_CONTINUATION: MSDU continuation
  172. * @ HAL_MSDU_F_SA_IS_VALID: Found match for SA in AST
  173. * @ HAL_MSDU_F_SA_IDX_TIMEOUT: AST search for SA timed out
  174. * @ HAL_MSDU_F_DA_IS_VALID: Found match for DA in AST
  175. * @ HAL_MSDU_F_DA_IS_MCBC: DA is MC/BC address
  176. * @ HAL_MSDU_F_DA_IDX_TIMEOUT: AST search for DA timed out
  177. * @ HAL_MSDU_F_INTRA_BSS: This is an intrabss packet
  178. */
  179. enum hal_rx_msdu_desc_flags {
  180. HAL_MSDU_F_FIRST_MSDU_IN_MPDU = (0x1 << 0),
  181. HAL_MSDU_F_LAST_MSDU_IN_MPDU = (0x1 << 1),
  182. HAL_MSDU_F_MSDU_CONTINUATION = (0x1 << 2),
  183. HAL_MSDU_F_SA_IS_VALID = (0x1 << 23),
  184. HAL_MSDU_F_SA_IDX_TIMEOUT = (0x1 << 24),
  185. HAL_MSDU_F_DA_IS_VALID = (0x1 << 25),
  186. HAL_MSDU_F_DA_IS_MCBC = (0x1 << 26),
  187. HAL_MSDU_F_DA_IDX_TIMEOUT = (0x1 << 27),
  188. HAL_MSDU_F_INTRA_BSS = (0x1 << 28),
  189. };
  190. /*
  191. * @msdu_count: no. of msdus in the MPDU
  192. * @mpdu_seq: MPDU sequence number
  193. * @mpdu_flags [0] Fragment flag
  194. * [1] MPDU_retry_bit
  195. * [2] AMPDU flag
  196. * [3] raw_ampdu
  197. * @peer_meta_data: Upper bits containing peer id, vdev id
  198. * @bar_frame: indicates if received frame is a bar frame
  199. * @tid: tid value of received MPDU
  200. */
  201. struct hal_rx_mpdu_desc_info {
  202. uint16_t msdu_count;
  203. uint16_t mpdu_seq; /* 12 bits for length */
  204. uint32_t mpdu_flags;
  205. uint32_t peer_meta_data; /* sw progamed meta-data:MAC Id & peer Id */
  206. uint16_t bar_frame;
  207. uint8_t tid:4,
  208. reserved:4;
  209. };
  210. /**
  211. * enum hal_rx_mpdu_desc_flags: Enum for flags in MPDU_DESC_INFO
  212. *
  213. * @ HAL_MPDU_F_FRAGMENT: Fragmented MPDU (802.11 fragemtation)
  214. * @ HAL_MPDU_F_RETRY_BIT: Retry bit is set in FC of MPDU
  215. * @ HAL_MPDU_F_AMPDU_FLAG: MPDU received as part of A-MPDU
  216. * @ HAL_MPDU_F_RAW_AMPDU: MPDU is a Raw MDPU
  217. * @ HAL_MPDU_F_QOS_CONTROL_VALID: MPDU has a QoS control field
  218. */
  219. enum hal_rx_mpdu_desc_flags {
  220. HAL_MPDU_F_FRAGMENT = (0x1 << 20),
  221. HAL_MPDU_F_RETRY_BIT = (0x1 << 21),
  222. HAL_MPDU_F_AMPDU_FLAG = (0x1 << 22),
  223. HAL_MPDU_F_RAW_AMPDU = (0x1 << 30),
  224. HAL_MPDU_F_QOS_CONTROL_VALID = (0x1 << 31)
  225. };
  226. /* Return Buffer manager ID */
  227. #define HAL_RX_BUF_RBM_WBM_IDLE_BUF_LIST 0
  228. #define HAL_RX_BUF_RBM_WBM_CHIP0_IDLE_DESC_LIST 1
  229. #define HAL_RX_BUF_RBM_WBM_CHIP1_IDLE_DESC_LIST 2
  230. #define HAL_RX_BUF_RBM_WBM_CHIP2_IDLE_DESC_LIST 3
  231. #define HAL_RX_BUF_RBM_SW0_BM(sw0_bm_id) (sw0_bm_id)
  232. #define HAL_RX_BUF_RBM_SW1_BM(sw0_bm_id) (sw0_bm_id + 1)
  233. #define HAL_RX_BUF_RBM_SW2_BM(sw0_bm_id) (sw0_bm_id + 2)
  234. #define HAL_RX_BUF_RBM_SW3_BM(sw0_bm_id) (sw0_bm_id + 3)
  235. #define HAL_RX_BUF_RBM_SW4_BM(sw0_bm_id) (sw0_bm_id + 4)
  236. #define HAL_RX_BUF_RBM_SW5_BM(sw0_bm_id) (sw0_bm_id + 5)
  237. #define HAL_RX_BUF_RBM_SW6_BM(sw0_bm_id) (sw0_bm_id + 6)
  238. #define HAL_RX_BUF_RBM_SW_BM(sw0_bm_id, wbm2sw_id) (sw0_bm_id + wbm2sw_id)
  239. #define HAL_REO_DESTINATION_RING_MSDU_COUNT_OFFSET 0x8
  240. #define HAL_REO_DESTINATION_RING_MSDU_COUNT_LSB 0
  241. #define HAL_REO_DESTINATION_RING_MSDU_COUNT_MASK 0x000000ff
  242. #define HAL_RX_REO_DESC_MSDU_COUNT_GET(reo_desc) \
  243. (_HAL_MS((*_OFFSET_TO_WORD_PTR(reo_desc, \
  244. HAL_REO_DESTINATION_RING_MSDU_COUNT_OFFSET)), \
  245. HAL_REO_DESTINATION_RING_MSDU_COUNT_MASK, \
  246. HAL_REO_DESTINATION_RING_MSDU_COUNT_LSB))
  247. #define HAL_BUFFER_ADDR_INFO_BUFFER_ADDR_31_0_OFFSET 0x0
  248. #define HAL_BUFFER_ADDR_INFO_BUFFER_ADDR_31_0_LSB 0
  249. #define HAL_BUFFER_ADDR_INFO_BUFFER_ADDR_31_0_MASK 0xffffffff
  250. #define HAL_BUFFER_ADDR_INFO_BUFFER_ADDR_39_32_OFFSET 0x4
  251. #define HAL_BUFFER_ADDR_INFO_BUFFER_ADDR_39_32_LSB 0
  252. #define HAL_BUFFER_ADDR_INFO_BUFFER_ADDR_39_32_MASK 0x000000ff
  253. /*
  254. * macro to set the LSW of the nbuf data physical address
  255. * to the rxdma ring entry
  256. */
  257. #define HAL_RXDMA_PADDR_LO_SET(buff_addr_info, paddr_lo) \
  258. ((*(((unsigned int *) buff_addr_info) + \
  259. (HAL_BUFFER_ADDR_INFO_BUFFER_ADDR_31_0_OFFSET >> 2))) = \
  260. (paddr_lo << HAL_BUFFER_ADDR_INFO_BUFFER_ADDR_31_0_LSB) & \
  261. HAL_BUFFER_ADDR_INFO_BUFFER_ADDR_31_0_MASK)
  262. /*
  263. * macro to set the LSB of MSW of the nbuf data physical address
  264. * to the rxdma ring entry
  265. */
  266. #define HAL_RXDMA_PADDR_HI_SET(buff_addr_info, paddr_hi) \
  267. ((*(((unsigned int *) buff_addr_info) + \
  268. (HAL_BUFFER_ADDR_INFO_BUFFER_ADDR_39_32_OFFSET >> 2))) = \
  269. (paddr_hi << HAL_BUFFER_ADDR_INFO_BUFFER_ADDR_39_32_LSB) & \
  270. HAL_BUFFER_ADDR_INFO_BUFFER_ADDR_39_32_MASK)
  271. #ifdef DP_RX_DESC_COOKIE_INVALIDATE
  272. #define HAL_RX_COOKIE_INVALID_MASK 0x80000000
  273. /*
  274. * macro to get the invalid bit for sw cookie
  275. */
  276. #define HAL_RX_BUF_COOKIE_INVALID_GET(buff_addr_info) \
  277. ((*(((unsigned int *)buff_addr_info) + \
  278. (BUFFER_ADDR_INFO_1_SW_BUFFER_COOKIE_OFFSET >> 2))) & \
  279. HAL_RX_COOKIE_INVALID_MASK)
  280. /*
  281. * macro to set the invalid bit for sw cookie
  282. */
  283. #define HAL_RX_BUF_COOKIE_INVALID_SET(buff_addr_info) \
  284. ((*(((unsigned int *)buff_addr_info) + \
  285. (BUFFER_ADDR_INFO_1_SW_BUFFER_COOKIE_OFFSET >> 2))) |= \
  286. HAL_RX_COOKIE_INVALID_MASK)
  287. /*
  288. * macro to reset the invalid bit for sw cookie
  289. */
  290. #define HAL_RX_BUF_COOKIE_INVALID_RESET(buff_addr_info) \
  291. ((*(((unsigned int *)buff_addr_info) + \
  292. (BUFFER_ADDR_INFO_1_SW_BUFFER_COOKIE_OFFSET >> 2))) &= \
  293. ~HAL_RX_COOKIE_INVALID_MASK)
  294. #define HAL_RX_REO_BUF_COOKIE_INVALID_GET(reo_desc) \
  295. (HAL_RX_BUF_COOKIE_INVALID_GET(& \
  296. (((struct reo_destination_ring *) \
  297. reo_desc)->buf_or_link_desc_addr_info)))
  298. #define HAL_RX_REO_BUF_COOKIE_INVALID_SET(reo_desc) \
  299. (HAL_RX_BUF_COOKIE_INVALID_SET(& \
  300. (((struct reo_destination_ring *) \
  301. reo_desc)->buf_or_link_desc_addr_info)))
  302. #define HAL_RX_LINK_COOKIE_INVALID_MASK 0x40000000
  303. #define HAL_RX_BUF_LINK_COOKIE_INVALID_GET(buff_addr_info) \
  304. ((*(((unsigned int *)buff_addr_info) + \
  305. (BUFFER_ADDR_INFO_1_SW_BUFFER_COOKIE_OFFSET >> 2))) & \
  306. HAL_RX_LINK_COOKIE_INVALID_MASK)
  307. #define HAL_RX_BUF_LINK_COOKIE_INVALID_SET(buff_addr_info) \
  308. ((*(((unsigned int *)buff_addr_info) + \
  309. (BUFFER_ADDR_INFO_1_SW_BUFFER_COOKIE_OFFSET >> 2))) |= \
  310. HAL_RX_LINK_COOKIE_INVALID_MASK)
  311. #define HAL_RX_REO_BUF_LINK_COOKIE_INVALID_GET(reo_desc) \
  312. (HAL_RX_BUF_LINK_COOKIE_INVALID_GET(& \
  313. (((struct reo_destination_ring *) \
  314. reo_desc)->buf_or_link_desc_addr_info)))
  315. #define HAL_RX_REO_BUF_LINK_COOKIE_INVALID_SET(reo_desc) \
  316. (HAL_RX_BUF_LINK_COOKIE_INVALID_SET(& \
  317. (((struct reo_destination_ring *) \
  318. reo_desc)->buf_or_link_desc_addr_info)))
  319. #endif
  320. /* TODO: Convert the following structure fields accesseses to offsets */
  321. #define HAL_RX_REO_BUFFER_ADDR_39_32_GET(reo_desc) \
  322. (HAL_RX_BUFFER_ADDR_39_32_GET(& \
  323. (((struct reo_destination_ring *) \
  324. reo_desc)->buf_or_link_desc_addr_info)))
  325. #define HAL_RX_REO_BUFFER_ADDR_31_0_GET(reo_desc) \
  326. (HAL_RX_BUFFER_ADDR_31_0_GET(& \
  327. (((struct reo_destination_ring *) \
  328. reo_desc)->buf_or_link_desc_addr_info)))
  329. #define HAL_RX_REO_BUF_COOKIE_INVALID_RESET(reo_desc) \
  330. (HAL_RX_BUF_COOKIE_INVALID_RESET(& \
  331. (((struct reo_destination_ring *) \
  332. reo_desc)->buf_or_link_desc_addr_info)))
  333. #define HAL_RX_UNIFORM_HDR_SET(_rx_msdu_link, _field, _val) \
  334. HAL_RX_FLD_SET(_rx_msdu_link, HAL_UNIFORM_DESCRIPTOR_HEADER, \
  335. _field, _val)
  336. #define HAL_BUFFER_ADDR_INFO_BUFFER_ADDR_31_0_OFFSET 0x0
  337. #define HAL_BUFFER_ADDR_INFO_BUFFER_ADDR_31_0_LSB 0
  338. #define HAL_BUFFER_ADDR_INFO_BUFFER_ADDR_31_0_MASK 0xffffffff
  339. #define HAL_RX_BUFFER_ADDR_31_0_GET(buff_addr_info) \
  340. (_HAL_MS((*_OFFSET_TO_WORD_PTR(buff_addr_info, \
  341. HAL_BUFFER_ADDR_INFO_BUFFER_ADDR_31_0_OFFSET)), \
  342. HAL_BUFFER_ADDR_INFO_BUFFER_ADDR_31_0_MASK, \
  343. HAL_BUFFER_ADDR_INFO_BUFFER_ADDR_31_0_LSB))
  344. #define HAL_RX_BUFFER_ADDR_39_32_GET(buff_addr_info) \
  345. (_HAL_MS((*_OFFSET_TO_WORD_PTR(buff_addr_info, \
  346. HAL_BUFFER_ADDR_INFO_BUFFER_ADDR_39_32_OFFSET)), \
  347. HAL_BUFFER_ADDR_INFO_BUFFER_ADDR_39_32_MASK, \
  348. HAL_BUFFER_ADDR_INFO_BUFFER_ADDR_39_32_LSB))
  349. #define HAL_RX_MSDU_DESC_INFO_FIRST_MSDU_IN_MPDU_FLAG_OFFSET 0x0
  350. #define HAL_RX_MSDU_DESC_INFO_FIRST_MSDU_IN_MPDU_FLAG_LSB 0
  351. #define HAL_RX_MSDU_DESC_INFO_FIRST_MSDU_IN_MPDU_FLAG_MASK 0x00000001
  352. #define HAL_RX_MSDU_DESC_INFO_LAST_MSDU_IN_MPDU_FLAG_OFFSET 0x0
  353. #define HAL_RX_MSDU_DESC_INFO_LAST_MSDU_IN_MPDU_FLAG_LSB 1
  354. #define HAL_RX_MSDU_DESC_INFO_LAST_MSDU_IN_MPDU_FLAG_MASK 0x00000002
  355. #define HAL_RX_FIRST_MSDU_IN_MPDU_FLAG_SET(msdu_info_ptr, val) \
  356. ((*_OFFSET_TO_WORD_PTR(msdu_info_ptr, \
  357. HAL_RX_MSDU_DESC_INFO_FIRST_MSDU_IN_MPDU_FLAG_OFFSET)) |= \
  358. (val << HAL_RX_MSDU_DESC_INFO_FIRST_MSDU_IN_MPDU_FLAG_LSB) & \
  359. HAL_RX_MSDU_DESC_INFO_FIRST_MSDU_IN_MPDU_FLAG_MASK)
  360. #define HAL_RX_LAST_MSDU_IN_MPDU_FLAG_SET(msdu_info_ptr, val) \
  361. ((*_OFFSET_TO_WORD_PTR(msdu_info_ptr, \
  362. HAL_RX_MSDU_DESC_INFO_LAST_MSDU_IN_MPDU_FLAG_OFFSET)) |= \
  363. (val << HAL_RX_MSDU_DESC_INFO_LAST_MSDU_IN_MPDU_FLAG_LSB) & \
  364. HAL_RX_MSDU_DESC_INFO_LAST_MSDU_IN_MPDU_FLAG_MASK)
  365. #define HAL_RX_FIRST_MSDU_IN_MPDU_FLAG_GET(msdu_info_ptr) \
  366. ((*_OFFSET_TO_WORD_PTR(msdu_info_ptr, \
  367. HAL_RX_MSDU_DESC_INFO_FIRST_MSDU_IN_MPDU_FLAG_OFFSET)) & \
  368. HAL_RX_MSDU_DESC_INFO_FIRST_MSDU_IN_MPDU_FLAG_MASK)
  369. #define HAL_RX_LAST_MSDU_IN_MPDU_FLAG_GET(msdu_info_ptr) \
  370. ((*_OFFSET_TO_WORD_PTR(msdu_info_ptr, \
  371. HAL_RX_MSDU_DESC_INFO_LAST_MSDU_IN_MPDU_FLAG_OFFSET)) & \
  372. HAL_RX_MSDU_DESC_INFO_LAST_MSDU_IN_MPDU_FLAG_MASK)
  373. #define HAL_RX_MSDU_DESC_INFO_MSDU_LENGTH_OFFSET 0x0
  374. #define HAL_RX_MSDU_DESC_INFO_MSDU_LENGTH_LSB 3
  375. #define HAL_RX_MSDU_DESC_INFO_MSDU_LENGTH_MASK 0x0001fff8
  376. #define HAL_RX_MSDU_PKT_LENGTH_GET(msdu_info_ptr) \
  377. (_HAL_MS((*_OFFSET_TO_WORD_PTR(msdu_info_ptr, \
  378. HAL_RX_MSDU_DESC_INFO_MSDU_LENGTH_OFFSET)), \
  379. HAL_RX_MSDU_DESC_INFO_MSDU_LENGTH_MASK, \
  380. HAL_RX_MSDU_DESC_INFO_MSDU_LENGTH_LSB))
  381. static inline uint32_t
  382. hal_rx_msdu_flags_get(hal_soc_handle_t hal_soc_hdl,
  383. rx_msdu_desc_info_t msdu_desc_info_hdl)
  384. {
  385. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  386. return hal_soc->ops->hal_rx_msdu_flags_get(msdu_desc_info_hdl);
  387. }
  388. /*
  389. * Structures & Macros to obtain fields from the TLV's in the Rx packet
  390. * pre-header.
  391. */
  392. static inline uint8_t *hal_rx_desc_get_80211_hdr(hal_soc_handle_t hal_soc_hdl,
  393. void *hw_desc_addr)
  394. {
  395. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  396. return hal_soc->ops->hal_rx_desc_get_80211_hdr(hw_desc_addr);
  397. }
  398. /**
  399. * hal_rx_mpdu_desc_info_get() - Get MDPU desc info params
  400. * @hal_soc_hdl: hal soc handle
  401. * @desc_addr: ring descriptor
  402. * @mpdu_desc_info: Buffer to fill the mpdu desc info params
  403. *
  404. * Return: None
  405. */
  406. static inline void
  407. hal_rx_mpdu_desc_info_get(hal_soc_handle_t hal_soc_hdl, void *desc_addr,
  408. struct hal_rx_mpdu_desc_info *mpdu_desc_info)
  409. {
  410. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  411. return hal_soc->ops->hal_rx_mpdu_desc_info_get(desc_addr,
  412. mpdu_desc_info);
  413. }
  414. #define HAL_RX_NUM_MSDU_DESC 6
  415. #define HAL_RX_MAX_SAVED_RING_DESC 16
  416. /* TODO: rework the structure */
  417. struct hal_rx_msdu_list {
  418. struct hal_rx_msdu_desc_info msdu_info[HAL_RX_NUM_MSDU_DESC];
  419. uint32_t sw_cookie[HAL_RX_NUM_MSDU_DESC];
  420. uint8_t rbm[HAL_RX_NUM_MSDU_DESC];
  421. /* physical address of the msdu */
  422. uint64_t paddr[HAL_RX_NUM_MSDU_DESC];
  423. };
  424. struct hal_buf_info {
  425. uint64_t paddr;
  426. uint32_t sw_cookie;
  427. uint8_t rbm;
  428. };
  429. /* This special cookie value will be used to indicate FW allocated buffers
  430. * received through RXDMA2SW ring for RXDMA WARs
  431. */
  432. #define HAL_RX_COOKIE_SPECIAL 0x1fffff
  433. /**
  434. * enum hal_reo_error_code: Indicates that type of buffer or descriptor
  435. *
  436. * @ HAL_RX_MSDU_BUF_ADDR_TYPE : Reo buffer address points to the MSDU buffer
  437. * @ HAL_RX_MSDU_LINK_DESC_TYPE: Reo buffer address points to the link
  438. * descriptor
  439. */
  440. enum hal_rx_reo_buf_type {
  441. HAL_RX_REO_MSDU_BUF_ADDR_TYPE = 0,
  442. HAL_RX_REO_MSDU_LINK_DESC_TYPE,
  443. };
  444. /**
  445. * enum hal_reo_error_code: Error code describing the type of error detected
  446. *
  447. * @ HAL_REO_ERR_QUEUE_DESC_ADDR_0 : Reo queue descriptor provided in the
  448. * REO_ENTRANCE ring is set to 0
  449. * @ HAL_REO_ERR_QUEUE_DESC_INVALID: Reo queue descriptor valid bit is NOT set
  450. * @ HAL_REO_ERR_AMPDU_IN_NON_BA : AMPDU frame received without BA session
  451. * having been setup
  452. * @ HAL_REO_ERR_NON_BA_DUPLICATE : Non-BA session, SN equal to SSN,
  453. * Retry bit set: duplicate frame
  454. * @ HAL_REO_ERR_BA_DUPLICATE : BA session, duplicate frame
  455. * @ HAL_REO_ERR_REGULAR_FRAME_2K_JUMP : A normal (management/data frame)
  456. * received with 2K jump in SN
  457. * @ HAL_REO_ERR_BAR_FRAME_2K_JUMP : A bar received with 2K jump in SSN
  458. * @ HAL_REO_ERR_REGULAR_FRAME_OOR : A normal (management/data frame) received
  459. * with SN falling within the OOR window
  460. * @ HAL_REO_ERR_BAR_FRAME_OOR : A bar received with SSN falling within the
  461. * OOR window
  462. * @ HAL_REO_ERR_BAR_FRAME_NO_BA_SESSION : A bar received without a BA session
  463. * @ HAL_REO_ERR_BAR_FRAME_SN_EQUALS_SSN : A bar received with SSN equal to SN
  464. * @ HAL_REO_ERR_PN_CHECK_FAILED : PN Check Failed packet
  465. * @ HAL_REO_ERR_2K_ERROR_HANDLING_FLAG_SET : Frame is forwarded as a result
  466. * of the Seq_2k_error_detected_flag been set in the REO Queue descriptor
  467. * @ HAL_REO_ERR_PN_ERROR_HANDLING_FLAG_SET : Frame is forwarded as a result
  468. * of the pn_error_detected_flag been set in the REO Queue descriptor
  469. * @ HAL_REO_ERR_QUEUE_DESC_BLOCKED_SET : Frame is forwarded as a result of
  470. * the queue descriptor(address) being blocked as SW/FW seems to be currently
  471. * in the process of making updates to this descriptor
  472. */
  473. enum hal_reo_error_code {
  474. HAL_REO_ERR_QUEUE_DESC_ADDR_0 = 0,
  475. HAL_REO_ERR_QUEUE_DESC_INVALID,
  476. HAL_REO_ERR_AMPDU_IN_NON_BA,
  477. HAL_REO_ERR_NON_BA_DUPLICATE,
  478. HAL_REO_ERR_BA_DUPLICATE,
  479. HAL_REO_ERR_REGULAR_FRAME_2K_JUMP,
  480. HAL_REO_ERR_BAR_FRAME_2K_JUMP,
  481. HAL_REO_ERR_REGULAR_FRAME_OOR,
  482. HAL_REO_ERR_BAR_FRAME_OOR,
  483. HAL_REO_ERR_BAR_FRAME_NO_BA_SESSION,
  484. HAL_REO_ERR_BAR_FRAME_SN_EQUALS_SSN,
  485. HAL_REO_ERR_PN_CHECK_FAILED,
  486. HAL_REO_ERR_2K_ERROR_HANDLING_FLAG_SET,
  487. HAL_REO_ERR_PN_ERROR_HANDLING_FLAG_SET,
  488. HAL_REO_ERR_QUEUE_DESC_BLOCKED_SET,
  489. HAL_REO_ERR_MAX
  490. };
  491. /**
  492. * enum hal_rxdma_error_code: Code describing the type of RxDMA error detected
  493. *
  494. * @HAL_RXDMA_ERR_OVERFLOW: MPDU frame is not complete due to a FIFO overflow
  495. * @ HAL_RXDMA_ERR_OVERFLOW : MPDU frame is not complete due to a FIFO
  496. * overflow
  497. * @ HAL_RXDMA_ERR_MPDU_LENGTH : MPDU frame is not complete due to receiving
  498. * incomplete
  499. * MPDU from the PHY
  500. * @ HAL_RXDMA_ERR_FCS : FCS check on the MPDU frame failed
  501. * @ HAL_RXDMA_ERR_DECRYPT : Decryption error
  502. * @ HAL_RXDMA_ERR_TKIP_MIC : TKIP MIC error
  503. * @ HAL_RXDMA_ERR_UNENCRYPTED : Received a frame that was expected to be
  504. * encrypted but wasn’t
  505. * @ HAL_RXDMA_ERR_MSDU_LEN : MSDU related length error
  506. * @ HAL_RXDMA_ERR_MSDU_LIMIT : Number of MSDUs in the MPDUs exceeded
  507. * the max allowed
  508. * @ HAL_RXDMA_ERR_WIFI_PARSE : wifi parsing error
  509. * @ HAL_RXDMA_ERR_AMSDU_PARSE : Amsdu parsing error
  510. * @ HAL_RXDMA_ERR_SA_TIMEOUT : Source Address search timeout
  511. * @ HAL_RXDMA_ERR_DA_TIMEOUT : Destination Address search timeout
  512. * @ HAL_RXDMA_ERR_FLOW_TIMEOUT : Flow Search Timeout
  513. * @ HAL_RXDMA_ERR_FLUSH_REQUEST : RxDMA FIFO Flush request
  514. * @ HAL_RXDMA_AMSDU_FRAGMENT : Rx PCU reported A-MSDU
  515. * present as well as a fragmented MPDU
  516. * @ HAL_RXDMA_MULTICAST_ECHO : RX OLE reported a multicast echo
  517. * @ HAL_RXDMA_AMSDU_ADDR_MISMATCH : RX OLE reported AMSDU address mismatch
  518. * @ HAL_RXDMA_UNAUTHORIZED_WDS : RX PCU reported unauthorized wds
  519. * @ HAL_RXDMA_GROUPCAST_AMSDU_OR_WDS :RX PCU reported group cast AMSDU or WDS
  520. * @ HAL_RXDMA_ERR_WAR : RxDMA WAR dummy errors
  521. */
  522. enum hal_rxdma_error_code {
  523. HAL_RXDMA_ERR_OVERFLOW = 0,
  524. HAL_RXDMA_ERR_MPDU_LENGTH,
  525. HAL_RXDMA_ERR_FCS,
  526. HAL_RXDMA_ERR_DECRYPT,
  527. HAL_RXDMA_ERR_TKIP_MIC,
  528. HAL_RXDMA_ERR_UNENCRYPTED,
  529. HAL_RXDMA_ERR_MSDU_LEN,
  530. HAL_RXDMA_ERR_MSDU_LIMIT,
  531. HAL_RXDMA_ERR_WIFI_PARSE,
  532. HAL_RXDMA_ERR_AMSDU_PARSE,
  533. HAL_RXDMA_ERR_SA_TIMEOUT,
  534. HAL_RXDMA_ERR_DA_TIMEOUT,
  535. HAL_RXDMA_ERR_FLOW_TIMEOUT,
  536. HAL_RXDMA_ERR_FLUSH_REQUEST,
  537. HAL_RXDMA_AMSDU_FRAGMENT,
  538. HAL_RXDMA_MULTICAST_ECHO,
  539. HAL_RXDMA_AMSDU_ADDR_MISMATCH,
  540. HAL_RXDMA_UNAUTHORIZED_WDS,
  541. HAL_RXDMA_GROUPCAST_AMSDU_OR_WDS,
  542. HAL_RXDMA_ERR_WAR = 31,
  543. HAL_RXDMA_ERR_MAX
  544. };
  545. /**
  546. * HW BM action settings in WBM release ring
  547. */
  548. #define HAL_BM_ACTION_PUT_IN_IDLE_LIST 0
  549. #define HAL_BM_ACTION_RELEASE_MSDU_LIST 1
  550. /**
  551. * enum hal_rx_wbm_error_source: Indicates which module initiated the
  552. * release of this buffer or descriptor
  553. *
  554. * @ HAL_RX_WBM_ERR_SRC_TQM : TQM released this buffer or descriptor
  555. * @ HAL_RX_WBM_ERR_SRC_RXDMA: RXDMA released this buffer or descriptor
  556. * @ HAL_RX_WBM_ERR_SRC_REO: REO released this buffer or descriptor
  557. * @ HAL_RX_WBM_ERR_SRC_FW: FW released this buffer or descriptor
  558. * @ HAL_RX_WBM_ERR_SRC_SW: SW released this buffer or descriptor
  559. */
  560. enum hal_rx_wbm_error_source {
  561. HAL_RX_WBM_ERR_SRC_TQM = 0,
  562. HAL_RX_WBM_ERR_SRC_RXDMA,
  563. HAL_RX_WBM_ERR_SRC_REO,
  564. HAL_RX_WBM_ERR_SRC_FW,
  565. HAL_RX_WBM_ERR_SRC_SW,
  566. };
  567. /**
  568. * enum hal_rx_wbm_buf_type: Indicates that type of buffer or descriptor
  569. * released
  570. *
  571. * @ HAL_RX_WBM_ERR_SRC_TQM : TQM released this buffer or descriptor
  572. * @ HAL_RX_WBM_ERR_SRC_RXDMA: RXDMA released this buffer or descriptor
  573. * @ HAL_RX_WBM_ERR_SRC_REO: REO released this buffer or descriptor
  574. * @ HAL_RX_WBM_ERR_SRC_FW: FW released this buffer or descriptor
  575. * @ HAL_RX_WBM_ERR_SRC_SW: SW released this buffer or descriptor
  576. */
  577. enum hal_rx_wbm_buf_type {
  578. HAL_RX_WBM_BUF_TYPE_REL_BUF = 0,
  579. HAL_RX_WBM_BUF_TYPE_MSDU_LINK_DESC,
  580. HAL_RX_WBM_BUF_TYPE_MPDU_LINK_DESC,
  581. HAL_RX_WBM_BUF_TYPE_MSDU_EXT_DESC,
  582. HAL_RX_WBM_BUF_TYPE_Q_EXT_DESC,
  583. };
  584. #define HAL_WBM_RELEASE_RING_DESC_LEN_DWORDS (NUM_OF_DWORDS_WBM_RELEASE_RING)
  585. //#include "hal_rx_be.h"
  586. /*
  587. * hal_rx_msdu_is_wlan_mcast(): Check if the buffer is for multicast address
  588. *
  589. * @nbuf: Network buffer
  590. * Returns: flag to indicate whether the nbuf has MC/BC address
  591. */
  592. static inline uint32_t
  593. hal_rx_msdu_is_wlan_mcast(hal_soc_handle_t hal_soc_hdl,
  594. qdf_nbuf_t nbuf)
  595. {
  596. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  597. return hal_soc->ops->hal_rx_msdu_is_wlan_mcast(nbuf);
  598. }
  599. /**
  600. * hal_rx_priv_info_set_in_tlv(): Save the private info to
  601. * the reserved bytes of rx_tlv_hdr
  602. * @buf: start of rx_tlv_hdr
  603. * @wbm_er_info: hal_wbm_err_desc_info structure
  604. * Return: void
  605. */
  606. static inline void
  607. hal_rx_priv_info_set_in_tlv(hal_soc_handle_t hal_soc_hdl,
  608. uint8_t *buf, uint8_t *priv_data,
  609. uint32_t len)
  610. {
  611. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  612. return hal_soc->ops->hal_rx_priv_info_set_in_tlv(buf,
  613. priv_data,
  614. len);
  615. }
  616. /*
  617. * hal_rx_reo_ent_rxdma_push_reason_get(): Retrieves RXDMA push reason from
  618. * reo_entrance_ring descriptor
  619. *
  620. * @reo_ent_desc: reo_entrance_ring descriptor
  621. * Returns: value of rxdma_push_reason
  622. */
  623. static inline
  624. uint8_t hal_rx_reo_ent_rxdma_push_reason_get(hal_rxdma_desc_t reo_ent_desc)
  625. {
  626. return _HAL_MS((*_OFFSET_TO_WORD_PTR(reo_ent_desc,
  627. HAL_REO_ENTRANCE_RING_RXDMA_PUSH_REASON_OFFSET)),
  628. HAL_REO_ENTRANCE_RING_RXDMA_PUSH_REASON_MASK,
  629. HAL_REO_ENTRANCE_RING_RXDMA_PUSH_REASON_LSB);
  630. }
  631. /**
  632. * hal_rx_reo_ent_rxdma_error_code_get(): Retrieves RXDMA error code from
  633. * reo_entrance_ring descriptor
  634. * @reo_ent_desc: reo_entrance_ring descriptor
  635. * Return: value of rxdma_error_code
  636. */
  637. static inline
  638. uint8_t hal_rx_reo_ent_rxdma_error_code_get(hal_rxdma_desc_t reo_ent_desc)
  639. {
  640. return _HAL_MS((*_OFFSET_TO_WORD_PTR(reo_ent_desc,
  641. HAL_REO_ENTRANCE_RING_RXDMA_ERROR_CODE_OFFSET)),
  642. HAL_REO_ENTRANCE_RING_RXDMA_ERROR_CODE_MASK,
  643. HAL_REO_ENTRANCE_RING_RXDMA_ERROR_CODE_LSB);
  644. }
  645. /**
  646. * hal_rx_priv_info_get_from_tlv(): retrieve the private data from
  647. * the reserved bytes of rx_tlv_hdr.
  648. * @buf: start of rx_tlv_hdr
  649. * @wbm_er_info: hal_wbm_err_desc_info structure, output parameter.
  650. * Return: void
  651. */
  652. static inline void
  653. hal_rx_priv_info_get_from_tlv(hal_soc_handle_t hal_soc_hdl,
  654. uint8_t *buf, uint8_t *wbm_er_info,
  655. uint32_t len)
  656. {
  657. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  658. return hal_soc->ops->hal_rx_priv_info_get_from_tlv(buf,
  659. wbm_er_info,
  660. len);
  661. }
  662. static inline void
  663. hal_rx_get_tlv_size(hal_soc_handle_t hal_soc_hdl, uint16_t *rx_pkt_tlv_size,
  664. uint16_t *rx_mon_pkt_tlv_size)
  665. {
  666. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  667. return hal_soc->ops->hal_rx_get_tlv_size(rx_pkt_tlv_size,
  668. rx_mon_pkt_tlv_size);
  669. }
  670. /*
  671. * hal_rx_encryption_info_valid(): Returns encryption type.
  672. *
  673. * @hal_soc_hdl: hal soc handle
  674. * @buf: rx_tlv_hdr of the received packet
  675. *
  676. * Return: encryption type
  677. */
  678. static inline uint32_t
  679. hal_rx_encryption_info_valid(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
  680. {
  681. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  682. return hal_soc->ops->hal_rx_encryption_info_valid(buf);
  683. }
  684. /*
  685. * hal_rx_print_pn: Prints the PN of rx packet.
  686. * @hal_soc_hdl: hal soc handle
  687. * @buf: rx_tlv_hdr of the received packet
  688. *
  689. * Return: void
  690. */
  691. static inline void
  692. hal_rx_print_pn(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
  693. {
  694. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  695. hal_soc->ops->hal_rx_print_pn(buf);
  696. }
  697. /**
  698. * hal_rx_msdu_end_l3_hdr_padding_get(): API to get the
  699. * l3_header padding from rx_msdu_end TLV
  700. *
  701. * @buf: pointer to the start of RX PKT TLV headers
  702. * Return: number of l3 header padding bytes
  703. */
  704. static inline uint32_t
  705. hal_rx_msdu_end_l3_hdr_padding_get(hal_soc_handle_t hal_soc_hdl,
  706. uint8_t *buf)
  707. {
  708. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  709. return hal_soc->ops->hal_rx_msdu_end_l3_hdr_padding_get(buf);
  710. }
  711. /**
  712. * hal_rx_msdu_end_sa_idx_get(): API to get the
  713. * sa_idx from rx_msdu_end TLV
  714. *
  715. * @ buf: pointer to the start of RX PKT TLV headers
  716. * Return: sa_idx (SA AST index)
  717. */
  718. static inline uint16_t
  719. hal_rx_msdu_end_sa_idx_get(hal_soc_handle_t hal_soc_hdl,
  720. uint8_t *buf)
  721. {
  722. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  723. return hal_soc->ops->hal_rx_msdu_end_sa_idx_get(buf);
  724. }
  725. /**
  726. * hal_rx_msdu_end_sa_is_valid_get(): API to get the
  727. * sa_is_valid bit from rx_msdu_end TLV
  728. *
  729. * @ buf: pointer to the start of RX PKT TLV headers
  730. * Return: sa_is_valid bit
  731. */
  732. static inline uint8_t
  733. hal_rx_msdu_end_sa_is_valid_get(hal_soc_handle_t hal_soc_hdl,
  734. uint8_t *buf)
  735. {
  736. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  737. return hal_soc->ops->hal_rx_msdu_end_sa_is_valid_get(buf);
  738. }
  739. /**
  740. * hal_rx_msdu_start_msdu_len_set(): API to set the MSDU length
  741. * from rx_msdu_start TLV
  742. *
  743. * @buf: pointer to the start of RX PKT TLV headers
  744. * @len: msdu length
  745. *
  746. * Return: none
  747. */
  748. static inline void
  749. hal_rx_tlv_msdu_len_set(hal_soc_handle_t hal_soc_hdl, uint8_t *buf,
  750. uint32_t len)
  751. {
  752. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  753. return hal_soc->ops->hal_rx_tlv_msdu_len_set(buf, len);
  754. }
  755. /**
  756. * enum hal_rx_mpdu_info_sw_frame_group_id_type: Enum for group id in MPDU_INFO
  757. *
  758. * @ HAL_MPDU_SW_FRAME_GROUP_NDP_FRAME: NDP frame
  759. * @ HAL_MPDU_SW_FRAME_GROUP_MULTICAST_DATA: multicast data frame
  760. * @ HAL_MPDU_SW_FRAME_GROUP_UNICAST_DATA: unicast data frame
  761. * @ HAL_MPDU_SW_FRAME_GROUP_NULL_DATA: NULL data frame
  762. * @ HAL_MPDU_SW_FRAME_GROUP_MGMT: management frame
  763. * @ HAL_MPDU_SW_FRAME_GROUP_MGMT_PROBE_REQ: probe req frame
  764. * @ HAL_MPDU_SW_FRAME_GROUP_CTRL: control frame
  765. * @ HAL_MPDU_SW_FRAME_GROUP_CTRL_NDPA: NDPA frame
  766. * @ HAL_MPDU_SW_FRAME_GROUP_CTRL_BAR: BAR frame
  767. * @ HAL_MPDU_SW_FRAME_GROUP_CTRL_RTS: RTS frame
  768. * @ HAL_MPDU_SW_FRAME_GROUP_UNSUPPORTED: unsupported
  769. * @ HAL_MPDU_SW_FRAME_GROUP_MAX: max limit
  770. */
  771. enum hal_rx_mpdu_info_sw_frame_group_id_type {
  772. HAL_MPDU_SW_FRAME_GROUP_NDP_FRAME = 0,
  773. HAL_MPDU_SW_FRAME_GROUP_MULTICAST_DATA,
  774. HAL_MPDU_SW_FRAME_GROUP_UNICAST_DATA,
  775. HAL_MPDU_SW_FRAME_GROUP_NULL_DATA,
  776. HAL_MPDU_SW_FRAME_GROUP_MGMT,
  777. HAL_MPDU_SW_FRAME_GROUP_MGMT_PROBE_REQ = 8,
  778. HAL_MPDU_SW_FRAME_GROUP_MGMT_BEACON = 12,
  779. HAL_MPDU_SW_FRAME_GROUP_CTRL = 20,
  780. HAL_MPDU_SW_FRAME_GROUP_CTRL_NDPA = 25,
  781. HAL_MPDU_SW_FRAME_GROUP_CTRL_BAR = 28,
  782. HAL_MPDU_SW_FRAME_GROUP_CTRL_RTS = 31,
  783. HAL_MPDU_SW_FRAME_GROUP_UNSUPPORTED = 36,
  784. HAL_MPDU_SW_FRAME_GROUP_MAX = 37,
  785. };
  786. /**
  787. * hal_rx_mpdu_start_mpdu_qos_control_valid_get():
  788. * Retrieve qos control valid bit from the tlv.
  789. * @hal_soc_hdl: hal_soc handle
  790. * @buf: pointer to rx pkt TLV.
  791. *
  792. * Return: qos control value.
  793. */
  794. static inline uint32_t
  795. hal_rx_mpdu_start_mpdu_qos_control_valid_get(
  796. hal_soc_handle_t hal_soc_hdl,
  797. uint8_t *buf)
  798. {
  799. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  800. if ((!hal_soc) || (!hal_soc->ops)) {
  801. hal_err("hal handle is NULL");
  802. QDF_BUG(0);
  803. return QDF_STATUS_E_INVAL;
  804. }
  805. if (hal_soc->ops->hal_rx_mpdu_start_mpdu_qos_control_valid_get)
  806. return hal_soc->ops->
  807. hal_rx_mpdu_start_mpdu_qos_control_valid_get(buf);
  808. return QDF_STATUS_E_INVAL;
  809. }
  810. /**
  811. * hal_rx_is_unicast: check packet is unicast frame or not.
  812. * @hal_soc_hdl: hal_soc handle
  813. * @buf: pointer to rx pkt TLV.
  814. *
  815. * Return: true on unicast.
  816. */
  817. static inline bool
  818. hal_rx_is_unicast(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
  819. {
  820. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  821. return hal_soc->ops->hal_rx_is_unicast(buf);
  822. }
  823. /**
  824. * hal_rx_tid_get: get tid based on qos control valid.
  825. * @hal_soc_hdl: hal soc handle
  826. * @buf: pointer to rx pkt TLV.
  827. *
  828. * Return: tid
  829. */
  830. static inline uint32_t
  831. hal_rx_tid_get(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
  832. {
  833. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  834. return hal_soc->ops->hal_rx_tid_get(hal_soc_hdl, buf);
  835. }
  836. /**
  837. * hal_rx_mpdu_start_sw_peer_id_get() - Retrieve sw peer id
  838. * @hal_soc_hdl: hal soc handle
  839. * @buf: pointer to rx pkt TLV.
  840. *
  841. * Return: sw peer_id
  842. */
  843. static inline uint32_t
  844. hal_rx_mpdu_start_sw_peer_id_get(hal_soc_handle_t hal_soc_hdl,
  845. uint8_t *buf)
  846. {
  847. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  848. return hal_soc->ops->hal_rx_mpdu_start_sw_peer_id_get(buf);
  849. }
  850. /**
  851. * hal_rx_mpdu_peer_meta_data_get() - Retrieve PEER_META_DATA
  852. * @hal_soc_hdl: hal soc handle
  853. * @buf: pointer to rx pkt TLV.
  854. *
  855. * Return: peer meta data
  856. */
  857. static inline uint32_t
  858. hal_rx_mpdu_peer_meta_data_get(hal_soc_handle_t hal_soc_hdl,
  859. uint8_t *buf)
  860. {
  861. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  862. return hal_soc->ops->hal_rx_mpdu_peer_meta_data_get(buf);
  863. }
  864. /*
  865. * hal_rx_mpdu_get_tods(): API to get the tods info
  866. * from rx_mpdu_start
  867. *
  868. * @buf: pointer to the start of RX PKT TLV header
  869. * Return: uint32_t(to_ds)
  870. */
  871. static inline uint32_t
  872. hal_rx_mpdu_get_to_ds(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
  873. {
  874. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  875. return hal_soc->ops->hal_rx_mpdu_get_to_ds(buf);
  876. }
  877. /*
  878. * hal_rx_mpdu_get_fr_ds(): API to get the from ds info
  879. * from rx_mpdu_start
  880. * @hal_soc_hdl: hal soc handle
  881. * @buf: pointer to the start of RX PKT TLV header
  882. *
  883. * Return: uint32_t(fr_ds)
  884. */
  885. static inline uint32_t
  886. hal_rx_mpdu_get_fr_ds(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
  887. {
  888. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  889. return hal_soc->ops->hal_rx_mpdu_get_fr_ds(buf);
  890. }
  891. /*
  892. * hal_rx_mpdu_get_addr1(): API to check get address1 of the mpdu
  893. * @hal_soc_hdl: hal soc handle
  894. * @buf: pointer to the start of RX PKT TLV headera
  895. * @mac_addr: pointer to mac address
  896. *
  897. * Return: success/failure
  898. */
  899. static inline
  900. QDF_STATUS hal_rx_mpdu_get_addr1(hal_soc_handle_t hal_soc_hdl,
  901. uint8_t *buf, uint8_t *mac_addr)
  902. {
  903. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  904. return hal_soc->ops->hal_rx_mpdu_get_addr1(buf, mac_addr);
  905. }
  906. /*
  907. * hal_rx_mpdu_get_addr2(): API to check get address2 of the mpdu
  908. * in the packet
  909. * @hal_soc_hdl: hal soc handle
  910. * @buf: pointer to the start of RX PKT TLV header
  911. * @mac_addr: pointer to mac address
  912. *
  913. * Return: success/failure
  914. */
  915. static inline
  916. QDF_STATUS hal_rx_mpdu_get_addr2(hal_soc_handle_t hal_soc_hdl,
  917. uint8_t *buf, uint8_t *mac_addr)
  918. {
  919. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  920. return hal_soc->ops->hal_rx_mpdu_get_addr2(buf, mac_addr);
  921. }
  922. /*
  923. * hal_rx_mpdu_get_addr3(): API to get address3 of the mpdu
  924. * in the packet
  925. * @hal_soc_hdl: hal soc handle
  926. * @buf: pointer to the start of RX PKT TLV header
  927. * @mac_addr: pointer to mac address
  928. *
  929. * Return: success/failure
  930. */
  931. static inline
  932. QDF_STATUS hal_rx_mpdu_get_addr3(hal_soc_handle_t hal_soc_hdl,
  933. uint8_t *buf, uint8_t *mac_addr)
  934. {
  935. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  936. return hal_soc->ops->hal_rx_mpdu_get_addr3(buf, mac_addr);
  937. }
  938. /*
  939. * hal_rx_mpdu_get_addr4(): API to get address4 of the mpdu
  940. * in the packet
  941. * @hal_soc_hdl: hal_soc handle
  942. * @buf: pointer to the start of RX PKT TLV header
  943. * @mac_addr: pointer to mac address
  944. * Return: success/failure
  945. */
  946. static inline
  947. QDF_STATUS hal_rx_mpdu_get_addr4(hal_soc_handle_t hal_soc_hdl,
  948. uint8_t *buf, uint8_t *mac_addr)
  949. {
  950. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  951. return hal_soc->ops->hal_rx_mpdu_get_addr4(buf, mac_addr);
  952. }
  953. /**
  954. * hal_rx_msdu_end_da_idx_get: API to get da_idx
  955. * from rx_msdu_end TLV
  956. *
  957. * @ buf: pointer to the start of RX PKT TLV headers
  958. * Return: da index
  959. */
  960. static inline uint16_t
  961. hal_rx_msdu_end_da_idx_get(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
  962. {
  963. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  964. return hal_soc->ops->hal_rx_msdu_end_da_idx_get(buf);
  965. }
  966. /**
  967. * hal_rx_msdu_end_da_is_valid_get: API to check if da is valid
  968. * from rx_msdu_end TLV
  969. * @hal_soc_hdl: hal soc handle
  970. * @ buf: pointer to the start of RX PKT TLV headers
  971. *
  972. * Return: da_is_valid
  973. */
  974. static inline uint8_t
  975. hal_rx_msdu_end_da_is_valid_get(hal_soc_handle_t hal_soc_hdl,
  976. uint8_t *buf)
  977. {
  978. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  979. return hal_soc->ops->hal_rx_msdu_end_da_is_valid_get(buf);
  980. }
  981. /**
  982. * hal_rx_msdu_end_da_is_mcbc_get: API to check if pkt is MCBC
  983. * from rx_msdu_end TLV
  984. *
  985. * @buf: pointer to the start of RX PKT TLV headers
  986. *
  987. * Return: da_is_mcbc
  988. */
  989. static inline uint8_t
  990. hal_rx_msdu_end_da_is_mcbc_get(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
  991. {
  992. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  993. return hal_soc->ops->hal_rx_msdu_end_da_is_mcbc_get(buf);
  994. }
  995. /**
  996. * hal_rx_msdu_end_first_msdu_get: API to get first msdu status
  997. * from rx_msdu_end TLV
  998. * @hal_soc_hdl: hal soc handle
  999. * @buf: pointer to the start of RX PKT TLV headers
  1000. *
  1001. * Return: first_msdu
  1002. */
  1003. static inline uint8_t
  1004. hal_rx_msdu_end_first_msdu_get(hal_soc_handle_t hal_soc_hdl,
  1005. uint8_t *buf)
  1006. {
  1007. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1008. return hal_soc->ops->hal_rx_msdu_end_first_msdu_get(buf);
  1009. }
  1010. /**
  1011. * hal_rx_msdu_end_last_msdu_get: API to get last msdu status
  1012. * from rx_msdu_end TLV
  1013. * @hal_soc_hdl: hal soc handle
  1014. * @buf: pointer to the start of RX PKT TLV headers
  1015. *
  1016. * Return: last_msdu
  1017. */
  1018. static inline uint8_t
  1019. hal_rx_msdu_end_last_msdu_get(hal_soc_handle_t hal_soc_hdl,
  1020. uint8_t *buf)
  1021. {
  1022. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1023. return hal_soc->ops->hal_rx_msdu_end_last_msdu_get(buf);
  1024. }
  1025. /**
  1026. * hal_rx_msdu_cce_match_get: API to get CCE match
  1027. * from rx_msdu_end TLV
  1028. * @buf: pointer to the start of RX PKT TLV headers
  1029. * Return: cce_meta_data
  1030. */
  1031. static inline bool
  1032. hal_rx_msdu_cce_match_get(hal_soc_handle_t hal_soc_hdl,
  1033. uint8_t *buf)
  1034. {
  1035. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1036. return hal_soc->ops->hal_rx_msdu_cce_match_get(buf);
  1037. }
  1038. /**
  1039. * hal_rx_msdu_cce_metadata_get: API to get CCE metadata
  1040. * from rx_msdu_end TLV
  1041. * @buf: pointer to the start of RX PKT TLV headers
  1042. * Return: cce_meta_data
  1043. */
  1044. static inline uint16_t
  1045. hal_rx_msdu_cce_metadata_get(hal_soc_handle_t hal_soc_hdl,
  1046. uint8_t *buf)
  1047. {
  1048. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1049. return hal_soc->ops->hal_rx_msdu_cce_metadata_get(buf);
  1050. }
  1051. /*******************************************************************************
  1052. * RX REO ERROR APIS
  1053. ******************************************************************************/
  1054. /**
  1055. * hal_rx_link_desc_msdu0_ptr - Get pointer to rx_msdu details
  1056. * @msdu_link_ptr - msdu link ptr
  1057. * @hal - pointer to hal_soc
  1058. * Return - Pointer to rx_msdu_details structure
  1059. *
  1060. */
  1061. static inline
  1062. void *hal_rx_link_desc_msdu0_ptr(void *msdu_link_ptr,
  1063. struct hal_soc *hal_soc)
  1064. {
  1065. return hal_soc->ops->hal_rx_link_desc_msdu0_ptr(msdu_link_ptr);
  1066. }
  1067. /**
  1068. * hal_rx_msdu_desc_info_get_ptr() - Get msdu desc info ptr
  1069. * @msdu_details_ptr - Pointer to msdu_details_ptr
  1070. * @hal - pointer to hal_soc
  1071. * Return - Pointer to rx_msdu_desc_info structure.
  1072. *
  1073. */
  1074. static inline
  1075. void *hal_rx_msdu_desc_info_get_ptr(void *msdu_details_ptr,
  1076. struct hal_soc *hal_soc)
  1077. {
  1078. return hal_soc->ops->hal_rx_msdu_desc_info_get_ptr(msdu_details_ptr);
  1079. }
  1080. /**
  1081. * hal_rx_reo_buf_paddr_get: Gets the physical address and
  1082. * cookie from the REO destination ring element
  1083. *
  1084. * @ hal_rx_desc_cookie: Opaque cookie pointer used by HAL to get to
  1085. * the current descriptor
  1086. * @ buf_info: structure to return the buffer information
  1087. * Return: void
  1088. */
  1089. static inline
  1090. void hal_rx_reo_buf_paddr_get(hal_soc_handle_t hal_soc_hdl,
  1091. hal_ring_desc_t rx_desc,
  1092. struct hal_buf_info *buf_info)
  1093. {
  1094. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1095. if (hal_soc->ops->hal_rx_reo_buf_paddr_get)
  1096. return hal_soc->ops->hal_rx_reo_buf_paddr_get(
  1097. rx_desc,
  1098. buf_info);
  1099. }
  1100. /**
  1101. * hal_rx_wbm_rel_buf_paddr_get: Gets the physical address and
  1102. * cookie from the WBM release ring element
  1103. *
  1104. * @ hal_rx_desc_cookie: Opaque cookie pointer used by HAL to get to
  1105. * the current descriptor
  1106. * @ buf_info: structure to return the buffer information
  1107. * Return: void
  1108. */
  1109. static inline
  1110. void hal_rx_wbm_rel_buf_paddr_get(hal_soc_handle_t hal_soc_hdl,
  1111. hal_ring_desc_t rx_desc,
  1112. struct hal_buf_info *buf_info)
  1113. {
  1114. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1115. if (hal_soc->ops->hal_rx_wbm_rel_buf_paddr_get)
  1116. return hal_soc->ops->hal_rx_wbm_rel_buf_paddr_get(rx_desc,
  1117. buf_info);
  1118. }
  1119. /**
  1120. * hal_rx_buf_cookie_rbm_get: Gets the physical address and
  1121. * cookie from the REO entrance ring element
  1122. *
  1123. * @ hal_rx_desc_cookie: Opaque cookie pointer used by HAL to get to
  1124. * the current descriptor
  1125. * @ buf_info: structure to return the buffer information
  1126. * @ msdu_cnt: pointer to msdu count in MPDU
  1127. * Return: void
  1128. */
  1129. static inline
  1130. void hal_rx_buf_cookie_rbm_get(hal_soc_handle_t hal_soc_hdl,
  1131. uint32_t *buf_addr_info,
  1132. struct hal_buf_info *buf_info)
  1133. {
  1134. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1135. return hal_soc->ops->hal_rx_buf_cookie_rbm_get(
  1136. buf_addr_info,
  1137. buf_info);
  1138. }
  1139. /**
  1140. * hal_rx_msdu_link_desc_get(): API to get the MSDU information
  1141. * from the MSDU link descriptor
  1142. *
  1143. * @msdu_link_desc: Opaque pointer used by HAL to get to the
  1144. * MSDU link descriptor (struct rx_msdu_link)
  1145. *
  1146. * @msdu_list: Return the list of MSDUs contained in this link descriptor
  1147. *
  1148. * @num_msdus: Number of MSDUs in the MPDU
  1149. *
  1150. * Return: void
  1151. */
  1152. static inline void hal_rx_msdu_list_get(hal_soc_handle_t hal_soc_hdl,
  1153. void *msdu_link_desc,
  1154. struct hal_rx_msdu_list *msdu_list,
  1155. uint16_t *num_msdus)
  1156. {
  1157. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1158. struct rx_msdu_details *msdu_details;
  1159. struct rx_msdu_desc_info *msdu_desc_info;
  1160. struct rx_msdu_link *msdu_link = (struct rx_msdu_link *)msdu_link_desc;
  1161. int i;
  1162. struct hal_buf_info buf_info;
  1163. msdu_details = hal_rx_link_desc_msdu0_ptr(msdu_link, hal_soc);
  1164. dp_nofl_debug("[%s][%d] msdu_link=%pK msdu_details=%pK",
  1165. __func__, __LINE__, msdu_link, msdu_details);
  1166. for (i = 0; i < HAL_RX_NUM_MSDU_DESC; i++) {
  1167. /* num_msdus received in mpdu descriptor may be incorrect
  1168. * sometimes due to HW issue. Check msdu buffer address also
  1169. */
  1170. if (!i && (HAL_RX_BUFFER_ADDR_31_0_GET(
  1171. &msdu_details[i].buffer_addr_info_details) == 0))
  1172. break;
  1173. if (HAL_RX_BUFFER_ADDR_31_0_GET(
  1174. &msdu_details[i].buffer_addr_info_details) == 0) {
  1175. /* set the last msdu bit in the prev msdu_desc_info */
  1176. msdu_desc_info =
  1177. hal_rx_msdu_desc_info_get_ptr(&msdu_details[i - 1], hal_soc);
  1178. HAL_RX_LAST_MSDU_IN_MPDU_FLAG_SET(msdu_desc_info, 1);
  1179. break;
  1180. }
  1181. msdu_desc_info = hal_rx_msdu_desc_info_get_ptr(&msdu_details[i],
  1182. hal_soc);
  1183. /* set first MSDU bit or the last MSDU bit */
  1184. if (!i)
  1185. HAL_RX_FIRST_MSDU_IN_MPDU_FLAG_SET(msdu_desc_info, 1);
  1186. else if (i == (HAL_RX_NUM_MSDU_DESC - 1))
  1187. HAL_RX_LAST_MSDU_IN_MPDU_FLAG_SET(msdu_desc_info, 1);
  1188. msdu_list->msdu_info[i].msdu_flags =
  1189. hal_rx_msdu_flags_get(hal_soc_hdl, msdu_desc_info);
  1190. msdu_list->msdu_info[i].msdu_len =
  1191. HAL_RX_MSDU_PKT_LENGTH_GET(msdu_desc_info);
  1192. /* addr field in buf_info will not be valid */
  1193. hal_rx_buf_cookie_rbm_get(
  1194. hal_soc_hdl,
  1195. (uint32_t *)&msdu_details[i].buffer_addr_info_details,
  1196. &buf_info);
  1197. msdu_list->sw_cookie[i] = buf_info.sw_cookie;
  1198. msdu_list->rbm[i] = buf_info.rbm;
  1199. msdu_list->paddr[i] = HAL_RX_BUFFER_ADDR_31_0_GET(
  1200. &msdu_details[i].buffer_addr_info_details) |
  1201. (uint64_t)HAL_RX_BUFFER_ADDR_39_32_GET(
  1202. &msdu_details[i].buffer_addr_info_details) << 32;
  1203. dp_nofl_debug("[%s][%d] i=%d sw_cookie=%d",
  1204. __func__, __LINE__, i, msdu_list->sw_cookie[i]);
  1205. }
  1206. *num_msdus = i;
  1207. }
  1208. /**
  1209. * hal_rx_is_pn_error() - Indicate if this error was caused by a
  1210. * PN check failure
  1211. *
  1212. * @reo_desc: opaque pointer used by HAL to get the REO destination entry
  1213. *
  1214. * Return: true: error caused by PN check, false: other error
  1215. */
  1216. static inline bool hal_rx_reo_is_pn_error(uint32_t error_code)
  1217. {
  1218. return ((error_code == HAL_REO_ERR_PN_CHECK_FAILED) ||
  1219. (error_code == HAL_REO_ERR_PN_ERROR_HANDLING_FLAG_SET)) ?
  1220. true : false;
  1221. }
  1222. /**
  1223. * hal_rx_is_2k_jump() - Indicate if this error was caused by a 2K jump in
  1224. * the sequence number
  1225. *
  1226. * @ring_desc: opaque pointer used by HAL to get the REO destination entry
  1227. *
  1228. * Return: true: error caused by 2K jump, false: other error
  1229. */
  1230. static inline bool hal_rx_reo_is_2k_jump(uint32_t error_code)
  1231. {
  1232. return ((error_code == HAL_REO_ERR_REGULAR_FRAME_2K_JUMP) ||
  1233. (error_code == HAL_REO_ERR_2K_ERROR_HANDLING_FLAG_SET)) ?
  1234. true : false;
  1235. }
  1236. /**
  1237. * hal_rx_reo_is_oor_error() - Indicate if this error was caused by OOR
  1238. *
  1239. * @ring_desc: opaque pointer used by HAL to get the REO destination entry
  1240. *
  1241. * Return: true: error caused by OOR, false: other error
  1242. */
  1243. static inline bool hal_rx_reo_is_oor_error(uint32_t error_code)
  1244. {
  1245. return (error_code == HAL_REO_ERR_REGULAR_FRAME_OOR) ?
  1246. true : false;
  1247. }
  1248. /**
  1249. * hal_rx_reo_is_bar_oor_2k_jump() - Check if the error is 2k-jump or OOR error
  1250. * @error_code: error code obtained from ring descriptor.
  1251. *
  1252. * Return: true, if the error code is 2k-jump or OOR
  1253. * false, for other error codes.
  1254. */
  1255. static inline bool hal_rx_reo_is_bar_oor_2k_jump(uint32_t error_code)
  1256. {
  1257. return ((error_code == HAL_REO_ERR_BAR_FRAME_2K_JUMP) ||
  1258. (error_code == HAL_REO_ERR_BAR_FRAME_OOR)) ?
  1259. true : false;
  1260. }
  1261. /**
  1262. * hal_dump_wbm_rel_desc() - dump wbm release descriptor
  1263. * @hal_desc: hardware descriptor pointer
  1264. *
  1265. * This function will print wbm release descriptor
  1266. *
  1267. * Return: none
  1268. */
  1269. static inline void hal_dump_wbm_rel_desc(void *src_srng_desc)
  1270. {
  1271. uint32_t *wbm_comp = (uint32_t *)src_srng_desc;
  1272. uint32_t i;
  1273. QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_FATAL,
  1274. "Current Rx wbm release descriptor is");
  1275. for (i = 0; i < HAL_WBM_RELEASE_RING_DESC_LEN_DWORDS; i++) {
  1276. QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_FATAL,
  1277. "DWORD[i] = 0x%x", wbm_comp[i]);
  1278. }
  1279. }
  1280. /**
  1281. * hal_rx_msdu_link_desc_set: Retrieves MSDU Link Descriptor to WBM
  1282. *
  1283. * @ hal_soc_hdl : HAL version of the SOC pointer
  1284. * @ src_srng_desc : void pointer to the WBM Release Ring descriptor
  1285. * @ buf_addr_info : void pointer to the buffer_addr_info
  1286. * @ bm_action : put in IDLE list or release to MSDU_LIST
  1287. *
  1288. * Return: void
  1289. */
  1290. /* look at implementation at dp_hw_link_desc_pool_setup()*/
  1291. static inline
  1292. void hal_rx_msdu_link_desc_set(hal_soc_handle_t hal_soc_hdl,
  1293. void *src_srng_desc,
  1294. hal_buff_addrinfo_t buf_addr_info,
  1295. uint8_t bm_action)
  1296. {
  1297. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1298. if (hal_soc->ops->hal_rx_msdu_link_desc_set)
  1299. return hal_soc->ops->hal_rx_msdu_link_desc_set(hal_soc_hdl,
  1300. src_srng_desc,
  1301. buf_addr_info,
  1302. bm_action);
  1303. }
  1304. /**
  1305. * HAL_RX_BUF_ADDR_INFO_GET: Returns the address of the
  1306. * BUFFER_ADDR_INFO, give the RX descriptor
  1307. * (Assumption -- BUFFER_ADDR_INFO is the
  1308. * first field in the descriptor structure)
  1309. */
  1310. #define HAL_RX_BUF_ADDR_INFO_GET(ring_desc) \
  1311. ((hal_link_desc_t)(ring_desc))
  1312. #define HAL_RX_REO_BUF_ADDR_INFO_GET HAL_RX_BUF_ADDR_INFO_GET
  1313. #define HAL_RX_WBM_BUF_ADDR_INFO_GET HAL_RX_BUF_ADDR_INFO_GET
  1314. /*******************************************************************************
  1315. * RX WBM ERROR APIS
  1316. ******************************************************************************/
  1317. #define HAL_RX_WBM_BUF_TYPE_GET(wbm_desc) (((*(((uint32_t *) wbm_desc)+ \
  1318. (WBM_ERR_RING_BUFFER_OR_DESC_TYPE_OFFSET >> 2))) & \
  1319. WBM_ERR_RING_BUFFER_OR_DESC_TYPE_MASK) >> \
  1320. WBM_ERR_RING_BUFFER_OR_DESC_TYPE_LSB)
  1321. /**
  1322. * enum - hal_rx_wbm_reo_push_reason: Indicates why REO pushed
  1323. * the frame to this release ring
  1324. *
  1325. * @ HAL_RX_WBM_REO_PSH_RSN_ERROR : Reo detected an error and pushed this
  1326. * frame to this queue
  1327. * @ HAL_RX_WBM_REO_PSH_RSN_ROUTE: Reo pushed the frame to this queue per
  1328. * received routing instructions. No error within REO was detected
  1329. */
  1330. enum hal_rx_wbm_reo_push_reason {
  1331. HAL_RX_WBM_REO_PSH_RSN_ERROR = 0,
  1332. HAL_RX_WBM_REO_PSH_RSN_ROUTE,
  1333. };
  1334. /**
  1335. * enum hal_rx_wbm_rxdma_push_reason: Indicates why REO pushed the frame to
  1336. * this release ring
  1337. *
  1338. * @ HAL_RX_WBM_RXDMA_PSH_RSN_ERROR : RXDMA detected an error and pushed
  1339. * this frame to this queue
  1340. * @ HAL_RX_WBM_RXDMA_PSH_RSN_ROUTE: RXDMA pushed the frame to this queue
  1341. * per received routing instructions. No error within RXDMA was detected
  1342. */
  1343. enum hal_rx_wbm_rxdma_push_reason {
  1344. HAL_RX_WBM_RXDMA_PSH_RSN_ERROR = 0,
  1345. HAL_RX_WBM_RXDMA_PSH_RSN_ROUTE,
  1346. HAL_RX_WBM_RXDMA_PSH_RSN_FLUSH,
  1347. };
  1348. static inline void hal_rx_dump_mpdu_start_tlv(struct rx_mpdu_start *mpdu_start,
  1349. uint8_t dbg_level,
  1350. struct hal_soc *hal)
  1351. {
  1352. hal->ops->hal_rx_dump_mpdu_start_tlv(mpdu_start, dbg_level);
  1353. }
  1354. /**
  1355. * hal_rx_dump_msdu_end_tlv: dump RX msdu_end TLV in structured
  1356. * human readable format.
  1357. * @ msdu_end: pointer the msdu_end TLV in pkt.
  1358. * @ dbg_level: log level.
  1359. *
  1360. * Return: void
  1361. */
  1362. static inline void hal_rx_dump_msdu_end_tlv(struct hal_soc *hal_soc,
  1363. struct rx_msdu_end *msdu_end,
  1364. uint8_t dbg_level)
  1365. {
  1366. hal_soc->ops->hal_rx_dump_msdu_end_tlv(msdu_end, dbg_level);
  1367. }
  1368. /**
  1369. * hal_srng_ring_id_get: API to retrieve ring id from hal ring
  1370. * structure
  1371. * @hal_ring: pointer to hal_srng structure
  1372. *
  1373. * Return: ring_id
  1374. */
  1375. static inline uint8_t hal_srng_ring_id_get(hal_ring_handle_t hal_ring_hdl)
  1376. {
  1377. return ((struct hal_srng *)hal_ring_hdl)->ring_id;
  1378. }
  1379. #define DOT11_SEQ_FRAG_MASK 0x000f
  1380. #define DOT11_FC1_MORE_FRAG_OFFSET 0x04
  1381. /**
  1382. * hal_rx_get_rx_fragment_number(): Function to retrieve rx fragment number
  1383. *
  1384. * @nbuf: Network buffer
  1385. * Returns: rx fragment number
  1386. */
  1387. static inline
  1388. uint8_t hal_rx_get_rx_fragment_number(struct hal_soc *hal_soc,
  1389. uint8_t *buf)
  1390. {
  1391. return hal_soc->ops->hal_rx_get_rx_fragment_number(buf);
  1392. }
  1393. /*
  1394. * hal_rx_get_mpdu_sequence_control_valid(): Get mpdu sequence control valid
  1395. * @hal_soc_hdl: hal soc handle
  1396. * @nbuf: Network buffer
  1397. *
  1398. * Return: value of sequence control valid field
  1399. */
  1400. static inline
  1401. uint8_t hal_rx_get_mpdu_sequence_control_valid(hal_soc_handle_t hal_soc_hdl,
  1402. uint8_t *buf)
  1403. {
  1404. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1405. return hal_soc->ops->hal_rx_get_mpdu_sequence_control_valid(buf);
  1406. }
  1407. /*
  1408. * hal_rx_get_mpdu_frame_control_valid(): Retrieves mpdu frame control valid
  1409. * @hal_soc_hdl: hal soc handle
  1410. * @nbuf: Network buffer
  1411. *
  1412. * Returns: value of frame control valid field
  1413. */
  1414. static inline
  1415. uint8_t hal_rx_get_mpdu_frame_control_valid(hal_soc_handle_t hal_soc_hdl,
  1416. uint8_t *buf)
  1417. {
  1418. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1419. return hal_soc->ops->hal_rx_get_mpdu_frame_control_valid(buf);
  1420. }
  1421. /**
  1422. * hal_rx_get_mpdu_mac_ad4_valid(): Retrieves if mpdu 4th addr is valid
  1423. * @hal_soc_hdl: hal soc handle
  1424. * @nbuf: Network buffer
  1425. * Returns: value of mpdu 4th address valid field
  1426. */
  1427. static inline
  1428. bool hal_rx_get_mpdu_mac_ad4_valid(hal_soc_handle_t hal_soc_hdl,
  1429. uint8_t *buf)
  1430. {
  1431. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1432. return hal_soc->ops->hal_rx_get_mpdu_mac_ad4_valid(buf);
  1433. }
  1434. /*
  1435. * hal_rx_clear_mpdu_desc_info(): Clears mpdu_desc_info
  1436. *
  1437. * @rx_mpdu_desc_info: HAL view of rx mpdu desc info
  1438. * Returns: None
  1439. */
  1440. static inline void
  1441. hal_rx_clear_mpdu_desc_info(struct hal_rx_mpdu_desc_info *rx_mpdu_desc_info)
  1442. {
  1443. qdf_mem_zero(rx_mpdu_desc_info, sizeof(*rx_mpdu_desc_info));
  1444. }
  1445. /**
  1446. * hal_rx_wbm_err_info_get(): Retrieves WBM error code and reason and
  1447. * save it to hal_wbm_err_desc_info structure passed by caller
  1448. * @wbm_desc: wbm ring descriptor
  1449. * @wbm_er_info: hal_wbm_err_desc_info structure, output parameter.
  1450. * Return: void
  1451. */
  1452. static inline
  1453. void hal_rx_wbm_err_info_get(void *wbm_desc,
  1454. struct hal_wbm_err_desc_info *wbm_er_info,
  1455. hal_soc_handle_t hal_soc_hdl)
  1456. {
  1457. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1458. hal_soc->ops->hal_rx_wbm_err_info_get(wbm_desc, (void *)wbm_er_info);
  1459. }
  1460. /**
  1461. * hal_rx_wbm_err_msdu_continuation_get(): Get wbm msdu continuation
  1462. * bit from wbm release ring descriptor
  1463. * @wbm_desc: wbm ring descriptor
  1464. * Return: uint8_t
  1465. */
  1466. static inline
  1467. uint8_t hal_rx_wbm_err_msdu_continuation_get(hal_soc_handle_t hal_soc_hdl,
  1468. void *wbm_desc)
  1469. {
  1470. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1471. return hal_soc->ops->hal_rx_wbm_err_msdu_continuation_get(wbm_desc);
  1472. }
  1473. /**
  1474. * hal_rx_mon_hw_desc_get_mpdu_status: Retrieve MPDU status
  1475. *
  1476. * @ hal_soc: HAL version of the SOC pointer
  1477. * @ hw_desc_addr: Start address of Rx HW TLVs
  1478. * @ rs: Status for monitor mode
  1479. *
  1480. * Return: void
  1481. */
  1482. static inline
  1483. void hal_rx_mon_hw_desc_get_mpdu_status(hal_soc_handle_t hal_soc_hdl,
  1484. void *hw_desc_addr,
  1485. struct mon_rx_status *rs)
  1486. {
  1487. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1488. hal_soc->ops->hal_rx_mon_hw_desc_get_mpdu_status(hw_desc_addr, rs);
  1489. }
  1490. /*
  1491. * hal_rx_get_tlv(): API to get the tlv
  1492. *
  1493. * @hal_soc: HAL version of the SOC pointer
  1494. * @rx_tlv: TLV data extracted from the rx packet
  1495. * Return: uint8_t
  1496. */
  1497. static inline uint8_t hal_rx_get_tlv(struct hal_soc *hal_soc, void *rx_tlv)
  1498. {
  1499. return hal_soc->ops->hal_rx_get_tlv(rx_tlv);
  1500. }
  1501. /*
  1502. * hal_rx_msdu_start_nss_get(): API to get the NSS
  1503. * Interval from rx_msdu_start
  1504. *
  1505. * @hal_soc: HAL version of the SOC pointer
  1506. * @buf: pointer to the start of RX PKT TLV header
  1507. * Return: uint32_t(nss)
  1508. */
  1509. static inline
  1510. uint32_t hal_rx_msdu_start_nss_get(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
  1511. {
  1512. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1513. return hal_soc->ops->hal_rx_msdu_start_nss_get(buf);
  1514. }
  1515. /**
  1516. * hal_rx_dump_msdu_start_tlv: dump RX msdu_start TLV in structured
  1517. * human readable format.
  1518. * @ msdu_start: pointer the msdu_start TLV in pkt.
  1519. * @ dbg_level: log level.
  1520. *
  1521. * Return: void
  1522. */
  1523. static inline void hal_rx_dump_msdu_start_tlv(struct hal_soc *hal_soc,
  1524. struct rx_msdu_start *msdu_start,
  1525. uint8_t dbg_level)
  1526. {
  1527. hal_soc->ops->hal_rx_dump_msdu_start_tlv(msdu_start, dbg_level);
  1528. }
  1529. /**
  1530. * hal_rx_mpdu_start_tid_get - Return tid info from the rx mpdu start
  1531. * info details
  1532. *
  1533. * @ buf - Pointer to buffer containing rx pkt tlvs.
  1534. *
  1535. *
  1536. */
  1537. static inline uint32_t hal_rx_mpdu_start_tid_get(hal_soc_handle_t hal_soc_hdl,
  1538. uint8_t *buf)
  1539. {
  1540. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1541. return hal_soc->ops->hal_rx_mpdu_start_tid_get(buf);
  1542. }
  1543. /*
  1544. * hal_rx_msdu_start_reception_type_get(): API to get the reception type
  1545. * Interval from rx_msdu_start
  1546. *
  1547. * @buf: pointer to the start of RX PKT TLV header
  1548. * Return: uint32_t(reception_type)
  1549. */
  1550. static inline
  1551. uint32_t hal_rx_msdu_start_reception_type_get(hal_soc_handle_t hal_soc_hdl,
  1552. uint8_t *buf)
  1553. {
  1554. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1555. return hal_soc->ops->hal_rx_msdu_start_reception_type_get(buf);
  1556. }
  1557. /**
  1558. * hal_reo_status_get_header_generic - Process reo desc info
  1559. * @d - Pointer to reo descriptior
  1560. * @b - tlv type info
  1561. * @h - Pointer to hal_reo_status_header where info to be stored
  1562. * @hal- pointer to hal_soc structure
  1563. * Return - none.
  1564. *
  1565. */
  1566. static inline
  1567. void hal_reo_status_get_header(hal_ring_desc_t ring_desc, int b,
  1568. void *h, struct hal_soc *hal_soc)
  1569. {
  1570. hal_soc->ops->hal_reo_status_get_header(ring_desc, b, h);
  1571. }
  1572. /**
  1573. * hal_rx_desc_is_first_msdu() - Check if first msdu
  1574. *
  1575. * @hal_soc_hdl: hal_soc handle
  1576. * @hw_desc_addr: hardware descriptor address
  1577. *
  1578. * Return: 0 - success/ non-zero failure
  1579. */
  1580. static inline
  1581. uint32_t hal_rx_desc_is_first_msdu(hal_soc_handle_t hal_soc_hdl,
  1582. void *hw_desc_addr)
  1583. {
  1584. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1585. return hal_soc->ops->hal_rx_desc_is_first_msdu(hw_desc_addr);
  1586. }
  1587. /**
  1588. * hal_rx_tlv_populate_mpdu_desc_info() - Populate mpdu_desc_info fields from
  1589. * the rx tlv fields.
  1590. * @hal_soc_hdl: HAL SoC handle
  1591. * @buf: rx tlv start address [To be validated by caller]
  1592. * @mpdu_desc_info_hdl: Buffer where the mpdu_desc_info is to be populated.
  1593. *
  1594. * Return: None
  1595. */
  1596. static inline void
  1597. hal_rx_tlv_populate_mpdu_desc_info(hal_soc_handle_t hal_soc_hdl,
  1598. uint8_t *buf,
  1599. void *mpdu_desc_info_hdl)
  1600. {
  1601. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1602. if (hal_soc->ops->hal_rx_tlv_populate_mpdu_desc_info)
  1603. return hal_soc->ops->hal_rx_tlv_populate_mpdu_desc_info(buf,
  1604. mpdu_desc_info_hdl);
  1605. }
  1606. static inline uint32_t
  1607. hal_rx_tlv_decap_format_get(hal_soc_handle_t hal_soc_hdl, void *hw_desc_addr)
  1608. {
  1609. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1610. return hal_soc->ops->hal_rx_tlv_decap_format_get(hw_desc_addr);
  1611. }
  1612. static inline
  1613. bool HAL_IS_DECAP_FORMAT_RAW(hal_soc_handle_t hal_soc_hdl,
  1614. uint8_t *rx_tlv_hdr)
  1615. {
  1616. uint8_t decap_format;
  1617. if (hal_rx_desc_is_first_msdu(hal_soc_hdl, rx_tlv_hdr)) {
  1618. decap_format = hal_rx_tlv_decap_format_get(hal_soc_hdl,
  1619. rx_tlv_hdr);
  1620. if (decap_format == HAL_HW_RX_DECAP_FORMAT_RAW)
  1621. return true;
  1622. }
  1623. return false;
  1624. }
  1625. /**
  1626. * hal_rx_msdu_fse_metadata_get: API to get FSE metadata
  1627. * from rx_msdu_end TLV
  1628. * @buf: pointer to the start of RX PKT TLV headers
  1629. *
  1630. * Return: fse metadata value from MSDU END TLV
  1631. */
  1632. static inline uint32_t
  1633. hal_rx_msdu_fse_metadata_get(hal_soc_handle_t hal_soc_hdl,
  1634. uint8_t *buf)
  1635. {
  1636. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1637. return hal_soc->ops->hal_rx_msdu_fse_metadata_get(buf);
  1638. }
  1639. /**
  1640. * hal_rx_buffer_addr_info_get_paddr(): get paddr/sw_cookie from
  1641. * <struct buffer_addr_info> structure
  1642. * @buf_addr_info: pointer to <struct buffer_addr_info> structure
  1643. * @buf_info: structure to return the buffer information including
  1644. * paddr/cookie
  1645. *
  1646. * return: None
  1647. */
  1648. static inline
  1649. void hal_rx_buffer_addr_info_get_paddr(void *buf_addr_info,
  1650. struct hal_buf_info *buf_info)
  1651. {
  1652. buf_info->paddr =
  1653. (HAL_RX_BUFFER_ADDR_31_0_GET(buf_addr_info) |
  1654. ((uint64_t)(HAL_RX_BUFFER_ADDR_39_32_GET(buf_addr_info)) << 32));
  1655. }
  1656. /**
  1657. * hal_rx_msdu_flow_idx_get: API to get flow index
  1658. * from rx_msdu_end TLV
  1659. * @buf: pointer to the start of RX PKT TLV headers
  1660. *
  1661. * Return: flow index value from MSDU END TLV
  1662. */
  1663. static inline uint32_t
  1664. hal_rx_msdu_flow_idx_get(hal_soc_handle_t hal_soc_hdl,
  1665. uint8_t *buf)
  1666. {
  1667. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1668. return hal_soc->ops->hal_rx_msdu_flow_idx_get(buf);
  1669. }
  1670. /**
  1671. * hal_rx_msdu_get_reo_destination_indication: API to get reo
  1672. * destination index from rx_msdu_end TLV
  1673. * @buf: pointer to the start of RX PKT TLV headers
  1674. * @reo_destination_indication: pointer to return value of
  1675. * reo_destination_indication
  1676. *
  1677. * Return: reo_destination_indication value from MSDU END TLV
  1678. */
  1679. static inline void
  1680. hal_rx_msdu_get_reo_destination_indication(hal_soc_handle_t hal_soc_hdl,
  1681. uint8_t *buf,
  1682. uint32_t *reo_destination_indication)
  1683. {
  1684. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1685. hal_soc->ops->hal_rx_msdu_get_reo_destination_indication(buf,
  1686. reo_destination_indication);
  1687. }
  1688. /**
  1689. * hal_rx_msdu_flow_idx_timeout: API to get flow index timeout
  1690. * from rx_msdu_end TLV
  1691. * @buf: pointer to the start of RX PKT TLV headers
  1692. *
  1693. * Return: flow index timeout value from MSDU END TLV
  1694. */
  1695. static inline bool
  1696. hal_rx_msdu_flow_idx_timeout(hal_soc_handle_t hal_soc_hdl,
  1697. uint8_t *buf)
  1698. {
  1699. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1700. return hal_soc->ops->hal_rx_msdu_flow_idx_timeout(buf);
  1701. }
  1702. /**
  1703. * hal_rx_msdu_flow_idx_invalid: API to get flow index invalid
  1704. * from rx_msdu_end TLV
  1705. * @buf: pointer to the start of RX PKT TLV headers
  1706. *
  1707. * Return: flow index invalid value from MSDU END TLV
  1708. */
  1709. static inline bool
  1710. hal_rx_msdu_flow_idx_invalid(hal_soc_handle_t hal_soc_hdl,
  1711. uint8_t *buf)
  1712. {
  1713. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1714. return hal_soc->ops->hal_rx_msdu_flow_idx_invalid(buf);
  1715. }
  1716. /**
  1717. * hal_rx_hw_desc_get_ppduid_get() - Retrieve ppdu id
  1718. * @hal_soc_hdl: hal_soc handle
  1719. * @rx_tlv_hdr: Rx_tlv_hdr
  1720. * @rxdma_dst_ring_desc: Rx HW descriptor
  1721. *
  1722. * Return: ppdu id
  1723. */
  1724. static inline
  1725. uint32_t hal_rx_hw_desc_get_ppduid_get(hal_soc_handle_t hal_soc_hdl,
  1726. void *rx_tlv_hdr,
  1727. void *rxdma_dst_ring_desc)
  1728. {
  1729. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1730. return hal_soc->ops->hal_rx_hw_desc_get_ppduid_get(rx_tlv_hdr,
  1731. rxdma_dst_ring_desc);
  1732. }
  1733. /**
  1734. * hal_rx_msdu_end_sa_sw_peer_id_get() - get sw peer id
  1735. * @hal_soc_hdl: hal_soc handle
  1736. * @buf: rx tlv address
  1737. *
  1738. * Return: sw peer id
  1739. */
  1740. static inline
  1741. uint32_t hal_rx_msdu_end_sa_sw_peer_id_get(hal_soc_handle_t hal_soc_hdl,
  1742. uint8_t *buf)
  1743. {
  1744. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1745. return hal_soc->ops->hal_rx_msdu_end_sa_sw_peer_id_get(buf);
  1746. }
  1747. static inline
  1748. void *hal_rx_msdu0_buffer_addr_lsb(hal_soc_handle_t hal_soc_hdl,
  1749. void *link_desc_addr)
  1750. {
  1751. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1752. return hal_soc->ops->hal_rx_msdu0_buffer_addr_lsb(link_desc_addr);
  1753. }
  1754. static inline
  1755. void *hal_rx_msdu_desc_info_ptr_get(hal_soc_handle_t hal_soc_hdl,
  1756. void *msdu_addr)
  1757. {
  1758. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1759. return hal_soc->ops->hal_rx_msdu_desc_info_ptr_get(msdu_addr);
  1760. }
  1761. static inline
  1762. void *hal_ent_mpdu_desc_info(hal_soc_handle_t hal_soc_hdl,
  1763. void *hw_addr)
  1764. {
  1765. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1766. return hal_soc->ops->hal_ent_mpdu_desc_info(hw_addr);
  1767. }
  1768. static inline
  1769. void *hal_dst_mpdu_desc_info(hal_soc_handle_t hal_soc_hdl,
  1770. void *hw_addr)
  1771. {
  1772. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1773. return hal_soc->ops->hal_dst_mpdu_desc_info(hw_addr);
  1774. }
  1775. static inline
  1776. uint8_t hal_rx_get_fc_valid(hal_soc_handle_t hal_soc_hdl,
  1777. uint8_t *buf)
  1778. {
  1779. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1780. return hal_soc->ops->hal_rx_get_fc_valid(buf);
  1781. }
  1782. static inline
  1783. uint8_t hal_rx_get_to_ds_flag(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
  1784. {
  1785. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1786. return hal_soc->ops->hal_rx_get_to_ds_flag(buf);
  1787. }
  1788. static inline
  1789. uint8_t hal_rx_get_mac_addr2_valid(hal_soc_handle_t hal_soc_hdl,
  1790. uint8_t *buf)
  1791. {
  1792. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1793. return hal_soc->ops->hal_rx_get_mac_addr2_valid(buf);
  1794. }
  1795. static inline
  1796. uint8_t hal_rx_get_filter_category(hal_soc_handle_t hal_soc_hdl,
  1797. uint8_t *buf)
  1798. {
  1799. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1800. return hal_soc->ops->hal_rx_get_filter_category(buf);
  1801. }
  1802. static inline
  1803. uint32_t hal_rx_get_ppdu_id(hal_soc_handle_t hal_soc_hdl,
  1804. uint8_t *buf)
  1805. {
  1806. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1807. return hal_soc->ops->hal_rx_get_ppdu_id(buf);
  1808. }
  1809. /**
  1810. * hal_reo_config(): Set reo config parameters
  1811. * @soc: hal soc handle
  1812. * @reg_val: value to be set
  1813. * @reo_params: reo parameters
  1814. *
  1815. * Return: void
  1816. */
  1817. static inline
  1818. void hal_reo_config(struct hal_soc *hal_soc,
  1819. uint32_t reg_val,
  1820. struct hal_reo_params *reo_params)
  1821. {
  1822. hal_soc->ops->hal_reo_config(hal_soc,
  1823. reg_val,
  1824. reo_params);
  1825. }
  1826. /**
  1827. * hal_rx_msdu_get_flow_params: API to get flow index,
  1828. * flow index invalid and flow index timeout from rx_msdu_end TLV
  1829. * @buf: pointer to the start of RX PKT TLV headers
  1830. * @flow_invalid: pointer to return value of flow_idx_valid
  1831. * @flow_timeout: pointer to return value of flow_idx_timeout
  1832. * @flow_index: pointer to return value of flow_idx
  1833. *
  1834. * Return: none
  1835. */
  1836. static inline void
  1837. hal_rx_msdu_get_flow_params(hal_soc_handle_t hal_soc_hdl,
  1838. uint8_t *buf,
  1839. bool *flow_invalid,
  1840. bool *flow_timeout,
  1841. uint32_t *flow_index)
  1842. {
  1843. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1844. hal_soc->ops->hal_rx_msdu_get_flow_params(buf,
  1845. flow_invalid,
  1846. flow_timeout,
  1847. flow_index);
  1848. }
  1849. static inline
  1850. uint16_t hal_rx_tlv_get_tcp_chksum(hal_soc_handle_t hal_soc_hdl,
  1851. uint8_t *buf)
  1852. {
  1853. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1854. return hal_soc->ops->hal_rx_tlv_get_tcp_chksum(buf);
  1855. }
  1856. static inline
  1857. uint16_t hal_rx_get_rx_sequence(hal_soc_handle_t hal_soc_hdl,
  1858. uint8_t *buf)
  1859. {
  1860. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1861. return hal_soc->ops->hal_rx_get_rx_sequence(buf);
  1862. }
  1863. static inline void
  1864. hal_rx_get_bb_info(hal_soc_handle_t hal_soc_hdl,
  1865. void *rx_tlv,
  1866. void *ppdu_info)
  1867. {
  1868. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1869. if (hal_soc->ops->hal_rx_get_bb_info)
  1870. hal_soc->ops->hal_rx_get_bb_info(rx_tlv, ppdu_info);
  1871. }
  1872. static inline void
  1873. hal_rx_get_rtt_info(hal_soc_handle_t hal_soc_hdl,
  1874. void *rx_tlv,
  1875. void *ppdu_info)
  1876. {
  1877. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1878. if (hal_soc->ops->hal_rx_get_rtt_info)
  1879. hal_soc->ops->hal_rx_get_rtt_info(rx_tlv, ppdu_info);
  1880. }
  1881. /**
  1882. * hal_rx_msdu_metadata_get(): API to get the
  1883. * fast path information from rx_msdu_end TLV
  1884. *
  1885. * @ hal_soc_hdl: DP soc handle
  1886. * @ buf: pointer to the start of RX PKT TLV headers
  1887. * @ msdu_metadata: Structure to hold msdu end information
  1888. * Return: none
  1889. */
  1890. static inline void
  1891. hal_rx_msdu_metadata_get(hal_soc_handle_t hal_soc_hdl, uint8_t *buf,
  1892. struct hal_rx_msdu_metadata *msdu_md)
  1893. {
  1894. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1895. return hal_soc->ops->hal_rx_msdu_packet_metadata_get(buf, msdu_md);
  1896. }
  1897. /**
  1898. * hal_rx_get_fisa_cumulative_l4_checksum: API to get cumulative_l4_checksum
  1899. * from rx_msdu_end TLV
  1900. * @buf: pointer to the start of RX PKT TLV headers
  1901. *
  1902. * Return: cumulative_l4_checksum
  1903. */
  1904. static inline uint16_t
  1905. hal_rx_get_fisa_cumulative_l4_checksum(hal_soc_handle_t hal_soc_hdl,
  1906. uint8_t *buf)
  1907. {
  1908. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1909. if (!hal_soc || !hal_soc->ops) {
  1910. hal_err("hal handle is NULL");
  1911. QDF_BUG(0);
  1912. return 0;
  1913. }
  1914. if (!hal_soc->ops->hal_rx_get_fisa_cumulative_l4_checksum)
  1915. return 0;
  1916. return hal_soc->ops->hal_rx_get_fisa_cumulative_l4_checksum(buf);
  1917. }
  1918. /**
  1919. * hal_rx_get_fisa_cumulative_ip_length: API to get cumulative_ip_length
  1920. * from rx_msdu_end TLV
  1921. * @buf: pointer to the start of RX PKT TLV headers
  1922. *
  1923. * Return: cumulative_ip_length
  1924. */
  1925. static inline uint16_t
  1926. hal_rx_get_fisa_cumulative_ip_length(hal_soc_handle_t hal_soc_hdl,
  1927. uint8_t *buf)
  1928. {
  1929. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1930. if (!hal_soc || !hal_soc->ops) {
  1931. hal_err("hal handle is NULL");
  1932. QDF_BUG(0);
  1933. return 0;
  1934. }
  1935. if (hal_soc->ops->hal_rx_get_fisa_cumulative_ip_length)
  1936. return hal_soc->ops->hal_rx_get_fisa_cumulative_ip_length(buf);
  1937. return 0;
  1938. }
  1939. /**
  1940. * hal_rx_get_udp_proto: API to get UDP proto field
  1941. * from rx_msdu_start TLV
  1942. * @buf: pointer to the start of RX PKT TLV headers
  1943. *
  1944. * Return: UDP proto field value
  1945. */
  1946. static inline bool
  1947. hal_rx_get_udp_proto(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
  1948. {
  1949. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1950. if (!hal_soc || !hal_soc->ops) {
  1951. hal_err("hal handle is NULL");
  1952. QDF_BUG(0);
  1953. return 0;
  1954. }
  1955. if (hal_soc->ops->hal_rx_get_udp_proto)
  1956. return hal_soc->ops->hal_rx_get_udp_proto(buf);
  1957. return 0;
  1958. }
  1959. /**
  1960. * hal_rx_get_fisa_flow_agg_continuation: API to get fisa flow_agg_continuation
  1961. * from rx_msdu_end TLV
  1962. * @buf: pointer to the start of RX PKT TLV headers
  1963. *
  1964. * Return: flow_agg_continuation bit field value
  1965. */
  1966. static inline bool
  1967. hal_rx_get_fisa_flow_agg_continuation(hal_soc_handle_t hal_soc_hdl,
  1968. uint8_t *buf)
  1969. {
  1970. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1971. if (!hal_soc || !hal_soc->ops) {
  1972. hal_err("hal handle is NULL");
  1973. QDF_BUG(0);
  1974. return 0;
  1975. }
  1976. if (hal_soc->ops->hal_rx_get_fisa_flow_agg_continuation)
  1977. return hal_soc->ops->hal_rx_get_fisa_flow_agg_continuation(buf);
  1978. return 0;
  1979. }
  1980. /**
  1981. * hal_rx_get_fisa_flow_agg_count: API to get fisa flow_agg count from
  1982. * rx_msdu_end TLV
  1983. * @buf: pointer to the start of RX PKT TLV headers
  1984. *
  1985. * Return: flow_agg count value
  1986. */
  1987. static inline uint8_t
  1988. hal_rx_get_fisa_flow_agg_count(hal_soc_handle_t hal_soc_hdl,
  1989. uint8_t *buf)
  1990. {
  1991. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  1992. if (!hal_soc || !hal_soc->ops) {
  1993. hal_err("hal handle is NULL");
  1994. QDF_BUG(0);
  1995. return 0;
  1996. }
  1997. if (hal_soc->ops->hal_rx_get_fisa_flow_agg_count)
  1998. return hal_soc->ops->hal_rx_get_fisa_flow_agg_count(buf);
  1999. return 0;
  2000. }
  2001. /**
  2002. * hal_rx_get_fisa_timeout: API to get fisa time out from rx_msdu_end TLV
  2003. * @buf: pointer to the start of RX PKT TLV headers
  2004. *
  2005. * Return: fisa flow_agg timeout bit value
  2006. */
  2007. static inline bool
  2008. hal_rx_get_fisa_timeout(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
  2009. {
  2010. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2011. if (!hal_soc || !hal_soc->ops) {
  2012. hal_err("hal handle is NULL");
  2013. QDF_BUG(0);
  2014. return 0;
  2015. }
  2016. if (hal_soc->ops->hal_rx_get_fisa_timeout)
  2017. return hal_soc->ops->hal_rx_get_fisa_timeout(buf);
  2018. return 0;
  2019. }
  2020. /**
  2021. * hal_rx_mpdu_start_tlv_tag_valid - API to check if RX_MPDU_START tlv
  2022. * tag is valid
  2023. *
  2024. * @hal_soc_hdl: HAL SOC handle
  2025. * @rx_tlv_hdr: start address of rx_pkt_tlvs
  2026. *
  2027. * Return: true if RX_MPDU_START tlv tag is valid, else false
  2028. */
  2029. static inline uint8_t
  2030. hal_rx_mpdu_start_tlv_tag_valid(hal_soc_handle_t hal_soc_hdl,
  2031. void *rx_tlv_hdr)
  2032. {
  2033. struct hal_soc *hal = (struct hal_soc *)hal_soc_hdl;
  2034. if (hal->ops->hal_rx_mpdu_start_tlv_tag_valid)
  2035. return hal->ops->hal_rx_mpdu_start_tlv_tag_valid(rx_tlv_hdr);
  2036. return 0;
  2037. }
  2038. /**
  2039. * hal_rx_get_next_msdu_link_desc_buf_addr_info(): get next msdu link desc
  2040. * buffer addr info
  2041. * @link_desc_va: pointer to current msdu link Desc
  2042. * @next_addr_info: buffer to save next msdu link Desc buffer addr info
  2043. *
  2044. * return: None
  2045. */
  2046. static inline void hal_rx_get_next_msdu_link_desc_buf_addr_info(
  2047. void *link_desc_va,
  2048. struct buffer_addr_info *next_addr_info)
  2049. {
  2050. struct rx_msdu_link *msdu_link = link_desc_va;
  2051. if (!msdu_link) {
  2052. qdf_mem_zero(next_addr_info, sizeof(struct buffer_addr_info));
  2053. return;
  2054. }
  2055. *next_addr_info = msdu_link->next_msdu_link_desc_addr_info;
  2056. }
  2057. /**
  2058. * hal_rx_clear_next_msdu_link_desc_buf_addr_info(): clear next msdu link desc
  2059. * buffer addr info
  2060. * @link_desc_va: pointer to current msdu link Desc
  2061. *
  2062. * return: None
  2063. */
  2064. static inline
  2065. void hal_rx_clear_next_msdu_link_desc_buf_addr_info(void *link_desc_va)
  2066. {
  2067. struct rx_msdu_link *msdu_link = link_desc_va;
  2068. if (msdu_link)
  2069. qdf_mem_zero(&msdu_link->next_msdu_link_desc_addr_info,
  2070. sizeof(msdu_link->next_msdu_link_desc_addr_info));
  2071. }
  2072. /**
  2073. * hal_rx_is_buf_addr_info_valid(): check is the buf_addr_info valid
  2074. *
  2075. * @buf_addr_info: pointer to buf_addr_info structure
  2076. *
  2077. * return: true: has valid paddr, false: not.
  2078. */
  2079. static inline
  2080. bool hal_rx_is_buf_addr_info_valid(struct buffer_addr_info *buf_addr_info)
  2081. {
  2082. return (HAL_RX_BUFFER_ADDR_31_0_GET(buf_addr_info) == 0) ?
  2083. false : true;
  2084. }
  2085. /**
  2086. * hal_rx_msdu_end_offset_get(): Get the MSDU end offset from
  2087. * rx_pkt_tlvs structure
  2088. *
  2089. * @hal_soc_hdl: HAL SOC handle
  2090. * return: msdu_end_tlv offset value
  2091. */
  2092. static inline
  2093. uint32_t hal_rx_msdu_end_offset_get(hal_soc_handle_t hal_soc_hdl)
  2094. {
  2095. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2096. if (!hal_soc || !hal_soc->ops) {
  2097. hal_err("hal handle is NULL");
  2098. QDF_BUG(0);
  2099. return 0;
  2100. }
  2101. return hal_soc->ops->hal_rx_msdu_end_offset_get();
  2102. }
  2103. /**
  2104. * hal_rx_msdu_start_offset_get(): Get the MSDU start offset from
  2105. * rx_pkt_tlvs structure
  2106. *
  2107. * @hal_soc_hdl: HAL SOC handle
  2108. * return: msdu_start_tlv offset value
  2109. */
  2110. static inline
  2111. uint32_t hal_rx_msdu_start_offset_get(hal_soc_handle_t hal_soc_hdl)
  2112. {
  2113. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2114. if (!hal_soc || !hal_soc->ops) {
  2115. hal_err("hal handle is NULL");
  2116. QDF_BUG(0);
  2117. return 0;
  2118. }
  2119. return hal_soc->ops->hal_rx_msdu_start_offset_get();
  2120. }
  2121. /**
  2122. * hal_rx_mpdu_start_offset_get(): Get the MPDU start offset from
  2123. * rx_pkt_tlvs structure
  2124. *
  2125. * @hal_soc_hdl: HAL SOC handle
  2126. * return: mpdu_start_tlv offset value
  2127. */
  2128. static inline
  2129. uint32_t hal_rx_mpdu_start_offset_get(hal_soc_handle_t hal_soc_hdl)
  2130. {
  2131. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2132. if (!hal_soc || !hal_soc->ops) {
  2133. hal_err("hal handle is NULL");
  2134. QDF_BUG(0);
  2135. return 0;
  2136. }
  2137. return hal_soc->ops->hal_rx_mpdu_start_offset_get();
  2138. }
  2139. static inline
  2140. uint32_t hal_rx_pkt_tlv_offset_get(hal_soc_handle_t hal_soc_hdl)
  2141. {
  2142. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2143. if (!hal_soc || !hal_soc->ops) {
  2144. hal_err("hal handle is NULL");
  2145. QDF_BUG(0);
  2146. return 0;
  2147. }
  2148. return hal_soc->ops->hal_rx_pkt_tlv_offset_get();
  2149. }
  2150. /**
  2151. * hal_rx_mpdu_end_offset_get(): Get the MPDU end offset from
  2152. * rx_pkt_tlvs structure
  2153. *
  2154. * @hal_soc_hdl: HAL SOC handle
  2155. * return: mpdu_end_tlv offset value
  2156. */
  2157. static inline
  2158. uint32_t hal_rx_mpdu_end_offset_get(hal_soc_handle_t hal_soc_hdl)
  2159. {
  2160. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2161. if (!hal_soc || !hal_soc->ops) {
  2162. hal_err("hal handle is NULL");
  2163. QDF_BUG(0);
  2164. return 0;
  2165. }
  2166. return hal_soc->ops->hal_rx_mpdu_end_offset_get();
  2167. }
  2168. /**
  2169. * hal_rx_attn_offset_get(): Get the ATTENTION offset from
  2170. * rx_pkt_tlvs structure
  2171. *
  2172. * @hal_soc_hdl: HAL SOC handle
  2173. * return: attn_tlv offset value
  2174. */
  2175. static inline
  2176. uint32_t hal_rx_attn_offset_get(hal_soc_handle_t hal_soc_hdl)
  2177. {
  2178. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2179. if (!hal_soc || !hal_soc->ops) {
  2180. hal_err("hal handle is NULL");
  2181. QDF_BUG(0);
  2182. return 0;
  2183. }
  2184. return hal_soc->ops->hal_rx_attn_offset_get();
  2185. }
  2186. /**
  2187. * hal_rx_msdu_desc_info_get_ptr() - Get msdu desc info ptr
  2188. * @msdu_details_ptr - Pointer to msdu_details_ptr
  2189. * @hal - pointer to hal_soc
  2190. * Return - Pointer to rx_msdu_desc_info structure.
  2191. *
  2192. */
  2193. static inline
  2194. void *hal_rx_msdu_ext_desc_info_get_ptr(void *msdu_details_ptr,
  2195. struct hal_soc *hal_soc)
  2196. {
  2197. return hal_soc->ops->hal_rx_msdu_ext_desc_info_get_ptr(
  2198. msdu_details_ptr);
  2199. }
  2200. static inline void
  2201. hal_rx_dump_pkt_tlvs(hal_soc_handle_t hal_soc_hdl,
  2202. uint8_t *buf, uint8_t dbg_level)
  2203. {
  2204. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2205. hal_soc->ops->hal_rx_dump_pkt_tlvs(hal_soc_hdl, buf, dbg_level);
  2206. }
  2207. //TODO - Change the names to not include tlv names
  2208. static inline uint16_t
  2209. hal_rx_attn_phy_ppdu_id_get(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
  2210. {
  2211. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2212. return hal_soc->ops->hal_rx_tlv_phy_ppdu_id_get(buf);
  2213. }
  2214. static inline uint32_t
  2215. hal_rx_attn_msdu_done_get(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
  2216. {
  2217. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2218. return hal_soc->ops->hal_rx_tlv_msdu_done_get(buf);
  2219. }
  2220. static inline uint32_t
  2221. hal_rx_msdu_start_msdu_len_get(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
  2222. {
  2223. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2224. return hal_soc->ops->hal_rx_tlv_msdu_len_get(buf);
  2225. }
  2226. static inline uint16_t
  2227. hal_rx_get_frame_ctrl_field(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
  2228. {
  2229. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2230. return hal_soc->ops->hal_rx_get_frame_ctrl_field(buf);
  2231. }
  2232. static inline int
  2233. hal_rx_tlv_get_offload_info(hal_soc_handle_t hal_soc_hdl,
  2234. uint8_t *rx_pkt_tlv,
  2235. struct hal_offload_info *offload_info)
  2236. {
  2237. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2238. return hal_soc->ops->hal_rx_tlv_get_offload_info(rx_pkt_tlv,
  2239. offload_info);
  2240. }
  2241. static inline int
  2242. hal_rx_get_proto_params(hal_soc_handle_t hal_soc_hdl, uint8_t *buf,
  2243. void *proto_params)
  2244. {
  2245. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2246. return hal_soc->ops->hal_rx_get_proto_params(buf, proto_params);
  2247. }
  2248. static inline int
  2249. hal_rx_get_l3_l4_offsets(hal_soc_handle_t hal_soc_hdl, uint8_t *buf,
  2250. uint32_t *l3_hdr_offset, uint32_t *l4_hdr_offset)
  2251. {
  2252. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2253. return hal_soc->ops->hal_rx_get_l3_l4_offsets(buf,
  2254. l3_hdr_offset,
  2255. l4_hdr_offset);
  2256. }
  2257. static inline uint32_t
  2258. hal_rx_tlv_mic_err_get(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
  2259. {
  2260. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2261. return hal_soc->ops->hal_rx_tlv_mic_err_get(buf);
  2262. }
  2263. /*
  2264. * hal_rx_tlv_get_pkt_type(): API to get the pkt type
  2265. * from rx_msdu_start
  2266. *
  2267. * @buf: pointer to the start of RX PKT TLV header
  2268. * Return: uint32_t(pkt type)
  2269. */
  2270. static inline uint32_t
  2271. hal_rx_tlv_get_pkt_type(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
  2272. {
  2273. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2274. return hal_soc->ops->hal_rx_tlv_get_pkt_type(buf);
  2275. }
  2276. static inline void
  2277. hal_rx_tlv_get_pn_num(hal_soc_handle_t hal_soc_hdl,
  2278. uint8_t *buf, uint64_t *pn_num)
  2279. {
  2280. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2281. hal_soc->ops->hal_rx_tlv_get_pn_num(buf, pn_num);
  2282. }
  2283. static inline uint8_t *
  2284. hal_get_reo_ent_desc_qdesc_addr(hal_soc_handle_t hal_soc_hdl, uint8_t *desc)
  2285. {
  2286. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2287. if (hal_soc->ops->hal_get_reo_ent_desc_qdesc_addr)
  2288. return hal_soc->ops->hal_get_reo_ent_desc_qdesc_addr(desc);
  2289. return NULL;
  2290. }
  2291. static inline uint64_t
  2292. hal_rx_get_qdesc_addr(hal_soc_handle_t hal_soc_hdl, uint8_t *dst_ring_desc,
  2293. uint8_t *buf)
  2294. {
  2295. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2296. if (hal_soc->ops->hal_rx_get_qdesc_addr)
  2297. return hal_soc->ops->hal_rx_get_qdesc_addr(dst_ring_desc, buf);
  2298. return 0;
  2299. }
  2300. static inline void
  2301. hal_set_reo_ent_desc_reo_dest_ind(hal_soc_handle_t hal_soc_hdl,
  2302. uint8_t *desc, uint32_t dst_ind)
  2303. {
  2304. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2305. if (hal_soc->ops->hal_set_reo_ent_desc_reo_dest_ind)
  2306. hal_soc->ops->hal_set_reo_ent_desc_reo_dest_ind(desc, dst_ind);
  2307. }
  2308. static inline uint32_t
  2309. hal_rx_tlv_get_is_decrypted(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
  2310. {
  2311. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2312. if (hal_soc->ops->hal_rx_tlv_get_is_decrypted)
  2313. return hal_soc->ops->hal_rx_tlv_get_is_decrypted(buf);
  2314. return 0;
  2315. }
  2316. static inline uint8_t *
  2317. hal_rx_pkt_hdr_get(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
  2318. {
  2319. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2320. return hal_soc->ops->hal_rx_pkt_hdr_get(buf);
  2321. }
  2322. static inline uint8_t
  2323. hal_rx_msdu_get_keyid(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
  2324. {
  2325. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2326. if (hal_soc->ops->hal_rx_msdu_get_keyid)
  2327. return hal_soc->ops->hal_rx_msdu_get_keyid(buf);
  2328. return 0;
  2329. }
  2330. static inline uint32_t
  2331. hal_rx_tlv_get_freq(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
  2332. {
  2333. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2334. if (hal_soc->ops->hal_rx_tlv_get_freq)
  2335. return hal_soc->ops->hal_rx_tlv_get_freq(buf);
  2336. return 0;
  2337. }
  2338. static inline void hal_mpdu_desc_info_set(hal_soc_handle_t hal_soc_hdl,
  2339. void *mpdu_desc_info, uint32_t val)
  2340. {
  2341. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2342. if (hal_soc->ops->hal_mpdu_desc_info_set)
  2343. return hal_soc->ops->hal_mpdu_desc_info_set(
  2344. hal_soc_hdl, mpdu_desc_info, val);
  2345. }
  2346. static inline void hal_msdu_desc_info_set(hal_soc_handle_t hal_soc_hdl,
  2347. void *msdu_desc_info,
  2348. uint32_t val, uint32_t nbuf_len)
  2349. {
  2350. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2351. if (hal_soc->ops->hal_msdu_desc_info_set)
  2352. return hal_soc->ops->hal_msdu_desc_info_set(
  2353. hal_soc_hdl, msdu_desc_info, val, nbuf_len);
  2354. }
  2355. static inline uint32_t
  2356. hal_rx_msdu_reo_dst_ind_get(hal_soc_handle_t hal_soc_hdl, void *msdu_link_desc)
  2357. {
  2358. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2359. if (hal_soc->ops->hal_rx_msdu_reo_dst_ind_get)
  2360. return hal_soc->ops->hal_rx_msdu_reo_dst_ind_get(
  2361. hal_soc_hdl, msdu_link_desc);
  2362. return 0;
  2363. }
  2364. static inline uint32_t
  2365. hal_rx_tlv_sgi_get(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
  2366. {
  2367. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2368. return hal_soc->ops->hal_rx_tlv_sgi_get(buf);
  2369. }
  2370. static inline uint32_t
  2371. hal_rx_tlv_rate_mcs_get(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
  2372. {
  2373. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2374. return hal_soc->ops->hal_rx_tlv_rate_mcs_get(buf);
  2375. }
  2376. static inline uint32_t
  2377. hal_rx_tlv_decrypt_err_get(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
  2378. {
  2379. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2380. return hal_soc->ops->hal_rx_tlv_decrypt_err_get(buf);
  2381. }
  2382. static inline uint32_t
  2383. hal_rx_tlv_first_mpdu_get(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
  2384. {
  2385. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2386. return hal_soc->ops->hal_rx_tlv_first_mpdu_get(buf);
  2387. }
  2388. static inline uint32_t
  2389. hal_rx_tlv_bw_get(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
  2390. {
  2391. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2392. return hal_soc->ops->hal_rx_tlv_bw_get(buf);
  2393. }
  2394. static inline uint32_t
  2395. hal_rx_wbm_err_src_get(hal_soc_handle_t hal_soc_hdl,
  2396. hal_ring_desc_t ring_desc)
  2397. {
  2398. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2399. return hal_soc->ops->hal_rx_wbm_err_src_get(ring_desc);
  2400. }
  2401. /**
  2402. * hal_rx_ret_buf_manager_get: Returns the "return_buffer_manager"
  2403. * from the BUFFER_ADDR_INFO structure
  2404. * given a REO destination ring descriptor.
  2405. * @ ring_desc: RX(REO/WBM release) destination ring descriptor
  2406. *
  2407. * Return: uint8_t (value of the return_buffer_manager)
  2408. */
  2409. static inline uint8_t
  2410. hal_rx_ret_buf_manager_get(hal_soc_handle_t hal_soc_hdl,
  2411. hal_ring_desc_t ring_desc)
  2412. {
  2413. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2414. return hal_soc->ops->hal_rx_ret_buf_manager_get(ring_desc);
  2415. }
  2416. /*
  2417. * hal_rxdma_buff_addr_info_set() - set the buffer_addr_info of the
  2418. * rxdma ring entry.
  2419. * @rxdma_entry: descriptor entry
  2420. * @paddr: physical address of nbuf data pointer.
  2421. * @cookie: SW cookie used as a index to SW rx desc.
  2422. * @manager: who owns the nbuf (host, NSS, etc...).
  2423. *
  2424. */
  2425. static inline void hal_rxdma_buff_addr_info_set(hal_soc_handle_t hal_soc_hdl,
  2426. void *rxdma_entry,
  2427. qdf_dma_addr_t paddr,
  2428. uint32_t cookie,
  2429. uint8_t manager)
  2430. {
  2431. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2432. return hal_soc->ops->hal_rxdma_buff_addr_info_set(rxdma_entry,
  2433. paddr,
  2434. cookie,
  2435. manager);
  2436. }
  2437. static inline uint32_t
  2438. hal_rx_get_reo_error_code(hal_soc_handle_t hal_soc_hdl, hal_ring_desc_t rx_desc)
  2439. {
  2440. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2441. return hal_soc->ops->hal_rx_get_reo_error_code(rx_desc);
  2442. }
  2443. static inline void
  2444. hal_rx_tlv_csum_err_get(hal_soc_handle_t hal_soc_hdl, uint8_t *rx_tlv_hdr,
  2445. uint32_t *ip_csum_err, uint32_t *tcp_udp_csum_err)
  2446. {
  2447. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2448. return hal_soc->ops->hal_rx_tlv_csum_err_get(rx_tlv_hdr,
  2449. ip_csum_err,
  2450. tcp_udp_csum_err);
  2451. }
  2452. static inline void
  2453. hal_rx_tlv_get_pkt_capture_flags(hal_soc_handle_t hal_soc_hdl,
  2454. uint8_t *rx_tlv_hdr,
  2455. struct hal_rx_pkt_capture_flags *flags)
  2456. {
  2457. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2458. return hal_soc->ops->hal_rx_tlv_get_pkt_capture_flags(rx_tlv_hdr,
  2459. flags);
  2460. }
  2461. static inline uint8_t
  2462. hal_rx_err_status_get(hal_soc_handle_t hal_soc_hdl, hal_ring_desc_t rx_desc)
  2463. {
  2464. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2465. return hal_soc->ops->hal_rx_err_status_get(rx_desc);
  2466. }
  2467. static inline uint8_t
  2468. hal_rx_reo_buf_type_get(hal_soc_handle_t hal_soc_hdl, hal_ring_desc_t rx_desc)
  2469. {
  2470. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2471. return hal_soc->ops->hal_rx_reo_buf_type_get(rx_desc);
  2472. }
  2473. /**
  2474. * hal_rx_reo_prev_pn_get() - Get the previous pn from ring descriptor.
  2475. * @hal_soc_hdl: HAL SoC handle
  2476. * @ring_desc: REO ring descriptor
  2477. * @prev_pn: Buffer to populate the previos PN
  2478. *
  2479. * Return: None
  2480. */
  2481. static inline void
  2482. hal_rx_reo_prev_pn_get(hal_soc_handle_t hal_soc_hdl, hal_ring_desc_t ring_desc,
  2483. uint64_t *prev_pn)
  2484. {
  2485. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2486. if (hal_soc->ops->hal_rx_reo_prev_pn_get)
  2487. return hal_soc->ops->hal_rx_reo_prev_pn_get(ring_desc, prev_pn);
  2488. }
  2489. /**
  2490. * hal_rx_mpdu_info_ampdu_flag_get(): get ampdu flag bit
  2491. * from rx mpdu info
  2492. * @buf: pointer to rx_pkt_tlvs
  2493. *
  2494. * No input validdataion, since this function is supposed to be
  2495. * called from fastpath.
  2496. *
  2497. * Return: ampdu flag
  2498. */
  2499. static inline bool
  2500. hal_rx_mpdu_info_ampdu_flag_get(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
  2501. {
  2502. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2503. return hal_soc->ops->hal_rx_mpdu_info_ampdu_flag_get(buf);
  2504. }
  2505. #ifdef REO_SHARED_QREF_TABLE_EN
  2506. /**
  2507. * hal_reo_shared_qaddr_write(): Write REo tid queue addr
  2508. * LUT shared by SW and HW at the index given by peer id
  2509. * and tid.
  2510. *
  2511. * @hal_soc: hal soc pointer
  2512. * @reo_qref_addr: pointer to index pointed to be peer_id
  2513. * and tid
  2514. * @tid: tid queue number
  2515. * @hw_qdesc_paddr: reo queue addr
  2516. */
  2517. static inline void
  2518. hal_reo_shared_qaddr_write(hal_soc_handle_t hal_soc_hdl,
  2519. uint16_t peer_id,
  2520. int tid,
  2521. qdf_dma_addr_t hw_qdesc_paddr)
  2522. {
  2523. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2524. if (hal_soc->ops->hal_reo_shared_qaddr_write)
  2525. return hal_soc->ops->hal_reo_shared_qaddr_write(hal_soc_hdl,
  2526. peer_id, tid, hw_qdesc_paddr);
  2527. }
  2528. /**
  2529. * hal_reo_shared_qaddr_init(): Initialize reo qref LUT
  2530. * @hal_soc: Hal soc pointer
  2531. *
  2532. * Write MLO and Non MLO table start addr to HW reg
  2533. *
  2534. * Return: void
  2535. */
  2536. static inline void
  2537. hal_reo_shared_qaddr_init(hal_soc_handle_t hal_soc_hdl)
  2538. {
  2539. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2540. if (hal_soc->ops->hal_reo_shared_qaddr_init)
  2541. return hal_soc->ops->hal_reo_shared_qaddr_init(hal_soc_hdl);
  2542. }
  2543. #else
  2544. static inline void
  2545. hal_reo_shared_qaddr_write(hal_soc_handle_t hal_soc_hdl,
  2546. uint16_t peer_id,
  2547. int tid,
  2548. qdf_dma_addr_t hw_qdesc_paddr) {}
  2549. static inline void
  2550. hal_reo_shared_qaddr_init(hal_soc_handle_t hal_soc_hdl) {}
  2551. #endif /* REO_SHARED_QREF_TABLE_EN */
  2552. static inline uint8_t
  2553. hal_reo_shared_qaddr_is_enable(hal_soc_handle_t hal_soc_hdl)
  2554. {
  2555. struct hal_soc *hal = (struct hal_soc *)hal_soc_hdl;
  2556. return hal->reo_qref.reo_qref_table_en;
  2557. }
  2558. #ifdef WLAN_FEATURE_MARK_FIRST_WAKEUP_PACKET
  2559. static inline uint8_t
  2560. hal_get_first_wow_wakeup_packet(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
  2561. {
  2562. struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
  2563. return hal_soc->ops->hal_get_first_wow_wakeup_packet(buf);
  2564. }
  2565. #endif
  2566. #endif /* _HAL_RX_H */