dp_mon.h 84 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435
  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 any
  6. * purpose with or without fee is hereby granted, provided that the above
  7. * copyright notice and this permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  10. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  12. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  13. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  14. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  15. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  16. */
  17. #ifndef _DP_MON_H_
  18. #define _DP_MON_H_
  19. #include "qdf_trace.h"
  20. #include "dp_internal.h"
  21. #include "dp_types.h"
  22. #include "dp_htt.h"
  23. #ifdef WLAN_TX_PKT_CAPTURE_ENH
  24. #include "dp_tx_capture.h"
  25. #endif
  26. #define DP_INTR_POLL_TIMER_MS 5
  27. #define MON_VDEV_TIMER_INIT 0x1
  28. #define MON_VDEV_TIMER_RUNNING 0x2
  29. /* Budget to reap monitor status ring */
  30. #define DP_MON_REAP_BUDGET 1024
  31. #define MON_BUF_MIN_ENTRIES 64
  32. #define RNG_ERR "SRNG setup failed for"
  33. #define dp_mon_info(params...) \
  34. __QDF_TRACE_FL(QDF_TRACE_LEVEL_INFO_HIGH, QDF_MODULE_ID_MON, ## params)
  35. #define dp_mon_err(params...) QDF_TRACE_ERROR(QDF_MODULE_ID_MON, params)
  36. #define dp_mon_debug(params...) QDF_TRACE_DEBUG(QDF_MODULE_ID_MON, params)
  37. #define dp_mon_warn(params...) QDF_TRACE_WARN(QDF_MODULE_ID_MON, params)
  38. #ifndef WLAN_TX_PKT_CAPTURE_ENH
  39. struct dp_pdev_tx_capture {
  40. };
  41. struct dp_peer_tx_capture {
  42. };
  43. #endif
  44. #ifndef WLAN_TX_PKT_CAPTURE_ENH
  45. static inline void
  46. dp_process_ppdu_stats_update_failed_bitmap(struct dp_pdev *pdev,
  47. void *data,
  48. uint32_t ppdu_id,
  49. uint32_t size)
  50. {
  51. }
  52. #endif
  53. #ifdef DP_CON_MON_MSI_ENABLED
  54. static inline bool dp_is_monitor_mode_using_poll(struct dp_soc *soc)
  55. {
  56. return false;
  57. }
  58. #else
  59. static inline bool dp_is_monitor_mode_using_poll(struct dp_soc *soc)
  60. {
  61. return true;
  62. }
  63. #endif
  64. /*
  65. * dp_mon_soc_attach() - DP monitor soc attach
  66. * @soc: Datapath SOC handle
  67. *
  68. * Return: QDF_STATUS_SUCCESS: Success
  69. * QDF_STATUS_E_NOMEM: Error
  70. */
  71. QDF_STATUS dp_mon_soc_attach(struct dp_soc *soc);
  72. /*
  73. * dp_mon_soc_detach() - DP monitor soc detach
  74. * @soc: Datapath SOC handle
  75. *
  76. * Return: QDF_STATUS_SUCCESS: Success
  77. * QDF_STATUS_E_FAILURE: Error
  78. */
  79. QDF_STATUS dp_mon_soc_detach(struct dp_soc *soc);
  80. /*
  81. * dp_mon_soc_cfg_init() - DP monitor soc config init
  82. * @soc: Datapath SOC handle
  83. *
  84. * Return: QDF_STATUS_SUCCESS: Success
  85. * QDF_STATUS_E_FAILURE: Error
  86. */
  87. QDF_STATUS dp_mon_soc_cfg_init(struct dp_soc *soc);
  88. /*
  89. * dp_mon_pdev_attach() - DP monitor pdev attach
  90. * @pdev: Datapath pdev handle
  91. *
  92. * Return: QDF_STATUS_SUCCESS: Success
  93. * QDF_STATUS_E_NOMEM: Error
  94. */
  95. QDF_STATUS dp_mon_pdev_attach(struct dp_pdev *pdev);
  96. /*
  97. * dp_mon_pdev_detach() - DP monitor pdev detach
  98. * @pdev: Datapath pdev handle
  99. *
  100. * Return: QDF_STATUS_SUCCESS: Success
  101. * QDF_STATUS_E_FAILURE: Error
  102. */
  103. QDF_STATUS dp_mon_pdev_detach(struct dp_pdev *pdev);
  104. /*
  105. * dp_mon_pdev_init() - DP monitor pdev init
  106. * @pdev: Datapath pdev handle
  107. *
  108. * Return: QDF_STATUS_SUCCESS: Success
  109. * QDF_STATUS_E_FAILURE: Error
  110. */
  111. QDF_STATUS dp_mon_pdev_init(struct dp_pdev *pdev);
  112. /*
  113. * dp_mon_pdev_deinit() - DP monitor pdev deinit
  114. * @pdev: Datapath pdev handle
  115. *
  116. * Return: QDF_STATUS_SUCCESS: Success
  117. * QDF_STATUS_E_FAILURE: Error
  118. */
  119. QDF_STATUS dp_mon_pdev_deinit(struct dp_pdev *pdev);
  120. /*
  121. * dp_mon_vdev_attach() - DP monitor vdev attach
  122. * @vdev: Datapath vdev handle
  123. *
  124. * Return: QDF_STATUS_SUCCESS: Success
  125. * QDF_STATUS_E_NOMEM: Error
  126. */
  127. QDF_STATUS dp_mon_vdev_attach(struct dp_vdev *vdev);
  128. /*
  129. * dp_mon_vdev_detach() - DP monitor vdev detach
  130. * @vdev: Datapath vdev handle
  131. *
  132. * Return: QDF_STATUS_SUCCESS: Success
  133. * QDF_STATUS_E_FAILURE: Error
  134. */
  135. QDF_STATUS dp_mon_vdev_detach(struct dp_vdev *vdev);
  136. /*
  137. * dp_mon_peer_attach() - DP monitor peer attach
  138. * @peer: Datapath peer handle
  139. *
  140. * Return: QDF_STATUS_SUCCESS: Success
  141. * QDF_STATUS_E_NOMEM: Error
  142. */
  143. #if defined(WLAN_TX_PKT_CAPTURE_ENH) || defined(FEATURE_PERPKT_INFO)
  144. QDF_STATUS dp_mon_peer_attach(struct dp_peer *peer);
  145. #else
  146. static inline
  147. QDF_STATUS dp_mon_peer_attach(struct dp_peer *peer)
  148. {
  149. return QDF_STATUS_SUCCESS;
  150. }
  151. #endif
  152. /*
  153. * dp_mon_peer_detach() - DP monitor peer detach
  154. * @peer: Datapath peer handle
  155. *
  156. * Return: QDF_STATUS_SUCCESS: Success
  157. * QDF_STATUS_E_FAILURE: Error
  158. */
  159. QDF_STATUS dp_mon_peer_detach(struct dp_peer *peer);
  160. /*
  161. * dp_mon_cdp_ops_register() - Register monitor cdp ops
  162. * @soc: Datapath soc handle
  163. *
  164. */
  165. void dp_mon_cdp_ops_register(struct dp_soc *soc);
  166. /*
  167. * dp_mon_cdp_ops_deregister() - deregister monitor cdp ops
  168. * @soc: Datapath soc handle
  169. *
  170. */
  171. void dp_mon_cdp_ops_deregister(struct dp_soc *soc);
  172. /*
  173. * dp_mon_intr_ops_deregister() - deregister monitor interrupt ops
  174. * @soc: Datapath soc handle
  175. *
  176. */
  177. void dp_mon_intr_ops_deregister(struct dp_soc *soc);
  178. /*
  179. * dp_mon_feature_ops_deregister() - deregister monitor feature ops
  180. * @soc: Datapath soc handle
  181. *
  182. */
  183. void dp_mon_feature_ops_deregister(struct dp_soc *soc);
  184. /*
  185. * dp_mon_ops_free() - free monitor ops
  186. * @soc: Datapath soc handle
  187. *
  188. */
  189. void dp_mon_ops_free(struct dp_soc *soc);
  190. /*
  191. * dp_mon_ops_register() - Register monitor ops
  192. * @soc: Datapath soc handle
  193. *
  194. */
  195. void dp_mon_ops_register(struct dp_soc *soc);
  196. #ifndef DISABLE_MON_CONFIG
  197. void dp_mon_register_intr_ops(struct dp_soc *soc);
  198. #else
  199. static inline void dp_mon_register_intr_ops(struct dp_soc *soc)
  200. {}
  201. #endif
  202. /*
  203. * dp_mon_htt_srng_setup() - DP mon htt srng setup
  204. * @soc: Datapath soc handle
  205. * @pdev: Datapath pdev handle
  206. * @mac_id: mac id
  207. * @mac_for_pdev: mac id mapped pdev
  208. *
  209. * Return: QDF_STATUS_SUCCESS: Success
  210. * QDF_STATUS_E_FAILURE: Error
  211. */
  212. QDF_STATUS dp_mon_htt_srng_setup(struct dp_soc *soc,
  213. struct dp_pdev *pdev,
  214. int mac_id,
  215. int mac_for_pdev);
  216. /*
  217. * dp_config_debug_sniffer()- API to enable/disable debug sniffer
  218. * @pdev: DP_PDEV handle
  219. * @val: user provided value
  220. *
  221. * Return: 0 for success. nonzero for failure.
  222. */
  223. #if defined(QCA_MCOPY_SUPPORT) || defined(QCA_TX_CAPTURE_SUPPORT)
  224. QDF_STATUS
  225. dp_config_debug_sniffer(struct dp_pdev *pdev, int val);
  226. #else
  227. static inline QDF_STATUS
  228. dp_config_debug_sniffer(struct dp_pdev *pdev, int val) {
  229. return QDF_STATUS_E_INVAL;
  230. }
  231. #endif /* QCA_MCOPY_SUPPORT || QCA_TX_CAPTURE_SUPPORT */
  232. /*
  233. * dp_htt_ppdu_stats_attach() - attach resources for HTT PPDU stats processing
  234. * @pdev: Datapath PDEV handle
  235. *
  236. * Return: QDF_STATUS_SUCCESS: Success
  237. * QDF_STATUS_E_NOMEM: Error
  238. */
  239. QDF_STATUS dp_htt_ppdu_stats_attach(struct dp_pdev *pdev);
  240. /*
  241. * dp_htt_ppdu_stats_detach() - detach stats resources
  242. * @pdev: Datapath PDEV handle
  243. *
  244. * Return: void
  245. */
  246. void dp_htt_ppdu_stats_detach(struct dp_pdev *pdev);
  247. /*
  248. *dp_set_bpr_enable() - API to enable/disable bpr feature
  249. *@pdev_handle: DP_PDEV handle.
  250. *@val: Provided value.
  251. *
  252. *Return: 0 for success. nonzero for failure.
  253. */
  254. #ifdef QCA_SUPPORT_BPR
  255. QDF_STATUS
  256. dp_set_bpr_enable(struct dp_pdev *pdev, int val);
  257. #endif
  258. #ifdef ATH_SUPPORT_NAC
  259. int dp_set_filter_neigh_peers(struct dp_pdev *pdev,
  260. bool val);
  261. #endif /* ATH_SUPPORT_NAC */
  262. #ifdef WLAN_ATF_ENABLE
  263. void dp_set_atf_stats_enable(struct dp_pdev *pdev, bool value);
  264. #endif
  265. /**
  266. * dp_set_bsscolor() - sets bsscolor for tx capture
  267. * @pdev: Datapath PDEV handle
  268. * @bsscolor: new bsscolor
  269. */
  270. void
  271. dp_mon_set_bsscolor(struct dp_pdev *pdev, uint8_t bsscolor);
  272. /**
  273. * dp_pdev_get_filter_ucast_data() - get DP PDEV monitor ucast filter
  274. * @soc : data path soc handle
  275. * @pdev_id : pdev_id
  276. * Return: true on ucast filter flag set
  277. */
  278. bool dp_pdev_get_filter_ucast_data(struct cdp_pdev *pdev_handle);
  279. /**
  280. * dp_pdev_get_filter_mcast_data() - get DP PDEV monitor mcast filter
  281. * @pdev_handle: Datapath PDEV handle
  282. * Return: true on mcast filter flag set
  283. */
  284. bool dp_pdev_get_filter_mcast_data(struct cdp_pdev *pdev_handle);
  285. /**
  286. * dp_pdev_get_filter_non_data() - get DP PDEV monitor non_data filter
  287. * @pdev_handle: Datapath PDEV handle
  288. * Return: true on non data filter flag set
  289. */
  290. bool dp_pdev_get_filter_non_data(struct cdp_pdev *pdev_handle);
  291. /*
  292. * dp_set_pktlog_wifi3() - attach txrx vdev
  293. * @pdev: Datapath PDEV handle
  294. * @event: which event's notifications are being subscribed to
  295. * @enable: WDI event subscribe or not. (True or False)
  296. *
  297. * Return: Success, NULL on failure
  298. */
  299. #ifdef WDI_EVENT_ENABLE
  300. int dp_set_pktlog_wifi3(struct dp_pdev *pdev, uint32_t event,
  301. bool enable);
  302. #endif
  303. /* MCL specific functions */
  304. #if defined(DP_CON_MON) && !defined(REMOVE_PKT_LOG)
  305. /**
  306. * dp_pktlogmod_exit() - API to cleanup pktlog info
  307. * @pdev: Pdev handle
  308. *
  309. * Return: none
  310. */
  311. void dp_pktlogmod_exit(struct dp_pdev *pdev);
  312. #else
  313. static inline
  314. void dp_pktlogmod_exit(struct dp_pdev *handle)
  315. {
  316. }
  317. #endif
  318. #ifdef QCA_MONITOR_PKT_SUPPORT
  319. /**
  320. * dp_vdev_set_monitor_mode_buf_rings () - set monitor mode buf rings
  321. *
  322. * Allocate SW descriptor pool, buffers, link descriptor memory
  323. * Initialize monitor related SRNGs
  324. *
  325. * @pdev: DP pdev object
  326. *
  327. * Return: void
  328. */
  329. void dp_vdev_set_monitor_mode_buf_rings(struct dp_pdev *pdev);
  330. /**
  331. * dp_vdev_set_monitor_mode_rings () - set monitor mode rings
  332. *
  333. * Allocate SW descriptor pool, buffers, link descriptor memory
  334. * Initialize monitor related SRNGs
  335. *
  336. * @pdev: DP pdev object
  337. *
  338. * Return: QDF_STATUS
  339. */
  340. QDF_STATUS dp_vdev_set_monitor_mode_rings(struct dp_pdev *pdev,
  341. uint8_t delayed_replenish);
  342. #else
  343. static inline void
  344. dp_vdev_set_monitor_mode_buf_rings(struct dp_pdev *pdev)
  345. {
  346. }
  347. static inline QDF_STATUS
  348. dp_vdev_set_monitor_mode_rings(struct dp_pdev *pdev,
  349. uint8_t delayed_replenish)
  350. {
  351. return QDF_STATUS_SUCCESS;
  352. }
  353. #endif
  354. #if defined(WDI_EVENT_ENABLE) &&\
  355. (defined(QCA_ENHANCED_STATS_SUPPORT) || !defined(REMOVE_PKT_LOG))
  356. /*
  357. * dp_ppdu_stats_ind_handler() - PPDU stats msg handler
  358. * @htt_soc: HTT SOC handle
  359. * @msg_word: Pointer to payload
  360. * @htt_t2h_msg: HTT msg nbuf
  361. *
  362. * Return: True if buffer should be freed by caller.
  363. */
  364. bool dp_ppdu_stats_ind_handler(struct htt_soc *soc,
  365. uint32_t *msg_word,
  366. qdf_nbuf_t htt_t2h_msg);
  367. #endif
  368. struct dp_mon_ops {
  369. QDF_STATUS (*mon_soc_cfg_init)(struct dp_soc *soc);
  370. QDF_STATUS (*mon_soc_attach)(struct dp_soc *soc);
  371. QDF_STATUS (*mon_soc_detach)(struct dp_soc *soc);
  372. QDF_STATUS (*mon_pdev_alloc)(struct dp_pdev *pdev);
  373. void (*mon_pdev_free)(struct dp_pdev *pdev);
  374. QDF_STATUS (*mon_pdev_attach)(struct dp_pdev *pdev);
  375. QDF_STATUS (*mon_pdev_detach)(struct dp_pdev *pdev);
  376. QDF_STATUS (*mon_pdev_init)(struct dp_pdev *pdev);
  377. QDF_STATUS (*mon_pdev_deinit)(struct dp_pdev *pdev);
  378. QDF_STATUS (*mon_vdev_attach)(struct dp_vdev *vdev);
  379. QDF_STATUS (*mon_vdev_detach)(struct dp_vdev *vdev);
  380. QDF_STATUS (*mon_peer_attach)(struct dp_peer *peer);
  381. QDF_STATUS (*mon_peer_detach)(struct dp_peer *peer);
  382. QDF_STATUS (*mon_config_debug_sniffer)(struct dp_pdev *pdev, int val);
  383. void (*mon_flush_rings)(struct dp_soc *soc);
  384. #if !defined(DISABLE_MON_CONFIG)
  385. QDF_STATUS (*mon_pdev_htt_srng_setup)(struct dp_soc *soc,
  386. struct dp_pdev *pdev,
  387. int mac_id,
  388. int mac_for_pdev);
  389. QDF_STATUS (*mon_soc_htt_srng_setup)(struct dp_soc *soc);
  390. #endif
  391. #if !defined(DISABLE_MON_CONFIG) && defined(MON_ENABLE_DROP_FOR_MAC)
  392. uint32_t (*mon_drop_packets_for_mac)(struct dp_pdev *pdev,
  393. uint32_t mac_id,
  394. uint32_t quota);
  395. #endif
  396. #if defined(DP_CON_MON)
  397. void (*mon_service_rings)(struct dp_soc *soc, uint32_t quota);
  398. #endif
  399. #ifndef DISABLE_MON_CONFIG
  400. uint32_t (*mon_rx_process)(struct dp_soc *soc,
  401. struct dp_intr *int_ctx,
  402. uint32_t mac_id,
  403. uint32_t quota);
  404. uint32_t (*mon_tx_process)(struct dp_soc *soc,
  405. struct dp_intr *int_ctx,
  406. uint32_t mac_id,
  407. uint32_t quota);
  408. #endif
  409. void (*mon_peer_tx_init)(struct dp_pdev *pdev, struct dp_peer *peer);
  410. void (*mon_peer_tx_cleanup)(struct dp_vdev *vdev,
  411. struct dp_peer *peer);
  412. #ifdef WLAN_TX_PKT_CAPTURE_ENH
  413. void (*mon_peer_tid_peer_id_update)(struct dp_peer *peer,
  414. uint16_t peer_id);
  415. void (*mon_tx_ppdu_stats_attach)(struct dp_pdev *pdev);
  416. void (*mon_tx_ppdu_stats_detach)(struct dp_pdev *pdev);
  417. QDF_STATUS (*mon_tx_capture_debugfs_init)(struct dp_pdev *pdev);
  418. void (*mon_peer_tx_capture_filter_check)(struct dp_pdev *pdev,
  419. struct dp_peer *peer);
  420. QDF_STATUS (*mon_tx_add_to_comp_queue)(struct dp_soc *soc,
  421. struct dp_tx_desc_s *desc,
  422. struct hal_tx_completion_status *ts,
  423. struct dp_peer *peer);
  424. QDF_STATUS (*mon_update_msdu_to_list)(struct dp_soc *soc,
  425. struct dp_pdev *pdev,
  426. struct dp_peer *peer,
  427. struct hal_tx_completion_status *ts,
  428. qdf_nbuf_t netbuf);
  429. #endif
  430. #if defined(WDI_EVENT_ENABLE) &&\
  431. (defined(QCA_ENHANCED_STATS_SUPPORT) || !defined(REMOVE_PKT_LOG))
  432. bool (*mon_ppdu_stats_ind_handler)(struct htt_soc *soc,
  433. uint32_t *msg_word,
  434. qdf_nbuf_t htt_t2h_msg);
  435. #endif
  436. QDF_STATUS (*mon_htt_ppdu_stats_attach)(struct dp_pdev *pdev);
  437. void (*mon_htt_ppdu_stats_detach)(struct dp_pdev *pdev);
  438. void (*mon_print_pdev_rx_mon_stats)(struct dp_pdev *pdev);
  439. #ifdef WLAN_TX_PKT_CAPTURE_ENH
  440. void (*mon_print_pdev_tx_capture_stats)(struct dp_pdev *pdev);
  441. QDF_STATUS (*mon_config_enh_tx_capture)(struct dp_pdev *pdev,
  442. uint8_t val);
  443. #endif
  444. #ifdef WLAN_RX_PKT_CAPTURE_ENH
  445. QDF_STATUS (*mon_config_enh_rx_capture)(struct dp_pdev *pdev,
  446. uint8_t val);
  447. #endif
  448. #ifdef QCA_SUPPORT_BPR
  449. QDF_STATUS (*mon_set_bpr_enable)(struct dp_pdev *pdev, int val);
  450. #endif
  451. #ifdef ATH_SUPPORT_NAC
  452. int (*mon_set_filter_neigh_peers)(struct dp_pdev *pdev, bool val);
  453. #endif
  454. #ifdef WLAN_ATF_ENABLE
  455. void (*mon_set_atf_stats_enable)(struct dp_pdev *pdev, bool value);
  456. #endif
  457. void (*mon_set_bsscolor)(struct dp_pdev *pdev, uint8_t bsscolor);
  458. bool (*mon_pdev_get_filter_ucast_data)(struct cdp_pdev *pdev_handle);
  459. bool (*mon_pdev_get_filter_non_data)(struct cdp_pdev *pdev_handle);
  460. bool (*mon_pdev_get_filter_mcast_data)(struct cdp_pdev *pdev_handle);
  461. #ifdef WDI_EVENT_ENABLE
  462. int (*mon_set_pktlog_wifi3)(struct dp_pdev *pdev, uint32_t event,
  463. bool enable);
  464. #endif
  465. #if defined(DP_CON_MON) && !defined(REMOVE_PKT_LOG)
  466. void (*mon_pktlogmod_exit)(struct dp_pdev *pdev);
  467. #endif
  468. void (*mon_vdev_set_monitor_mode_buf_rings)(struct dp_pdev *pdev);
  469. QDF_STATUS (*mon_vdev_set_monitor_mode_rings)(struct dp_pdev *pdev,
  470. uint8_t delayed_replenish);
  471. void (*mon_neighbour_peers_detach)(struct dp_pdev *pdev);
  472. #ifdef FEATURE_NAC_RSSI
  473. QDF_STATUS (*mon_filter_neighbour_peer)(struct dp_pdev *pdev,
  474. uint8_t *rx_pkt_hdr);
  475. #endif
  476. void (*mon_vdev_timer_init)(struct dp_soc *soc);
  477. void (*mon_vdev_timer_start)(struct dp_soc *soc);
  478. bool (*mon_vdev_timer_stop)(struct dp_soc *soc);
  479. void (*mon_vdev_timer_deinit)(struct dp_soc *soc);
  480. void (*mon_reap_timer_init)(struct dp_soc *soc);
  481. void (*mon_reap_timer_start)(struct dp_soc *soc);
  482. bool (*mon_reap_timer_stop)(struct dp_soc *soc);
  483. void (*mon_reap_timer_deinit)(struct dp_soc *soc);
  484. #ifdef QCA_MCOPY_SUPPORT
  485. QDF_STATUS (*mon_mcopy_check_deliver)(struct dp_pdev *pdev,
  486. uint16_t peer_id,
  487. uint32_t ppdu_id,
  488. uint8_t first_msdu);
  489. #endif
  490. void (*mon_neighbour_peer_add_ast)(struct dp_pdev *pdev,
  491. struct dp_peer *ta_peer,
  492. uint8_t *mac_addr,
  493. qdf_nbuf_t nbuf,
  494. uint32_t flags);
  495. #ifdef QCA_ENHANCED_STATS_SUPPORT
  496. void (*mon_filter_setup_enhanced_stats)(struct dp_pdev *pdev);
  497. void (*mon_filter_reset_enhanced_stats)(struct dp_pdev *pdev);
  498. void (*mon_tx_stats_update)(struct dp_peer *peer,
  499. struct cdp_tx_completion_ppdu_user *ppdu);
  500. #endif
  501. #ifdef QCA_MCOPY_SUPPORT
  502. void (*mon_filter_setup_mcopy_mode)(struct dp_pdev *pdev);
  503. void (*mon_filter_reset_mcopy_mode)(struct dp_pdev *pdev);
  504. #endif
  505. #if defined(ATH_SUPPORT_NAC_RSSI) || defined(ATH_SUPPORT_NAC)
  506. void (*mon_filter_setup_smart_monitor)(struct dp_pdev *pdev);
  507. void (*mon_filter_reset_smart_monitor)(struct dp_pdev *pdev);
  508. #endif
  509. #ifdef WLAN_RX_PKT_CAPTURE_ENH
  510. void (*mon_filter_setup_rx_enh_capture)(struct dp_pdev *pdev);
  511. void (*mon_filter_reset_rx_enh_capture)(struct dp_pdev *pdev);
  512. #endif
  513. void (*mon_filter_setup_rx_mon_mode)(struct dp_pdev *pdev);
  514. void (*mon_filter_reset_rx_mon_mode)(struct dp_pdev *pdev);
  515. void (*mon_filter_setup_tx_mon_mode)(struct dp_pdev *pdev);
  516. void (*mon_filter_reset_tx_mon_mode)(struct dp_pdev *pdev);
  517. #ifdef WDI_EVENT_ENABLE
  518. void (*mon_filter_setup_rx_pkt_log_full)(struct dp_pdev *pdev);
  519. void (*mon_filter_reset_rx_pkt_log_full)(struct dp_pdev *pdev);
  520. void (*mon_filter_setup_rx_pkt_log_lite)(struct dp_pdev *pdev);
  521. void (*mon_filter_reset_rx_pkt_log_lite)(struct dp_pdev *pdev);
  522. void (*mon_filter_setup_rx_pkt_log_cbf)(struct dp_pdev *pdev);
  523. void (*mon_filter_reset_rx_pkt_log_cbf)(struct dp_pdev *pdev);
  524. #ifdef QCA_WIFI_QCN9224
  525. void (*mon_filter_setup_pktlog_hybrid)(struct dp_pdev *pdev);
  526. void (*mon_filter_reset_pktlog_hybrid)(struct dp_pdev *pdev);
  527. #endif
  528. #endif
  529. QDF_STATUS (*rx_mon_filter_update)(struct dp_pdev *pdev);
  530. QDF_STATUS (*tx_mon_filter_update)(struct dp_pdev *pdev);
  531. QDF_STATUS (*tx_mon_filter_alloc)(struct dp_pdev *pdev);
  532. void (*tx_mon_filter_dealloc)(struct dp_pdev *pdev);
  533. QDF_STATUS (*mon_rings_alloc)(struct dp_pdev *pdev);
  534. void (*mon_rings_free)(struct dp_pdev *pdev);
  535. QDF_STATUS (*mon_rings_init)(struct dp_pdev *pdev);
  536. void (*mon_rings_deinit)(struct dp_pdev *pdev);
  537. QDF_STATUS (*rx_mon_buffers_alloc)(struct dp_pdev *pdev);
  538. void (*rx_mon_buffers_free)(struct dp_pdev *pdev);
  539. void (*rx_mon_desc_pool_init)(struct dp_pdev *pdev);
  540. void (*rx_mon_desc_pool_deinit)(struct dp_pdev *pdev);
  541. QDF_STATUS (*rx_mon_desc_pool_alloc)(struct dp_pdev *pdev);
  542. void (*rx_mon_desc_pool_free)(struct dp_pdev *pdev);
  543. void (*tx_mon_desc_pool_init)(struct dp_pdev *pdev);
  544. void (*tx_mon_desc_pool_deinit)(struct dp_pdev *pdev);
  545. QDF_STATUS (*tx_mon_desc_pool_alloc)(struct dp_pdev *pdev);
  546. void (*tx_mon_desc_pool_free)(struct dp_pdev *pdev);
  547. void (*rx_packet_length_set)(uint32_t *msg_word,
  548. struct htt_rx_ring_tlv_filter *tlv_filter);
  549. void (*rx_wmask_subscribe)(uint32_t *msg_word,
  550. struct htt_rx_ring_tlv_filter *tlv_filter);
  551. void (*rx_enable_mpdu_logging)(uint32_t *msg_word,
  552. struct htt_rx_ring_tlv_filter *tlv_filter);
  553. #ifndef DISABLE_MON_CONFIG
  554. void (*mon_register_intr_ops)(struct dp_soc *soc);
  555. #endif
  556. void (*mon_register_feature_ops)(struct dp_soc *soc);
  557. #ifdef QCA_ENHANCED_STATS_SUPPORT
  558. void (*mon_rx_stats_update)(struct dp_peer *peer,
  559. struct cdp_rx_indication_ppdu *ppdu,
  560. struct cdp_rx_stats_ppdu_user *ppdu_user);
  561. void (*mon_rx_populate_ppdu_usr_info)(struct mon_rx_user_status *rx_user_status,
  562. struct cdp_rx_stats_ppdu_user *ppdu_user);
  563. void (*mon_rx_populate_ppdu_info)(struct hal_rx_ppdu_info *hal_ppdu_info,
  564. struct cdp_rx_indication_ppdu *ppdu);
  565. #endif
  566. QDF_STATUS (*rx_mon_refill_buf_ring)(struct dp_intr *int_ctx);
  567. QDF_STATUS (*tx_mon_refill_buf_ring)(struct dp_intr *int_ctx);
  568. };
  569. struct dp_mon_soc {
  570. /* Holds all monitor related fields extracted from dp_soc */
  571. /* Holds pointer to monitor ops */
  572. /* monitor link descriptor pages */
  573. struct qdf_mem_multi_page_t mon_link_desc_pages[MAX_NUM_LMAC_HW];
  574. /* total link descriptors for monitor mode for each radio */
  575. uint32_t total_mon_link_descs[MAX_NUM_LMAC_HW];
  576. /* Monitor Link descriptor memory banks */
  577. struct link_desc_bank
  578. mon_link_desc_banks[MAX_NUM_LMAC_HW][MAX_MON_LINK_DESC_BANKS];
  579. uint32_t num_mon_link_desc_banks[MAX_NUM_LMAC_HW];
  580. /* Smart monitor capability for HKv2 */
  581. uint8_t hw_nac_monitor_support;
  582. /* Full monitor mode support */
  583. bool full_mon_mode;
  584. /*interrupt timer*/
  585. qdf_timer_t mon_reap_timer;
  586. uint8_t reap_timer_init;
  587. qdf_timer_t mon_vdev_timer;
  588. uint8_t mon_vdev_timer_state;
  589. struct dp_mon_ops *mon_ops;
  590. bool monitor_mode_v2;
  591. #ifndef DISABLE_MON_CONFIG
  592. uint32_t (*mon_rx_process)(struct dp_soc *soc,
  593. struct dp_intr *int_ctx,
  594. uint32_t mac_id,
  595. uint32_t quota);
  596. #endif
  597. };
  598. struct dp_mon_pdev {
  599. /* monitor */
  600. bool monitor_configured;
  601. struct dp_mon_filter **filter; /* Monitor Filter pointer */
  602. /* advance filter mode and type*/
  603. uint8_t mon_filter_mode;
  604. uint16_t fp_mgmt_filter;
  605. uint16_t fp_ctrl_filter;
  606. uint16_t fp_data_filter;
  607. uint16_t mo_mgmt_filter;
  608. uint16_t mo_ctrl_filter;
  609. uint16_t mo_data_filter;
  610. uint16_t md_data_filter;
  611. #ifdef WLAN_TX_PKT_CAPTURE_ENH
  612. struct dp_pdev_tx_capture tx_capture;
  613. bool stop_tx_capture_work_q_timer;
  614. #endif
  615. /* tx packet capture enhancement */
  616. enum cdp_tx_enh_capture_mode tx_capture_enabled;
  617. /* Stuck count on monitor destination ring MPDU process */
  618. uint32_t mon_dest_ring_stuck_cnt;
  619. /* monitor mode lock */
  620. qdf_spinlock_t mon_lock;
  621. /* Monitor mode operation channel */
  622. int mon_chan_num;
  623. /* Monitor mode operation frequency */
  624. qdf_freq_t mon_chan_freq;
  625. /* Monitor mode band */
  626. enum reg_wifi_band mon_chan_band;
  627. uint32_t mon_ppdu_status;
  628. /* monitor mode status/destination ring PPDU and MPDU count */
  629. struct cdp_pdev_mon_stats rx_mon_stats;
  630. /* Monitor mode interface and status storage */
  631. struct dp_vdev *mvdev;
  632. struct cdp_mon_status rx_mon_recv_status;
  633. /* to track duplicate link descriptor indications by HW for a WAR */
  634. uint64_t mon_last_linkdesc_paddr;
  635. /* to track duplicate buffer indications by HW for a WAR */
  636. uint32_t mon_last_buf_cookie;
  637. #ifdef QCA_SUPPORT_FULL_MON
  638. /* List to maintain all MPDUs for a PPDU in monitor mode */
  639. TAILQ_HEAD(, dp_mon_mpdu) mon_mpdu_q;
  640. /* TODO: define per-user mpdu list
  641. * struct dp_mon_mpdu_list mpdu_list[MAX_MU_USERS];
  642. */
  643. struct hal_rx_mon_desc_info *mon_desc;
  644. #endif
  645. /* Flag to hold on to monitor destination ring */
  646. bool hold_mon_dest_ring;
  647. /* Flag to inidicate monitor rings are initialized */
  648. uint8_t pdev_mon_init;
  649. #ifndef REMOVE_PKT_LOG
  650. bool pkt_log_init;
  651. struct pktlog_dev_t *pl_dev; /* Pktlog pdev */
  652. #endif /* #ifndef REMOVE_PKT_LOG */
  653. /* Smart Mesh */
  654. bool filter_neighbour_peers;
  655. /*flag to indicate neighbour_peers_list not empty */
  656. bool neighbour_peers_added;
  657. /* smart mesh mutex */
  658. qdf_spinlock_t neighbour_peer_mutex;
  659. /* Neighnour peer list */
  660. TAILQ_HEAD(, dp_neighbour_peer) neighbour_peers_list;
  661. /* Enhanced Stats is enabled */
  662. bool enhanced_stats_en;
  663. qdf_nbuf_queue_t rx_status_q;
  664. /* 128 bytes mpdu header queue per user for ppdu */
  665. qdf_nbuf_queue_t mpdu_q[MAX_MU_USERS];
  666. /* is this a mpdu header TLV and not msdu header TLV */
  667. bool is_mpdu_hdr[MAX_MU_USERS];
  668. /* per user 128 bytes msdu header list for MPDU */
  669. struct msdu_list msdu_list[MAX_MU_USERS];
  670. /* RX enhanced capture mode */
  671. uint8_t rx_enh_capture_mode;
  672. /* Rx per peer enhanced capture mode */
  673. bool rx_enh_capture_peer;
  674. struct dp_vdev *rx_enh_monitor_vdev;
  675. /* RX enhanced capture trailer enable/disable flag */
  676. bool is_rx_enh_capture_trailer_enabled;
  677. #ifdef WLAN_RX_PKT_CAPTURE_ENH
  678. /* RX per MPDU/PPDU information */
  679. struct cdp_rx_indication_mpdu mpdu_ind;
  680. #endif
  681. /* Packet log mode */
  682. uint8_t rx_pktlog_mode;
  683. /* Enable pktlog logging cbf */
  684. bool rx_pktlog_cbf;
  685. /* Enable pktlog logging hybrid */
  686. #ifdef QCA_WIFI_QCN9224
  687. bool pktlog_hybrid_mode;
  688. #endif
  689. bool tx_sniffer_enable;
  690. /* mirror copy mode */
  691. enum m_copy_mode mcopy_mode;
  692. bool enable_reap_timer_non_pkt;
  693. bool bpr_enable;
  694. /* Pdev level flag to check peer based pktlog enabled or
  695. * disabled
  696. */
  697. uint8_t dp_peer_based_pktlog;
  698. #ifdef WLAN_ATF_ENABLE
  699. /* ATF stats enable */
  700. bool dp_atf_stats_enable;
  701. #endif
  702. /* Maintains first status buffer's paddr of a PPDU */
  703. uint64_t status_buf_addr;
  704. struct hal_rx_ppdu_info ppdu_info;
  705. /* ppdu_id of last received HTT TX stats */
  706. uint32_t last_ppdu_id;
  707. struct {
  708. uint8_t last_user;
  709. qdf_nbuf_t buf;
  710. } tx_ppdu_info;
  711. struct {
  712. uint32_t tx_ppdu_id;
  713. uint16_t tx_peer_id;
  714. uint32_t rx_ppdu_id;
  715. } m_copy_id;
  716. /* To check if PPDU Tx stats are enabled for Pktlog */
  717. bool pktlog_ppdu_stats;
  718. #ifdef ATH_SUPPORT_NAC_RSSI
  719. bool nac_rssi_filtering;
  720. #endif
  721. /* ppdu_stats lock for queue concurrency between cores*/
  722. qdf_spinlock_t ppdu_stats_lock;
  723. /* list of ppdu tlvs */
  724. TAILQ_HEAD(, ppdu_info) ppdu_info_list;
  725. TAILQ_HEAD(, ppdu_info) sched_comp_ppdu_list;
  726. uint32_t sched_comp_list_depth;
  727. uint16_t delivered_sched_cmdid;
  728. uint16_t last_sched_cmdid;
  729. uint32_t tlv_count;
  730. uint32_t list_depth;
  731. struct {
  732. qdf_nbuf_t last_nbuf; /*Ptr to mgmt last buf */
  733. uint8_t *mgmt_buf; /* Ptr to mgmt. payload in HTT ppdu stats */
  734. uint32_t mgmt_buf_len; /* Len of mgmt. payload in ppdu stats */
  735. uint32_t ppdu_id;
  736. } mgmtctrl_frm_info;
  737. /* Context of cal client timer */
  738. struct cdp_cal_client *cal_client_ctx;
  739. uint32_t *ppdu_tlv_buf; /* Buffer to hold HTT ppdu stats TLVs*/
  740. qdf_nbuf_t mcopy_status_nbuf;
  741. bool is_dp_mon_pdev_initialized;
  742. /* indicates if spcl vap is configured */
  743. bool scan_spcl_vap_configured;
  744. #ifdef QCA_SUPPORT_SCAN_SPCL_VAP_STATS
  745. /* enable spcl vap stats reset on ch change */
  746. bool reset_scan_spcl_vap_stats_enable;
  747. #endif
  748. bool is_tlv_hdr_64_bit;
  749. };
  750. struct dp_mon_vdev {
  751. /* callback to hand rx monitor 802.11 MPDU to the OS shim */
  752. ol_txrx_rx_mon_fp osif_rx_mon;
  753. #ifdef QCA_SUPPORT_SCAN_SPCL_VAP_STATS
  754. struct cdp_scan_spcl_vap_stats *scan_spcl_vap_stats;
  755. #endif
  756. };
  757. struct dp_mon_peer {
  758. #ifdef WLAN_TX_PKT_CAPTURE_ENH
  759. struct dp_peer_tx_capture tx_capture;
  760. #endif
  761. #ifdef FEATURE_PERPKT_INFO
  762. /* delayed ba ppdu stats handling */
  763. struct cdp_delayed_tx_completion_ppdu_user delayed_ba_ppdu_stats;
  764. /* delayed ba flag */
  765. bool last_delayed_ba;
  766. /* delayed ba ppdu id */
  767. uint32_t last_delayed_ba_ppduid;
  768. #endif
  769. };
  770. #if defined(QCA_TX_CAPTURE_SUPPORT) || defined(QCA_ENHANCED_STATS_SUPPORT)
  771. void dp_deliver_mgmt_frm(struct dp_pdev *pdev, qdf_nbuf_t nbuf);
  772. #else
  773. static inline
  774. void dp_deliver_mgmt_frm(struct dp_pdev *pdev, qdf_nbuf_t nbuf)
  775. {
  776. }
  777. #endif
  778. #if defined(WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG) ||\
  779. defined(WLAN_SUPPORT_RX_FLOW_TAG)
  780. /**
  781. * dp_rx_mon_update_protocol_flow_tag() - Performs necessary checks for monitor
  782. * mode and then tags appropriate packets
  783. * @soc: core txrx main context
  784. * @vdev: pdev on which packet is received
  785. * @msdu: QDF packet buffer on which the protocol tag should be set
  786. * @rx_desc: base address where the RX TLVs start
  787. * Return: void
  788. */
  789. void dp_rx_mon_update_protocol_flow_tag(struct dp_soc *soc,
  790. struct dp_pdev *dp_pdev,
  791. qdf_nbuf_t msdu, void *rx_desc);
  792. #endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG || WLAN_SUPPORT_RX_FLOW_TAG */
  793. #if !defined(WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG) &&\
  794. !defined(WLAN_SUPPORT_RX_FLOW_TAG)
  795. /**
  796. * dp_rx_mon_update_protocol_flow_tag() - Performs necessary checks for monitor
  797. * mode and then tags appropriate packets
  798. * @soc: core txrx main context
  799. * @vdev: pdev on which packet is received
  800. * @msdu: QDF packet buffer on which the protocol tag should be set
  801. * @rx_desc: base address where the RX TLVs start
  802. * Return: void
  803. */
  804. static inline
  805. void dp_rx_mon_update_protocol_flow_tag(struct dp_soc *soc,
  806. struct dp_pdev *dp_pdev,
  807. qdf_nbuf_t msdu, void *rx_desc)
  808. {
  809. }
  810. #endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG || WLAN_SUPPORT_RX_FLOW_TAG */
  811. #ifndef WLAN_TX_PKT_CAPTURE_ENH
  812. static inline
  813. QDF_STATUS dp_peer_set_tx_capture_enabled(struct dp_pdev *pdev,
  814. struct dp_peer *peer_handle,
  815. uint8_t value, uint8_t *peer_mac)
  816. {
  817. return QDF_STATUS_SUCCESS;
  818. }
  819. /**
  820. * dp_peer_tid_queue_init() – Initialize ppdu stats queue per TID
  821. * @peer: Datapath peer
  822. *
  823. */
  824. static inline void dp_peer_tid_queue_init(struct dp_peer *peer)
  825. {
  826. }
  827. /**
  828. * dp_peer_tid_queue_cleanup() – remove ppdu stats queue per TID
  829. * @peer: Datapath peer
  830. *
  831. */
  832. static inline void dp_peer_tid_queue_cleanup(struct dp_peer *peer)
  833. {
  834. }
  835. /**
  836. * dp_peer_update_80211_hdr() – dp peer update 80211 hdr
  837. * @vdev: Datapath vdev
  838. * @peer: Datapath peer
  839. *
  840. */
  841. static inline void
  842. dp_peer_update_80211_hdr(struct dp_vdev *vdev, struct dp_peer *peer)
  843. {
  844. }
  845. /**
  846. * dp_tx_ppdu_stats_attach - Initialize Tx PPDU stats and enhanced capture
  847. * @pdev: DP PDEV
  848. *
  849. * Return: none
  850. */
  851. static inline void dp_tx_ppdu_stats_attach(struct dp_pdev *pdev)
  852. {
  853. }
  854. /**
  855. * dp_tx_ppdu_stats_detach - Cleanup Tx PPDU stats and enhanced capture
  856. * @pdev: DP PDEV
  857. *
  858. * Return: none
  859. */
  860. static inline void dp_tx_ppdu_stats_detach(struct dp_pdev *pdev)
  861. {
  862. }
  863. /**
  864. * dp_tx_add_to_comp_queue() - add completion msdu to queue
  865. * @soc: DP Soc handle
  866. * @tx_desc: software Tx descriptor
  867. * @ts : Tx completion status from HAL/HTT descriptor
  868. * @peer: DP peer
  869. *
  870. * Return: none
  871. */
  872. static inline
  873. QDF_STATUS dp_tx_add_to_comp_queue(struct dp_soc *soc,
  874. struct dp_tx_desc_s *desc,
  875. struct hal_tx_completion_status *ts,
  876. struct dp_peer *peer)
  877. {
  878. return QDF_STATUS_E_FAILURE;
  879. }
  880. /**
  881. * dp_update_msdu_to_list(): Function to queue msdu from wbm
  882. * @pdev: dp_pdev
  883. * @peer: dp_peer
  884. * @ts: hal tx completion status
  885. * @netbuf: msdu
  886. *
  887. * return: status
  888. */
  889. static inline
  890. QDF_STATUS dp_update_msdu_to_list(struct dp_soc *soc,
  891. struct dp_pdev *pdev,
  892. struct dp_peer *peer,
  893. struct hal_tx_completion_status *ts,
  894. qdf_nbuf_t netbuf)
  895. {
  896. return QDF_STATUS_E_FAILURE;
  897. }
  898. /*
  899. * dp_peer_tx_capture_filter_check: check filter is enable for the filter
  900. * and update tx_cap_enabled flag
  901. * @pdev: DP PDEV handle
  902. * @peer: DP PEER handle
  903. *
  904. * return: void
  905. */
  906. static inline
  907. void dp_peer_tx_capture_filter_check(struct dp_pdev *pdev,
  908. struct dp_peer *peer)
  909. {
  910. }
  911. /*
  912. * dp_tx_capture_debugfs_init: tx capture debugfs init
  913. * @pdev: DP PDEV handle
  914. *
  915. * return: QDF_STATUS
  916. */
  917. static inline
  918. QDF_STATUS dp_tx_capture_debugfs_init(struct dp_pdev *pdev)
  919. {
  920. return QDF_STATUS_E_FAILURE;
  921. }
  922. #endif
  923. #ifdef WLAN_TX_PKT_CAPTURE_ENH
  924. extern uint8_t
  925. dp_cpu_ring_map[DP_NSS_CPU_RING_MAP_MAX][WLAN_CFG_INT_NUM_CONTEXTS_MAX];
  926. #endif
  927. int
  928. dp_htt_get_ppdu_sniffer_ampdu_tlv_bitmap(uint32_t bitmap);
  929. #ifdef WDI_EVENT_ENABLE
  930. void dp_pkt_log_init(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, void *scn);
  931. #else
  932. static inline void
  933. dp_pkt_log_init(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, void *scn)
  934. {
  935. }
  936. #endif
  937. #ifdef WDI_EVENT_ENABLE
  938. QDF_STATUS dp_peer_stats_notify(struct dp_pdev *pdev, struct dp_peer *peer);
  939. #else
  940. static inline QDF_STATUS dp_peer_stats_notify(struct dp_pdev *pdev,
  941. struct dp_peer *peer)
  942. {
  943. return QDF_STATUS_SUCCESS;
  944. }
  945. #endif
  946. #ifndef WLAN_TX_PKT_CAPTURE_ENH
  947. /**
  948. * dp_tx_ppdu_stats_process - Deferred PPDU stats handler
  949. * @context: Opaque work context (PDEV)
  950. *
  951. * Return: none
  952. */
  953. static inline void dp_tx_ppdu_stats_process(void *context)
  954. {
  955. }
  956. /*
  957. * dp_tx_capture_htt_frame_counter: increment counter for htt_frame_type
  958. * pdev: DP pdev handle
  959. * htt_frame_type: htt frame type received from fw
  960. *
  961. * return: void
  962. */
  963. static inline
  964. void dp_tx_capture_htt_frame_counter(struct dp_pdev *pdev,
  965. uint32_t htt_frame_type)
  966. {
  967. }
  968. /*
  969. * dp_tx_cature_stats: print tx capture stats
  970. * @pdev: DP PDEV handle
  971. *
  972. * return: void
  973. */
  974. static inline
  975. void dp_print_pdev_tx_capture_stats(struct dp_pdev *pdev)
  976. {
  977. }
  978. #endif
  979. /**
  980. * dp_rx_cookie_2_mon_link_desc_va() - Converts cookie to a virtual address of
  981. * the MSDU Link Descriptor
  982. * @pdev: core txrx pdev context
  983. * @buf_info: buf_info includes cookie that used to lookup virtual address of
  984. * link descriptor. Normally this is just an index into a per pdev array.
  985. *
  986. * This is the VA of the link descriptor in monitor mode destination ring,
  987. * that HAL layer later uses to retrieve the list of MSDU's for a given MPDU.
  988. *
  989. * Return: void *: Virtual Address of the Rx descriptor
  990. */
  991. static inline
  992. void *dp_rx_cookie_2_mon_link_desc_va(struct dp_pdev *pdev,
  993. struct hal_buf_info *buf_info,
  994. int mac_id)
  995. {
  996. void *link_desc_va;
  997. struct qdf_mem_multi_page_t *pages;
  998. uint16_t page_id = LINK_DESC_COOKIE_PAGE_ID(buf_info->sw_cookie);
  999. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  1000. if (!mon_soc)
  1001. return NULL;
  1002. pages = &mon_soc->mon_link_desc_pages[mac_id];
  1003. if (!pages)
  1004. return NULL;
  1005. if (qdf_unlikely(page_id >= pages->num_pages))
  1006. return NULL;
  1007. link_desc_va = pages->dma_pages[page_id].page_v_addr_start +
  1008. (buf_info->paddr - pages->dma_pages[page_id].page_p_addr);
  1009. return link_desc_va;
  1010. }
  1011. /**
  1012. * dp_soc_is_full_mon_enable () - Return if full monitor mode is enabled
  1013. * @soc: DP soc handle
  1014. *
  1015. * Return: Full monitor mode status
  1016. */
  1017. static inline bool dp_soc_is_full_mon_enable(struct dp_pdev *pdev)
  1018. {
  1019. return (pdev->soc->monitor_soc->full_mon_mode &&
  1020. pdev->monitor_pdev->monitor_configured) ? true : false;
  1021. }
  1022. /*
  1023. * dp_mon_is_enable_reap_timer_non_pkt() - check if mon reap timer is
  1024. * enabled by non-pkt log or not
  1025. * @pdev: point to dp pdev
  1026. *
  1027. * Return: true if mon reap timer is enabled by non-pkt log
  1028. */
  1029. static inline bool dp_mon_is_enable_reap_timer_non_pkt(struct dp_pdev *pdev)
  1030. {
  1031. if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
  1032. return false;
  1033. return pdev->monitor_pdev->enable_reap_timer_non_pkt;
  1034. }
  1035. /*
  1036. * dp_monitor_is_enable_mcopy_mode() - check if mcopy mode is enabled
  1037. * @pdev: point to dp pdev
  1038. *
  1039. * Return: true if mcopy mode is enabled
  1040. */
  1041. static inline bool dp_monitor_is_enable_mcopy_mode(struct dp_pdev *pdev)
  1042. {
  1043. if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
  1044. return false;
  1045. return pdev->monitor_pdev->mcopy_mode;
  1046. }
  1047. /*
  1048. * dp_monitor_is_enable_tx_sniffer() - check if tx sniffer is enabled
  1049. * @pdev: point to dp pdev
  1050. *
  1051. * Return: true if tx sniffer is enabled
  1052. */
  1053. static inline bool dp_monitor_is_enable_tx_sniffer(struct dp_pdev *pdev)
  1054. {
  1055. if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
  1056. return false;
  1057. return pdev->monitor_pdev->tx_sniffer_enable;
  1058. }
  1059. /*
  1060. * dp_monitor_is_set_monitor_configured() - check if monitor configured is set
  1061. * @pdev: point to dp pdev
  1062. *
  1063. * Return: true if monitor configured is set
  1064. */
  1065. static inline bool dp_monitor_is_configured(struct dp_pdev *pdev)
  1066. {
  1067. if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
  1068. return false;
  1069. return pdev->monitor_pdev->monitor_configured;
  1070. }
  1071. /*
  1072. * dp_monitor_check_com_info_ppdu_id() - check if msdu ppdu_id matches with
  1073. * com info ppdu_id
  1074. * @pdev: point to dp pdev
  1075. * @rx_desc: point to rx_desc
  1076. *
  1077. * Return: success if ppdu_id matches
  1078. */
  1079. static inline QDF_STATUS dp_monitor_check_com_info_ppdu_id(struct dp_pdev *pdev,
  1080. void *rx_desc)
  1081. {
  1082. struct cdp_mon_status *rs;
  1083. struct dp_mon_pdev *mon_pdev;
  1084. uint32_t msdu_ppdu_id = 0;
  1085. if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
  1086. return QDF_STATUS_E_FAILURE;
  1087. mon_pdev = pdev->monitor_pdev;
  1088. if (qdf_likely(1 != mon_pdev->ppdu_info.rx_status.rxpcu_filter_pass))
  1089. return QDF_STATUS_E_FAILURE;
  1090. rs = &pdev->monitor_pdev->rx_mon_recv_status;
  1091. if (!rs || rs->cdp_rs_rxdma_err)
  1092. return QDF_STATUS_E_FAILURE;
  1093. msdu_ppdu_id = hal_rx_get_ppdu_id(pdev->soc->hal_soc, rx_desc);
  1094. if (msdu_ppdu_id != mon_pdev->ppdu_info.com_info.ppdu_id) {
  1095. QDF_TRACE(QDF_MODULE_ID_DP,
  1096. QDF_TRACE_LEVEL_ERROR,
  1097. "msdu_ppdu_id=%x,com_info.ppdu_id=%x",
  1098. msdu_ppdu_id,
  1099. mon_pdev->ppdu_info.com_info.ppdu_id);
  1100. return QDF_STATUS_E_FAILURE;
  1101. }
  1102. return QDF_STATUS_SUCCESS;
  1103. }
  1104. /*
  1105. * dp_monitor_get_rx_status() - get rx status
  1106. * @pdev: point to dp pdev
  1107. *
  1108. * Return: return rx status pointer
  1109. */
  1110. static inline struct mon_rx_status*
  1111. dp_monitor_get_rx_status(struct dp_pdev *pdev)
  1112. {
  1113. if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
  1114. return NULL;
  1115. return &pdev->monitor_pdev->ppdu_info.rx_status;
  1116. }
  1117. /*
  1118. * dp_monitor_is_chan_band_known() - check if monitor chan band known
  1119. * @pdev: point to dp pdev
  1120. *
  1121. * Return: true if chan band known
  1122. */
  1123. static inline bool dp_monitor_is_chan_band_known(struct dp_pdev *pdev)
  1124. {
  1125. if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
  1126. return false;
  1127. if (pdev->monitor_pdev->mon_chan_band != REG_BAND_UNKNOWN)
  1128. return true;
  1129. return false;
  1130. }
  1131. /*
  1132. * dp_monitor_get_chan_band() - get chan band
  1133. * @pdev: point to dp pdev
  1134. *
  1135. * Return: wifi channel band
  1136. */
  1137. static inline enum reg_wifi_band
  1138. dp_monitor_get_chan_band(struct dp_pdev *pdev)
  1139. {
  1140. return pdev->monitor_pdev->mon_chan_band;
  1141. }
  1142. /*
  1143. * dp_monitor_print_tx_stats() - print tx stats from monitor pdev
  1144. * @pdev: point to dp pdev
  1145. *
  1146. */
  1147. static inline void dp_monitor_print_tx_stats(struct dp_pdev *pdev)
  1148. {
  1149. if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
  1150. return;
  1151. DP_PRINT_STATS("ppdu info schedule completion list depth: %d",
  1152. pdev->monitor_pdev->sched_comp_list_depth);
  1153. DP_PRINT_STATS("delivered sched cmdid: %d",
  1154. pdev->monitor_pdev->delivered_sched_cmdid);
  1155. DP_PRINT_STATS("cur sched cmdid: %d",
  1156. pdev->monitor_pdev->last_sched_cmdid);
  1157. DP_PRINT_STATS("ppdu info list depth: %d",
  1158. pdev->monitor_pdev->list_depth);
  1159. }
  1160. /*
  1161. * dp_monitor_set_chan_num() - set channel number
  1162. * @pdev: point to dp pdev
  1163. * @chan_num: channel number
  1164. *
  1165. */
  1166. static inline void dp_monitor_set_chan_num(struct dp_pdev *pdev, int chan_num)
  1167. {
  1168. if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
  1169. return;
  1170. pdev->monitor_pdev->mon_chan_num = chan_num;
  1171. }
  1172. /*
  1173. * dp_monitor_set_chan_freq() - set channel frequency
  1174. * @pdev: point to dp pdev
  1175. * @chan_freq: channel frequency
  1176. *
  1177. */
  1178. static inline void
  1179. dp_monitor_set_chan_freq(struct dp_pdev *pdev, qdf_freq_t chan_freq)
  1180. {
  1181. if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
  1182. return;
  1183. pdev->monitor_pdev->mon_chan_freq = chan_freq;
  1184. }
  1185. /*
  1186. * dp_monitor_set_chan_band() - set channel band
  1187. * @pdev: point to dp pdev
  1188. * @chan_band: channel band
  1189. *
  1190. */
  1191. static inline void
  1192. dp_monitor_set_chan_band(struct dp_pdev *pdev, enum reg_wifi_band chan_band)
  1193. {
  1194. if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
  1195. return;
  1196. pdev->monitor_pdev->mon_chan_band = chan_band;
  1197. }
  1198. /*
  1199. * dp_monitor_get_mpdu_status() - get mpdu status
  1200. * @pdev: point to dp pdev
  1201. * @soc: point to dp soc
  1202. * @rx_tlv_hdr: point to rx tlv header
  1203. *
  1204. */
  1205. static inline void dp_monitor_get_mpdu_status(struct dp_pdev *pdev,
  1206. struct dp_soc *soc,
  1207. uint8_t *rx_tlv_hdr)
  1208. {
  1209. struct dp_mon_pdev *mon_pdev;
  1210. if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
  1211. return;
  1212. mon_pdev = pdev->monitor_pdev;
  1213. hal_rx_mon_hw_desc_get_mpdu_status(soc->hal_soc, rx_tlv_hdr,
  1214. &mon_pdev->ppdu_info.rx_status);
  1215. }
  1216. #ifdef FEATURE_NAC_RSSI
  1217. /*
  1218. * dp_monitor_drop_inv_peer_pkts() - drop invalid peer pkts
  1219. * @vdev: point to dp vdev
  1220. *
  1221. * Return: success if sta mode and filter for neighbour peers enabled
  1222. */
  1223. static inline QDF_STATUS dp_monitor_drop_inv_peer_pkts(struct dp_vdev *vdev)
  1224. {
  1225. struct dp_pdev *pdev = vdev->pdev;
  1226. struct dp_soc *soc = pdev->soc;
  1227. if (!soc->monitor_soc)
  1228. return QDF_STATUS_E_FAILURE;
  1229. if (!soc->monitor_soc->hw_nac_monitor_support &&
  1230. pdev->monitor_pdev->filter_neighbour_peers &&
  1231. vdev->opmode == wlan_op_mode_sta)
  1232. return QDF_STATUS_SUCCESS;
  1233. return QDF_STATUS_E_FAILURE;
  1234. }
  1235. #endif
  1236. /*
  1237. * dp_peer_ppdu_delayed_ba_init() - Initialize ppdu in peer
  1238. * @peer: Datapath peer
  1239. *
  1240. * return: void
  1241. */
  1242. #ifdef FEATURE_PERPKT_INFO
  1243. static inline void dp_peer_ppdu_delayed_ba_init(struct dp_peer *peer)
  1244. {
  1245. struct dp_mon_peer *mon_peer = peer->monitor_peer;
  1246. if (!mon_peer)
  1247. return;
  1248. qdf_mem_zero(&mon_peer->delayed_ba_ppdu_stats,
  1249. sizeof(struct cdp_delayed_tx_completion_ppdu_user));
  1250. mon_peer->last_delayed_ba = false;
  1251. mon_peer->last_delayed_ba_ppduid = 0;
  1252. }
  1253. #else
  1254. static inline void dp_peer_ppdu_delayed_ba_init(struct dp_peer *peer)
  1255. {
  1256. }
  1257. #endif
  1258. /*
  1259. * dp_monitor_vdev_register_osif() - Register osif rx mon
  1260. * @vdev: point to vdev
  1261. * @txrx_ops: point to ol txrx ops
  1262. *
  1263. * Return: void
  1264. */
  1265. static inline void dp_monitor_vdev_register_osif(struct dp_vdev *vdev,
  1266. struct ol_txrx_ops *txrx_ops)
  1267. {
  1268. if (!vdev->monitor_vdev)
  1269. return;
  1270. vdev->monitor_vdev->osif_rx_mon = txrx_ops->rx.mon;
  1271. }
  1272. /*
  1273. * dp_monitor_get_monitor_vdev_from_pdev() - Get monitor vdev
  1274. * @pdev: point to pdev
  1275. *
  1276. * Return: pointer to vdev
  1277. */
  1278. static inline struct dp_vdev*
  1279. dp_monitor_get_monitor_vdev_from_pdev(struct dp_pdev *pdev)
  1280. {
  1281. if (!pdev || !pdev->monitor_pdev || !pdev->monitor_pdev->mvdev)
  1282. return NULL;
  1283. return pdev->monitor_pdev->mvdev;
  1284. }
  1285. /*
  1286. * dp_monitor_is_vdev_timer_running() - Get vdev timer status
  1287. * @soc: point to soc
  1288. *
  1289. * Return: true if timer running
  1290. */
  1291. static inline bool dp_monitor_is_vdev_timer_running(struct dp_soc *soc)
  1292. {
  1293. if (qdf_unlikely(!soc || !soc->monitor_soc))
  1294. return false;
  1295. return !!(soc->monitor_soc->mon_vdev_timer_state &
  1296. MON_VDEV_TIMER_RUNNING);
  1297. }
  1298. /*
  1299. * dp_monitor_get_link_desc_pages() - Get link desc pages
  1300. * @soc: point to soc
  1301. * @mac_id: mac id
  1302. *
  1303. * Return: return point to link desc pages
  1304. */
  1305. static inline struct qdf_mem_multi_page_t*
  1306. dp_monitor_get_link_desc_pages(struct dp_soc *soc, uint32_t mac_id)
  1307. {
  1308. if (qdf_unlikely(!soc || !soc->monitor_soc))
  1309. return NULL;
  1310. return &soc->monitor_soc->mon_link_desc_pages[mac_id];
  1311. }
  1312. /*
  1313. * dp_monitor_get_total_link_descs() - Get total link descs
  1314. * @soc: point to soc
  1315. * @mac_id: mac id
  1316. *
  1317. * Return: return point total link descs
  1318. */
  1319. static inline uint32_t *
  1320. dp_monitor_get_total_link_descs(struct dp_soc *soc, uint32_t mac_id)
  1321. {
  1322. return &soc->monitor_soc->total_mon_link_descs[mac_id];
  1323. }
  1324. /*
  1325. * dp_monitor_pdev_attach() - Monitor pdev attach
  1326. * @pdev: point to pdev
  1327. *
  1328. * Return: return QDF_STATUS
  1329. */
  1330. static inline QDF_STATUS dp_monitor_pdev_attach(struct dp_pdev *pdev)
  1331. {
  1332. struct dp_mon_ops *monitor_ops;
  1333. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  1334. /*
  1335. * mon_soc uninitialized modular support enabled
  1336. * monitor related attach/detach/init/deinit
  1337. * will be done while monitor insmod
  1338. */
  1339. if (!mon_soc)
  1340. return QDF_STATUS_SUCCESS;
  1341. monitor_ops = mon_soc->mon_ops;
  1342. if (!monitor_ops || !monitor_ops->mon_pdev_attach) {
  1343. dp_mon_debug("callback not registered");
  1344. return QDF_STATUS_E_FAILURE;
  1345. }
  1346. return monitor_ops->mon_pdev_attach(pdev);
  1347. }
  1348. /*
  1349. * dp_monitor_pdev_detach() - Monitor pdev detach
  1350. * @pdev: point to pdev
  1351. *
  1352. * Return: return QDF_STATUS
  1353. */
  1354. static inline QDF_STATUS dp_monitor_pdev_detach(struct dp_pdev *pdev)
  1355. {
  1356. struct dp_mon_ops *monitor_ops;
  1357. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  1358. /*
  1359. * mon_soc uninitialized modular support enabled
  1360. * monitor related attach/detach/init/deinit
  1361. * will be done while monitor insmod
  1362. */
  1363. if (!mon_soc)
  1364. return QDF_STATUS_SUCCESS;
  1365. monitor_ops = mon_soc->mon_ops;
  1366. if (!monitor_ops || !monitor_ops->mon_pdev_detach) {
  1367. dp_mon_debug("callback not registered");
  1368. return QDF_STATUS_E_FAILURE;
  1369. }
  1370. return monitor_ops->mon_pdev_detach(pdev);
  1371. }
  1372. /*
  1373. * dp_monitor_vdev_attach() - Monitor vdev attach
  1374. * @vdev: point to vdev
  1375. *
  1376. * Return: return QDF_STATUS
  1377. */
  1378. static inline QDF_STATUS dp_monitor_vdev_attach(struct dp_vdev *vdev)
  1379. {
  1380. struct dp_mon_ops *monitor_ops;
  1381. struct dp_mon_soc *mon_soc = vdev->pdev->soc->monitor_soc;
  1382. if (!mon_soc)
  1383. return QDF_STATUS_E_FAILURE;
  1384. monitor_ops = mon_soc->mon_ops;
  1385. if (!monitor_ops || !monitor_ops->mon_vdev_attach) {
  1386. dp_mon_debug("callback not registered");
  1387. return QDF_STATUS_E_FAILURE;
  1388. }
  1389. return monitor_ops->mon_vdev_attach(vdev);
  1390. }
  1391. /*
  1392. * dp_monitor_vdev_detach() - Monitor vdev detach
  1393. * @vdev: point to vdev
  1394. *
  1395. * Return: return QDF_STATUS
  1396. */
  1397. static inline QDF_STATUS dp_monitor_vdev_detach(struct dp_vdev *vdev)
  1398. {
  1399. struct dp_mon_ops *monitor_ops;
  1400. struct dp_mon_soc *mon_soc = vdev->pdev->soc->monitor_soc;
  1401. if (!mon_soc)
  1402. return QDF_STATUS_E_FAILURE;
  1403. monitor_ops = mon_soc->mon_ops;
  1404. if (!monitor_ops || !monitor_ops->mon_vdev_detach) {
  1405. dp_mon_debug("callback not registered");
  1406. return QDF_STATUS_E_FAILURE;
  1407. }
  1408. return monitor_ops->mon_vdev_detach(vdev);
  1409. }
  1410. /*
  1411. * dp_monitor_peer_attach() - Monitor peer attach
  1412. * @soc: point to soc
  1413. * @peer: point to peer
  1414. *
  1415. * Return: return QDF_STATUS
  1416. */
  1417. static inline QDF_STATUS dp_monitor_peer_attach(struct dp_soc *soc,
  1418. struct dp_peer *peer)
  1419. {
  1420. struct dp_mon_ops *monitor_ops;
  1421. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  1422. if (!mon_soc)
  1423. return QDF_STATUS_E_FAILURE;
  1424. monitor_ops = mon_soc->mon_ops;
  1425. if (!monitor_ops || !monitor_ops->mon_peer_attach) {
  1426. dp_mon_debug("callback not registered");
  1427. return QDF_STATUS_E_FAILURE;
  1428. }
  1429. return monitor_ops->mon_peer_attach(peer);
  1430. }
  1431. /*
  1432. * dp_monitor_peer_detach() - Monitor peer detach
  1433. * @soc: point to soc
  1434. * @peer: point to peer
  1435. *
  1436. * Return: return QDF_STATUS
  1437. */
  1438. static inline QDF_STATUS dp_monitor_peer_detach(struct dp_soc *soc,
  1439. struct dp_peer *peer)
  1440. {
  1441. struct dp_mon_ops *monitor_ops;
  1442. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  1443. if (!mon_soc)
  1444. return QDF_STATUS_E_FAILURE;
  1445. monitor_ops = mon_soc->mon_ops;
  1446. if (!monitor_ops || !monitor_ops->mon_peer_detach) {
  1447. dp_mon_debug("callback not registered");
  1448. return QDF_STATUS_E_FAILURE;
  1449. }
  1450. return monitor_ops->mon_peer_detach(peer);
  1451. }
  1452. /*
  1453. * dp_monitor_pdev_init() - Monitor pdev init
  1454. * @pdev: point to pdev
  1455. *
  1456. * Return: return QDF_STATUS
  1457. */
  1458. static inline QDF_STATUS dp_monitor_pdev_init(struct dp_pdev *pdev)
  1459. {
  1460. struct dp_mon_ops *monitor_ops;
  1461. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  1462. /*
  1463. * mon_soc uninitialized when modular support enabled
  1464. * monitor related attach/detach/init/deinit
  1465. * will be done while monitor insmod
  1466. */
  1467. if (!mon_soc)
  1468. return QDF_STATUS_SUCCESS;
  1469. monitor_ops = mon_soc->mon_ops;
  1470. if (!monitor_ops || !monitor_ops->mon_pdev_init) {
  1471. dp_mon_debug("callback not registered");
  1472. return QDF_STATUS_E_FAILURE;
  1473. }
  1474. return monitor_ops->mon_pdev_init(pdev);
  1475. }
  1476. /*
  1477. * dp_monitor_pdev_deinit() - Monitor pdev deinit
  1478. * @pdev: point to pdev
  1479. *
  1480. * Return: return QDF_STATUS
  1481. */
  1482. static inline QDF_STATUS dp_monitor_pdev_deinit(struct dp_pdev *pdev)
  1483. {
  1484. struct dp_mon_ops *monitor_ops;
  1485. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  1486. /*
  1487. * mon_soc uninitialized modular when support enabled
  1488. * monitor related attach/detach/init/deinit
  1489. * will be done while monitor insmod
  1490. */
  1491. if (!mon_soc)
  1492. return QDF_STATUS_SUCCESS;
  1493. monitor_ops = mon_soc->mon_ops;
  1494. if (!monitor_ops || !monitor_ops->mon_pdev_deinit) {
  1495. dp_mon_debug("callback not registered");
  1496. return QDF_STATUS_E_FAILURE;
  1497. }
  1498. return monitor_ops->mon_pdev_deinit(pdev);
  1499. }
  1500. /*
  1501. * dp_monitor_soc_cfg_init() - Monitor sco cfg init
  1502. * @soc: point to soc
  1503. *
  1504. * Return: return QDF_STATUS
  1505. */
  1506. static inline QDF_STATUS dp_monitor_soc_cfg_init(struct dp_soc *soc)
  1507. {
  1508. struct dp_mon_ops *monitor_ops;
  1509. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  1510. /*
  1511. * this API is getting call from dp_soc_init,
  1512. * mon_soc will be uninitialized when monitor support enabled
  1513. * So returning QDF_STATUS_SUCCESS.
  1514. * soc cfg init will be done while monitor insmod.
  1515. */
  1516. if (!mon_soc)
  1517. return QDF_STATUS_SUCCESS;
  1518. monitor_ops = mon_soc->mon_ops;
  1519. if (!monitor_ops || !monitor_ops->mon_soc_cfg_init) {
  1520. dp_mon_debug("callback not registered");
  1521. return QDF_STATUS_E_FAILURE;
  1522. }
  1523. return monitor_ops->mon_soc_cfg_init(soc);
  1524. }
  1525. /*
  1526. * dp_monitor_config_debug_sniffer() - Monitor config debug sniffer
  1527. * @pdev: point to pdev
  1528. * @val: val
  1529. *
  1530. * Return: return QDF_STATUS
  1531. */
  1532. static inline QDF_STATUS dp_monitor_config_debug_sniffer(struct dp_pdev *pdev,
  1533. int val)
  1534. {
  1535. struct dp_mon_ops *monitor_ops;
  1536. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  1537. if (!mon_soc)
  1538. return QDF_STATUS_E_FAILURE;
  1539. monitor_ops = mon_soc->mon_ops;
  1540. if (!monitor_ops || !monitor_ops->mon_config_debug_sniffer) {
  1541. dp_mon_debug("callback not registered");
  1542. return QDF_STATUS_E_FAILURE;
  1543. }
  1544. return monitor_ops->mon_config_debug_sniffer(pdev, val);
  1545. }
  1546. /*
  1547. * dp_monitor_flush_rings() - Flush monitor rings
  1548. * @soc: point to soc
  1549. *
  1550. * Return: None
  1551. */
  1552. static inline void dp_monitor_flush_rings(struct dp_soc *soc)
  1553. {
  1554. struct dp_mon_ops *monitor_ops;
  1555. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  1556. if (!mon_soc) {
  1557. dp_mon_debug("monitor soc is NULL");
  1558. return;
  1559. }
  1560. monitor_ops = mon_soc->mon_ops;
  1561. if (!monitor_ops || !monitor_ops->mon_flush_rings) {
  1562. dp_mon_debug("callback not registered");
  1563. return;
  1564. }
  1565. return monitor_ops->mon_flush_rings(soc);
  1566. }
  1567. /*
  1568. * dp_monitor_htt_srng_setup() - Setup htt srng
  1569. * @soc: point to soc
  1570. * @pdev: point to pdev
  1571. * @mac_id: lmac id
  1572. * @mac for pdev: pdev id
  1573. *
  1574. * Return: QDF_STATUS
  1575. */
  1576. #if !defined(DISABLE_MON_CONFIG)
  1577. static inline QDF_STATUS dp_monitor_htt_srng_setup(struct dp_soc *soc,
  1578. struct dp_pdev *pdev,
  1579. int mac_id,
  1580. int mac_for_pdev)
  1581. {
  1582. struct dp_mon_ops *monitor_ops;
  1583. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  1584. if (!mon_soc) {
  1585. dp_mon_debug("monitor soc is NULL");
  1586. return QDF_STATUS_SUCCESS;
  1587. }
  1588. monitor_ops = mon_soc->mon_ops;
  1589. if (!monitor_ops || !monitor_ops->mon_pdev_htt_srng_setup) {
  1590. dp_mon_debug("callback not registered");
  1591. return QDF_STATUS_E_FAILURE;
  1592. }
  1593. return monitor_ops->mon_pdev_htt_srng_setup(soc, pdev, mac_id,
  1594. mac_for_pdev);
  1595. }
  1596. static inline QDF_STATUS dp_monitor_soc_htt_srng_setup(struct dp_soc *soc)
  1597. {
  1598. struct dp_mon_ops *monitor_ops;
  1599. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  1600. if (!mon_soc) {
  1601. dp_mon_debug("monitor soc is NULL");
  1602. return QDF_STATUS_SUCCESS;
  1603. }
  1604. monitor_ops = mon_soc->mon_ops;
  1605. if (!monitor_ops || !monitor_ops->mon_soc_htt_srng_setup) {
  1606. dp_mon_debug("callback not registered");
  1607. return QDF_STATUS_E_FAILURE;
  1608. }
  1609. return monitor_ops->mon_soc_htt_srng_setup(soc);
  1610. }
  1611. #else
  1612. static inline QDF_STATUS dp_monitor_htt_srng_setup(struct dp_soc *soc,
  1613. struct dp_pdev *pdev,
  1614. int mac_id,
  1615. int mac_for_pdev)
  1616. {
  1617. return QDF_STATUS_SUCCESS;
  1618. }
  1619. #endif
  1620. /*
  1621. * dp_monitor_service_mon_rings() - service monitor rings
  1622. * @soc: point to soc
  1623. * @quota: reap budget
  1624. *
  1625. * Return: None
  1626. */
  1627. #if defined(DP_CON_MON)
  1628. static inline
  1629. void dp_monitor_service_mon_rings(struct dp_soc *soc, uint32_t quota)
  1630. {
  1631. struct dp_mon_ops *monitor_ops;
  1632. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  1633. if (!mon_soc) {
  1634. dp_mon_debug("monitor soc is NULL");
  1635. return;
  1636. }
  1637. monitor_ops = mon_soc->mon_ops;
  1638. if (!monitor_ops || !monitor_ops->mon_service_rings) {
  1639. dp_mon_debug("callback not registered");
  1640. return;
  1641. }
  1642. return monitor_ops->mon_service_rings(soc, quota);
  1643. }
  1644. #endif
  1645. /*
  1646. * dp_rx_monitor_process() - Process monitor
  1647. * @soc: point to soc
  1648. * @int_ctx: interrupt ctx
  1649. * @mac_id: lma
  1650. * @quota:
  1651. *
  1652. * Return: None
  1653. */
  1654. #ifndef DISABLE_MON_CONFIG
  1655. static inline
  1656. uint32_t dp_monitor_process(struct dp_soc *soc, struct dp_intr *int_ctx,
  1657. uint32_t mac_id, uint32_t quota)
  1658. {
  1659. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  1660. if (!mon_soc) {
  1661. dp_mon_debug("monitor soc is NULL");
  1662. return 0;
  1663. }
  1664. if (!mon_soc->mon_rx_process) {
  1665. dp_mon_debug("callback not registered");
  1666. return 0;
  1667. }
  1668. return mon_soc->mon_rx_process(soc, int_ctx, mac_id, quota);
  1669. }
  1670. static inline
  1671. uint32_t dp_tx_mon_process(struct dp_soc *soc, struct dp_intr *int_ctx,
  1672. uint32_t mac_id, uint32_t quota)
  1673. {
  1674. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  1675. struct dp_mon_ops *monitor_ops;
  1676. if (!mon_soc) {
  1677. dp_mon_debug("monitor soc is NULL");
  1678. return 0;
  1679. }
  1680. monitor_ops = mon_soc->mon_ops;
  1681. if (!monitor_ops || !monitor_ops->mon_tx_process) {
  1682. dp_mon_debug("callback not registered");
  1683. return 0;
  1684. }
  1685. return monitor_ops->mon_tx_process(soc, int_ctx, mac_id, quota);
  1686. }
  1687. static inline
  1688. uint32_t dp_tx_mon_buf_refill(struct dp_intr *int_ctx)
  1689. {
  1690. struct dp_soc *soc = int_ctx->soc;
  1691. struct dp_mon_ops *monitor_ops;
  1692. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  1693. if (!mon_soc) {
  1694. dp_mon_debug("monitor soc is NULL");
  1695. return 0;
  1696. }
  1697. monitor_ops = mon_soc->mon_ops;
  1698. if (!monitor_ops || !monitor_ops->tx_mon_refill_buf_ring) {
  1699. dp_mon_debug("callback not registered");
  1700. return 0;
  1701. }
  1702. return monitor_ops->tx_mon_refill_buf_ring(int_ctx);
  1703. }
  1704. static inline
  1705. uint32_t dp_rx_mon_buf_refill(struct dp_intr *int_ctx)
  1706. {
  1707. struct dp_soc *soc = int_ctx->soc;
  1708. struct dp_mon_ops *monitor_ops;
  1709. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  1710. if (!mon_soc) {
  1711. dp_mon_debug("monitor soc is NULL");
  1712. return 0;
  1713. }
  1714. monitor_ops = mon_soc->mon_ops;
  1715. if (!monitor_ops || !monitor_ops->rx_mon_refill_buf_ring) {
  1716. dp_mon_debug("callback not registered");
  1717. return 0;
  1718. }
  1719. return monitor_ops->rx_mon_refill_buf_ring(int_ctx);
  1720. }
  1721. #else
  1722. static inline
  1723. uint32_t dp_monitor_process(struct dp_soc *soc, struct dp_intr *int_ctx,
  1724. uint32_t mac_id, uint32_t quota)
  1725. {
  1726. return 0;
  1727. }
  1728. static inline uint32_t
  1729. dp_tx_mon_process(struct dp_soc *soc, struct dp_intr *int_ctx,
  1730. uint32_t mac_id, uint32_t quota)
  1731. {
  1732. return 0;
  1733. }
  1734. static inline
  1735. uint32_t dp_tx_mon_buf_refill(struct dp_intr *int_ctx)
  1736. {
  1737. }
  1738. static inline
  1739. uint32_t dp_rx_mon_buf_refill(struct dp_intr *int_ctx)
  1740. {
  1741. }
  1742. #endif
  1743. /*
  1744. * dp_monitor_drop_packets_for_mac() - monitor_drop_packets_for_mac
  1745. * @pdev: point to pdev
  1746. * @mac_id:
  1747. * @quota:
  1748. *
  1749. * Return:
  1750. */
  1751. #if !defined(DISABLE_MON_CONFIG) && defined(MON_ENABLE_DROP_FOR_MAC)
  1752. static inline
  1753. uint32_t dp_monitor_drop_packets_for_mac(struct dp_pdev *pdev,
  1754. uint32_t mac_id, uint32_t quota)
  1755. {
  1756. struct dp_mon_ops *monitor_ops;
  1757. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  1758. if (!mon_soc) {
  1759. dp_mon_debug("monitor soc is NULL");
  1760. return 0;
  1761. }
  1762. monitor_ops = mon_soc->mon_ops;
  1763. if (!monitor_ops || !monitor_ops->mon_drop_packets_for_mac) {
  1764. dp_mon_debug("callback not registered");
  1765. return 0;
  1766. }
  1767. return monitor_ops->mon_drop_packets_for_mac(pdev,
  1768. mac_id, quota);
  1769. }
  1770. #else
  1771. static inline
  1772. uint32_t dp_monitor_drop_packets_for_mac(struct dp_pdev *pdev,
  1773. uint32_t mac_id, uint32_t quota)
  1774. {
  1775. return 0;
  1776. }
  1777. #endif
  1778. /*
  1779. * dp_monitor_peer_tx_init() - peer tx init
  1780. * @pdev: point to pdev
  1781. * @peer: point to peer
  1782. *
  1783. * Return: None
  1784. */
  1785. static inline void dp_monitor_peer_tx_init(struct dp_pdev *pdev,
  1786. struct dp_peer *peer)
  1787. {
  1788. struct dp_mon_ops *monitor_ops;
  1789. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  1790. if (!mon_soc) {
  1791. dp_mon_debug("monitor soc is NULL");
  1792. return;
  1793. }
  1794. monitor_ops = mon_soc->mon_ops;
  1795. if (!monitor_ops || !monitor_ops->mon_peer_tx_init) {
  1796. dp_mon_debug("callback not registered");
  1797. return;
  1798. }
  1799. return monitor_ops->mon_peer_tx_init(pdev, peer);
  1800. }
  1801. /*
  1802. * dp_monitor_peer_tx_cleanup() - peer tx cleanup
  1803. * @vdev: point to vdev
  1804. * @peer: point to peer
  1805. *
  1806. * Return: None
  1807. */
  1808. static inline void dp_monitor_peer_tx_cleanup(struct dp_vdev *vdev,
  1809. struct dp_peer *peer)
  1810. {
  1811. struct dp_mon_ops *monitor_ops;
  1812. struct dp_mon_soc *mon_soc = vdev->pdev->soc->monitor_soc;
  1813. if (!mon_soc) {
  1814. dp_mon_debug("monitor soc is NULL");
  1815. return;
  1816. }
  1817. monitor_ops = mon_soc->mon_ops;
  1818. if (!monitor_ops || !monitor_ops->mon_peer_tx_cleanup) {
  1819. dp_mon_debug("callback not registered");
  1820. return;
  1821. }
  1822. return monitor_ops->mon_peer_tx_cleanup(vdev, peer);
  1823. }
  1824. #ifdef WLAN_TX_PKT_CAPTURE_ENH
  1825. /*
  1826. * dp_monitor_peer_tid_peer_id_update() - peer tid update
  1827. * @soc: point to soc
  1828. * @peer: point to peer
  1829. * @peer_id: peer id
  1830. *
  1831. * Return: None
  1832. */
  1833. static inline
  1834. void dp_monitor_peer_tid_peer_id_update(struct dp_soc *soc,
  1835. struct dp_peer *peer,
  1836. uint16_t peer_id)
  1837. {
  1838. struct dp_mon_ops *monitor_ops;
  1839. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  1840. if (!mon_soc) {
  1841. dp_mon_debug("monitor soc is NULL");
  1842. return;
  1843. }
  1844. monitor_ops = mon_soc->mon_ops;
  1845. if (!monitor_ops || !monitor_ops->mon_peer_tid_peer_id_update) {
  1846. dp_mon_debug("callback not registered");
  1847. return;
  1848. }
  1849. return monitor_ops->mon_peer_tid_peer_id_update(peer, peer_id);
  1850. }
  1851. /*
  1852. * dp_monitor_tx_ppdu_stats_attach() - Attach tx ppdu stats
  1853. * @pdev: point to pdev
  1854. *
  1855. * Return: None
  1856. */
  1857. static inline void dp_monitor_tx_ppdu_stats_attach(struct dp_pdev *pdev)
  1858. {
  1859. struct dp_mon_ops *monitor_ops;
  1860. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  1861. if (!mon_soc) {
  1862. dp_mon_debug("monitor soc is NULL");
  1863. return;
  1864. }
  1865. monitor_ops = mon_soc->mon_ops;
  1866. if (!monitor_ops || !monitor_ops->mon_tx_ppdu_stats_attach) {
  1867. dp_mon_debug("callback not registered");
  1868. return;
  1869. }
  1870. return monitor_ops->mon_tx_ppdu_stats_attach(pdev);
  1871. }
  1872. /*
  1873. * dp_monitor_tx_ppdu_stats_detach() - Detach tx ppdu stats
  1874. * @pdev: point to pdev
  1875. *
  1876. * Return: None
  1877. */
  1878. static inline void dp_monitor_tx_ppdu_stats_detach(struct dp_pdev *pdev)
  1879. {
  1880. struct dp_mon_ops *monitor_ops;
  1881. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  1882. if (!mon_soc) {
  1883. dp_mon_debug("monitor soc is NULL");
  1884. return;
  1885. }
  1886. monitor_ops = mon_soc->mon_ops;
  1887. if (!monitor_ops || !monitor_ops->mon_tx_ppdu_stats_detach) {
  1888. dp_mon_debug("callback not registered");
  1889. return;
  1890. }
  1891. return monitor_ops->mon_tx_ppdu_stats_detach(pdev);
  1892. }
  1893. /*
  1894. * dp_monitor_tx_capture_debugfs_init() - Init tx capture debugfs
  1895. * @pdev: point to pdev
  1896. *
  1897. * Return: QDF_STATUS_SUCCESS
  1898. */
  1899. static inline
  1900. QDF_STATUS dp_monitor_tx_capture_debugfs_init(struct dp_pdev *pdev)
  1901. {
  1902. struct dp_mon_ops *monitor_ops;
  1903. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  1904. if (!mon_soc) {
  1905. dp_mon_debug("monitor soc is NULL");
  1906. return QDF_STATUS_E_FAILURE;
  1907. }
  1908. monitor_ops = mon_soc->mon_ops;
  1909. if (!monitor_ops || !monitor_ops->mon_tx_capture_debugfs_init) {
  1910. dp_mon_debug("callback not registered");
  1911. return QDF_STATUS_E_FAILURE;
  1912. }
  1913. return monitor_ops->mon_tx_capture_debugfs_init(pdev);
  1914. }
  1915. /*
  1916. * dp_monitor_peer_tx_capture_filter_check() - Check tx capture filter
  1917. * @pdev: point to pdev
  1918. * @peer: point to peer
  1919. *
  1920. * Return: None
  1921. */
  1922. static inline void dp_monitor_peer_tx_capture_filter_check(struct dp_pdev *pdev,
  1923. struct dp_peer *peer)
  1924. {
  1925. struct dp_mon_ops *monitor_ops;
  1926. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  1927. if (!mon_soc) {
  1928. dp_mon_debug("monitor soc is NULL");
  1929. return;
  1930. }
  1931. monitor_ops = mon_soc->mon_ops;
  1932. if (!monitor_ops || !monitor_ops->mon_peer_tx_capture_filter_check) {
  1933. dp_mon_debug("callback not registered");
  1934. return;
  1935. }
  1936. return monitor_ops->mon_peer_tx_capture_filter_check(pdev, peer);
  1937. }
  1938. /*
  1939. * dp_monitor_tx_add_to_comp_queue() - add completion msdu to queue
  1940. *
  1941. * This API returns QDF_STATUS_SUCCESS in case where buffer is added
  1942. * to txmonitor queue successfuly caller will not free the buffer in
  1943. * this case. In other cases this API return QDF_STATUS_E_FAILURE and
  1944. * caller frees the buffer
  1945. *
  1946. * @soc: point to soc
  1947. * @desc: point to tx desc
  1948. * @ts: Tx completion status from HAL/HTT descriptor
  1949. * @peer: DP peer
  1950. *
  1951. * Return: QDF_STATUS
  1952. *
  1953. */
  1954. static inline
  1955. QDF_STATUS dp_monitor_tx_add_to_comp_queue(struct dp_soc *soc,
  1956. struct dp_tx_desc_s *desc,
  1957. struct hal_tx_completion_status *ts,
  1958. struct dp_peer *peer)
  1959. {
  1960. struct dp_mon_ops *monitor_ops;
  1961. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  1962. if (!mon_soc) {
  1963. dp_mon_debug("monitor soc is NULL");
  1964. return QDF_STATUS_E_FAILURE;
  1965. }
  1966. monitor_ops = mon_soc->mon_ops;
  1967. if (!monitor_ops || !monitor_ops->mon_tx_add_to_comp_queue) {
  1968. dp_mon_debug("callback not registered");
  1969. return QDF_STATUS_E_FAILURE;
  1970. }
  1971. return monitor_ops->mon_tx_add_to_comp_queue(soc, desc, ts, peer);
  1972. }
  1973. static inline
  1974. QDF_STATUS monitor_update_msdu_to_list(struct dp_soc *soc,
  1975. struct dp_pdev *pdev,
  1976. struct dp_peer *peer,
  1977. struct hal_tx_completion_status *ts,
  1978. qdf_nbuf_t netbuf)
  1979. {
  1980. struct dp_mon_ops *monitor_ops;
  1981. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  1982. if (!mon_soc) {
  1983. dp_mon_debug("monitor soc is NULL");
  1984. return QDF_STATUS_SUCCESS;
  1985. }
  1986. monitor_ops = mon_soc->mon_ops;
  1987. if (!monitor_ops || !monitor_ops->mon_update_msdu_to_list) {
  1988. dp_mon_debug("callback not registered");
  1989. return QDF_STATUS_E_FAILURE;
  1990. }
  1991. return monitor_ops->mon_update_msdu_to_list(soc, pdev,
  1992. peer, ts, netbuf);
  1993. }
  1994. #else
  1995. static inline
  1996. void dp_monitor_peer_tid_peer_id_update(struct dp_soc *soc,
  1997. struct dp_peer *peer,
  1998. uint16_t peer_id)
  1999. {
  2000. }
  2001. static inline void dp_monitor_tx_ppdu_stats_attach(struct dp_pdev *pdev)
  2002. {
  2003. }
  2004. static inline void dp_monitor_tx_ppdu_stats_detach(struct dp_pdev *pdev)
  2005. {
  2006. }
  2007. static inline
  2008. QDF_STATUS dp_monitor_tx_capture_debugfs_init(struct dp_pdev *pdev)
  2009. {
  2010. return QDF_STATUS_E_FAILURE;
  2011. }
  2012. static inline void dp_monitor_peer_tx_capture_filter_check(struct dp_pdev *pdev,
  2013. struct dp_peer *peer)
  2014. {
  2015. }
  2016. static inline
  2017. QDF_STATUS dp_monitor_tx_add_to_comp_queue(struct dp_soc *soc,
  2018. struct dp_tx_desc_s *desc,
  2019. struct hal_tx_completion_status *ts,
  2020. struct dp_peer *peer)
  2021. {
  2022. return QDF_STATUS_E_FAILURE;
  2023. }
  2024. static inline
  2025. QDF_STATUS monitor_update_msdu_to_list(struct dp_soc *soc,
  2026. struct dp_pdev *pdev,
  2027. struct dp_peer *peer,
  2028. struct hal_tx_completion_status *ts,
  2029. qdf_nbuf_t netbuf)
  2030. {
  2031. return QDF_STATUS_E_FAILURE;
  2032. }
  2033. #endif
  2034. /*
  2035. * dp_monitor_ppdu_stats_ind_handler() - PPDU stats msg handler
  2036. * @htt_soc: HTT SOC handle
  2037. * @msg_word: Pointer to payload
  2038. * @htt_t2h_msg: HTT msg nbuf
  2039. *
  2040. * Return: True if buffer should be freed by caller.
  2041. */
  2042. #if defined(WDI_EVENT_ENABLE) &&\
  2043. (defined(QCA_ENHANCED_STATS_SUPPORT) || !defined(REMOVE_PKT_LOG))
  2044. static inline bool dp_monitor_ppdu_stats_ind_handler(struct htt_soc *soc,
  2045. uint32_t *msg_word,
  2046. qdf_nbuf_t htt_t2h_msg)
  2047. {
  2048. struct dp_mon_ops *monitor_ops;
  2049. struct dp_mon_soc *mon_soc = soc->dp_soc->monitor_soc;
  2050. if (!mon_soc) {
  2051. dp_mon_debug("monitor soc is NULL");
  2052. return true;
  2053. }
  2054. monitor_ops = mon_soc->mon_ops;
  2055. if (!monitor_ops || !monitor_ops->mon_ppdu_stats_ind_handler) {
  2056. dp_mon_debug("callback not registered");
  2057. return true;
  2058. }
  2059. return monitor_ops->mon_ppdu_stats_ind_handler(soc, msg_word,
  2060. htt_t2h_msg);
  2061. }
  2062. #else
  2063. static inline bool dp_monitor_ppdu_stats_ind_handler(struct htt_soc *soc,
  2064. uint32_t *msg_word,
  2065. qdf_nbuf_t htt_t2h_msg)
  2066. {
  2067. return true;
  2068. }
  2069. #endif
  2070. /*
  2071. * dp_monitor_htt_ppdu_stats_attach() - attach resources for HTT PPDU
  2072. * stats processing
  2073. * @pdev: Datapath PDEV handle
  2074. *
  2075. * Return: QDF_STATUS
  2076. */
  2077. static inline QDF_STATUS dp_monitor_htt_ppdu_stats_attach(struct dp_pdev *pdev)
  2078. {
  2079. struct dp_mon_ops *monitor_ops;
  2080. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2081. if (!mon_soc) {
  2082. dp_mon_debug("monitor soc is NULL");
  2083. return QDF_STATUS_SUCCESS;
  2084. }
  2085. monitor_ops = mon_soc->mon_ops;
  2086. if (!monitor_ops || !monitor_ops->mon_htt_ppdu_stats_attach) {
  2087. dp_mon_debug("callback not registered");
  2088. return QDF_STATUS_E_FAILURE;
  2089. }
  2090. return monitor_ops->mon_htt_ppdu_stats_attach(pdev);
  2091. }
  2092. /*
  2093. * dp_monitor_htt_ppdu_stats_detach() - detach stats resources
  2094. * @pdev: Datapath PDEV handle
  2095. *
  2096. * Return: void
  2097. */
  2098. static inline void dp_monitor_htt_ppdu_stats_detach(struct dp_pdev *pdev)
  2099. {
  2100. struct dp_mon_ops *monitor_ops;
  2101. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2102. if (!mon_soc) {
  2103. dp_mon_debug("monitor soc is NULL");
  2104. return;
  2105. }
  2106. monitor_ops = mon_soc->mon_ops;
  2107. if (!monitor_ops || !monitor_ops->mon_htt_ppdu_stats_detach) {
  2108. dp_mon_debug("callback not registered");
  2109. return;
  2110. }
  2111. return monitor_ops->mon_htt_ppdu_stats_detach(pdev);
  2112. }
  2113. /*
  2114. * dp_monitor_print_pdev_rx_mon_stats() - print rx mon stats
  2115. * @pdev: Datapath PDEV handle
  2116. *
  2117. * Return: void
  2118. */
  2119. static inline void dp_monitor_print_pdev_rx_mon_stats(struct dp_pdev *pdev)
  2120. {
  2121. struct dp_mon_ops *monitor_ops;
  2122. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2123. if (!mon_soc) {
  2124. dp_mon_debug("monitor soc is NULL");
  2125. return;
  2126. }
  2127. monitor_ops = mon_soc->mon_ops;
  2128. if (!monitor_ops || !monitor_ops->mon_print_pdev_rx_mon_stats) {
  2129. dp_mon_debug("callback not registered");
  2130. return;
  2131. }
  2132. return monitor_ops->mon_print_pdev_rx_mon_stats(pdev);
  2133. }
  2134. /*
  2135. * dp_monitor_print_pdev_tx_capture_stats() - print tx capture stats
  2136. * @pdev: Datapath PDEV handle
  2137. *
  2138. * Return: void
  2139. */
  2140. #ifdef WLAN_TX_PKT_CAPTURE_ENH
  2141. static inline void dp_monitor_print_pdev_tx_capture_stats(struct dp_pdev *pdev)
  2142. {
  2143. struct dp_mon_ops *monitor_ops;
  2144. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2145. if (!mon_soc) {
  2146. dp_mon_debug("monitor soc is NULL");
  2147. return;
  2148. }
  2149. monitor_ops = mon_soc->mon_ops;
  2150. if (!monitor_ops || !monitor_ops->mon_print_pdev_tx_capture_stats) {
  2151. dp_mon_debug("callback not registered");
  2152. return;
  2153. }
  2154. return monitor_ops->mon_print_pdev_tx_capture_stats(pdev);
  2155. }
  2156. static inline QDF_STATUS dp_monitor_config_enh_tx_capture(struct dp_pdev *pdev,
  2157. uint32_t val)
  2158. {
  2159. struct dp_mon_ops *monitor_ops;
  2160. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2161. if (!mon_soc) {
  2162. dp_mon_debug("monitor soc is NULL");
  2163. return QDF_STATUS_E_FAILURE;
  2164. }
  2165. monitor_ops = mon_soc->mon_ops;
  2166. if (!monitor_ops || !monitor_ops->mon_config_enh_tx_capture) {
  2167. dp_mon_debug("callback not registered");
  2168. return QDF_STATUS_E_FAILURE;
  2169. }
  2170. return monitor_ops->mon_config_enh_tx_capture(pdev, val);
  2171. }
  2172. #else
  2173. static inline void dp_monitor_print_pdev_tx_capture_stats(struct dp_pdev *pdev)
  2174. {
  2175. }
  2176. static inline QDF_STATUS dp_monitor_config_enh_tx_capture(struct dp_pdev *pdev,
  2177. uint32_t val)
  2178. {
  2179. return QDF_STATUS_E_INVAL;
  2180. }
  2181. #endif
  2182. #ifdef WLAN_RX_PKT_CAPTURE_ENH
  2183. static inline QDF_STATUS dp_monitor_config_enh_rx_capture(struct dp_pdev *pdev,
  2184. uint32_t val)
  2185. {
  2186. struct dp_mon_ops *monitor_ops;
  2187. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2188. if (!mon_soc) {
  2189. dp_mon_debug("monitor soc is NULL");
  2190. return QDF_STATUS_E_FAILURE;
  2191. }
  2192. monitor_ops = mon_soc->mon_ops;
  2193. if (!monitor_ops || !monitor_ops->mon_config_enh_rx_capture) {
  2194. dp_mon_debug("callback not registered");
  2195. return QDF_STATUS_E_FAILURE;
  2196. }
  2197. return monitor_ops->mon_config_enh_rx_capture(pdev, val);
  2198. }
  2199. #else
  2200. static inline QDF_STATUS dp_monitor_config_enh_rx_capture(struct dp_pdev *pdev,
  2201. uint32_t val)
  2202. {
  2203. return QDF_STATUS_E_INVAL;
  2204. }
  2205. #endif
  2206. #ifdef QCA_SUPPORT_BPR
  2207. static inline QDF_STATUS dp_monitor_set_bpr_enable(struct dp_pdev *pdev,
  2208. uint32_t val)
  2209. {
  2210. struct dp_mon_ops *monitor_ops;
  2211. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2212. if (!mon_soc) {
  2213. dp_mon_debug("monitor soc is NULL");
  2214. return QDF_STATUS_E_FAILURE;
  2215. }
  2216. monitor_ops = mon_soc->mon_ops;
  2217. if (!monitor_ops || !monitor_ops->mon_set_bpr_enable) {
  2218. dp_mon_debug("callback not registered");
  2219. return QDF_STATUS_E_FAILURE;
  2220. }
  2221. return monitor_ops->mon_set_bpr_enable(pdev, val);
  2222. }
  2223. #else
  2224. static inline QDF_STATUS dp_monitor_set_bpr_enable(struct dp_pdev *pdev,
  2225. uint32_t val)
  2226. {
  2227. return QDF_STATUS_E_FAILURE;
  2228. }
  2229. #endif
  2230. #ifdef ATH_SUPPORT_NAC
  2231. static inline
  2232. int dp_monitor_set_filter_neigh_peers(struct dp_pdev *pdev, bool val)
  2233. {
  2234. struct dp_mon_ops *monitor_ops;
  2235. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2236. if (!mon_soc) {
  2237. dp_mon_debug("monitor soc is NULL");
  2238. return 0;
  2239. }
  2240. monitor_ops = mon_soc->mon_ops;
  2241. if (!monitor_ops || !monitor_ops->mon_set_filter_neigh_peers) {
  2242. dp_mon_debug("callback not registered");
  2243. return 0;
  2244. }
  2245. return monitor_ops->mon_set_filter_neigh_peers(pdev, val);
  2246. }
  2247. #else
  2248. static inline
  2249. int dp_monitor_set_filter_neigh_peers(struct dp_pdev *pdev, bool val)
  2250. {
  2251. return 0;
  2252. }
  2253. #endif
  2254. #ifdef WLAN_ATF_ENABLE
  2255. static inline
  2256. void dp_monitor_set_atf_stats_enable(struct dp_pdev *pdev, bool value)
  2257. {
  2258. struct dp_mon_ops *monitor_ops;
  2259. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2260. if (!mon_soc) {
  2261. dp_mon_debug("monitor soc is NULL");
  2262. return;
  2263. }
  2264. monitor_ops = mon_soc->mon_ops;
  2265. if (!monitor_ops || !monitor_ops->mon_set_atf_stats_enable) {
  2266. dp_mon_debug("callback not registered");
  2267. return;
  2268. }
  2269. return monitor_ops->mon_set_atf_stats_enable(pdev, value);
  2270. }
  2271. #else
  2272. static inline
  2273. void dp_monitor_set_atf_stats_enable(struct dp_pdev *pdev, bool value)
  2274. {
  2275. }
  2276. #endif
  2277. static inline
  2278. void dp_monitor_set_bsscolor(struct dp_pdev *pdev, uint8_t bsscolor)
  2279. {
  2280. struct dp_mon_ops *monitor_ops;
  2281. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2282. if (!mon_soc) {
  2283. dp_mon_debug("monitor soc is NULL");
  2284. return;
  2285. }
  2286. monitor_ops = mon_soc->mon_ops;
  2287. if (!monitor_ops || !monitor_ops->mon_set_bsscolor) {
  2288. dp_mon_debug("callback not registered");
  2289. return;
  2290. }
  2291. return monitor_ops->mon_set_bsscolor(pdev, bsscolor);
  2292. }
  2293. static inline
  2294. bool dp_monitor_pdev_get_filter_mcast_data(struct cdp_pdev *pdev_handle)
  2295. {
  2296. struct dp_mon_ops *monitor_ops;
  2297. struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
  2298. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2299. if (!mon_soc) {
  2300. dp_mon_debug("monitor soc is NULL");
  2301. return false;
  2302. }
  2303. monitor_ops = mon_soc->mon_ops;
  2304. if (!monitor_ops || !monitor_ops->mon_pdev_get_filter_mcast_data) {
  2305. dp_mon_debug("callback not registered");
  2306. return false;
  2307. }
  2308. return monitor_ops->mon_pdev_get_filter_mcast_data(pdev_handle);
  2309. }
  2310. static inline
  2311. bool dp_monitor_pdev_get_filter_non_data(struct cdp_pdev *pdev_handle)
  2312. {
  2313. struct dp_mon_ops *monitor_ops;
  2314. struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
  2315. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2316. if (!mon_soc) {
  2317. dp_mon_debug("monitor soc is NULL");
  2318. return false;
  2319. }
  2320. monitor_ops = mon_soc->mon_ops;
  2321. if (!monitor_ops || !monitor_ops->mon_pdev_get_filter_non_data) {
  2322. dp_mon_debug("callback not registered");
  2323. return false;
  2324. }
  2325. return monitor_ops->mon_pdev_get_filter_non_data(pdev_handle);
  2326. }
  2327. static inline
  2328. bool dp_monitor_pdev_get_filter_ucast_data(struct cdp_pdev *pdev_handle)
  2329. {
  2330. struct dp_mon_ops *monitor_ops;
  2331. struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
  2332. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2333. if (!mon_soc) {
  2334. dp_mon_debug("monitor soc is NULL");
  2335. return false;
  2336. }
  2337. monitor_ops = mon_soc->mon_ops;
  2338. if (!monitor_ops || !monitor_ops->mon_pdev_get_filter_ucast_data) {
  2339. dp_mon_debug("callback not registered");
  2340. return false;
  2341. }
  2342. return monitor_ops->mon_pdev_get_filter_ucast_data(pdev_handle);
  2343. }
  2344. #ifdef WDI_EVENT_ENABLE
  2345. static inline
  2346. int dp_monitor_set_pktlog_wifi3(struct dp_pdev *pdev, uint32_t event,
  2347. bool enable)
  2348. {
  2349. struct dp_mon_ops *monitor_ops;
  2350. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2351. if (!mon_soc) {
  2352. dp_mon_debug("monitor soc is NULL");
  2353. return 0;
  2354. }
  2355. monitor_ops = mon_soc->mon_ops;
  2356. if (!monitor_ops || !monitor_ops->mon_set_pktlog_wifi3) {
  2357. dp_mon_debug("callback not registered");
  2358. return 0;
  2359. }
  2360. return monitor_ops->mon_set_pktlog_wifi3(pdev, event, enable);
  2361. }
  2362. #else
  2363. static inline
  2364. int dp_monitor_set_pktlog_wifi3(struct dp_pdev *pdev, uint32_t event,
  2365. bool enable)
  2366. {
  2367. return 0;
  2368. }
  2369. #endif
  2370. #if defined(DP_CON_MON) && !defined(REMOVE_PKT_LOG)
  2371. static inline void dp_monitor_pktlogmod_exit(struct dp_pdev *pdev)
  2372. {
  2373. struct dp_mon_ops *monitor_ops;
  2374. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2375. if (!mon_soc) {
  2376. dp_mon_debug("monitor soc is NULL");
  2377. return;
  2378. }
  2379. monitor_ops = mon_soc->mon_ops;
  2380. if (!monitor_ops || !monitor_ops->mon_pktlogmod_exit) {
  2381. dp_mon_debug("callback not registered");
  2382. return;
  2383. }
  2384. return monitor_ops->mon_pktlogmod_exit(pdev);
  2385. }
  2386. #else
  2387. static inline void dp_monitor_pktlogmod_exit(struct dp_pdev *pdev) {}
  2388. #endif
  2389. static inline
  2390. void dp_monitor_vdev_set_monitor_mode_buf_rings(struct dp_pdev *pdev)
  2391. {
  2392. struct dp_mon_ops *monitor_ops;
  2393. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2394. if (!mon_soc) {
  2395. dp_mon_debug("monitor soc is NULL");
  2396. return;
  2397. }
  2398. monitor_ops = mon_soc->mon_ops;
  2399. if (!monitor_ops || !monitor_ops->mon_vdev_set_monitor_mode_buf_rings) {
  2400. dp_mon_debug("callback not registered");
  2401. return;
  2402. }
  2403. return monitor_ops->mon_vdev_set_monitor_mode_buf_rings(pdev);
  2404. }
  2405. static inline
  2406. void dp_monitor_neighbour_peers_detach(struct dp_pdev *pdev)
  2407. {
  2408. struct dp_mon_ops *monitor_ops;
  2409. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2410. if (!mon_soc) {
  2411. dp_mon_debug("monitor soc is NULL");
  2412. return;
  2413. }
  2414. monitor_ops = mon_soc->mon_ops;
  2415. if (!monitor_ops || !monitor_ops->mon_neighbour_peers_detach) {
  2416. dp_mon_debug("callback not registered");
  2417. return;
  2418. }
  2419. return monitor_ops->mon_neighbour_peers_detach(pdev);
  2420. }
  2421. #ifdef FEATURE_NAC_RSSI
  2422. static inline QDF_STATUS dp_monitor_filter_neighbour_peer(struct dp_pdev *pdev,
  2423. uint8_t *rx_pkt_hdr)
  2424. {
  2425. struct dp_mon_ops *monitor_ops;
  2426. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2427. if (!mon_soc) {
  2428. dp_mon_debug("monitor soc is NULL");
  2429. return QDF_STATUS_E_FAILURE;
  2430. }
  2431. monitor_ops = mon_soc->mon_ops;
  2432. if (!monitor_ops || !monitor_ops->mon_filter_neighbour_peer) {
  2433. dp_mon_debug("callback not registered");
  2434. return QDF_STATUS_E_FAILURE;
  2435. }
  2436. return monitor_ops->mon_filter_neighbour_peer(pdev, rx_pkt_hdr);
  2437. }
  2438. #endif
  2439. static inline
  2440. void dp_monitor_reap_timer_init(struct dp_soc *soc)
  2441. {
  2442. struct dp_mon_ops *monitor_ops;
  2443. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  2444. if (!mon_soc) {
  2445. dp_mon_debug("monitor soc is NULL");
  2446. return;
  2447. }
  2448. monitor_ops = mon_soc->mon_ops;
  2449. if (!monitor_ops || !monitor_ops->mon_reap_timer_init) {
  2450. dp_mon_debug("callback not registered");
  2451. return;
  2452. }
  2453. monitor_ops->mon_reap_timer_init(soc);
  2454. }
  2455. static inline
  2456. void dp_monitor_reap_timer_deinit(struct dp_soc *soc)
  2457. {
  2458. struct dp_mon_ops *monitor_ops;
  2459. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  2460. if (!mon_soc) {
  2461. dp_mon_debug("monitor soc is NULL");
  2462. return;
  2463. }
  2464. monitor_ops = mon_soc->mon_ops;
  2465. if (!monitor_ops || !monitor_ops->mon_reap_timer_deinit) {
  2466. dp_mon_debug("callback not registered");
  2467. return;
  2468. }
  2469. monitor_ops->mon_reap_timer_deinit(soc);
  2470. }
  2471. static inline
  2472. void dp_monitor_reap_timer_start(struct dp_soc *soc)
  2473. {
  2474. struct dp_mon_ops *monitor_ops;
  2475. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  2476. if (!mon_soc) {
  2477. dp_mon_debug("monitor soc is NULL");
  2478. return;
  2479. }
  2480. monitor_ops = mon_soc->mon_ops;
  2481. if (!monitor_ops || !monitor_ops->mon_reap_timer_start) {
  2482. dp_mon_debug("callback not registered");
  2483. return;
  2484. }
  2485. monitor_ops->mon_reap_timer_start(soc);
  2486. }
  2487. static inline
  2488. bool dp_monitor_reap_timer_stop(struct dp_soc *soc)
  2489. {
  2490. struct dp_mon_ops *monitor_ops;
  2491. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  2492. if (!mon_soc) {
  2493. dp_mon_debug("monitor soc is NULL");
  2494. return false;
  2495. }
  2496. monitor_ops = mon_soc->mon_ops;
  2497. if (!monitor_ops || !monitor_ops->mon_reap_timer_stop) {
  2498. dp_mon_debug("callback not registered");
  2499. return false;
  2500. }
  2501. return monitor_ops->mon_reap_timer_stop(soc);
  2502. }
  2503. static inline
  2504. void dp_monitor_vdev_timer_init(struct dp_soc *soc)
  2505. {
  2506. struct dp_mon_ops *monitor_ops;
  2507. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  2508. if (!mon_soc) {
  2509. dp_mon_debug("monitor soc is NULL");
  2510. return;
  2511. }
  2512. monitor_ops = mon_soc->mon_ops;
  2513. if (!monitor_ops || !monitor_ops->mon_vdev_timer_init) {
  2514. dp_mon_debug("callback not registered");
  2515. return;
  2516. }
  2517. monitor_ops->mon_vdev_timer_init(soc);
  2518. }
  2519. static inline
  2520. void dp_monitor_vdev_timer_deinit(struct dp_soc *soc)
  2521. {
  2522. struct dp_mon_ops *monitor_ops;
  2523. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  2524. if (!mon_soc) {
  2525. dp_mon_debug("monitor soc is NULL");
  2526. return;
  2527. }
  2528. monitor_ops = mon_soc->mon_ops;
  2529. if (!monitor_ops || !monitor_ops->mon_vdev_timer_deinit) {
  2530. dp_mon_debug("callback not registered");
  2531. return;
  2532. }
  2533. monitor_ops->mon_vdev_timer_deinit(soc);
  2534. }
  2535. static inline
  2536. void dp_monitor_vdev_timer_start(struct dp_soc *soc)
  2537. {
  2538. struct dp_mon_ops *monitor_ops;
  2539. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  2540. if (!mon_soc) {
  2541. dp_mon_debug("monitor soc is NULL");
  2542. return;
  2543. }
  2544. monitor_ops = mon_soc->mon_ops;
  2545. if (!monitor_ops || !monitor_ops->mon_vdev_timer_start) {
  2546. dp_mon_debug("callback not registered");
  2547. return;
  2548. }
  2549. monitor_ops->mon_vdev_timer_start(soc);
  2550. }
  2551. static inline
  2552. bool dp_monitor_vdev_timer_stop(struct dp_soc *soc)
  2553. {
  2554. struct dp_mon_ops *monitor_ops;
  2555. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  2556. if (!mon_soc) {
  2557. dp_mon_debug("monitor soc is NULL");
  2558. return false;
  2559. }
  2560. monitor_ops = mon_soc->mon_ops;
  2561. if (!monitor_ops || !monitor_ops->mon_vdev_timer_stop) {
  2562. dp_mon_debug("callback not registered");
  2563. return false;
  2564. }
  2565. return monitor_ops->mon_vdev_timer_stop(soc);
  2566. }
  2567. #ifdef QCA_MCOPY_SUPPORT
  2568. static inline
  2569. QDF_STATUS dp_monitor_mcopy_check_deliver(struct dp_pdev *pdev,
  2570. uint16_t peer_id, uint32_t ppdu_id,
  2571. uint8_t first_msdu)
  2572. {
  2573. struct dp_mon_ops *monitor_ops;
  2574. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2575. if (!mon_soc) {
  2576. dp_mon_debug("monitor soc is NULL");
  2577. return QDF_STATUS_E_FAILURE;
  2578. }
  2579. monitor_ops = mon_soc->mon_ops;
  2580. if (!monitor_ops || !monitor_ops->mon_mcopy_check_deliver) {
  2581. dp_mon_debug("callback not registered");
  2582. return QDF_STATUS_E_FAILURE;
  2583. }
  2584. return monitor_ops->mon_mcopy_check_deliver(pdev, peer_id,
  2585. ppdu_id, first_msdu);
  2586. }
  2587. #else
  2588. static inline
  2589. QDF_STATUS dp_monitor_mcopy_check_deliver(struct dp_pdev *pdev,
  2590. uint16_t peer_id, uint32_t ppdu_id,
  2591. uint8_t first_msdu)
  2592. {
  2593. return QDF_STATUS_SUCCESS;
  2594. }
  2595. #endif
  2596. /*
  2597. * dp_monitor_neighbour_peer_add_ast() - Add ast entry
  2598. * @pdev: point to dp pdev
  2599. * @ta_peer: point to peer
  2600. * @mac_addr: mac address
  2601. * @nbuf: point to nbuf
  2602. * @flags: flags
  2603. *
  2604. * Return: void
  2605. */
  2606. static inline void
  2607. dp_monitor_neighbour_peer_add_ast(struct dp_pdev *pdev,
  2608. struct dp_peer *ta_peer,
  2609. uint8_t *mac_addr,
  2610. qdf_nbuf_t nbuf,
  2611. uint32_t flags)
  2612. {
  2613. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2614. struct dp_mon_ops *monitor_ops;
  2615. if (!mon_soc) {
  2616. dp_mon_debug("monitor soc is NULL");
  2617. return;
  2618. }
  2619. monitor_ops = mon_soc->mon_ops;
  2620. if (!monitor_ops || !monitor_ops->mon_neighbour_peer_add_ast) {
  2621. dp_mon_debug("callback not registered");
  2622. return;
  2623. }
  2624. return monitor_ops->mon_neighbour_peer_add_ast(pdev, ta_peer, mac_addr,
  2625. nbuf, flags);
  2626. }
  2627. /*
  2628. * dp_monitor_vdev_delete() - delete monitor vdev
  2629. * @soc: point to dp soc
  2630. * @vdev: point to dp vdev
  2631. *
  2632. * Return: void
  2633. */
  2634. static inline void dp_monitor_vdev_delete(struct dp_soc *soc,
  2635. struct dp_vdev *vdev)
  2636. {
  2637. if (soc->intr_mode == DP_INTR_POLL) {
  2638. qdf_timer_sync_cancel(&soc->int_timer);
  2639. dp_monitor_flush_rings(soc);
  2640. } else if (soc->intr_mode == DP_INTR_MSI) {
  2641. if (dp_monitor_vdev_timer_stop(soc))
  2642. dp_monitor_flush_rings(soc);
  2643. }
  2644. dp_monitor_vdev_detach(vdev);
  2645. }
  2646. #ifdef DP_POWER_SAVE
  2647. /*
  2648. * dp_monitor_pktlog_reap_pending_frames() - reap pending frames
  2649. * @pdev: point to dp pdev
  2650. *
  2651. * Return: void
  2652. */
  2653. static inline void dp_monitor_pktlog_reap_pending_frames(struct dp_pdev *pdev)
  2654. {
  2655. struct dp_soc *soc;
  2656. if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
  2657. return;
  2658. soc = pdev->soc;
  2659. if (((pdev->monitor_pdev->rx_pktlog_mode != DP_RX_PKTLOG_DISABLED) ||
  2660. dp_mon_is_enable_reap_timer_non_pkt(pdev))) {
  2661. if (dp_monitor_reap_timer_stop(soc))
  2662. dp_monitor_service_mon_rings(soc, DP_MON_REAP_BUDGET);
  2663. }
  2664. }
  2665. /*
  2666. * dp_monitor_pktlog_start_reap_timer() - start reap timer
  2667. * @pdev: point to dp pdev
  2668. *
  2669. * Return: void
  2670. */
  2671. static inline void dp_monitor_pktlog_start_reap_timer(struct dp_pdev *pdev)
  2672. {
  2673. struct dp_soc *soc;
  2674. if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
  2675. return;
  2676. soc = pdev->soc;
  2677. if (((pdev->monitor_pdev->rx_pktlog_mode != DP_RX_PKTLOG_DISABLED) ||
  2678. dp_mon_is_enable_reap_timer_non_pkt(pdev)))
  2679. dp_monitor_reap_timer_start(soc);
  2680. }
  2681. #endif
  2682. /*
  2683. * dp_monitor_neighbour_peer_list_remove() - remove neighbour peer list
  2684. * @pdev: point to dp pdev
  2685. * @vdev: point to dp vdev
  2686. * @peer: point to dp_neighbour_peer
  2687. *
  2688. * Return: void
  2689. */
  2690. static inline
  2691. void dp_monitor_neighbour_peer_list_remove(struct dp_pdev *pdev,
  2692. struct dp_vdev *vdev,
  2693. struct dp_neighbour_peer *peer)
  2694. {
  2695. struct dp_mon_pdev *mon_pdev;
  2696. struct dp_neighbour_peer *temp_peer = NULL;
  2697. if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
  2698. return;
  2699. mon_pdev = pdev->monitor_pdev;
  2700. qdf_spin_lock_bh(&mon_pdev->neighbour_peer_mutex);
  2701. if (!pdev->soc->monitor_soc->hw_nac_monitor_support) {
  2702. TAILQ_FOREACH(peer, &mon_pdev->neighbour_peers_list,
  2703. neighbour_peer_list_elem) {
  2704. QDF_ASSERT(peer->vdev != vdev);
  2705. }
  2706. } else {
  2707. TAILQ_FOREACH_SAFE(peer, &mon_pdev->neighbour_peers_list,
  2708. neighbour_peer_list_elem, temp_peer) {
  2709. if (peer->vdev == vdev) {
  2710. TAILQ_REMOVE(&mon_pdev->neighbour_peers_list,
  2711. peer,
  2712. neighbour_peer_list_elem);
  2713. qdf_mem_free(peer);
  2714. }
  2715. }
  2716. }
  2717. qdf_spin_unlock_bh(&mon_pdev->neighbour_peer_mutex);
  2718. }
  2719. static inline
  2720. void dp_monitor_pdev_set_mon_vdev(struct dp_vdev *vdev)
  2721. {
  2722. if (!vdev->pdev->monitor_pdev)
  2723. return;
  2724. vdev->pdev->monitor_pdev->mvdev = vdev;
  2725. }
  2726. static inline
  2727. void dp_monitor_pdev_config_scan_spcl_vap(struct dp_pdev *pdev, bool val)
  2728. {
  2729. if (!pdev || !pdev->monitor_pdev)
  2730. return;
  2731. pdev->monitor_pdev->scan_spcl_vap_configured = val;
  2732. }
  2733. #ifdef QCA_SUPPORT_SCAN_SPCL_VAP_STATS
  2734. static inline
  2735. void dp_monitor_pdev_reset_scan_spcl_vap_stats_enable(struct dp_pdev *pdev,
  2736. bool val)
  2737. {
  2738. if (!pdev || !pdev->monitor_pdev)
  2739. return;
  2740. pdev->monitor_pdev->reset_scan_spcl_vap_stats_enable = val;
  2741. }
  2742. #else
  2743. static inline
  2744. void dp_monitor_pdev_reset_scan_spcl_vap_stats_enable(struct dp_pdev *pdev,
  2745. bool val)
  2746. {
  2747. }
  2748. #endif
  2749. static inline void
  2750. dp_mon_rx_wmask_subscribe(struct dp_soc *soc, uint32_t *msg_word,
  2751. struct htt_rx_ring_tlv_filter *tlv_filter)
  2752. {
  2753. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  2754. struct dp_mon_ops *monitor_ops;
  2755. if (!mon_soc) {
  2756. dp_mon_debug("mon soc is NULL");
  2757. return;
  2758. }
  2759. monitor_ops = mon_soc->mon_ops;
  2760. if (!monitor_ops || !monitor_ops->rx_wmask_subscribe) {
  2761. dp_mon_debug("callback not registered");
  2762. return;
  2763. }
  2764. monitor_ops->rx_wmask_subscribe(msg_word, tlv_filter);
  2765. }
  2766. static inline void
  2767. dp_mon_rx_enable_mpdu_logging(struct dp_soc *soc, uint32_t *msg_word,
  2768. struct htt_rx_ring_tlv_filter *tlv_filter)
  2769. {
  2770. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  2771. struct dp_mon_ops *monitor_ops;
  2772. if (!mon_soc) {
  2773. dp_mon_debug("mon soc is NULL");
  2774. return;
  2775. }
  2776. monitor_ops = mon_soc->mon_ops;
  2777. if (!monitor_ops || !monitor_ops->rx_enable_mpdu_logging) {
  2778. dp_mon_debug("callback not registered");
  2779. return;
  2780. }
  2781. monitor_ops->rx_enable_mpdu_logging(msg_word, tlv_filter);
  2782. }
  2783. static inline void
  2784. dp_mon_rx_packet_length_set(struct dp_soc *soc, uint32_t *msg_word,
  2785. struct htt_rx_ring_tlv_filter *tlv_filter)
  2786. {
  2787. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  2788. struct dp_mon_ops *monitor_ops;
  2789. if (!mon_soc) {
  2790. dp_mon_debug("mon soc is NULL");
  2791. return;
  2792. }
  2793. monitor_ops = mon_soc->mon_ops;
  2794. if (!monitor_ops || !monitor_ops->rx_packet_length_set) {
  2795. dp_mon_debug("callback not registered");
  2796. return;
  2797. }
  2798. monitor_ops->rx_packet_length_set(msg_word, tlv_filter);
  2799. }
  2800. #ifdef QCA_ENHANCED_STATS_SUPPORT
  2801. QDF_STATUS dp_peer_qos_stats_notify(struct dp_pdev *dp_pdev,
  2802. struct cdp_rx_stats_ppdu_user *ppdu_user);
  2803. #endif
  2804. /*
  2805. * dp_print_pdev_rx_mon_stats() - print rx mon stats
  2806. * @pdev: device object
  2807. *
  2808. * Return: void
  2809. */
  2810. void
  2811. dp_print_pdev_rx_mon_stats(struct dp_pdev *pdev);
  2812. /**
  2813. * dp_mcopy_check_deliver() - mcopy check deliver
  2814. * @pdev: DP pdev handle
  2815. * @peer_id: peer id
  2816. * @ppdu_id: ppdu
  2817. * @first_msdu: flag to indicate first msdu of ppdu
  2818. * Return: 0 on success, not 0 on failure
  2819. */
  2820. QDF_STATUS dp_mcopy_check_deliver(struct dp_pdev *pdev,
  2821. uint16_t peer_id,
  2822. uint32_t ppdu_id,
  2823. uint8_t first_msdu);
  2824. /**
  2825. * dp_pdev_set_advance_monitor_filter() - Set DP PDEV monitor filter
  2826. * @soc: soc handle
  2827. * @pdev_id: id of Datapath PDEV handle
  2828. * @filter_val: Flag to select Filter for monitor mode
  2829. * Return: 0 on success, not 0 on failure
  2830. */
  2831. #ifdef QCA_ADVANCE_MON_FILTER_SUPPORT
  2832. QDF_STATUS
  2833. dp_pdev_set_advance_monitor_filter(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  2834. struct cdp_monitor_filter *filter_val);
  2835. #else
  2836. static inline QDF_STATUS
  2837. dp_pdev_set_advance_monitor_filter(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  2838. struct cdp_monitor_filter *filter_val)
  2839. {
  2840. return QDF_STATUS_E_INVAL;
  2841. }
  2842. #endif /* QCA_ADVANCE_MON_FILTER_SUPPORT */
  2843. /**
  2844. * dp_deliver_tx_mgmt() - Deliver mgmt frame for tx capture
  2845. * @cdp_soc : data path soc handle
  2846. * @pdev_id : pdev_id
  2847. * @nbuf: Management frame buffer
  2848. */
  2849. QDF_STATUS
  2850. dp_deliver_tx_mgmt(struct cdp_soc_t *cdp_soc, uint8_t pdev_id, qdf_nbuf_t nbuf);
  2851. /**
  2852. * dp_filter_neighbour_peer() - API to filter neighbour peer
  2853. * @pdev : DP pdev handle
  2854. * @rx_pkt_hdr : packet header
  2855. *
  2856. * return: QDF_STATUS_SUCCESS on success
  2857. * QDF_STATUS_E_FAILURE on failure
  2858. */
  2859. #ifdef FEATURE_NAC_RSSI
  2860. QDF_STATUS dp_filter_neighbour_peer(struct dp_pdev *pdev,
  2861. uint8_t *rx_pkt_hdr);
  2862. #else
  2863. static inline
  2864. QDF_STATUS dp_filter_neighbour_peer(struct dp_pdev *pdev,
  2865. uint8_t *rx_pkt_hdr)
  2866. {
  2867. return QDF_STATUS_SUCCESS;
  2868. }
  2869. #endif /* FEATURE_NAC_RSSI */
  2870. /*
  2871. * dp_neighbour_peers_detach() - Detach neighbour peers(nac clients)
  2872. * @pdev: device object
  2873. *
  2874. * Return: void
  2875. */
  2876. void dp_neighbour_peers_detach(struct dp_pdev *pdev);
  2877. /**
  2878. * dp_reset_monitor_mode() - Disable monitor mode
  2879. * @soc_hdl: Datapath soc handle
  2880. * @pdev_id: id of datapath PDEV handle
  2881. * @smart_monitor: smart monitor flag
  2882. *
  2883. * Return: QDF_STATUS
  2884. */
  2885. QDF_STATUS dp_reset_monitor_mode(struct cdp_soc_t *soc_hdl,
  2886. uint8_t pdev_id,
  2887. uint8_t smart_monitor);
  2888. static inline
  2889. struct dp_mon_ops *dp_mon_ops_get(struct dp_soc *soc)
  2890. {
  2891. if (soc && soc->monitor_soc)
  2892. return soc->monitor_soc->mon_ops;
  2893. return NULL;
  2894. }
  2895. static inline
  2896. struct cdp_mon_ops *dp_mon_cdp_ops_get(struct dp_soc *soc)
  2897. {
  2898. struct cdp_ops *ops = soc->cdp_soc.ops;
  2899. return ops->mon_ops;
  2900. }
  2901. /**
  2902. * dp_ppdu_desc_user_stats_update(): Function to update TX user stats
  2903. * @pdev: DP pdev handle
  2904. * @ppdu_info: per PPDU TLV descriptor
  2905. *
  2906. * return: void
  2907. */
  2908. #ifdef QCA_ENHANCED_STATS_SUPPORT
  2909. void
  2910. dp_ppdu_desc_user_stats_update(struct dp_pdev *pdev,
  2911. struct ppdu_info *ppdu_info);
  2912. #else
  2913. static inline void
  2914. dp_ppdu_desc_user_stats_update(struct dp_pdev *pdev,
  2915. struct ppdu_info *ppdu_info)
  2916. {
  2917. }
  2918. #endif /* QCA_ENHANCED_STATS_SUPPORT */
  2919. /**
  2920. * dp_mon_ops_register_1_0(): register legacy monitor ops
  2921. * @mon_soc: monitor soc handle
  2922. *
  2923. * return: void
  2924. */
  2925. void dp_mon_ops_register_1_0(struct dp_mon_soc *mon_soc);
  2926. /**
  2927. * dp_mon_cdp_ops_register_1_0(): register legacy monitor cdp ops
  2928. * @ops: cdp ops handle
  2929. *
  2930. * return: void
  2931. */
  2932. void dp_mon_cdp_ops_register_1_0(struct cdp_ops *ops);
  2933. #ifdef QCA_MONITOR_2_0_SUPPORT
  2934. /**
  2935. * dp_mon_ops_register_2_0(): register monitor ops
  2936. * @mon_soc: monitor soc handle
  2937. *
  2938. * return: void
  2939. */
  2940. void dp_mon_ops_register_2_0(struct dp_mon_soc *mon_soc);
  2941. /**
  2942. * dp_mon_cdp_ops_register_2_0(): register monitor cdp ops
  2943. * @ops: cdp ops handle
  2944. *
  2945. * return: void
  2946. */
  2947. void dp_mon_cdp_ops_register_2_0(struct cdp_ops *ops);
  2948. #endif /* QCA_MONITOR_2_0_SUPPORT */
  2949. /**
  2950. * dp_mon_register_feature_ops(): Register mon feature ops
  2951. * @soc: Datapath soc context
  2952. *
  2953. * return: void
  2954. */
  2955. static inline
  2956. void dp_mon_register_feature_ops(struct dp_soc *soc)
  2957. {
  2958. struct dp_mon_ops *mon_ops = NULL;
  2959. mon_ops = dp_mon_ops_get(soc);
  2960. if (!mon_ops) {
  2961. dp_mon_err("Monitor ops is NULL");
  2962. return;
  2963. }
  2964. if (mon_ops->mon_register_feature_ops)
  2965. mon_ops->mon_register_feature_ops(soc);
  2966. }
  2967. /**
  2968. * dp_pdev_get_rx_mon_stats(): Get pdev Rx monitor stats
  2969. * @soc_hdl: soc handle
  2970. * @pdev_id: id of pdev handle
  2971. * @stats: User allocated stats buffer
  2972. *
  2973. * return: status success/failure
  2974. */
  2975. QDF_STATUS dp_pdev_get_rx_mon_stats(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  2976. struct cdp_pdev_mon_stats *stats);
  2977. #endif /* _DP_MON_H_ */