dp_mon.h 84 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439
  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. #ifdef WLAN_TX_PKT_CAPTURE_ENH
  598. struct dp_soc_tx_capture dp_soc_tx_capt;
  599. #endif
  600. };
  601. struct dp_mon_pdev {
  602. /* monitor */
  603. bool monitor_configured;
  604. struct dp_mon_filter **filter; /* Monitor Filter pointer */
  605. /* advance filter mode and type*/
  606. uint8_t mon_filter_mode;
  607. uint16_t fp_mgmt_filter;
  608. uint16_t fp_ctrl_filter;
  609. uint16_t fp_data_filter;
  610. uint16_t mo_mgmt_filter;
  611. uint16_t mo_ctrl_filter;
  612. uint16_t mo_data_filter;
  613. uint16_t md_data_filter;
  614. #ifdef WLAN_TX_PKT_CAPTURE_ENH
  615. struct dp_pdev_tx_capture tx_capture;
  616. bool stop_tx_capture_work_q_timer;
  617. #endif
  618. /* tx packet capture enhancement */
  619. enum cdp_tx_enh_capture_mode tx_capture_enabled;
  620. /* Stuck count on monitor destination ring MPDU process */
  621. uint32_t mon_dest_ring_stuck_cnt;
  622. /* monitor mode lock */
  623. qdf_spinlock_t mon_lock;
  624. /* Monitor mode operation channel */
  625. int mon_chan_num;
  626. /* Monitor mode operation frequency */
  627. qdf_freq_t mon_chan_freq;
  628. /* Monitor mode band */
  629. enum reg_wifi_band mon_chan_band;
  630. uint32_t mon_ppdu_status;
  631. /* monitor mode status/destination ring PPDU and MPDU count */
  632. struct cdp_pdev_mon_stats rx_mon_stats;
  633. /* Monitor mode interface and status storage */
  634. struct dp_vdev *mvdev;
  635. struct cdp_mon_status rx_mon_recv_status;
  636. /* to track duplicate link descriptor indications by HW for a WAR */
  637. uint64_t mon_last_linkdesc_paddr;
  638. /* to track duplicate buffer indications by HW for a WAR */
  639. uint32_t mon_last_buf_cookie;
  640. #ifdef QCA_SUPPORT_FULL_MON
  641. /* List to maintain all MPDUs for a PPDU in monitor mode */
  642. TAILQ_HEAD(, dp_mon_mpdu) mon_mpdu_q;
  643. /* TODO: define per-user mpdu list
  644. * struct dp_mon_mpdu_list mpdu_list[MAX_MU_USERS];
  645. */
  646. struct hal_rx_mon_desc_info *mon_desc;
  647. #endif
  648. /* Flag to hold on to monitor destination ring */
  649. bool hold_mon_dest_ring;
  650. /* Flag to inidicate monitor rings are initialized */
  651. uint8_t pdev_mon_init;
  652. #ifndef REMOVE_PKT_LOG
  653. bool pkt_log_init;
  654. struct pktlog_dev_t *pl_dev; /* Pktlog pdev */
  655. #endif /* #ifndef REMOVE_PKT_LOG */
  656. /* Smart Mesh */
  657. bool filter_neighbour_peers;
  658. /*flag to indicate neighbour_peers_list not empty */
  659. bool neighbour_peers_added;
  660. /* smart mesh mutex */
  661. qdf_spinlock_t neighbour_peer_mutex;
  662. /* Neighnour peer list */
  663. TAILQ_HEAD(, dp_neighbour_peer) neighbour_peers_list;
  664. /* Enhanced Stats is enabled */
  665. bool enhanced_stats_en;
  666. qdf_nbuf_queue_t rx_status_q;
  667. /* 128 bytes mpdu header queue per user for ppdu */
  668. qdf_nbuf_queue_t mpdu_q[MAX_MU_USERS];
  669. /* is this a mpdu header TLV and not msdu header TLV */
  670. bool is_mpdu_hdr[MAX_MU_USERS];
  671. /* per user 128 bytes msdu header list for MPDU */
  672. struct msdu_list msdu_list[MAX_MU_USERS];
  673. /* RX enhanced capture mode */
  674. uint8_t rx_enh_capture_mode;
  675. /* Rx per peer enhanced capture mode */
  676. bool rx_enh_capture_peer;
  677. struct dp_vdev *rx_enh_monitor_vdev;
  678. /* RX enhanced capture trailer enable/disable flag */
  679. bool is_rx_enh_capture_trailer_enabled;
  680. #ifdef WLAN_RX_PKT_CAPTURE_ENH
  681. /* RX per MPDU/PPDU information */
  682. struct cdp_rx_indication_mpdu mpdu_ind;
  683. #endif
  684. /* Packet log mode */
  685. uint8_t rx_pktlog_mode;
  686. /* Enable pktlog logging cbf */
  687. bool rx_pktlog_cbf;
  688. /* Enable pktlog logging hybrid */
  689. #ifdef QCA_WIFI_QCN9224
  690. bool pktlog_hybrid_mode;
  691. #endif
  692. bool tx_sniffer_enable;
  693. /* mirror copy mode */
  694. enum m_copy_mode mcopy_mode;
  695. bool enable_reap_timer_non_pkt;
  696. bool bpr_enable;
  697. /* Pdev level flag to check peer based pktlog enabled or
  698. * disabled
  699. */
  700. uint8_t dp_peer_based_pktlog;
  701. #ifdef WLAN_ATF_ENABLE
  702. /* ATF stats enable */
  703. bool dp_atf_stats_enable;
  704. #endif
  705. /* Maintains first status buffer's paddr of a PPDU */
  706. uint64_t status_buf_addr;
  707. struct hal_rx_ppdu_info ppdu_info;
  708. /* ppdu_id of last received HTT TX stats */
  709. uint32_t last_ppdu_id;
  710. struct {
  711. uint8_t last_user;
  712. qdf_nbuf_t buf;
  713. } tx_ppdu_info;
  714. struct {
  715. uint32_t tx_ppdu_id;
  716. uint16_t tx_peer_id;
  717. uint32_t rx_ppdu_id;
  718. } m_copy_id;
  719. /* To check if PPDU Tx stats are enabled for Pktlog */
  720. bool pktlog_ppdu_stats;
  721. #ifdef ATH_SUPPORT_NAC_RSSI
  722. bool nac_rssi_filtering;
  723. #endif
  724. /* ppdu_stats lock for queue concurrency between cores*/
  725. qdf_spinlock_t ppdu_stats_lock;
  726. /* list of ppdu tlvs */
  727. TAILQ_HEAD(, ppdu_info) ppdu_info_list;
  728. TAILQ_HEAD(, ppdu_info) sched_comp_ppdu_list;
  729. uint32_t sched_comp_list_depth;
  730. uint16_t delivered_sched_cmdid;
  731. uint16_t last_sched_cmdid;
  732. uint32_t tlv_count;
  733. uint32_t list_depth;
  734. struct {
  735. qdf_nbuf_t last_nbuf; /*Ptr to mgmt last buf */
  736. uint8_t *mgmt_buf; /* Ptr to mgmt. payload in HTT ppdu stats */
  737. uint32_t mgmt_buf_len; /* Len of mgmt. payload in ppdu stats */
  738. uint32_t ppdu_id;
  739. } mgmtctrl_frm_info;
  740. /* Context of cal client timer */
  741. struct cdp_cal_client *cal_client_ctx;
  742. uint32_t *ppdu_tlv_buf; /* Buffer to hold HTT ppdu stats TLVs*/
  743. qdf_nbuf_t mcopy_status_nbuf;
  744. bool is_dp_mon_pdev_initialized;
  745. /* indicates if spcl vap is configured */
  746. bool scan_spcl_vap_configured;
  747. #ifdef QCA_SUPPORT_SCAN_SPCL_VAP_STATS
  748. /* enable spcl vap stats reset on ch change */
  749. bool reset_scan_spcl_vap_stats_enable;
  750. #endif
  751. bool is_tlv_hdr_64_bit;
  752. };
  753. struct dp_mon_vdev {
  754. /* callback to hand rx monitor 802.11 MPDU to the OS shim */
  755. ol_txrx_rx_mon_fp osif_rx_mon;
  756. #ifdef QCA_SUPPORT_SCAN_SPCL_VAP_STATS
  757. struct cdp_scan_spcl_vap_stats *scan_spcl_vap_stats;
  758. #endif
  759. };
  760. struct dp_mon_peer {
  761. #ifdef WLAN_TX_PKT_CAPTURE_ENH
  762. struct dp_peer_tx_capture tx_capture;
  763. #endif
  764. #ifdef FEATURE_PERPKT_INFO
  765. /* delayed ba ppdu stats handling */
  766. struct cdp_delayed_tx_completion_ppdu_user delayed_ba_ppdu_stats;
  767. /* delayed ba flag */
  768. bool last_delayed_ba;
  769. /* delayed ba ppdu id */
  770. uint32_t last_delayed_ba_ppduid;
  771. #endif
  772. };
  773. #if defined(QCA_TX_CAPTURE_SUPPORT) || defined(QCA_ENHANCED_STATS_SUPPORT)
  774. void dp_deliver_mgmt_frm(struct dp_pdev *pdev, qdf_nbuf_t nbuf);
  775. #else
  776. static inline
  777. void dp_deliver_mgmt_frm(struct dp_pdev *pdev, qdf_nbuf_t nbuf)
  778. {
  779. }
  780. #endif
  781. #if defined(WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG) ||\
  782. defined(WLAN_SUPPORT_RX_FLOW_TAG)
  783. /**
  784. * dp_rx_mon_update_protocol_flow_tag() - Performs necessary checks for monitor
  785. * mode and then tags appropriate packets
  786. * @soc: core txrx main context
  787. * @vdev: pdev on which packet is received
  788. * @msdu: QDF packet buffer on which the protocol tag should be set
  789. * @rx_desc: base address where the RX TLVs start
  790. * Return: void
  791. */
  792. void dp_rx_mon_update_protocol_flow_tag(struct dp_soc *soc,
  793. struct dp_pdev *dp_pdev,
  794. qdf_nbuf_t msdu, void *rx_desc);
  795. #endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG || WLAN_SUPPORT_RX_FLOW_TAG */
  796. #if !defined(WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG) &&\
  797. !defined(WLAN_SUPPORT_RX_FLOW_TAG)
  798. /**
  799. * dp_rx_mon_update_protocol_flow_tag() - Performs necessary checks for monitor
  800. * mode and then tags appropriate packets
  801. * @soc: core txrx main context
  802. * @vdev: pdev on which packet is received
  803. * @msdu: QDF packet buffer on which the protocol tag should be set
  804. * @rx_desc: base address where the RX TLVs start
  805. * Return: void
  806. */
  807. static inline
  808. void dp_rx_mon_update_protocol_flow_tag(struct dp_soc *soc,
  809. struct dp_pdev *dp_pdev,
  810. qdf_nbuf_t msdu, void *rx_desc)
  811. {
  812. }
  813. #endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG || WLAN_SUPPORT_RX_FLOW_TAG */
  814. #ifndef WLAN_TX_PKT_CAPTURE_ENH
  815. static inline
  816. QDF_STATUS dp_peer_set_tx_capture_enabled(struct dp_pdev *pdev,
  817. struct dp_peer *peer_handle,
  818. uint8_t value, uint8_t *peer_mac)
  819. {
  820. return QDF_STATUS_SUCCESS;
  821. }
  822. /**
  823. * dp_peer_tid_queue_init() – Initialize ppdu stats queue per TID
  824. * @peer: Datapath peer
  825. *
  826. */
  827. static inline void dp_peer_tid_queue_init(struct dp_peer *peer)
  828. {
  829. }
  830. /**
  831. * dp_peer_tid_queue_cleanup() – remove ppdu stats queue per TID
  832. * @peer: Datapath peer
  833. *
  834. */
  835. static inline void dp_peer_tid_queue_cleanup(struct dp_peer *peer)
  836. {
  837. }
  838. /**
  839. * dp_peer_update_80211_hdr() – dp peer update 80211 hdr
  840. * @vdev: Datapath vdev
  841. * @peer: Datapath peer
  842. *
  843. */
  844. static inline void
  845. dp_peer_update_80211_hdr(struct dp_vdev *vdev, struct dp_peer *peer)
  846. {
  847. }
  848. /**
  849. * dp_tx_ppdu_stats_attach - Initialize Tx PPDU stats and enhanced capture
  850. * @pdev: DP PDEV
  851. *
  852. * Return: none
  853. */
  854. static inline void dp_tx_ppdu_stats_attach(struct dp_pdev *pdev)
  855. {
  856. }
  857. /**
  858. * dp_tx_ppdu_stats_detach - Cleanup Tx PPDU stats and enhanced capture
  859. * @pdev: DP PDEV
  860. *
  861. * Return: none
  862. */
  863. static inline void dp_tx_ppdu_stats_detach(struct dp_pdev *pdev)
  864. {
  865. }
  866. /**
  867. * dp_tx_add_to_comp_queue() - add completion msdu to queue
  868. * @soc: DP Soc handle
  869. * @tx_desc: software Tx descriptor
  870. * @ts : Tx completion status from HAL/HTT descriptor
  871. * @peer: DP peer
  872. *
  873. * Return: none
  874. */
  875. static inline
  876. QDF_STATUS dp_tx_add_to_comp_queue(struct dp_soc *soc,
  877. struct dp_tx_desc_s *desc,
  878. struct hal_tx_completion_status *ts,
  879. struct dp_peer *peer)
  880. {
  881. return QDF_STATUS_E_FAILURE;
  882. }
  883. /**
  884. * dp_update_msdu_to_list(): Function to queue msdu from wbm
  885. * @pdev: dp_pdev
  886. * @peer: dp_peer
  887. * @ts: hal tx completion status
  888. * @netbuf: msdu
  889. *
  890. * return: status
  891. */
  892. static inline
  893. QDF_STATUS dp_update_msdu_to_list(struct dp_soc *soc,
  894. struct dp_pdev *pdev,
  895. struct dp_peer *peer,
  896. struct hal_tx_completion_status *ts,
  897. qdf_nbuf_t netbuf)
  898. {
  899. return QDF_STATUS_E_FAILURE;
  900. }
  901. /*
  902. * dp_peer_tx_capture_filter_check: check filter is enable for the filter
  903. * and update tx_cap_enabled flag
  904. * @pdev: DP PDEV handle
  905. * @peer: DP PEER handle
  906. *
  907. * return: void
  908. */
  909. static inline
  910. void dp_peer_tx_capture_filter_check(struct dp_pdev *pdev,
  911. struct dp_peer *peer)
  912. {
  913. }
  914. /*
  915. * dp_tx_capture_debugfs_init: tx capture debugfs init
  916. * @pdev: DP PDEV handle
  917. *
  918. * return: QDF_STATUS
  919. */
  920. static inline
  921. QDF_STATUS dp_tx_capture_debugfs_init(struct dp_pdev *pdev)
  922. {
  923. return QDF_STATUS_E_FAILURE;
  924. }
  925. #endif
  926. #ifdef WLAN_TX_PKT_CAPTURE_ENH
  927. extern uint8_t
  928. dp_cpu_ring_map[DP_NSS_CPU_RING_MAP_MAX][WLAN_CFG_INT_NUM_CONTEXTS_MAX];
  929. #endif
  930. int
  931. dp_htt_get_ppdu_sniffer_ampdu_tlv_bitmap(uint32_t bitmap);
  932. #ifdef WDI_EVENT_ENABLE
  933. void dp_pkt_log_init(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, void *scn);
  934. #else
  935. static inline void
  936. dp_pkt_log_init(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, void *scn)
  937. {
  938. }
  939. #endif
  940. #ifdef WDI_EVENT_ENABLE
  941. QDF_STATUS dp_peer_stats_notify(struct dp_pdev *pdev, struct dp_peer *peer);
  942. #else
  943. static inline QDF_STATUS dp_peer_stats_notify(struct dp_pdev *pdev,
  944. struct dp_peer *peer)
  945. {
  946. return QDF_STATUS_SUCCESS;
  947. }
  948. #endif
  949. #ifndef WLAN_TX_PKT_CAPTURE_ENH
  950. /**
  951. * dp_tx_ppdu_stats_process - Deferred PPDU stats handler
  952. * @context: Opaque work context (PDEV)
  953. *
  954. * Return: none
  955. */
  956. static inline void dp_tx_ppdu_stats_process(void *context)
  957. {
  958. }
  959. /*
  960. * dp_tx_capture_htt_frame_counter: increment counter for htt_frame_type
  961. * pdev: DP pdev handle
  962. * htt_frame_type: htt frame type received from fw
  963. *
  964. * return: void
  965. */
  966. static inline
  967. void dp_tx_capture_htt_frame_counter(struct dp_pdev *pdev,
  968. uint32_t htt_frame_type)
  969. {
  970. }
  971. /*
  972. * dp_tx_cature_stats: print tx capture stats
  973. * @pdev: DP PDEV handle
  974. *
  975. * return: void
  976. */
  977. static inline
  978. void dp_print_pdev_tx_capture_stats(struct dp_pdev *pdev)
  979. {
  980. }
  981. #endif
  982. /**
  983. * dp_rx_cookie_2_mon_link_desc_va() - Converts cookie to a virtual address of
  984. * the MSDU Link Descriptor
  985. * @pdev: core txrx pdev context
  986. * @buf_info: buf_info includes cookie that used to lookup virtual address of
  987. * link descriptor. Normally this is just an index into a per pdev array.
  988. *
  989. * This is the VA of the link descriptor in monitor mode destination ring,
  990. * that HAL layer later uses to retrieve the list of MSDU's for a given MPDU.
  991. *
  992. * Return: void *: Virtual Address of the Rx descriptor
  993. */
  994. static inline
  995. void *dp_rx_cookie_2_mon_link_desc_va(struct dp_pdev *pdev,
  996. struct hal_buf_info *buf_info,
  997. int mac_id)
  998. {
  999. void *link_desc_va;
  1000. struct qdf_mem_multi_page_t *pages;
  1001. uint16_t page_id = LINK_DESC_COOKIE_PAGE_ID(buf_info->sw_cookie);
  1002. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  1003. if (!mon_soc)
  1004. return NULL;
  1005. pages = &mon_soc->mon_link_desc_pages[mac_id];
  1006. if (!pages)
  1007. return NULL;
  1008. if (qdf_unlikely(page_id >= pages->num_pages))
  1009. return NULL;
  1010. link_desc_va = pages->dma_pages[page_id].page_v_addr_start +
  1011. (buf_info->paddr - pages->dma_pages[page_id].page_p_addr);
  1012. return link_desc_va;
  1013. }
  1014. /**
  1015. * dp_soc_is_full_mon_enable () - Return if full monitor mode is enabled
  1016. * @soc: DP soc handle
  1017. *
  1018. * Return: Full monitor mode status
  1019. */
  1020. static inline bool dp_soc_is_full_mon_enable(struct dp_pdev *pdev)
  1021. {
  1022. return (pdev->soc->monitor_soc->full_mon_mode &&
  1023. pdev->monitor_pdev->monitor_configured) ? true : false;
  1024. }
  1025. /*
  1026. * dp_mon_is_enable_reap_timer_non_pkt() - check if mon reap timer is
  1027. * enabled by non-pkt log or not
  1028. * @pdev: point to dp pdev
  1029. *
  1030. * Return: true if mon reap timer is enabled by non-pkt log
  1031. */
  1032. static inline bool dp_mon_is_enable_reap_timer_non_pkt(struct dp_pdev *pdev)
  1033. {
  1034. if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
  1035. return false;
  1036. return pdev->monitor_pdev->enable_reap_timer_non_pkt;
  1037. }
  1038. /*
  1039. * dp_monitor_is_enable_mcopy_mode() - check if mcopy mode is enabled
  1040. * @pdev: point to dp pdev
  1041. *
  1042. * Return: true if mcopy mode is enabled
  1043. */
  1044. static inline bool dp_monitor_is_enable_mcopy_mode(struct dp_pdev *pdev)
  1045. {
  1046. if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
  1047. return false;
  1048. return pdev->monitor_pdev->mcopy_mode;
  1049. }
  1050. /*
  1051. * dp_monitor_is_enable_tx_sniffer() - check if tx sniffer is enabled
  1052. * @pdev: point to dp pdev
  1053. *
  1054. * Return: true if tx sniffer is enabled
  1055. */
  1056. static inline bool dp_monitor_is_enable_tx_sniffer(struct dp_pdev *pdev)
  1057. {
  1058. if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
  1059. return false;
  1060. return pdev->monitor_pdev->tx_sniffer_enable;
  1061. }
  1062. /*
  1063. * dp_monitor_is_set_monitor_configured() - check if monitor configured is set
  1064. * @pdev: point to dp pdev
  1065. *
  1066. * Return: true if monitor configured is set
  1067. */
  1068. static inline bool dp_monitor_is_configured(struct dp_pdev *pdev)
  1069. {
  1070. if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
  1071. return false;
  1072. return pdev->monitor_pdev->monitor_configured;
  1073. }
  1074. /*
  1075. * dp_monitor_check_com_info_ppdu_id() - check if msdu ppdu_id matches with
  1076. * com info ppdu_id
  1077. * @pdev: point to dp pdev
  1078. * @rx_desc: point to rx_desc
  1079. *
  1080. * Return: success if ppdu_id matches
  1081. */
  1082. static inline QDF_STATUS dp_monitor_check_com_info_ppdu_id(struct dp_pdev *pdev,
  1083. void *rx_desc)
  1084. {
  1085. struct cdp_mon_status *rs;
  1086. struct dp_mon_pdev *mon_pdev;
  1087. uint32_t msdu_ppdu_id = 0;
  1088. if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
  1089. return QDF_STATUS_E_FAILURE;
  1090. mon_pdev = pdev->monitor_pdev;
  1091. if (qdf_likely(1 != mon_pdev->ppdu_info.rx_status.rxpcu_filter_pass))
  1092. return QDF_STATUS_E_FAILURE;
  1093. rs = &pdev->monitor_pdev->rx_mon_recv_status;
  1094. if (!rs || rs->cdp_rs_rxdma_err)
  1095. return QDF_STATUS_E_FAILURE;
  1096. msdu_ppdu_id = hal_rx_get_ppdu_id(pdev->soc->hal_soc, rx_desc);
  1097. if (msdu_ppdu_id != mon_pdev->ppdu_info.com_info.ppdu_id) {
  1098. QDF_TRACE(QDF_MODULE_ID_DP,
  1099. QDF_TRACE_LEVEL_ERROR,
  1100. "msdu_ppdu_id=%x,com_info.ppdu_id=%x",
  1101. msdu_ppdu_id,
  1102. mon_pdev->ppdu_info.com_info.ppdu_id);
  1103. return QDF_STATUS_E_FAILURE;
  1104. }
  1105. return QDF_STATUS_SUCCESS;
  1106. }
  1107. /*
  1108. * dp_monitor_get_rx_status() - get rx status
  1109. * @pdev: point to dp pdev
  1110. *
  1111. * Return: return rx status pointer
  1112. */
  1113. static inline struct mon_rx_status*
  1114. dp_monitor_get_rx_status(struct dp_pdev *pdev)
  1115. {
  1116. if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
  1117. return NULL;
  1118. return &pdev->monitor_pdev->ppdu_info.rx_status;
  1119. }
  1120. /*
  1121. * dp_monitor_is_chan_band_known() - check if monitor chan band known
  1122. * @pdev: point to dp pdev
  1123. *
  1124. * Return: true if chan band known
  1125. */
  1126. static inline bool dp_monitor_is_chan_band_known(struct dp_pdev *pdev)
  1127. {
  1128. if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
  1129. return false;
  1130. if (pdev->monitor_pdev->mon_chan_band != REG_BAND_UNKNOWN)
  1131. return true;
  1132. return false;
  1133. }
  1134. /*
  1135. * dp_monitor_get_chan_band() - get chan band
  1136. * @pdev: point to dp pdev
  1137. *
  1138. * Return: wifi channel band
  1139. */
  1140. static inline enum reg_wifi_band
  1141. dp_monitor_get_chan_band(struct dp_pdev *pdev)
  1142. {
  1143. return pdev->monitor_pdev->mon_chan_band;
  1144. }
  1145. /*
  1146. * dp_monitor_print_tx_stats() - print tx stats from monitor pdev
  1147. * @pdev: point to dp pdev
  1148. *
  1149. */
  1150. static inline void dp_monitor_print_tx_stats(struct dp_pdev *pdev)
  1151. {
  1152. if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
  1153. return;
  1154. DP_PRINT_STATS("ppdu info schedule completion list depth: %d",
  1155. pdev->monitor_pdev->sched_comp_list_depth);
  1156. DP_PRINT_STATS("delivered sched cmdid: %d",
  1157. pdev->monitor_pdev->delivered_sched_cmdid);
  1158. DP_PRINT_STATS("cur sched cmdid: %d",
  1159. pdev->monitor_pdev->last_sched_cmdid);
  1160. DP_PRINT_STATS("ppdu info list depth: %d",
  1161. pdev->monitor_pdev->list_depth);
  1162. }
  1163. /*
  1164. * dp_monitor_set_chan_num() - set channel number
  1165. * @pdev: point to dp pdev
  1166. * @chan_num: channel number
  1167. *
  1168. */
  1169. static inline void dp_monitor_set_chan_num(struct dp_pdev *pdev, int chan_num)
  1170. {
  1171. if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
  1172. return;
  1173. pdev->monitor_pdev->mon_chan_num = chan_num;
  1174. }
  1175. /*
  1176. * dp_monitor_set_chan_freq() - set channel frequency
  1177. * @pdev: point to dp pdev
  1178. * @chan_freq: channel frequency
  1179. *
  1180. */
  1181. static inline void
  1182. dp_monitor_set_chan_freq(struct dp_pdev *pdev, qdf_freq_t chan_freq)
  1183. {
  1184. if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
  1185. return;
  1186. pdev->monitor_pdev->mon_chan_freq = chan_freq;
  1187. }
  1188. /*
  1189. * dp_monitor_set_chan_band() - set channel band
  1190. * @pdev: point to dp pdev
  1191. * @chan_band: channel band
  1192. *
  1193. */
  1194. static inline void
  1195. dp_monitor_set_chan_band(struct dp_pdev *pdev, enum reg_wifi_band chan_band)
  1196. {
  1197. if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
  1198. return;
  1199. pdev->monitor_pdev->mon_chan_band = chan_band;
  1200. }
  1201. /*
  1202. * dp_monitor_get_mpdu_status() - get mpdu status
  1203. * @pdev: point to dp pdev
  1204. * @soc: point to dp soc
  1205. * @rx_tlv_hdr: point to rx tlv header
  1206. *
  1207. */
  1208. static inline void dp_monitor_get_mpdu_status(struct dp_pdev *pdev,
  1209. struct dp_soc *soc,
  1210. uint8_t *rx_tlv_hdr)
  1211. {
  1212. struct dp_mon_pdev *mon_pdev;
  1213. if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
  1214. return;
  1215. mon_pdev = pdev->monitor_pdev;
  1216. hal_rx_mon_hw_desc_get_mpdu_status(soc->hal_soc, rx_tlv_hdr,
  1217. &mon_pdev->ppdu_info.rx_status);
  1218. }
  1219. #ifdef FEATURE_NAC_RSSI
  1220. /*
  1221. * dp_monitor_drop_inv_peer_pkts() - drop invalid peer pkts
  1222. * @vdev: point to dp vdev
  1223. *
  1224. * Return: success if sta mode and filter for neighbour peers enabled
  1225. */
  1226. static inline QDF_STATUS dp_monitor_drop_inv_peer_pkts(struct dp_vdev *vdev)
  1227. {
  1228. struct dp_pdev *pdev = vdev->pdev;
  1229. struct dp_soc *soc = pdev->soc;
  1230. if (!soc->monitor_soc)
  1231. return QDF_STATUS_E_FAILURE;
  1232. if (!soc->monitor_soc->hw_nac_monitor_support &&
  1233. pdev->monitor_pdev->filter_neighbour_peers &&
  1234. vdev->opmode == wlan_op_mode_sta)
  1235. return QDF_STATUS_SUCCESS;
  1236. return QDF_STATUS_E_FAILURE;
  1237. }
  1238. #endif
  1239. /*
  1240. * dp_peer_ppdu_delayed_ba_init() - Initialize ppdu in peer
  1241. * @peer: Datapath peer
  1242. *
  1243. * return: void
  1244. */
  1245. #ifdef FEATURE_PERPKT_INFO
  1246. static inline void dp_peer_ppdu_delayed_ba_init(struct dp_peer *peer)
  1247. {
  1248. struct dp_mon_peer *mon_peer = peer->monitor_peer;
  1249. if (!mon_peer)
  1250. return;
  1251. qdf_mem_zero(&mon_peer->delayed_ba_ppdu_stats,
  1252. sizeof(struct cdp_delayed_tx_completion_ppdu_user));
  1253. mon_peer->last_delayed_ba = false;
  1254. mon_peer->last_delayed_ba_ppduid = 0;
  1255. }
  1256. #else
  1257. static inline void dp_peer_ppdu_delayed_ba_init(struct dp_peer *peer)
  1258. {
  1259. }
  1260. #endif
  1261. /*
  1262. * dp_monitor_vdev_register_osif() - Register osif rx mon
  1263. * @vdev: point to vdev
  1264. * @txrx_ops: point to ol txrx ops
  1265. *
  1266. * Return: void
  1267. */
  1268. static inline void dp_monitor_vdev_register_osif(struct dp_vdev *vdev,
  1269. struct ol_txrx_ops *txrx_ops)
  1270. {
  1271. if (!vdev->monitor_vdev)
  1272. return;
  1273. vdev->monitor_vdev->osif_rx_mon = txrx_ops->rx.mon;
  1274. }
  1275. /*
  1276. * dp_monitor_get_monitor_vdev_from_pdev() - Get monitor vdev
  1277. * @pdev: point to pdev
  1278. *
  1279. * Return: pointer to vdev
  1280. */
  1281. static inline struct dp_vdev*
  1282. dp_monitor_get_monitor_vdev_from_pdev(struct dp_pdev *pdev)
  1283. {
  1284. if (!pdev || !pdev->monitor_pdev || !pdev->monitor_pdev->mvdev)
  1285. return NULL;
  1286. return pdev->monitor_pdev->mvdev;
  1287. }
  1288. /*
  1289. * dp_monitor_is_vdev_timer_running() - Get vdev timer status
  1290. * @soc: point to soc
  1291. *
  1292. * Return: true if timer running
  1293. */
  1294. static inline bool dp_monitor_is_vdev_timer_running(struct dp_soc *soc)
  1295. {
  1296. if (qdf_unlikely(!soc || !soc->monitor_soc))
  1297. return false;
  1298. return !!(soc->monitor_soc->mon_vdev_timer_state &
  1299. MON_VDEV_TIMER_RUNNING);
  1300. }
  1301. /*
  1302. * dp_monitor_get_link_desc_pages() - Get link desc pages
  1303. * @soc: point to soc
  1304. * @mac_id: mac id
  1305. *
  1306. * Return: return point to link desc pages
  1307. */
  1308. static inline struct qdf_mem_multi_page_t*
  1309. dp_monitor_get_link_desc_pages(struct dp_soc *soc, uint32_t mac_id)
  1310. {
  1311. if (qdf_unlikely(!soc || !soc->monitor_soc))
  1312. return NULL;
  1313. return &soc->monitor_soc->mon_link_desc_pages[mac_id];
  1314. }
  1315. /*
  1316. * dp_monitor_get_total_link_descs() - Get total link descs
  1317. * @soc: point to soc
  1318. * @mac_id: mac id
  1319. *
  1320. * Return: return point total link descs
  1321. */
  1322. static inline uint32_t *
  1323. dp_monitor_get_total_link_descs(struct dp_soc *soc, uint32_t mac_id)
  1324. {
  1325. return &soc->monitor_soc->total_mon_link_descs[mac_id];
  1326. }
  1327. /*
  1328. * dp_monitor_pdev_attach() - Monitor pdev attach
  1329. * @pdev: point to pdev
  1330. *
  1331. * Return: return QDF_STATUS
  1332. */
  1333. static inline QDF_STATUS dp_monitor_pdev_attach(struct dp_pdev *pdev)
  1334. {
  1335. struct dp_mon_ops *monitor_ops;
  1336. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  1337. /*
  1338. * mon_soc uninitialized modular support enabled
  1339. * monitor related attach/detach/init/deinit
  1340. * will be done while monitor insmod
  1341. */
  1342. if (!mon_soc)
  1343. return QDF_STATUS_SUCCESS;
  1344. monitor_ops = mon_soc->mon_ops;
  1345. if (!monitor_ops || !monitor_ops->mon_pdev_attach) {
  1346. dp_mon_debug("callback not registered");
  1347. return QDF_STATUS_E_FAILURE;
  1348. }
  1349. return monitor_ops->mon_pdev_attach(pdev);
  1350. }
  1351. /*
  1352. * dp_monitor_pdev_detach() - Monitor pdev detach
  1353. * @pdev: point to pdev
  1354. *
  1355. * Return: return QDF_STATUS
  1356. */
  1357. static inline QDF_STATUS dp_monitor_pdev_detach(struct dp_pdev *pdev)
  1358. {
  1359. struct dp_mon_ops *monitor_ops;
  1360. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  1361. /*
  1362. * mon_soc uninitialized modular support enabled
  1363. * monitor related attach/detach/init/deinit
  1364. * will be done while monitor insmod
  1365. */
  1366. if (!mon_soc)
  1367. return QDF_STATUS_SUCCESS;
  1368. monitor_ops = mon_soc->mon_ops;
  1369. if (!monitor_ops || !monitor_ops->mon_pdev_detach) {
  1370. dp_mon_debug("callback not registered");
  1371. return QDF_STATUS_E_FAILURE;
  1372. }
  1373. return monitor_ops->mon_pdev_detach(pdev);
  1374. }
  1375. /*
  1376. * dp_monitor_vdev_attach() - Monitor vdev attach
  1377. * @vdev: point to vdev
  1378. *
  1379. * Return: return QDF_STATUS
  1380. */
  1381. static inline QDF_STATUS dp_monitor_vdev_attach(struct dp_vdev *vdev)
  1382. {
  1383. struct dp_mon_ops *monitor_ops;
  1384. struct dp_mon_soc *mon_soc = vdev->pdev->soc->monitor_soc;
  1385. if (!mon_soc)
  1386. return QDF_STATUS_E_FAILURE;
  1387. monitor_ops = mon_soc->mon_ops;
  1388. if (!monitor_ops || !monitor_ops->mon_vdev_attach) {
  1389. dp_mon_debug("callback not registered");
  1390. return QDF_STATUS_E_FAILURE;
  1391. }
  1392. return monitor_ops->mon_vdev_attach(vdev);
  1393. }
  1394. /*
  1395. * dp_monitor_vdev_detach() - Monitor vdev detach
  1396. * @vdev: point to vdev
  1397. *
  1398. * Return: return QDF_STATUS
  1399. */
  1400. static inline QDF_STATUS dp_monitor_vdev_detach(struct dp_vdev *vdev)
  1401. {
  1402. struct dp_mon_ops *monitor_ops;
  1403. struct dp_mon_soc *mon_soc = vdev->pdev->soc->monitor_soc;
  1404. if (!mon_soc)
  1405. return QDF_STATUS_E_FAILURE;
  1406. monitor_ops = mon_soc->mon_ops;
  1407. if (!monitor_ops || !monitor_ops->mon_vdev_detach) {
  1408. dp_mon_debug("callback not registered");
  1409. return QDF_STATUS_E_FAILURE;
  1410. }
  1411. return monitor_ops->mon_vdev_detach(vdev);
  1412. }
  1413. /*
  1414. * dp_monitor_peer_attach() - Monitor peer attach
  1415. * @soc: point to soc
  1416. * @peer: point to peer
  1417. *
  1418. * Return: return QDF_STATUS
  1419. */
  1420. static inline QDF_STATUS dp_monitor_peer_attach(struct dp_soc *soc,
  1421. struct dp_peer *peer)
  1422. {
  1423. struct dp_mon_ops *monitor_ops;
  1424. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  1425. if (!mon_soc)
  1426. return QDF_STATUS_E_FAILURE;
  1427. monitor_ops = mon_soc->mon_ops;
  1428. if (!monitor_ops || !monitor_ops->mon_peer_attach) {
  1429. dp_mon_debug("callback not registered");
  1430. return QDF_STATUS_E_FAILURE;
  1431. }
  1432. return monitor_ops->mon_peer_attach(peer);
  1433. }
  1434. /*
  1435. * dp_monitor_peer_detach() - Monitor peer detach
  1436. * @soc: point to soc
  1437. * @peer: point to peer
  1438. *
  1439. * Return: return QDF_STATUS
  1440. */
  1441. static inline QDF_STATUS dp_monitor_peer_detach(struct dp_soc *soc,
  1442. struct dp_peer *peer)
  1443. {
  1444. struct dp_mon_ops *monitor_ops;
  1445. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  1446. if (!mon_soc)
  1447. return QDF_STATUS_E_FAILURE;
  1448. monitor_ops = mon_soc->mon_ops;
  1449. if (!monitor_ops || !monitor_ops->mon_peer_detach) {
  1450. dp_mon_debug("callback not registered");
  1451. return QDF_STATUS_E_FAILURE;
  1452. }
  1453. return monitor_ops->mon_peer_detach(peer);
  1454. }
  1455. /*
  1456. * dp_monitor_pdev_init() - Monitor pdev init
  1457. * @pdev: point to pdev
  1458. *
  1459. * Return: return QDF_STATUS
  1460. */
  1461. static inline QDF_STATUS dp_monitor_pdev_init(struct dp_pdev *pdev)
  1462. {
  1463. struct dp_mon_ops *monitor_ops;
  1464. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  1465. /*
  1466. * mon_soc uninitialized when modular support enabled
  1467. * monitor related attach/detach/init/deinit
  1468. * will be done while monitor insmod
  1469. */
  1470. if (!mon_soc)
  1471. return QDF_STATUS_SUCCESS;
  1472. monitor_ops = mon_soc->mon_ops;
  1473. if (!monitor_ops || !monitor_ops->mon_pdev_init) {
  1474. dp_mon_debug("callback not registered");
  1475. return QDF_STATUS_E_FAILURE;
  1476. }
  1477. return monitor_ops->mon_pdev_init(pdev);
  1478. }
  1479. /*
  1480. * dp_monitor_pdev_deinit() - Monitor pdev deinit
  1481. * @pdev: point to pdev
  1482. *
  1483. * Return: return QDF_STATUS
  1484. */
  1485. static inline QDF_STATUS dp_monitor_pdev_deinit(struct dp_pdev *pdev)
  1486. {
  1487. struct dp_mon_ops *monitor_ops;
  1488. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  1489. /*
  1490. * mon_soc uninitialized modular when support enabled
  1491. * monitor related attach/detach/init/deinit
  1492. * will be done while monitor insmod
  1493. */
  1494. if (!mon_soc)
  1495. return QDF_STATUS_SUCCESS;
  1496. monitor_ops = mon_soc->mon_ops;
  1497. if (!monitor_ops || !monitor_ops->mon_pdev_deinit) {
  1498. dp_mon_debug("callback not registered");
  1499. return QDF_STATUS_E_FAILURE;
  1500. }
  1501. return monitor_ops->mon_pdev_deinit(pdev);
  1502. }
  1503. /*
  1504. * dp_monitor_soc_cfg_init() - Monitor sco cfg init
  1505. * @soc: point to soc
  1506. *
  1507. * Return: return QDF_STATUS
  1508. */
  1509. static inline QDF_STATUS dp_monitor_soc_cfg_init(struct dp_soc *soc)
  1510. {
  1511. struct dp_mon_ops *monitor_ops;
  1512. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  1513. /*
  1514. * this API is getting call from dp_soc_init,
  1515. * mon_soc will be uninitialized when monitor support enabled
  1516. * So returning QDF_STATUS_SUCCESS.
  1517. * soc cfg init will be done while monitor insmod.
  1518. */
  1519. if (!mon_soc)
  1520. return QDF_STATUS_SUCCESS;
  1521. monitor_ops = mon_soc->mon_ops;
  1522. if (!monitor_ops || !monitor_ops->mon_soc_cfg_init) {
  1523. dp_mon_debug("callback not registered");
  1524. return QDF_STATUS_E_FAILURE;
  1525. }
  1526. return monitor_ops->mon_soc_cfg_init(soc);
  1527. }
  1528. /*
  1529. * dp_monitor_config_debug_sniffer() - Monitor config debug sniffer
  1530. * @pdev: point to pdev
  1531. * @val: val
  1532. *
  1533. * Return: return QDF_STATUS
  1534. */
  1535. static inline QDF_STATUS dp_monitor_config_debug_sniffer(struct dp_pdev *pdev,
  1536. int val)
  1537. {
  1538. struct dp_mon_ops *monitor_ops;
  1539. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  1540. if (!mon_soc)
  1541. return QDF_STATUS_E_FAILURE;
  1542. monitor_ops = mon_soc->mon_ops;
  1543. if (!monitor_ops || !monitor_ops->mon_config_debug_sniffer) {
  1544. dp_mon_debug("callback not registered");
  1545. return QDF_STATUS_E_FAILURE;
  1546. }
  1547. return monitor_ops->mon_config_debug_sniffer(pdev, val);
  1548. }
  1549. /*
  1550. * dp_monitor_flush_rings() - Flush monitor rings
  1551. * @soc: point to soc
  1552. *
  1553. * Return: None
  1554. */
  1555. static inline void dp_monitor_flush_rings(struct dp_soc *soc)
  1556. {
  1557. struct dp_mon_ops *monitor_ops;
  1558. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  1559. if (!mon_soc) {
  1560. dp_mon_debug("monitor soc is NULL");
  1561. return;
  1562. }
  1563. monitor_ops = mon_soc->mon_ops;
  1564. if (!monitor_ops || !monitor_ops->mon_flush_rings) {
  1565. dp_mon_debug("callback not registered");
  1566. return;
  1567. }
  1568. return monitor_ops->mon_flush_rings(soc);
  1569. }
  1570. /*
  1571. * dp_monitor_htt_srng_setup() - Setup htt srng
  1572. * @soc: point to soc
  1573. * @pdev: point to pdev
  1574. * @mac_id: lmac id
  1575. * @mac for pdev: pdev id
  1576. *
  1577. * Return: QDF_STATUS
  1578. */
  1579. #if !defined(DISABLE_MON_CONFIG)
  1580. static inline QDF_STATUS dp_monitor_htt_srng_setup(struct dp_soc *soc,
  1581. struct dp_pdev *pdev,
  1582. int mac_id,
  1583. int mac_for_pdev)
  1584. {
  1585. struct dp_mon_ops *monitor_ops;
  1586. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  1587. if (!mon_soc) {
  1588. dp_mon_debug("monitor soc is NULL");
  1589. return QDF_STATUS_SUCCESS;
  1590. }
  1591. monitor_ops = mon_soc->mon_ops;
  1592. if (!monitor_ops || !monitor_ops->mon_pdev_htt_srng_setup) {
  1593. dp_mon_debug("callback not registered");
  1594. return QDF_STATUS_E_FAILURE;
  1595. }
  1596. return monitor_ops->mon_pdev_htt_srng_setup(soc, pdev, mac_id,
  1597. mac_for_pdev);
  1598. }
  1599. static inline QDF_STATUS dp_monitor_soc_htt_srng_setup(struct dp_soc *soc)
  1600. {
  1601. struct dp_mon_ops *monitor_ops;
  1602. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  1603. if (!mon_soc) {
  1604. dp_mon_debug("monitor soc is NULL");
  1605. return QDF_STATUS_SUCCESS;
  1606. }
  1607. monitor_ops = mon_soc->mon_ops;
  1608. if (!monitor_ops || !monitor_ops->mon_soc_htt_srng_setup) {
  1609. dp_mon_debug("callback not registered");
  1610. return QDF_STATUS_E_FAILURE;
  1611. }
  1612. return monitor_ops->mon_soc_htt_srng_setup(soc);
  1613. }
  1614. #else
  1615. static inline QDF_STATUS dp_monitor_htt_srng_setup(struct dp_soc *soc,
  1616. struct dp_pdev *pdev,
  1617. int mac_id,
  1618. int mac_for_pdev)
  1619. {
  1620. return QDF_STATUS_SUCCESS;
  1621. }
  1622. #endif
  1623. /*
  1624. * dp_monitor_service_mon_rings() - service monitor rings
  1625. * @soc: point to soc
  1626. * @quota: reap budget
  1627. *
  1628. * Return: None
  1629. */
  1630. #if defined(DP_CON_MON)
  1631. static inline
  1632. void dp_monitor_service_mon_rings(struct dp_soc *soc, uint32_t quota)
  1633. {
  1634. struct dp_mon_ops *monitor_ops;
  1635. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  1636. if (!mon_soc) {
  1637. dp_mon_debug("monitor soc is NULL");
  1638. return;
  1639. }
  1640. monitor_ops = mon_soc->mon_ops;
  1641. if (!monitor_ops || !monitor_ops->mon_service_rings) {
  1642. dp_mon_debug("callback not registered");
  1643. return;
  1644. }
  1645. return monitor_ops->mon_service_rings(soc, quota);
  1646. }
  1647. #endif
  1648. /*
  1649. * dp_rx_monitor_process() - Process monitor
  1650. * @soc: point to soc
  1651. * @int_ctx: interrupt ctx
  1652. * @mac_id: lma
  1653. * @quota:
  1654. *
  1655. * Return: None
  1656. */
  1657. #ifndef DISABLE_MON_CONFIG
  1658. static inline
  1659. uint32_t dp_monitor_process(struct dp_soc *soc, struct dp_intr *int_ctx,
  1660. uint32_t mac_id, uint32_t quota)
  1661. {
  1662. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  1663. if (!mon_soc) {
  1664. dp_mon_debug("monitor soc is NULL");
  1665. return 0;
  1666. }
  1667. if (!mon_soc->mon_rx_process) {
  1668. dp_mon_debug("callback not registered");
  1669. return 0;
  1670. }
  1671. return mon_soc->mon_rx_process(soc, int_ctx, mac_id, quota);
  1672. }
  1673. static inline
  1674. uint32_t dp_tx_mon_process(struct dp_soc *soc, struct dp_intr *int_ctx,
  1675. uint32_t mac_id, uint32_t quota)
  1676. {
  1677. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  1678. struct dp_mon_ops *monitor_ops;
  1679. if (!mon_soc) {
  1680. dp_mon_debug("monitor soc is NULL");
  1681. return 0;
  1682. }
  1683. monitor_ops = mon_soc->mon_ops;
  1684. if (!monitor_ops || !monitor_ops->mon_tx_process) {
  1685. dp_mon_debug("callback not registered");
  1686. return 0;
  1687. }
  1688. return monitor_ops->mon_tx_process(soc, int_ctx, mac_id, quota);
  1689. }
  1690. static inline
  1691. uint32_t dp_tx_mon_buf_refill(struct dp_intr *int_ctx)
  1692. {
  1693. struct dp_soc *soc = int_ctx->soc;
  1694. struct dp_mon_ops *monitor_ops;
  1695. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  1696. if (!mon_soc) {
  1697. dp_mon_debug("monitor soc is NULL");
  1698. return 0;
  1699. }
  1700. monitor_ops = mon_soc->mon_ops;
  1701. if (!monitor_ops || !monitor_ops->tx_mon_refill_buf_ring) {
  1702. dp_mon_debug("callback not registered");
  1703. return 0;
  1704. }
  1705. return monitor_ops->tx_mon_refill_buf_ring(int_ctx);
  1706. }
  1707. static inline
  1708. uint32_t dp_rx_mon_buf_refill(struct dp_intr *int_ctx)
  1709. {
  1710. struct dp_soc *soc = int_ctx->soc;
  1711. struct dp_mon_ops *monitor_ops;
  1712. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  1713. if (!mon_soc) {
  1714. dp_mon_debug("monitor soc is NULL");
  1715. return 0;
  1716. }
  1717. monitor_ops = mon_soc->mon_ops;
  1718. if (!monitor_ops || !monitor_ops->rx_mon_refill_buf_ring) {
  1719. dp_mon_debug("callback not registered");
  1720. return 0;
  1721. }
  1722. return monitor_ops->rx_mon_refill_buf_ring(int_ctx);
  1723. }
  1724. #else
  1725. static inline
  1726. uint32_t dp_monitor_process(struct dp_soc *soc, struct dp_intr *int_ctx,
  1727. uint32_t mac_id, uint32_t quota)
  1728. {
  1729. return 0;
  1730. }
  1731. static inline uint32_t
  1732. dp_tx_mon_process(struct dp_soc *soc, struct dp_intr *int_ctx,
  1733. uint32_t mac_id, uint32_t quota)
  1734. {
  1735. return 0;
  1736. }
  1737. static inline
  1738. uint32_t dp_tx_mon_buf_refill(struct dp_intr *int_ctx)
  1739. {
  1740. }
  1741. static inline
  1742. uint32_t dp_rx_mon_buf_refill(struct dp_intr *int_ctx)
  1743. {
  1744. }
  1745. #endif
  1746. /*
  1747. * dp_monitor_drop_packets_for_mac() - monitor_drop_packets_for_mac
  1748. * @pdev: point to pdev
  1749. * @mac_id:
  1750. * @quota:
  1751. *
  1752. * Return:
  1753. */
  1754. #if !defined(DISABLE_MON_CONFIG) && defined(MON_ENABLE_DROP_FOR_MAC)
  1755. static inline
  1756. uint32_t dp_monitor_drop_packets_for_mac(struct dp_pdev *pdev,
  1757. uint32_t mac_id, uint32_t quota)
  1758. {
  1759. struct dp_mon_ops *monitor_ops;
  1760. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  1761. if (!mon_soc) {
  1762. dp_mon_debug("monitor soc is NULL");
  1763. return 0;
  1764. }
  1765. monitor_ops = mon_soc->mon_ops;
  1766. if (!monitor_ops || !monitor_ops->mon_drop_packets_for_mac) {
  1767. dp_mon_debug("callback not registered");
  1768. return 0;
  1769. }
  1770. return monitor_ops->mon_drop_packets_for_mac(pdev,
  1771. mac_id, quota);
  1772. }
  1773. #else
  1774. static inline
  1775. uint32_t dp_monitor_drop_packets_for_mac(struct dp_pdev *pdev,
  1776. uint32_t mac_id, uint32_t quota)
  1777. {
  1778. return 0;
  1779. }
  1780. #endif
  1781. /*
  1782. * dp_monitor_peer_tx_init() - peer tx init
  1783. * @pdev: point to pdev
  1784. * @peer: point to peer
  1785. *
  1786. * Return: None
  1787. */
  1788. static inline void dp_monitor_peer_tx_init(struct dp_pdev *pdev,
  1789. struct dp_peer *peer)
  1790. {
  1791. struct dp_mon_ops *monitor_ops;
  1792. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  1793. if (!mon_soc) {
  1794. dp_mon_debug("monitor soc is NULL");
  1795. return;
  1796. }
  1797. monitor_ops = mon_soc->mon_ops;
  1798. if (!monitor_ops || !monitor_ops->mon_peer_tx_init) {
  1799. dp_mon_debug("callback not registered");
  1800. return;
  1801. }
  1802. return monitor_ops->mon_peer_tx_init(pdev, peer);
  1803. }
  1804. /*
  1805. * dp_monitor_peer_tx_cleanup() - peer tx cleanup
  1806. * @vdev: point to vdev
  1807. * @peer: point to peer
  1808. *
  1809. * Return: None
  1810. */
  1811. static inline void dp_monitor_peer_tx_cleanup(struct dp_vdev *vdev,
  1812. struct dp_peer *peer)
  1813. {
  1814. struct dp_mon_ops *monitor_ops;
  1815. struct dp_mon_soc *mon_soc = vdev->pdev->soc->monitor_soc;
  1816. if (!mon_soc) {
  1817. dp_mon_debug("monitor soc is NULL");
  1818. return;
  1819. }
  1820. monitor_ops = mon_soc->mon_ops;
  1821. if (!monitor_ops || !monitor_ops->mon_peer_tx_cleanup) {
  1822. dp_mon_debug("callback not registered");
  1823. return;
  1824. }
  1825. return monitor_ops->mon_peer_tx_cleanup(vdev, peer);
  1826. }
  1827. #ifdef WLAN_TX_PKT_CAPTURE_ENH
  1828. /*
  1829. * dp_monitor_peer_tid_peer_id_update() - peer tid update
  1830. * @soc: point to soc
  1831. * @peer: point to peer
  1832. * @peer_id: peer id
  1833. *
  1834. * Return: None
  1835. */
  1836. static inline
  1837. void dp_monitor_peer_tid_peer_id_update(struct dp_soc *soc,
  1838. struct dp_peer *peer,
  1839. uint16_t peer_id)
  1840. {
  1841. struct dp_mon_ops *monitor_ops;
  1842. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  1843. if (!mon_soc) {
  1844. dp_mon_debug("monitor soc is NULL");
  1845. return;
  1846. }
  1847. monitor_ops = mon_soc->mon_ops;
  1848. if (!monitor_ops || !monitor_ops->mon_peer_tid_peer_id_update) {
  1849. dp_mon_debug("callback not registered");
  1850. return;
  1851. }
  1852. return monitor_ops->mon_peer_tid_peer_id_update(peer, peer_id);
  1853. }
  1854. /*
  1855. * dp_monitor_tx_ppdu_stats_attach() - Attach tx ppdu stats
  1856. * @pdev: point to pdev
  1857. *
  1858. * Return: None
  1859. */
  1860. static inline void dp_monitor_tx_ppdu_stats_attach(struct dp_pdev *pdev)
  1861. {
  1862. struct dp_mon_ops *monitor_ops;
  1863. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  1864. if (!mon_soc) {
  1865. dp_mon_debug("monitor soc is NULL");
  1866. return;
  1867. }
  1868. monitor_ops = mon_soc->mon_ops;
  1869. if (!monitor_ops || !monitor_ops->mon_tx_ppdu_stats_attach) {
  1870. dp_mon_debug("callback not registered");
  1871. return;
  1872. }
  1873. return monitor_ops->mon_tx_ppdu_stats_attach(pdev);
  1874. }
  1875. /*
  1876. * dp_monitor_tx_ppdu_stats_detach() - Detach tx ppdu stats
  1877. * @pdev: point to pdev
  1878. *
  1879. * Return: None
  1880. */
  1881. static inline void dp_monitor_tx_ppdu_stats_detach(struct dp_pdev *pdev)
  1882. {
  1883. struct dp_mon_ops *monitor_ops;
  1884. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  1885. if (!mon_soc) {
  1886. dp_mon_debug("monitor soc is NULL");
  1887. return;
  1888. }
  1889. monitor_ops = mon_soc->mon_ops;
  1890. if (!monitor_ops || !monitor_ops->mon_tx_ppdu_stats_detach) {
  1891. dp_mon_debug("callback not registered");
  1892. return;
  1893. }
  1894. return monitor_ops->mon_tx_ppdu_stats_detach(pdev);
  1895. }
  1896. /*
  1897. * dp_monitor_tx_capture_debugfs_init() - Init tx capture debugfs
  1898. * @pdev: point to pdev
  1899. *
  1900. * Return: QDF_STATUS_SUCCESS
  1901. */
  1902. static inline
  1903. QDF_STATUS dp_monitor_tx_capture_debugfs_init(struct dp_pdev *pdev)
  1904. {
  1905. struct dp_mon_ops *monitor_ops;
  1906. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  1907. if (!mon_soc) {
  1908. dp_mon_debug("monitor soc is NULL");
  1909. return QDF_STATUS_E_FAILURE;
  1910. }
  1911. monitor_ops = mon_soc->mon_ops;
  1912. if (!monitor_ops || !monitor_ops->mon_tx_capture_debugfs_init) {
  1913. dp_mon_debug("callback not registered");
  1914. return QDF_STATUS_E_FAILURE;
  1915. }
  1916. return monitor_ops->mon_tx_capture_debugfs_init(pdev);
  1917. }
  1918. /*
  1919. * dp_monitor_peer_tx_capture_filter_check() - Check tx capture filter
  1920. * @pdev: point to pdev
  1921. * @peer: point to peer
  1922. *
  1923. * Return: None
  1924. */
  1925. static inline void dp_monitor_peer_tx_capture_filter_check(struct dp_pdev *pdev,
  1926. struct dp_peer *peer)
  1927. {
  1928. struct dp_mon_ops *monitor_ops;
  1929. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  1930. if (!mon_soc) {
  1931. dp_mon_debug("monitor soc is NULL");
  1932. return;
  1933. }
  1934. monitor_ops = mon_soc->mon_ops;
  1935. if (!monitor_ops || !monitor_ops->mon_peer_tx_capture_filter_check) {
  1936. dp_mon_debug("callback not registered");
  1937. return;
  1938. }
  1939. return monitor_ops->mon_peer_tx_capture_filter_check(pdev, peer);
  1940. }
  1941. /*
  1942. * dp_monitor_tx_add_to_comp_queue() - add completion msdu to queue
  1943. *
  1944. * This API returns QDF_STATUS_SUCCESS in case where buffer is added
  1945. * to txmonitor queue successfuly caller will not free the buffer in
  1946. * this case. In other cases this API return QDF_STATUS_E_FAILURE and
  1947. * caller frees the buffer
  1948. *
  1949. * @soc: point to soc
  1950. * @desc: point to tx desc
  1951. * @ts: Tx completion status from HAL/HTT descriptor
  1952. * @peer: DP peer
  1953. *
  1954. * Return: QDF_STATUS
  1955. *
  1956. */
  1957. static inline
  1958. QDF_STATUS dp_monitor_tx_add_to_comp_queue(struct dp_soc *soc,
  1959. struct dp_tx_desc_s *desc,
  1960. struct hal_tx_completion_status *ts,
  1961. struct dp_peer *peer)
  1962. {
  1963. struct dp_mon_ops *monitor_ops;
  1964. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  1965. if (!mon_soc) {
  1966. dp_mon_debug("monitor soc is NULL");
  1967. return QDF_STATUS_E_FAILURE;
  1968. }
  1969. monitor_ops = mon_soc->mon_ops;
  1970. if (!monitor_ops || !monitor_ops->mon_tx_add_to_comp_queue) {
  1971. dp_mon_debug("callback not registered");
  1972. return QDF_STATUS_E_FAILURE;
  1973. }
  1974. return monitor_ops->mon_tx_add_to_comp_queue(soc, desc, ts, peer);
  1975. }
  1976. static inline
  1977. QDF_STATUS monitor_update_msdu_to_list(struct dp_soc *soc,
  1978. struct dp_pdev *pdev,
  1979. struct dp_peer *peer,
  1980. struct hal_tx_completion_status *ts,
  1981. qdf_nbuf_t netbuf)
  1982. {
  1983. struct dp_mon_ops *monitor_ops;
  1984. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  1985. if (!mon_soc) {
  1986. dp_mon_debug("monitor soc is NULL");
  1987. return QDF_STATUS_SUCCESS;
  1988. }
  1989. monitor_ops = mon_soc->mon_ops;
  1990. if (!monitor_ops || !monitor_ops->mon_update_msdu_to_list) {
  1991. dp_mon_debug("callback not registered");
  1992. return QDF_STATUS_E_FAILURE;
  1993. }
  1994. return monitor_ops->mon_update_msdu_to_list(soc, pdev,
  1995. peer, ts, netbuf);
  1996. }
  1997. #else
  1998. static inline
  1999. void dp_monitor_peer_tid_peer_id_update(struct dp_soc *soc,
  2000. struct dp_peer *peer,
  2001. uint16_t peer_id)
  2002. {
  2003. }
  2004. static inline void dp_monitor_tx_ppdu_stats_attach(struct dp_pdev *pdev)
  2005. {
  2006. }
  2007. static inline void dp_monitor_tx_ppdu_stats_detach(struct dp_pdev *pdev)
  2008. {
  2009. }
  2010. static inline
  2011. QDF_STATUS dp_monitor_tx_capture_debugfs_init(struct dp_pdev *pdev)
  2012. {
  2013. return QDF_STATUS_E_FAILURE;
  2014. }
  2015. static inline void dp_monitor_peer_tx_capture_filter_check(struct dp_pdev *pdev,
  2016. struct dp_peer *peer)
  2017. {
  2018. }
  2019. static inline
  2020. QDF_STATUS dp_monitor_tx_add_to_comp_queue(struct dp_soc *soc,
  2021. struct dp_tx_desc_s *desc,
  2022. struct hal_tx_completion_status *ts,
  2023. struct dp_peer *peer)
  2024. {
  2025. return QDF_STATUS_E_FAILURE;
  2026. }
  2027. static inline
  2028. QDF_STATUS monitor_update_msdu_to_list(struct dp_soc *soc,
  2029. struct dp_pdev *pdev,
  2030. struct dp_peer *peer,
  2031. struct hal_tx_completion_status *ts,
  2032. qdf_nbuf_t netbuf)
  2033. {
  2034. return QDF_STATUS_E_FAILURE;
  2035. }
  2036. #endif
  2037. /*
  2038. * dp_monitor_ppdu_stats_ind_handler() - PPDU stats msg handler
  2039. * @htt_soc: HTT SOC handle
  2040. * @msg_word: Pointer to payload
  2041. * @htt_t2h_msg: HTT msg nbuf
  2042. *
  2043. * Return: True if buffer should be freed by caller.
  2044. */
  2045. #if defined(WDI_EVENT_ENABLE) &&\
  2046. (defined(QCA_ENHANCED_STATS_SUPPORT) || !defined(REMOVE_PKT_LOG))
  2047. static inline bool dp_monitor_ppdu_stats_ind_handler(struct htt_soc *soc,
  2048. uint32_t *msg_word,
  2049. qdf_nbuf_t htt_t2h_msg)
  2050. {
  2051. struct dp_mon_ops *monitor_ops;
  2052. struct dp_mon_soc *mon_soc = soc->dp_soc->monitor_soc;
  2053. if (!mon_soc) {
  2054. dp_mon_debug("monitor soc is NULL");
  2055. return true;
  2056. }
  2057. monitor_ops = mon_soc->mon_ops;
  2058. if (!monitor_ops || !monitor_ops->mon_ppdu_stats_ind_handler) {
  2059. dp_mon_debug("callback not registered");
  2060. return true;
  2061. }
  2062. return monitor_ops->mon_ppdu_stats_ind_handler(soc, msg_word,
  2063. htt_t2h_msg);
  2064. }
  2065. #else
  2066. static inline bool dp_monitor_ppdu_stats_ind_handler(struct htt_soc *soc,
  2067. uint32_t *msg_word,
  2068. qdf_nbuf_t htt_t2h_msg)
  2069. {
  2070. return true;
  2071. }
  2072. #endif
  2073. /*
  2074. * dp_monitor_htt_ppdu_stats_attach() - attach resources for HTT PPDU
  2075. * stats processing
  2076. * @pdev: Datapath PDEV handle
  2077. *
  2078. * Return: QDF_STATUS
  2079. */
  2080. static inline QDF_STATUS dp_monitor_htt_ppdu_stats_attach(struct dp_pdev *pdev)
  2081. {
  2082. struct dp_mon_ops *monitor_ops;
  2083. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2084. if (!mon_soc) {
  2085. dp_mon_debug("monitor soc is NULL");
  2086. return QDF_STATUS_SUCCESS;
  2087. }
  2088. monitor_ops = mon_soc->mon_ops;
  2089. if (!monitor_ops || !monitor_ops->mon_htt_ppdu_stats_attach) {
  2090. dp_mon_debug("callback not registered");
  2091. return QDF_STATUS_E_FAILURE;
  2092. }
  2093. return monitor_ops->mon_htt_ppdu_stats_attach(pdev);
  2094. }
  2095. /*
  2096. * dp_monitor_htt_ppdu_stats_detach() - detach stats resources
  2097. * @pdev: Datapath PDEV handle
  2098. *
  2099. * Return: void
  2100. */
  2101. static inline void dp_monitor_htt_ppdu_stats_detach(struct dp_pdev *pdev)
  2102. {
  2103. struct dp_mon_ops *monitor_ops;
  2104. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2105. if (!mon_soc) {
  2106. dp_mon_debug("monitor soc is NULL");
  2107. return;
  2108. }
  2109. monitor_ops = mon_soc->mon_ops;
  2110. if (!monitor_ops || !monitor_ops->mon_htt_ppdu_stats_detach) {
  2111. dp_mon_debug("callback not registered");
  2112. return;
  2113. }
  2114. return monitor_ops->mon_htt_ppdu_stats_detach(pdev);
  2115. }
  2116. /*
  2117. * dp_monitor_print_pdev_rx_mon_stats() - print rx mon stats
  2118. * @pdev: Datapath PDEV handle
  2119. *
  2120. * Return: void
  2121. */
  2122. static inline void dp_monitor_print_pdev_rx_mon_stats(struct dp_pdev *pdev)
  2123. {
  2124. struct dp_mon_ops *monitor_ops;
  2125. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2126. if (!mon_soc) {
  2127. dp_mon_debug("monitor soc is NULL");
  2128. return;
  2129. }
  2130. monitor_ops = mon_soc->mon_ops;
  2131. if (!monitor_ops || !monitor_ops->mon_print_pdev_rx_mon_stats) {
  2132. dp_mon_debug("callback not registered");
  2133. return;
  2134. }
  2135. return monitor_ops->mon_print_pdev_rx_mon_stats(pdev);
  2136. }
  2137. /*
  2138. * dp_monitor_print_pdev_tx_capture_stats() - print tx capture stats
  2139. * @pdev: Datapath PDEV handle
  2140. *
  2141. * Return: void
  2142. */
  2143. #ifdef WLAN_TX_PKT_CAPTURE_ENH
  2144. static inline void dp_monitor_print_pdev_tx_capture_stats(struct dp_pdev *pdev)
  2145. {
  2146. struct dp_mon_ops *monitor_ops;
  2147. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2148. if (!mon_soc) {
  2149. dp_mon_debug("monitor soc is NULL");
  2150. return;
  2151. }
  2152. monitor_ops = mon_soc->mon_ops;
  2153. if (!monitor_ops || !monitor_ops->mon_print_pdev_tx_capture_stats) {
  2154. dp_mon_debug("callback not registered");
  2155. return;
  2156. }
  2157. return monitor_ops->mon_print_pdev_tx_capture_stats(pdev);
  2158. }
  2159. static inline QDF_STATUS dp_monitor_config_enh_tx_capture(struct dp_pdev *pdev,
  2160. uint32_t val)
  2161. {
  2162. struct dp_mon_ops *monitor_ops;
  2163. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2164. if (!mon_soc) {
  2165. dp_mon_debug("monitor soc is NULL");
  2166. return QDF_STATUS_E_FAILURE;
  2167. }
  2168. monitor_ops = mon_soc->mon_ops;
  2169. if (!monitor_ops || !monitor_ops->mon_config_enh_tx_capture) {
  2170. dp_mon_debug("callback not registered");
  2171. return QDF_STATUS_E_FAILURE;
  2172. }
  2173. return monitor_ops->mon_config_enh_tx_capture(pdev, val);
  2174. }
  2175. #else
  2176. static inline void dp_monitor_print_pdev_tx_capture_stats(struct dp_pdev *pdev)
  2177. {
  2178. }
  2179. static inline QDF_STATUS dp_monitor_config_enh_tx_capture(struct dp_pdev *pdev,
  2180. uint32_t val)
  2181. {
  2182. return QDF_STATUS_E_INVAL;
  2183. }
  2184. #endif
  2185. #ifdef WLAN_RX_PKT_CAPTURE_ENH
  2186. static inline QDF_STATUS dp_monitor_config_enh_rx_capture(struct dp_pdev *pdev,
  2187. uint32_t val)
  2188. {
  2189. struct dp_mon_ops *monitor_ops;
  2190. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2191. if (!mon_soc) {
  2192. dp_mon_debug("monitor soc is NULL");
  2193. return QDF_STATUS_E_FAILURE;
  2194. }
  2195. monitor_ops = mon_soc->mon_ops;
  2196. if (!monitor_ops || !monitor_ops->mon_config_enh_rx_capture) {
  2197. dp_mon_debug("callback not registered");
  2198. return QDF_STATUS_E_FAILURE;
  2199. }
  2200. return monitor_ops->mon_config_enh_rx_capture(pdev, val);
  2201. }
  2202. #else
  2203. static inline QDF_STATUS dp_monitor_config_enh_rx_capture(struct dp_pdev *pdev,
  2204. uint32_t val)
  2205. {
  2206. return QDF_STATUS_E_INVAL;
  2207. }
  2208. #endif
  2209. #ifdef QCA_SUPPORT_BPR
  2210. static inline QDF_STATUS dp_monitor_set_bpr_enable(struct dp_pdev *pdev,
  2211. uint32_t val)
  2212. {
  2213. struct dp_mon_ops *monitor_ops;
  2214. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2215. if (!mon_soc) {
  2216. dp_mon_debug("monitor soc is NULL");
  2217. return QDF_STATUS_E_FAILURE;
  2218. }
  2219. monitor_ops = mon_soc->mon_ops;
  2220. if (!monitor_ops || !monitor_ops->mon_set_bpr_enable) {
  2221. dp_mon_debug("callback not registered");
  2222. return QDF_STATUS_E_FAILURE;
  2223. }
  2224. return monitor_ops->mon_set_bpr_enable(pdev, val);
  2225. }
  2226. #else
  2227. static inline QDF_STATUS dp_monitor_set_bpr_enable(struct dp_pdev *pdev,
  2228. uint32_t val)
  2229. {
  2230. return QDF_STATUS_E_FAILURE;
  2231. }
  2232. #endif
  2233. #ifdef ATH_SUPPORT_NAC
  2234. static inline
  2235. int dp_monitor_set_filter_neigh_peers(struct dp_pdev *pdev, bool val)
  2236. {
  2237. struct dp_mon_ops *monitor_ops;
  2238. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2239. if (!mon_soc) {
  2240. dp_mon_debug("monitor soc is NULL");
  2241. return 0;
  2242. }
  2243. monitor_ops = mon_soc->mon_ops;
  2244. if (!monitor_ops || !monitor_ops->mon_set_filter_neigh_peers) {
  2245. dp_mon_debug("callback not registered");
  2246. return 0;
  2247. }
  2248. return monitor_ops->mon_set_filter_neigh_peers(pdev, val);
  2249. }
  2250. #else
  2251. static inline
  2252. int dp_monitor_set_filter_neigh_peers(struct dp_pdev *pdev, bool val)
  2253. {
  2254. return 0;
  2255. }
  2256. #endif
  2257. #ifdef WLAN_ATF_ENABLE
  2258. static inline
  2259. void dp_monitor_set_atf_stats_enable(struct dp_pdev *pdev, bool value)
  2260. {
  2261. struct dp_mon_ops *monitor_ops;
  2262. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2263. if (!mon_soc) {
  2264. dp_mon_debug("monitor soc is NULL");
  2265. return;
  2266. }
  2267. monitor_ops = mon_soc->mon_ops;
  2268. if (!monitor_ops || !monitor_ops->mon_set_atf_stats_enable) {
  2269. dp_mon_debug("callback not registered");
  2270. return;
  2271. }
  2272. return monitor_ops->mon_set_atf_stats_enable(pdev, value);
  2273. }
  2274. #else
  2275. static inline
  2276. void dp_monitor_set_atf_stats_enable(struct dp_pdev *pdev, bool value)
  2277. {
  2278. }
  2279. #endif
  2280. static inline
  2281. void dp_monitor_set_bsscolor(struct dp_pdev *pdev, uint8_t bsscolor)
  2282. {
  2283. struct dp_mon_ops *monitor_ops;
  2284. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2285. if (!mon_soc) {
  2286. dp_mon_debug("monitor soc is NULL");
  2287. return;
  2288. }
  2289. monitor_ops = mon_soc->mon_ops;
  2290. if (!monitor_ops || !monitor_ops->mon_set_bsscolor) {
  2291. dp_mon_debug("callback not registered");
  2292. return;
  2293. }
  2294. return monitor_ops->mon_set_bsscolor(pdev, bsscolor);
  2295. }
  2296. static inline
  2297. bool dp_monitor_pdev_get_filter_mcast_data(struct cdp_pdev *pdev_handle)
  2298. {
  2299. struct dp_mon_ops *monitor_ops;
  2300. struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
  2301. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2302. if (!mon_soc) {
  2303. dp_mon_debug("monitor soc is NULL");
  2304. return false;
  2305. }
  2306. monitor_ops = mon_soc->mon_ops;
  2307. if (!monitor_ops || !monitor_ops->mon_pdev_get_filter_mcast_data) {
  2308. dp_mon_debug("callback not registered");
  2309. return false;
  2310. }
  2311. return monitor_ops->mon_pdev_get_filter_mcast_data(pdev_handle);
  2312. }
  2313. static inline
  2314. bool dp_monitor_pdev_get_filter_non_data(struct cdp_pdev *pdev_handle)
  2315. {
  2316. struct dp_mon_ops *monitor_ops;
  2317. struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
  2318. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2319. if (!mon_soc) {
  2320. dp_mon_debug("monitor soc is NULL");
  2321. return false;
  2322. }
  2323. monitor_ops = mon_soc->mon_ops;
  2324. if (!monitor_ops || !monitor_ops->mon_pdev_get_filter_non_data) {
  2325. dp_mon_debug("callback not registered");
  2326. return false;
  2327. }
  2328. return monitor_ops->mon_pdev_get_filter_non_data(pdev_handle);
  2329. }
  2330. static inline
  2331. bool dp_monitor_pdev_get_filter_ucast_data(struct cdp_pdev *pdev_handle)
  2332. {
  2333. struct dp_mon_ops *monitor_ops;
  2334. struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
  2335. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2336. if (!mon_soc) {
  2337. dp_mon_debug("monitor soc is NULL");
  2338. return false;
  2339. }
  2340. monitor_ops = mon_soc->mon_ops;
  2341. if (!monitor_ops || !monitor_ops->mon_pdev_get_filter_ucast_data) {
  2342. dp_mon_debug("callback not registered");
  2343. return false;
  2344. }
  2345. return monitor_ops->mon_pdev_get_filter_ucast_data(pdev_handle);
  2346. }
  2347. #ifdef WDI_EVENT_ENABLE
  2348. static inline
  2349. int dp_monitor_set_pktlog_wifi3(struct dp_pdev *pdev, uint32_t event,
  2350. bool enable)
  2351. {
  2352. struct dp_mon_ops *monitor_ops;
  2353. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2354. if (!mon_soc) {
  2355. dp_mon_debug("monitor soc is NULL");
  2356. return 0;
  2357. }
  2358. monitor_ops = mon_soc->mon_ops;
  2359. if (!monitor_ops || !monitor_ops->mon_set_pktlog_wifi3) {
  2360. dp_mon_debug("callback not registered");
  2361. return 0;
  2362. }
  2363. return monitor_ops->mon_set_pktlog_wifi3(pdev, event, enable);
  2364. }
  2365. #else
  2366. static inline
  2367. int dp_monitor_set_pktlog_wifi3(struct dp_pdev *pdev, uint32_t event,
  2368. bool enable)
  2369. {
  2370. return 0;
  2371. }
  2372. #endif
  2373. #if defined(DP_CON_MON) && !defined(REMOVE_PKT_LOG)
  2374. static inline void dp_monitor_pktlogmod_exit(struct dp_pdev *pdev)
  2375. {
  2376. struct dp_mon_ops *monitor_ops;
  2377. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2378. if (!mon_soc) {
  2379. dp_mon_debug("monitor soc is NULL");
  2380. return;
  2381. }
  2382. monitor_ops = mon_soc->mon_ops;
  2383. if (!monitor_ops || !monitor_ops->mon_pktlogmod_exit) {
  2384. dp_mon_debug("callback not registered");
  2385. return;
  2386. }
  2387. return monitor_ops->mon_pktlogmod_exit(pdev);
  2388. }
  2389. #else
  2390. static inline void dp_monitor_pktlogmod_exit(struct dp_pdev *pdev) {}
  2391. #endif
  2392. static inline
  2393. void dp_monitor_vdev_set_monitor_mode_buf_rings(struct dp_pdev *pdev)
  2394. {
  2395. struct dp_mon_ops *monitor_ops;
  2396. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2397. if (!mon_soc) {
  2398. dp_mon_debug("monitor soc is NULL");
  2399. return;
  2400. }
  2401. monitor_ops = mon_soc->mon_ops;
  2402. if (!monitor_ops || !monitor_ops->mon_vdev_set_monitor_mode_buf_rings) {
  2403. dp_mon_debug("callback not registered");
  2404. return;
  2405. }
  2406. return monitor_ops->mon_vdev_set_monitor_mode_buf_rings(pdev);
  2407. }
  2408. static inline
  2409. void dp_monitor_neighbour_peers_detach(struct dp_pdev *pdev)
  2410. {
  2411. struct dp_mon_ops *monitor_ops;
  2412. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2413. if (!mon_soc) {
  2414. dp_mon_debug("monitor soc is NULL");
  2415. return;
  2416. }
  2417. monitor_ops = mon_soc->mon_ops;
  2418. if (!monitor_ops || !monitor_ops->mon_neighbour_peers_detach) {
  2419. dp_mon_debug("callback not registered");
  2420. return;
  2421. }
  2422. return monitor_ops->mon_neighbour_peers_detach(pdev);
  2423. }
  2424. #ifdef FEATURE_NAC_RSSI
  2425. static inline QDF_STATUS dp_monitor_filter_neighbour_peer(struct dp_pdev *pdev,
  2426. uint8_t *rx_pkt_hdr)
  2427. {
  2428. struct dp_mon_ops *monitor_ops;
  2429. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2430. if (!mon_soc) {
  2431. dp_mon_debug("monitor soc is NULL");
  2432. return QDF_STATUS_E_FAILURE;
  2433. }
  2434. monitor_ops = mon_soc->mon_ops;
  2435. if (!monitor_ops || !monitor_ops->mon_filter_neighbour_peer) {
  2436. dp_mon_debug("callback not registered");
  2437. return QDF_STATUS_E_FAILURE;
  2438. }
  2439. return monitor_ops->mon_filter_neighbour_peer(pdev, rx_pkt_hdr);
  2440. }
  2441. #endif
  2442. static inline
  2443. void dp_monitor_reap_timer_init(struct dp_soc *soc)
  2444. {
  2445. struct dp_mon_ops *monitor_ops;
  2446. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  2447. if (!mon_soc) {
  2448. dp_mon_debug("monitor soc is NULL");
  2449. return;
  2450. }
  2451. monitor_ops = mon_soc->mon_ops;
  2452. if (!monitor_ops || !monitor_ops->mon_reap_timer_init) {
  2453. dp_mon_debug("callback not registered");
  2454. return;
  2455. }
  2456. monitor_ops->mon_reap_timer_init(soc);
  2457. }
  2458. static inline
  2459. void dp_monitor_reap_timer_deinit(struct dp_soc *soc)
  2460. {
  2461. struct dp_mon_ops *monitor_ops;
  2462. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  2463. if (!mon_soc) {
  2464. dp_mon_debug("monitor soc is NULL");
  2465. return;
  2466. }
  2467. monitor_ops = mon_soc->mon_ops;
  2468. if (!monitor_ops || !monitor_ops->mon_reap_timer_deinit) {
  2469. dp_mon_debug("callback not registered");
  2470. return;
  2471. }
  2472. monitor_ops->mon_reap_timer_deinit(soc);
  2473. }
  2474. static inline
  2475. void dp_monitor_reap_timer_start(struct dp_soc *soc)
  2476. {
  2477. struct dp_mon_ops *monitor_ops;
  2478. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  2479. if (!mon_soc) {
  2480. dp_mon_debug("monitor soc is NULL");
  2481. return;
  2482. }
  2483. monitor_ops = mon_soc->mon_ops;
  2484. if (!monitor_ops || !monitor_ops->mon_reap_timer_start) {
  2485. dp_mon_debug("callback not registered");
  2486. return;
  2487. }
  2488. monitor_ops->mon_reap_timer_start(soc);
  2489. }
  2490. static inline
  2491. bool dp_monitor_reap_timer_stop(struct dp_soc *soc)
  2492. {
  2493. struct dp_mon_ops *monitor_ops;
  2494. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  2495. if (!mon_soc) {
  2496. dp_mon_debug("monitor soc is NULL");
  2497. return false;
  2498. }
  2499. monitor_ops = mon_soc->mon_ops;
  2500. if (!monitor_ops || !monitor_ops->mon_reap_timer_stop) {
  2501. dp_mon_debug("callback not registered");
  2502. return false;
  2503. }
  2504. return monitor_ops->mon_reap_timer_stop(soc);
  2505. }
  2506. static inline
  2507. void dp_monitor_vdev_timer_init(struct dp_soc *soc)
  2508. {
  2509. struct dp_mon_ops *monitor_ops;
  2510. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  2511. if (!mon_soc) {
  2512. dp_mon_debug("monitor soc is NULL");
  2513. return;
  2514. }
  2515. monitor_ops = mon_soc->mon_ops;
  2516. if (!monitor_ops || !monitor_ops->mon_vdev_timer_init) {
  2517. dp_mon_debug("callback not registered");
  2518. return;
  2519. }
  2520. monitor_ops->mon_vdev_timer_init(soc);
  2521. }
  2522. static inline
  2523. void dp_monitor_vdev_timer_deinit(struct dp_soc *soc)
  2524. {
  2525. struct dp_mon_ops *monitor_ops;
  2526. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  2527. if (!mon_soc) {
  2528. dp_mon_debug("monitor soc is NULL");
  2529. return;
  2530. }
  2531. monitor_ops = mon_soc->mon_ops;
  2532. if (!monitor_ops || !monitor_ops->mon_vdev_timer_deinit) {
  2533. dp_mon_debug("callback not registered");
  2534. return;
  2535. }
  2536. monitor_ops->mon_vdev_timer_deinit(soc);
  2537. }
  2538. static inline
  2539. void dp_monitor_vdev_timer_start(struct dp_soc *soc)
  2540. {
  2541. struct dp_mon_ops *monitor_ops;
  2542. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  2543. if (!mon_soc) {
  2544. dp_mon_debug("monitor soc is NULL");
  2545. return;
  2546. }
  2547. monitor_ops = mon_soc->mon_ops;
  2548. if (!monitor_ops || !monitor_ops->mon_vdev_timer_start) {
  2549. dp_mon_debug("callback not registered");
  2550. return;
  2551. }
  2552. monitor_ops->mon_vdev_timer_start(soc);
  2553. }
  2554. static inline
  2555. bool dp_monitor_vdev_timer_stop(struct dp_soc *soc)
  2556. {
  2557. struct dp_mon_ops *monitor_ops;
  2558. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  2559. if (!mon_soc) {
  2560. dp_mon_debug("monitor soc is NULL");
  2561. return false;
  2562. }
  2563. monitor_ops = mon_soc->mon_ops;
  2564. if (!monitor_ops || !monitor_ops->mon_vdev_timer_stop) {
  2565. dp_mon_debug("callback not registered");
  2566. return false;
  2567. }
  2568. return monitor_ops->mon_vdev_timer_stop(soc);
  2569. }
  2570. #ifdef QCA_MCOPY_SUPPORT
  2571. static inline
  2572. QDF_STATUS dp_monitor_mcopy_check_deliver(struct dp_pdev *pdev,
  2573. uint16_t peer_id, uint32_t ppdu_id,
  2574. uint8_t first_msdu)
  2575. {
  2576. struct dp_mon_ops *monitor_ops;
  2577. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2578. if (!mon_soc) {
  2579. dp_mon_debug("monitor soc is NULL");
  2580. return QDF_STATUS_E_FAILURE;
  2581. }
  2582. monitor_ops = mon_soc->mon_ops;
  2583. if (!monitor_ops || !monitor_ops->mon_mcopy_check_deliver) {
  2584. dp_mon_debug("callback not registered");
  2585. return QDF_STATUS_E_FAILURE;
  2586. }
  2587. return monitor_ops->mon_mcopy_check_deliver(pdev, peer_id,
  2588. ppdu_id, first_msdu);
  2589. }
  2590. #else
  2591. static inline
  2592. QDF_STATUS dp_monitor_mcopy_check_deliver(struct dp_pdev *pdev,
  2593. uint16_t peer_id, uint32_t ppdu_id,
  2594. uint8_t first_msdu)
  2595. {
  2596. return QDF_STATUS_SUCCESS;
  2597. }
  2598. #endif
  2599. /*
  2600. * dp_monitor_neighbour_peer_add_ast() - Add ast entry
  2601. * @pdev: point to dp pdev
  2602. * @ta_peer: point to peer
  2603. * @mac_addr: mac address
  2604. * @nbuf: point to nbuf
  2605. * @flags: flags
  2606. *
  2607. * Return: void
  2608. */
  2609. static inline void
  2610. dp_monitor_neighbour_peer_add_ast(struct dp_pdev *pdev,
  2611. struct dp_peer *ta_peer,
  2612. uint8_t *mac_addr,
  2613. qdf_nbuf_t nbuf,
  2614. uint32_t flags)
  2615. {
  2616. struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
  2617. struct dp_mon_ops *monitor_ops;
  2618. if (!mon_soc) {
  2619. dp_mon_debug("monitor soc is NULL");
  2620. return;
  2621. }
  2622. monitor_ops = mon_soc->mon_ops;
  2623. if (!monitor_ops || !monitor_ops->mon_neighbour_peer_add_ast) {
  2624. dp_mon_debug("callback not registered");
  2625. return;
  2626. }
  2627. return monitor_ops->mon_neighbour_peer_add_ast(pdev, ta_peer, mac_addr,
  2628. nbuf, flags);
  2629. }
  2630. /*
  2631. * dp_monitor_vdev_delete() - delete monitor vdev
  2632. * @soc: point to dp soc
  2633. * @vdev: point to dp vdev
  2634. *
  2635. * Return: void
  2636. */
  2637. static inline void dp_monitor_vdev_delete(struct dp_soc *soc,
  2638. struct dp_vdev *vdev)
  2639. {
  2640. if (soc->intr_mode == DP_INTR_POLL) {
  2641. qdf_timer_sync_cancel(&soc->int_timer);
  2642. dp_monitor_flush_rings(soc);
  2643. } else if (soc->intr_mode == DP_INTR_MSI) {
  2644. if (dp_monitor_vdev_timer_stop(soc))
  2645. dp_monitor_flush_rings(soc);
  2646. }
  2647. dp_monitor_vdev_detach(vdev);
  2648. }
  2649. #ifdef DP_POWER_SAVE
  2650. /*
  2651. * dp_monitor_pktlog_reap_pending_frames() - reap pending frames
  2652. * @pdev: point to dp pdev
  2653. *
  2654. * Return: void
  2655. */
  2656. static inline void dp_monitor_pktlog_reap_pending_frames(struct dp_pdev *pdev)
  2657. {
  2658. struct dp_soc *soc;
  2659. if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
  2660. return;
  2661. soc = pdev->soc;
  2662. if (((pdev->monitor_pdev->rx_pktlog_mode != DP_RX_PKTLOG_DISABLED) ||
  2663. dp_mon_is_enable_reap_timer_non_pkt(pdev))) {
  2664. if (dp_monitor_reap_timer_stop(soc))
  2665. dp_monitor_service_mon_rings(soc, DP_MON_REAP_BUDGET);
  2666. }
  2667. }
  2668. /*
  2669. * dp_monitor_pktlog_start_reap_timer() - start reap timer
  2670. * @pdev: point to dp pdev
  2671. *
  2672. * Return: void
  2673. */
  2674. static inline void dp_monitor_pktlog_start_reap_timer(struct dp_pdev *pdev)
  2675. {
  2676. struct dp_soc *soc;
  2677. if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
  2678. return;
  2679. soc = pdev->soc;
  2680. if (((pdev->monitor_pdev->rx_pktlog_mode != DP_RX_PKTLOG_DISABLED) ||
  2681. dp_mon_is_enable_reap_timer_non_pkt(pdev)))
  2682. dp_monitor_reap_timer_start(soc);
  2683. }
  2684. #endif
  2685. /*
  2686. * dp_monitor_neighbour_peer_list_remove() - remove neighbour peer list
  2687. * @pdev: point to dp pdev
  2688. * @vdev: point to dp vdev
  2689. * @peer: point to dp_neighbour_peer
  2690. *
  2691. * Return: void
  2692. */
  2693. static inline
  2694. void dp_monitor_neighbour_peer_list_remove(struct dp_pdev *pdev,
  2695. struct dp_vdev *vdev,
  2696. struct dp_neighbour_peer *peer)
  2697. {
  2698. struct dp_mon_pdev *mon_pdev;
  2699. struct dp_neighbour_peer *temp_peer = NULL;
  2700. if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
  2701. return;
  2702. mon_pdev = pdev->monitor_pdev;
  2703. qdf_spin_lock_bh(&mon_pdev->neighbour_peer_mutex);
  2704. if (!pdev->soc->monitor_soc->hw_nac_monitor_support) {
  2705. TAILQ_FOREACH(peer, &mon_pdev->neighbour_peers_list,
  2706. neighbour_peer_list_elem) {
  2707. QDF_ASSERT(peer->vdev != vdev);
  2708. }
  2709. } else {
  2710. TAILQ_FOREACH_SAFE(peer, &mon_pdev->neighbour_peers_list,
  2711. neighbour_peer_list_elem, temp_peer) {
  2712. if (peer->vdev == vdev) {
  2713. TAILQ_REMOVE(&mon_pdev->neighbour_peers_list,
  2714. peer,
  2715. neighbour_peer_list_elem);
  2716. qdf_mem_free(peer);
  2717. }
  2718. }
  2719. }
  2720. qdf_spin_unlock_bh(&mon_pdev->neighbour_peer_mutex);
  2721. }
  2722. static inline
  2723. void dp_monitor_pdev_set_mon_vdev(struct dp_vdev *vdev)
  2724. {
  2725. if (!vdev->pdev->monitor_pdev)
  2726. return;
  2727. vdev->pdev->monitor_pdev->mvdev = vdev;
  2728. }
  2729. static inline
  2730. void dp_monitor_pdev_config_scan_spcl_vap(struct dp_pdev *pdev, bool val)
  2731. {
  2732. if (!pdev || !pdev->monitor_pdev)
  2733. return;
  2734. pdev->monitor_pdev->scan_spcl_vap_configured = val;
  2735. }
  2736. #ifdef QCA_SUPPORT_SCAN_SPCL_VAP_STATS
  2737. static inline
  2738. void dp_monitor_pdev_reset_scan_spcl_vap_stats_enable(struct dp_pdev *pdev,
  2739. bool val)
  2740. {
  2741. if (!pdev || !pdev->monitor_pdev)
  2742. return;
  2743. pdev->monitor_pdev->reset_scan_spcl_vap_stats_enable = val;
  2744. }
  2745. #else
  2746. static inline
  2747. void dp_monitor_pdev_reset_scan_spcl_vap_stats_enable(struct dp_pdev *pdev,
  2748. bool val)
  2749. {
  2750. }
  2751. #endif
  2752. static inline void
  2753. dp_mon_rx_wmask_subscribe(struct dp_soc *soc, uint32_t *msg_word,
  2754. struct htt_rx_ring_tlv_filter *tlv_filter)
  2755. {
  2756. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  2757. struct dp_mon_ops *monitor_ops;
  2758. if (!mon_soc) {
  2759. dp_mon_debug("mon soc is NULL");
  2760. return;
  2761. }
  2762. monitor_ops = mon_soc->mon_ops;
  2763. if (!monitor_ops || !monitor_ops->rx_wmask_subscribe) {
  2764. dp_mon_debug("callback not registered");
  2765. return;
  2766. }
  2767. monitor_ops->rx_wmask_subscribe(msg_word, tlv_filter);
  2768. }
  2769. static inline void
  2770. dp_mon_rx_enable_mpdu_logging(struct dp_soc *soc, uint32_t *msg_word,
  2771. struct htt_rx_ring_tlv_filter *tlv_filter)
  2772. {
  2773. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  2774. struct dp_mon_ops *monitor_ops;
  2775. if (!mon_soc) {
  2776. dp_mon_debug("mon soc is NULL");
  2777. return;
  2778. }
  2779. monitor_ops = mon_soc->mon_ops;
  2780. if (!monitor_ops || !monitor_ops->rx_enable_mpdu_logging) {
  2781. dp_mon_debug("callback not registered");
  2782. return;
  2783. }
  2784. monitor_ops->rx_enable_mpdu_logging(msg_word, tlv_filter);
  2785. }
  2786. static inline void
  2787. dp_mon_rx_packet_length_set(struct dp_soc *soc, uint32_t *msg_word,
  2788. struct htt_rx_ring_tlv_filter *tlv_filter)
  2789. {
  2790. struct dp_mon_soc *mon_soc = soc->monitor_soc;
  2791. struct dp_mon_ops *monitor_ops;
  2792. if (!mon_soc) {
  2793. dp_mon_debug("mon soc is NULL");
  2794. return;
  2795. }
  2796. monitor_ops = mon_soc->mon_ops;
  2797. if (!monitor_ops || !monitor_ops->rx_packet_length_set) {
  2798. dp_mon_debug("callback not registered");
  2799. return;
  2800. }
  2801. monitor_ops->rx_packet_length_set(msg_word, tlv_filter);
  2802. }
  2803. #ifdef QCA_ENHANCED_STATS_SUPPORT
  2804. QDF_STATUS dp_peer_qos_stats_notify(struct dp_pdev *dp_pdev,
  2805. struct cdp_rx_stats_ppdu_user *ppdu_user);
  2806. #endif
  2807. /*
  2808. * dp_print_pdev_rx_mon_stats() - print rx mon stats
  2809. * @pdev: device object
  2810. *
  2811. * Return: void
  2812. */
  2813. void
  2814. dp_print_pdev_rx_mon_stats(struct dp_pdev *pdev);
  2815. /**
  2816. * dp_mcopy_check_deliver() - mcopy check deliver
  2817. * @pdev: DP pdev handle
  2818. * @peer_id: peer id
  2819. * @ppdu_id: ppdu
  2820. * @first_msdu: flag to indicate first msdu of ppdu
  2821. * Return: 0 on success, not 0 on failure
  2822. */
  2823. QDF_STATUS dp_mcopy_check_deliver(struct dp_pdev *pdev,
  2824. uint16_t peer_id,
  2825. uint32_t ppdu_id,
  2826. uint8_t first_msdu);
  2827. /**
  2828. * dp_pdev_set_advance_monitor_filter() - Set DP PDEV monitor filter
  2829. * @soc: soc handle
  2830. * @pdev_id: id of Datapath PDEV handle
  2831. * @filter_val: Flag to select Filter for monitor mode
  2832. * Return: 0 on success, not 0 on failure
  2833. */
  2834. #ifdef QCA_ADVANCE_MON_FILTER_SUPPORT
  2835. QDF_STATUS
  2836. dp_pdev_set_advance_monitor_filter(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  2837. struct cdp_monitor_filter *filter_val);
  2838. #else
  2839. static inline QDF_STATUS
  2840. dp_pdev_set_advance_monitor_filter(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  2841. struct cdp_monitor_filter *filter_val)
  2842. {
  2843. return QDF_STATUS_E_INVAL;
  2844. }
  2845. #endif /* QCA_ADVANCE_MON_FILTER_SUPPORT */
  2846. /**
  2847. * dp_deliver_tx_mgmt() - Deliver mgmt frame for tx capture
  2848. * @cdp_soc : data path soc handle
  2849. * @pdev_id : pdev_id
  2850. * @nbuf: Management frame buffer
  2851. */
  2852. QDF_STATUS
  2853. dp_deliver_tx_mgmt(struct cdp_soc_t *cdp_soc, uint8_t pdev_id, qdf_nbuf_t nbuf);
  2854. /**
  2855. * dp_filter_neighbour_peer() - API to filter neighbour peer
  2856. * @pdev : DP pdev handle
  2857. * @rx_pkt_hdr : packet header
  2858. *
  2859. * return: QDF_STATUS_SUCCESS on success
  2860. * QDF_STATUS_E_FAILURE on failure
  2861. */
  2862. #ifdef FEATURE_NAC_RSSI
  2863. QDF_STATUS dp_filter_neighbour_peer(struct dp_pdev *pdev,
  2864. uint8_t *rx_pkt_hdr);
  2865. #else
  2866. static inline
  2867. QDF_STATUS dp_filter_neighbour_peer(struct dp_pdev *pdev,
  2868. uint8_t *rx_pkt_hdr)
  2869. {
  2870. return QDF_STATUS_SUCCESS;
  2871. }
  2872. #endif /* FEATURE_NAC_RSSI */
  2873. /*
  2874. * dp_neighbour_peers_detach() - Detach neighbour peers(nac clients)
  2875. * @pdev: device object
  2876. *
  2877. * Return: void
  2878. */
  2879. void dp_neighbour_peers_detach(struct dp_pdev *pdev);
  2880. /**
  2881. * dp_reset_monitor_mode() - Disable monitor mode
  2882. * @soc_hdl: Datapath soc handle
  2883. * @pdev_id: id of datapath PDEV handle
  2884. * @smart_monitor: smart monitor flag
  2885. *
  2886. * Return: QDF_STATUS
  2887. */
  2888. QDF_STATUS dp_reset_monitor_mode(struct cdp_soc_t *soc_hdl,
  2889. uint8_t pdev_id,
  2890. uint8_t smart_monitor);
  2891. static inline
  2892. struct dp_mon_ops *dp_mon_ops_get(struct dp_soc *soc)
  2893. {
  2894. if (soc && soc->monitor_soc)
  2895. return soc->monitor_soc->mon_ops;
  2896. return NULL;
  2897. }
  2898. static inline
  2899. struct cdp_mon_ops *dp_mon_cdp_ops_get(struct dp_soc *soc)
  2900. {
  2901. struct cdp_ops *ops = soc->cdp_soc.ops;
  2902. return ops->mon_ops;
  2903. }
  2904. /**
  2905. * dp_ppdu_desc_user_stats_update(): Function to update TX user stats
  2906. * @pdev: DP pdev handle
  2907. * @ppdu_info: per PPDU TLV descriptor
  2908. *
  2909. * return: void
  2910. */
  2911. #ifdef QCA_ENHANCED_STATS_SUPPORT
  2912. void
  2913. dp_ppdu_desc_user_stats_update(struct dp_pdev *pdev,
  2914. struct ppdu_info *ppdu_info);
  2915. #else
  2916. static inline void
  2917. dp_ppdu_desc_user_stats_update(struct dp_pdev *pdev,
  2918. struct ppdu_info *ppdu_info)
  2919. {
  2920. }
  2921. #endif /* QCA_ENHANCED_STATS_SUPPORT */
  2922. /**
  2923. * dp_mon_ops_register_1_0(): register legacy monitor ops
  2924. * @mon_soc: monitor soc handle
  2925. *
  2926. * return: void
  2927. */
  2928. void dp_mon_ops_register_1_0(struct dp_mon_soc *mon_soc);
  2929. /**
  2930. * dp_mon_cdp_ops_register_1_0(): register legacy monitor cdp ops
  2931. * @ops: cdp ops handle
  2932. *
  2933. * return: void
  2934. */
  2935. void dp_mon_cdp_ops_register_1_0(struct cdp_ops *ops);
  2936. #ifdef QCA_MONITOR_2_0_SUPPORT
  2937. /**
  2938. * dp_mon_ops_register_2_0(): register monitor ops
  2939. * @mon_soc: monitor soc handle
  2940. *
  2941. * return: void
  2942. */
  2943. void dp_mon_ops_register_2_0(struct dp_mon_soc *mon_soc);
  2944. /**
  2945. * dp_mon_cdp_ops_register_2_0(): register monitor cdp ops
  2946. * @ops: cdp ops handle
  2947. *
  2948. * return: void
  2949. */
  2950. void dp_mon_cdp_ops_register_2_0(struct cdp_ops *ops);
  2951. #endif /* QCA_MONITOR_2_0_SUPPORT */
  2952. /**
  2953. * dp_mon_register_feature_ops(): Register mon feature ops
  2954. * @soc: Datapath soc context
  2955. *
  2956. * return: void
  2957. */
  2958. static inline
  2959. void dp_mon_register_feature_ops(struct dp_soc *soc)
  2960. {
  2961. struct dp_mon_ops *mon_ops = NULL;
  2962. mon_ops = dp_mon_ops_get(soc);
  2963. if (!mon_ops) {
  2964. dp_mon_err("Monitor ops is NULL");
  2965. return;
  2966. }
  2967. if (mon_ops->mon_register_feature_ops)
  2968. mon_ops->mon_register_feature_ops(soc);
  2969. }
  2970. /**
  2971. * dp_pdev_get_rx_mon_stats(): Get pdev Rx monitor stats
  2972. * @soc_hdl: soc handle
  2973. * @pdev_id: id of pdev handle
  2974. * @stats: User allocated stats buffer
  2975. *
  2976. * return: status success/failure
  2977. */
  2978. QDF_STATUS dp_pdev_get_rx_mon_stats(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  2979. struct cdp_pdev_mon_stats *stats);
  2980. #endif /* _DP_MON_H_ */