cdp_txrx_host_stats.h 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243
  1. /*
  2. * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for
  6. * any purpose with or without fee is hereby granted, provided that the
  7. * above copyright notice and this permission notice appear in all
  8. * copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  11. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  12. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  13. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  14. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  15. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  16. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  17. * PERFORMANCE OF THIS SOFTWARE.
  18. */
  19. /**
  20. * DOC: cdp_txrx_host_stats.h
  21. * Define the host data path stats API functions
  22. * called by the host control SW and the OS interface module
  23. */
  24. #ifndef _CDP_TXRX_HOST_STATS_H_
  25. #define _CDP_TXRX_HOST_STATS_H_
  26. #include "cdp_txrx_handle.h"
  27. #include <cdp_txrx_cmn.h>
  28. #include <wmi_unified_api.h>
  29. /**
  30. * cdp_host_stats_get() - cdp call to get host stats
  31. * @soc: SOC handle
  32. * @vdev_id: vdev id of vdev
  33. * @req: Requirement type
  34. *
  35. * Return: 0 for Success, Failure returns error message
  36. */
  37. static inline int cdp_host_stats_get(ol_txrx_soc_handle soc,
  38. uint8_t vdev_id,
  39. struct ol_txrx_stats_req *req)
  40. {
  41. if (!soc || !soc->ops) {
  42. dp_cdp_debug("Invalid Instance");
  43. QDF_BUG(0);
  44. return 0;
  45. }
  46. if (!soc->ops->host_stats_ops ||
  47. !soc->ops->host_stats_ops->txrx_host_stats_get)
  48. return 0;
  49. return soc->ops->host_stats_ops->txrx_host_stats_get(soc, vdev_id, req);
  50. }
  51. /**
  52. * cdp_host_stats_get_ratekbps() - cdp call to get rate in kbps
  53. * @soc: SOC handle
  54. * @preamb: Preamble
  55. * @mcs: Modulation and Coding scheme index
  56. * @htflag: Flag to identify HT or VHT
  57. * @gintval: Guard Interval value
  58. *
  59. * Return: 0 for Failure, Returns rate on Success
  60. */
  61. static inline int cdp_host_stats_get_ratekbps(ol_txrx_soc_handle soc,
  62. int preamb, int mcs,
  63. int htflag, int gintval)
  64. {
  65. if (!soc || !soc->ops) {
  66. dp_cdp_debug("Invalid Instance");
  67. QDF_BUG(0);
  68. return 0;
  69. }
  70. if (!soc->ops->host_stats_ops ||
  71. !soc->ops->host_stats_ops->txrx_get_ratekbps)
  72. return 0;
  73. return soc->ops->host_stats_ops->txrx_get_ratekbps(preamb,
  74. mcs, htflag,
  75. gintval);
  76. }
  77. /**
  78. * cdp_host_stats_clr() - cdp call to clear host stats
  79. * @soc: soc handle
  80. * @vdev_id: vdev handle id
  81. *
  82. * Return: QDF_STATUS
  83. */
  84. static inline QDF_STATUS
  85. cdp_host_stats_clr(ol_txrx_soc_handle soc, uint8_t vdev_id)
  86. {
  87. if (!soc || !soc->ops) {
  88. dp_cdp_debug("Invalid Instance");
  89. QDF_BUG(0);
  90. return QDF_STATUS_E_FAILURE;
  91. }
  92. if (!soc->ops->host_stats_ops ||
  93. !soc->ops->host_stats_ops->txrx_host_stats_clr)
  94. return QDF_STATUS_E_FAILURE;
  95. return soc->ops->host_stats_ops->txrx_host_stats_clr(soc, vdev_id);
  96. }
  97. static inline QDF_STATUS
  98. cdp_host_ce_stats(ol_txrx_soc_handle soc, uint8_t vdev_id)
  99. {
  100. if (!soc || !soc->ops) {
  101. dp_cdp_debug("Invalid Instance");
  102. QDF_BUG(0);
  103. return QDF_STATUS_E_FAILURE;
  104. }
  105. if (!soc->ops->host_stats_ops ||
  106. !soc->ops->host_stats_ops->txrx_host_ce_stats)
  107. return QDF_STATUS_E_FAILURE;
  108. return soc->ops->host_stats_ops->txrx_host_ce_stats(soc, vdev_id);
  109. }
  110. static inline int cdp_stats_publish
  111. (ol_txrx_soc_handle soc, uint8_t pdev_id,
  112. struct cdp_stats_extd *buf)
  113. {
  114. if (!soc || !soc->ops) {
  115. dp_cdp_debug("Invalid Instance");
  116. QDF_BUG(0);
  117. return 0;
  118. }
  119. if (!soc->ops->host_stats_ops ||
  120. !soc->ops->host_stats_ops->txrx_stats_publish)
  121. return 0;
  122. return soc->ops->host_stats_ops->txrx_stats_publish(soc, pdev_id, buf);
  123. }
  124. /**
  125. * cdp_enable_enhanced_stats() - Enable enhanced stats functionality.
  126. * @soc: the soc object
  127. * @pdev_id: id of the physical device object
  128. *
  129. * Return: QDF_STATUS
  130. */
  131. static inline QDF_STATUS
  132. cdp_enable_enhanced_stats(ol_txrx_soc_handle soc, uint8_t pdev_id)
  133. {
  134. if (!soc || !soc->ops) {
  135. dp_cdp_debug("Invalid Instance");
  136. QDF_BUG(0);
  137. return QDF_STATUS_E_FAILURE;
  138. }
  139. if (!soc->ops->mon_ops ||
  140. !soc->ops->mon_ops->txrx_enable_enhanced_stats)
  141. return QDF_STATUS_E_FAILURE;
  142. return soc->ops->mon_ops->txrx_enable_enhanced_stats
  143. (soc, pdev_id);
  144. }
  145. /**
  146. * cdp_disable_enhanced_stats() - Disable enhanced stats functionality.
  147. * @soc: the soc object
  148. * @pdev_id: id of the physical device object
  149. *
  150. * Return: QDF_STATUS
  151. */
  152. static inline QDF_STATUS
  153. cdp_disable_enhanced_stats(ol_txrx_soc_handle soc, uint8_t pdev_id)
  154. {
  155. if (!soc || !soc->ops) {
  156. dp_cdp_debug("Invalid Instance");
  157. QDF_BUG(0);
  158. return QDF_STATUS_E_FAILURE;
  159. }
  160. if (!soc->ops->mon_ops ||
  161. !soc->ops->mon_ops->txrx_disable_enhanced_stats)
  162. return QDF_STATUS_E_FAILURE;
  163. return soc->ops->mon_ops->txrx_disable_enhanced_stats
  164. (soc, pdev_id);
  165. }
  166. static inline QDF_STATUS
  167. cdp_tx_print_tso_stats(ol_txrx_soc_handle soc, uint8_t vdev_id)
  168. {
  169. if (!soc || !soc->ops) {
  170. dp_cdp_debug("Invalid Instance");
  171. QDF_BUG(0);
  172. return QDF_STATUS_E_FAILURE;
  173. }
  174. if (!soc->ops->host_stats_ops ||
  175. !soc->ops->host_stats_ops->tx_print_tso_stats)
  176. return QDF_STATUS_E_FAILURE;
  177. return soc->ops->host_stats_ops->tx_print_tso_stats(soc, vdev_id);
  178. }
  179. static inline QDF_STATUS
  180. cdp_tx_rst_tso_stats(ol_txrx_soc_handle soc, uint8_t vdev_id)
  181. {
  182. if (!soc || !soc->ops) {
  183. dp_cdp_debug("Invalid Instance");
  184. QDF_BUG(0);
  185. return QDF_STATUS_E_FAILURE;
  186. }
  187. if (!soc->ops->host_stats_ops ||
  188. !soc->ops->host_stats_ops->tx_rst_tso_stats)
  189. return QDF_STATUS_E_FAILURE;
  190. return soc->ops->host_stats_ops->tx_rst_tso_stats(soc, vdev_id);
  191. }
  192. static inline QDF_STATUS
  193. cdp_tx_print_sg_stats(ol_txrx_soc_handle soc, uint8_t vdev_id)
  194. {
  195. if (!soc || !soc->ops) {
  196. dp_cdp_debug("Invalid Instance");
  197. QDF_BUG(0);
  198. return QDF_STATUS_E_FAILURE;
  199. }
  200. if (!soc->ops->host_stats_ops ||
  201. !soc->ops->host_stats_ops->tx_print_sg_stats)
  202. return QDF_STATUS_E_FAILURE;
  203. return soc->ops->host_stats_ops->tx_print_sg_stats(soc, vdev_id);
  204. }
  205. static inline QDF_STATUS
  206. cdp_tx_rst_sg_stats(ol_txrx_soc_handle soc, uint8_t vdev_id)
  207. {
  208. if (!soc || !soc->ops) {
  209. dp_cdp_debug("Invalid Instance");
  210. QDF_BUG(0);
  211. return QDF_STATUS_E_FAILURE;
  212. }
  213. if (!soc->ops->host_stats_ops ||
  214. !soc->ops->host_stats_ops->tx_rst_sg_stats)
  215. return QDF_STATUS_E_FAILURE;
  216. return soc->ops->host_stats_ops->tx_rst_sg_stats(soc, vdev_id);
  217. }
  218. static inline QDF_STATUS
  219. cdp_print_rx_cksum_stats(ol_txrx_soc_handle soc, uint8_t vdev_id)
  220. {
  221. if (!soc || !soc->ops) {
  222. dp_cdp_debug("Invalid Instance");
  223. QDF_BUG(0);
  224. return QDF_STATUS_E_FAILURE;
  225. }
  226. if (!soc->ops->host_stats_ops ||
  227. !soc->ops->host_stats_ops->print_rx_cksum_stats)
  228. return QDF_STATUS_E_FAILURE;
  229. return soc->ops->host_stats_ops->print_rx_cksum_stats(soc, vdev_id);
  230. }
  231. static inline QDF_STATUS
  232. cdp_rst_rx_cksum_stats(ol_txrx_soc_handle soc, uint8_t vdev_id)
  233. {
  234. if (!soc || !soc->ops) {
  235. dp_cdp_debug("Invalid Instance");
  236. QDF_BUG(0);
  237. return QDF_STATUS_E_FAILURE;
  238. }
  239. if (!soc->ops->host_stats_ops ||
  240. !soc->ops->host_stats_ops->rst_rx_cksum_stats)
  241. return QDF_STATUS_E_FAILURE;
  242. return soc->ops->host_stats_ops->rst_rx_cksum_stats(soc, vdev_id);
  243. }
  244. static inline QDF_STATUS
  245. cdp_host_me_stats(ol_txrx_soc_handle soc, uint8_t vdev_id)
  246. {
  247. if (!soc || !soc->ops) {
  248. dp_cdp_debug("Invalid Instance");
  249. QDF_BUG(0);
  250. return QDF_STATUS_E_FAILURE;
  251. }
  252. if (!soc->ops->host_stats_ops ||
  253. !soc->ops->host_stats_ops->txrx_host_me_stats)
  254. return QDF_STATUS_E_FAILURE;
  255. return soc->ops->host_stats_ops->txrx_host_me_stats(soc, vdev_id);
  256. }
  257. /**
  258. * cdp_per_peer_stats() - function to print per peer REO Queue stats
  259. * @soc: soc handle
  260. * @addr: peer address
  261. *
  262. * Return: status
  263. */
  264. static inline QDF_STATUS cdp_per_peer_stats(ol_txrx_soc_handle soc,
  265. uint8_t *addr)
  266. {
  267. if (!soc || !soc->ops) {
  268. dp_cdp_debug("Invalid Instance");
  269. QDF_BUG(0);
  270. return QDF_STATUS_E_FAILURE;
  271. }
  272. if (!soc->ops->host_stats_ops ||
  273. !soc->ops->host_stats_ops->txrx_per_peer_stats)
  274. return QDF_STATUS_E_FAILURE;
  275. return soc->ops->host_stats_ops->txrx_per_peer_stats(soc, addr);
  276. }
  277. static inline int cdp_host_msdu_ttl_stats(ol_txrx_soc_handle soc,
  278. uint8_t vdev_id,
  279. struct ol_txrx_stats_req *req)
  280. {
  281. if (!soc || !soc->ops) {
  282. dp_cdp_debug("Invalid Instance");
  283. QDF_BUG(0);
  284. return 0;
  285. }
  286. if (!soc->ops->host_stats_ops ||
  287. !soc->ops->host_stats_ops->txrx_host_msdu_ttl_stats)
  288. return 0;
  289. return soc->ops->host_stats_ops->txrx_host_msdu_ttl_stats
  290. (soc, vdev_id, req);
  291. }
  292. static inline QDF_STATUS cdp_update_peer_stats(ol_txrx_soc_handle soc,
  293. uint8_t vdev_id, uint8_t *mac,
  294. void *stats,
  295. uint32_t last_tx_rate_mcs,
  296. uint32_t stats_id)
  297. {
  298. if (!soc || !soc->ops) {
  299. dp_cdp_debug("Invalid Instance");
  300. QDF_BUG(0);
  301. return QDF_STATUS_E_FAILURE;
  302. }
  303. if (!soc->ops->host_stats_ops ||
  304. !soc->ops->host_stats_ops->txrx_update_peer_stats)
  305. return QDF_STATUS_E_FAILURE;
  306. return soc->ops->host_stats_ops->txrx_update_peer_stats
  307. (soc, vdev_id, mac, stats, last_tx_rate_mcs, stats_id);
  308. }
  309. static inline QDF_STATUS cdp_get_dp_fw_peer_stats(ol_txrx_soc_handle soc,
  310. uint8_t pdev_id,
  311. uint8_t *mac, uint32_t caps,
  312. uint32_t copy_stats)
  313. {
  314. if (!soc || !soc->ops) {
  315. dp_cdp_debug("Invalid Instance");
  316. QDF_BUG(0);
  317. return QDF_STATUS_E_FAILURE;
  318. }
  319. if (!soc->ops->host_stats_ops ||
  320. !soc->ops->host_stats_ops->get_fw_peer_stats)
  321. return QDF_STATUS_E_FAILURE;
  322. return soc->ops->host_stats_ops->get_fw_peer_stats
  323. (soc, pdev_id, mac, caps, copy_stats);
  324. }
  325. static inline QDF_STATUS cdp_get_dp_htt_stats(ol_txrx_soc_handle soc,
  326. uint8_t pdev_id,
  327. void *data, uint32_t data_len)
  328. {
  329. if (!soc || !soc->ops) {
  330. dp_cdp_debug("Invalid Instance");
  331. QDF_BUG(0);
  332. return QDF_STATUS_E_FAILURE;
  333. }
  334. if (!soc->ops->host_stats_ops ||
  335. !soc->ops->host_stats_ops->get_htt_stats)
  336. return QDF_STATUS_E_FAILURE;
  337. return soc->ops->host_stats_ops->get_htt_stats(soc, pdev_id, data,
  338. data_len);
  339. }
  340. /**
  341. * cdp_update_pdev_host_stats() - Update pdev host stats received from firmware
  342. * (wmi_host_pdev_stats and wmi_host_pdev_ext_stats) into dp
  343. * @soc: soc handle
  344. * @pdev_id: id of the physical device object
  345. * @data: pdev stats
  346. * @stats_id: statistics to be updated
  347. *
  348. * Return: QDF_STATUS
  349. */
  350. static inline QDF_STATUS
  351. cdp_update_pdev_host_stats(ol_txrx_soc_handle soc,
  352. uint8_t pdev_id,
  353. void *data,
  354. uint16_t stats_id)
  355. {
  356. if (!soc || !soc->ops) {
  357. dp_cdp_debug("Invalid Instance");
  358. QDF_BUG(0);
  359. return QDF_STATUS_E_FAILURE;
  360. }
  361. if (!soc->ops->host_stats_ops ||
  362. !soc->ops->host_stats_ops->txrx_update_pdev_stats)
  363. return QDF_STATUS_E_FAILURE;
  364. return soc->ops->host_stats_ops->txrx_update_pdev_stats(soc, pdev_id,
  365. data,
  366. stats_id);
  367. }
  368. /**
  369. * cdp_update_vdev_host_stats() - Update vdev host stats
  370. * @soc: soc handle
  371. * @vdev_id: id of the virtual device object
  372. * @data: pdev stats
  373. * @stats_id: type of stats
  374. *
  375. * Return: QDF_STATUS
  376. */
  377. static inline QDF_STATUS
  378. cdp_update_vdev_host_stats(ol_txrx_soc_handle soc,
  379. uint8_t vdev_id,
  380. void *data,
  381. uint16_t stats_id)
  382. {
  383. if (!soc || !soc->ops) {
  384. dp_cdp_debug("Invalid Instance");
  385. QDF_BUG(0);
  386. return QDF_STATUS_E_FAILURE;
  387. }
  388. if (!soc->ops->host_stats_ops ||
  389. !soc->ops->host_stats_ops->txrx_update_vdev_stats)
  390. return QDF_STATUS_E_FAILURE;
  391. return soc->ops->host_stats_ops->txrx_update_vdev_stats(soc, vdev_id,
  392. data,
  393. stats_id);
  394. }
  395. /**
  396. * cdp_txrx_get_peer_stats_param() - Call to get specified peer stats
  397. * @soc: soc handle
  398. * @vdev_id: vdev_id of vdev object
  399. * @peer_mac: mac address of the peer
  400. * @type: enum of required stats
  401. * @buf: buffer to hold the value
  402. *
  403. * Return: QDF_STATUS
  404. */
  405. static inline QDF_STATUS
  406. cdp_txrx_get_peer_stats_param(ol_txrx_soc_handle soc, uint8_t vdev_id,
  407. uint8_t *peer_mac,
  408. enum cdp_peer_stats_type type,
  409. cdp_peer_stats_param_t *buf)
  410. {
  411. if (!soc || !soc->ops) {
  412. dp_cdp_debug("Invalid Instance");
  413. QDF_BUG(0);
  414. return QDF_STATUS_E_FAILURE;
  415. }
  416. if (!soc->ops->host_stats_ops ||
  417. !soc->ops->host_stats_ops->txrx_get_peer_stats_param)
  418. return QDF_STATUS_E_FAILURE;
  419. return soc->ops->host_stats_ops->txrx_get_peer_stats_param(soc,
  420. vdev_id,
  421. peer_mac,
  422. type,
  423. buf);
  424. }
  425. /**
  426. * cdp_host_get_soc_stats() - Call to get soc stats
  427. * @soc: soc handle
  428. * @soc_stats: buffer for cdp soc stats
  429. *
  430. * Return: QDF_STATUS
  431. */
  432. static inline QDF_STATUS
  433. cdp_host_get_soc_stats(ol_txrx_soc_handle soc, struct cdp_soc_stats *soc_stats)
  434. {
  435. if (!soc || !soc->ops) {
  436. dp_cdp_debug("Invalid Instance");
  437. QDF_BUG(0);
  438. return QDF_STATUS_E_FAILURE;
  439. }
  440. if (!soc->ops->host_stats_ops ||
  441. !soc->ops->host_stats_ops->txrx_get_soc_stats)
  442. return QDF_STATUS_E_FAILURE;
  443. return soc->ops->host_stats_ops->txrx_get_soc_stats(soc, soc_stats);
  444. }
  445. /**
  446. * cdp_host_get_peer_stats() - Call to get peer stats
  447. * @soc: soc handle
  448. * @vdev_id: vdev_id of vdev object
  449. * @peer_mac: mac address of the peer
  450. * @peer_stats: destination buffer
  451. *
  452. * Return: QDF_STATUS
  453. */
  454. static inline QDF_STATUS
  455. cdp_host_get_peer_stats(ol_txrx_soc_handle soc, uint8_t vdev_id,
  456. uint8_t *peer_mac,
  457. struct cdp_peer_stats *peer_stats)
  458. {
  459. if (!soc || !soc->ops) {
  460. dp_cdp_debug("Invalid Instance");
  461. QDF_BUG(0);
  462. return QDF_STATUS_E_FAILURE;
  463. }
  464. if (!soc->ops->host_stats_ops ||
  465. !soc->ops->host_stats_ops->txrx_get_peer_stats)
  466. return QDF_STATUS_E_FAILURE;
  467. return soc->ops->host_stats_ops->txrx_get_peer_stats(soc, vdev_id,
  468. peer_mac,
  469. peer_stats);
  470. }
  471. /**
  472. * cdp_host_get_per_link_peer_stats() - Call to get peer stats
  473. * @soc: soc handle
  474. * @vdev_id: vdev_id of vdev object
  475. * @peer_mac: mac address of the peer
  476. * @peer_stats: destination buffer
  477. * @peer_type: Peer type
  478. * @num_link: Number of ML links
  479. *
  480. * NOTE: For peer_type = CDP_MLD_PEER_TYPE peer_stats should point to
  481. * buffer of size = (sizeof(*peer_stats) * num_link)
  482. *
  483. * Return: QDF_STATUS
  484. */
  485. static inline QDF_STATUS
  486. cdp_host_get_per_link_peer_stats(ol_txrx_soc_handle soc, uint8_t vdev_id,
  487. uint8_t *peer_mac,
  488. struct cdp_peer_stats *peer_stats,
  489. enum cdp_peer_type peer_type,
  490. uint8_t num_link)
  491. {
  492. if (!soc || !soc->ops) {
  493. dp_cdp_debug("Invalid Instance");
  494. QDF_BUG(0);
  495. return QDF_STATUS_E_FAILURE;
  496. }
  497. if (!soc->ops->host_stats_ops ||
  498. !soc->ops->host_stats_ops->txrx_get_per_link_stats)
  499. return QDF_STATUS_E_FAILURE;
  500. return soc->ops->host_stats_ops->txrx_get_per_link_stats(soc, vdev_id,
  501. peer_mac,
  502. peer_stats,
  503. peer_type,
  504. num_link);
  505. }
  506. /**
  507. * cdp_host_reset_peer_ald_stats() - Call to reset ald stats
  508. * @soc: soc handle
  509. * @vdev_id: vdev_id of vdev object
  510. * @peer_mac: mac address of the peer
  511. *
  512. * Return: QDF_STATUS
  513. */
  514. static inline QDF_STATUS
  515. cdp_host_reset_peer_ald_stats(ol_txrx_soc_handle soc, uint8_t vdev_id,
  516. uint8_t *peer_mac)
  517. {
  518. if (!soc || !soc->ops) {
  519. dp_cdp_debug("Invalid Instance");
  520. QDF_BUG(0);
  521. return QDF_STATUS_E_FAILURE;
  522. }
  523. if (!soc->ops->host_stats_ops ||
  524. !soc->ops->host_stats_ops->txrx_reset_peer_ald_stats)
  525. return QDF_STATUS_E_FAILURE;
  526. return soc->ops->host_stats_ops->txrx_reset_peer_ald_stats(soc,
  527. vdev_id,
  528. peer_mac);
  529. }
  530. /**
  531. * cdp_host_reset_peer_stats() - Call to reset peer stats
  532. * @soc: soc handle
  533. * @vdev_id: vdev_id of vdev object
  534. * @peer_mac: mac address of the peer
  535. *
  536. * Return: QDF_STATUS
  537. */
  538. static inline QDF_STATUS
  539. cdp_host_reset_peer_stats(ol_txrx_soc_handle soc,
  540. uint8_t vdev_id, uint8_t *peer_mac)
  541. {
  542. if (!soc || !soc->ops) {
  543. dp_cdp_debug("Invalid Instance");
  544. QDF_BUG(0);
  545. return QDF_STATUS_E_FAILURE;
  546. }
  547. if (!soc->ops->host_stats_ops ||
  548. !soc->ops->host_stats_ops->txrx_reset_peer_stats)
  549. return QDF_STATUS_E_FAILURE;
  550. return soc->ops->host_stats_ops->txrx_reset_peer_stats(soc,
  551. vdev_id,
  552. peer_mac);
  553. }
  554. /**
  555. * cdp_host_get_vdev_stats() - Call to get vdev stats
  556. * @soc: dp soc object
  557. * @vdev_id: id of dp vdev object
  558. * @buf: buffer
  559. * @is_aggregate:
  560. *
  561. * Return: int
  562. */
  563. static inline int
  564. cdp_host_get_vdev_stats(ol_txrx_soc_handle soc,
  565. uint8_t vdev_id,
  566. struct cdp_vdev_stats *buf,
  567. bool is_aggregate)
  568. {
  569. if (!soc || !soc->ops) {
  570. dp_cdp_debug("Invalid Instance");
  571. QDF_BUG(0);
  572. return 0;
  573. }
  574. if (!soc->ops->host_stats_ops ||
  575. !soc->ops->host_stats_ops->txrx_get_vdev_stats)
  576. return 0;
  577. return soc->ops->host_stats_ops->txrx_get_vdev_stats(soc, vdev_id,
  578. buf,
  579. is_aggregate);
  580. }
  581. /**
  582. * cdp_update_host_vdev_stats() - Call to update vdev stats received from
  583. * firmware (wmi_host_vdev_stats and wmi_host_vdev_extd_stats) into dp
  584. * @soc: soc handle
  585. * @data: stats data to be updated
  586. * @size: size of stats data
  587. * @stats_id: stats id
  588. *
  589. * Return: int
  590. */
  591. static inline int
  592. cdp_update_host_vdev_stats(ol_txrx_soc_handle soc,
  593. void *data,
  594. uint32_t size,
  595. uint32_t stats_id)
  596. {
  597. if (!soc || !soc->ops) {
  598. dp_cdp_debug("Invalid Instance");
  599. QDF_BUG(0);
  600. return 0;
  601. }
  602. if (!soc->ops->host_stats_ops ||
  603. !soc->ops->host_stats_ops->txrx_process_wmi_host_vdev_stats)
  604. return 0;
  605. return soc->ops->host_stats_ops->txrx_process_wmi_host_vdev_stats
  606. (soc,
  607. data,
  608. size,
  609. stats_id);
  610. }
  611. /**
  612. * cdp_get_vdev_extd_stats() - Call to get vdev extd stats
  613. * @soc: soc handle
  614. * @vdev_id: id of dp vdev object
  615. * @buf: buffer
  616. *
  617. * Return: int
  618. */
  619. static inline int
  620. cdp_get_vdev_extd_stats(ol_txrx_soc_handle soc,
  621. uint8_t vdev_id,
  622. wmi_host_vdev_extd_stats *buf)
  623. {
  624. if (!soc || !soc->ops) {
  625. dp_cdp_debug("Invalid Instance");
  626. QDF_BUG(0);
  627. return 0;
  628. }
  629. if (!soc->ops->host_stats_ops ||
  630. !soc->ops->host_stats_ops->txrx_get_vdev_extd_stats)
  631. return 0;
  632. return soc->ops->host_stats_ops->txrx_get_vdev_extd_stats(soc, vdev_id,
  633. buf);
  634. }
  635. /**
  636. * cdp_host_get_pdev_stats() - Call to get cdp_pdev_stats
  637. * @soc: soc handle
  638. * @pdev_id: id of dp pdev object
  639. * @buf: buffer to hold cdp_pdev_stats
  640. *
  641. * Return: success/failure
  642. */
  643. static inline int
  644. cdp_host_get_pdev_stats(ol_txrx_soc_handle soc,
  645. uint8_t pdev_id, struct cdp_pdev_stats *buf)
  646. {
  647. if (!soc || !soc->ops) {
  648. dp_cdp_debug("Invalid Instance");
  649. QDF_BUG(0);
  650. return 0;
  651. }
  652. if (!soc->ops->host_stats_ops ||
  653. !soc->ops->host_stats_ops->txrx_get_pdev_stats)
  654. return 0;
  655. return soc->ops->host_stats_ops->txrx_get_pdev_stats(soc, pdev_id, buf);
  656. }
  657. /**
  658. * cdp_host_get_radio_stats() - Call to get radio stats
  659. * @soc: soc handle
  660. * @pdev_id: id of dp pdev object
  661. * @buf: stats buffer
  662. *
  663. * Return: int
  664. */
  665. static inline int
  666. cdp_host_get_radio_stats(ol_txrx_soc_handle soc,
  667. uint8_t pdev_id,
  668. void *buf)
  669. {
  670. if (!soc || !soc->ops) {
  671. dp_cdp_debug("Invalid Instance");
  672. QDF_BUG(0);
  673. return 0;
  674. }
  675. if (!soc->ops->host_stats_ops ||
  676. !soc->ops->host_stats_ops->txrx_get_radio_stats)
  677. return 0;
  678. return soc->ops->host_stats_ops->txrx_get_radio_stats(soc, pdev_id,
  679. buf);
  680. }
  681. #ifdef QCA_SUPPORT_SCAN_SPCL_VAP_STATS
  682. static inline int
  683. cdp_get_scan_spcl_vap_stats(ol_txrx_soc_handle soc,
  684. uint8_t vdev_id,
  685. struct cdp_scan_spcl_vap_stats *stats)
  686. {
  687. if (!soc || !soc->ops) {
  688. dp_cdp_debug("Invalid Instance");
  689. QDF_BUG(0);
  690. return QDF_STATUS_E_FAILURE;
  691. }
  692. if (!soc->ops->host_stats_ops ||
  693. !soc->ops->host_stats_ops->txrx_get_scan_spcl_vap_stats)
  694. return QDF_STATUS_E_FAILURE;
  695. return soc->ops->host_stats_ops->txrx_get_scan_spcl_vap_stats(soc,
  696. vdev_id,
  697. stats);
  698. }
  699. #endif
  700. /**
  701. * cdp_get_peer_delay_stats() - Call to get per peer delay stats
  702. * @soc: soc handle
  703. * @vdev_id: id of dp_vdev handle
  704. * @peer_mac: peer mac address
  705. * @delay_stats: user allocated buffer for peer delay stats
  706. *
  707. * Return: status Success/Failure
  708. */
  709. static inline QDF_STATUS
  710. cdp_get_peer_delay_stats(ol_txrx_soc_handle soc,
  711. uint8_t vdev_id,
  712. uint8_t *peer_mac,
  713. struct cdp_delay_tid_stats *delay_stats)
  714. {
  715. if (!soc || !soc->ops) {
  716. dp_cdp_debug("Invalid Instance");
  717. QDF_BUG(0);
  718. return QDF_STATUS_E_FAILURE;
  719. }
  720. if (!soc->ops->host_stats_ops ||
  721. !soc->ops->host_stats_ops->txrx_get_peer_delay_stats)
  722. return QDF_STATUS_E_FAILURE;
  723. return soc->ops->host_stats_ops->txrx_get_peer_delay_stats(soc,
  724. vdev_id,
  725. peer_mac,
  726. delay_stats);
  727. }
  728. /**
  729. * cdp_get_peer_jitter_stats() - Call to get per peer jitter stats
  730. * @soc: soc handle
  731. * @pdev_id: id of dp_pdev handle
  732. * @vdev_id: id of dp_vdev handle
  733. * @peer_mac: peer mac address
  734. * @tid_stats: user allocated buffer for tid_stats
  735. *
  736. * Return: status Success/Failure
  737. */
  738. static inline QDF_STATUS
  739. cdp_get_peer_jitter_stats(ol_txrx_soc_handle soc,
  740. uint8_t pdev_id,
  741. uint8_t vdev_id,
  742. uint8_t *peer_mac,
  743. struct cdp_peer_tid_stats *tid_stats)
  744. {
  745. if (!soc || !soc->ops) {
  746. dp_cdp_debug("Invalid Instance");
  747. QDF_BUG(0);
  748. return QDF_STATUS_E_FAILURE;
  749. }
  750. if (!soc->ops->host_stats_ops ||
  751. !soc->ops->host_stats_ops->txrx_get_peer_jitter_stats)
  752. return QDF_STATUS_E_FAILURE;
  753. return soc->ops->host_stats_ops->txrx_get_peer_jitter_stats(soc,
  754. pdev_id,
  755. vdev_id,
  756. peer_mac,
  757. tid_stats);
  758. }
  759. /**
  760. * cdp_mon_pdev_get_rx_stats() - Call to get monitor pdev rx stats
  761. * @soc: soc handle
  762. * @pdev_id: id of dp_pdev handle
  763. * @stats: user allocated buffer for dp pdev mon stats
  764. *
  765. * Return: status Success/Failure
  766. */
  767. static inline QDF_STATUS
  768. cdp_mon_pdev_get_rx_stats(ol_txrx_soc_handle soc, uint8_t pdev_id,
  769. struct cdp_pdev_mon_stats *stats)
  770. {
  771. if (!soc || !soc->ops) {
  772. dp_cdp_debug("Invalid Instance");
  773. QDF_BUG(0);
  774. return QDF_STATUS_E_FAILURE;
  775. }
  776. if (!soc->ops->mon_ops ||
  777. !soc->ops->mon_ops->get_mon_pdev_rx_stats)
  778. return QDF_STATUS_E_FAILURE;
  779. return soc->ops->mon_ops->get_mon_pdev_rx_stats(soc, pdev_id, stats);
  780. }
  781. #ifdef WLAN_TX_PKT_CAPTURE_ENH
  782. /**
  783. * cdp_get_peer_tx_capture_stats() - Call to get peer tx capture stats
  784. * @soc: soc handle
  785. * @vdev_id: id of dp_vdev handle
  786. * @peer_mac: peer mac address
  787. * @stats: pointer to peer tx capture stats
  788. *
  789. * Return: status Success/Failure
  790. */
  791. static inline QDF_STATUS
  792. cdp_get_peer_tx_capture_stats(ol_txrx_soc_handle soc,
  793. uint8_t vdev_id,
  794. uint8_t *peer_mac,
  795. struct cdp_peer_tx_capture_stats *stats)
  796. {
  797. if (!soc || !soc->ops) {
  798. dp_cdp_debug("Invalid Instance");
  799. QDF_BUG(0);
  800. return QDF_STATUS_E_FAILURE;
  801. }
  802. if (!soc->ops->host_stats_ops ||
  803. !soc->ops->host_stats_ops->get_peer_tx_capture_stats)
  804. return QDF_STATUS_E_FAILURE;
  805. return soc->ops->host_stats_ops->get_peer_tx_capture_stats(soc, vdev_id,
  806. peer_mac,
  807. stats);
  808. }
  809. /**
  810. * cdp_get_pdev_tx_capture_stats() - Call to get pdev tx capture stats
  811. * @soc: soc handle
  812. * @pdev_id: id of dp_pdev handle
  813. * @stats: pointer to pdev tx capture stats
  814. *
  815. * Return: status Success/Failure
  816. */
  817. static inline QDF_STATUS
  818. cdp_get_pdev_tx_capture_stats(ol_txrx_soc_handle soc, uint8_t pdev_id,
  819. struct cdp_pdev_tx_capture_stats *stats)
  820. {
  821. if (!soc || !soc->ops) {
  822. dp_cdp_debug("Invalid Instance");
  823. QDF_BUG(0);
  824. return QDF_STATUS_E_FAILURE;
  825. }
  826. if (!soc->ops->host_stats_ops ||
  827. !soc->ops->host_stats_ops->get_pdev_tx_capture_stats)
  828. return QDF_STATUS_E_FAILURE;
  829. return soc->ops->host_stats_ops->get_pdev_tx_capture_stats(soc, pdev_id,
  830. stats);
  831. }
  832. #endif /* WLAN_TX_PKT_CAPTURE_ENH */
  833. #ifdef HW_TX_DELAY_STATS_ENABLE
  834. /**
  835. * cdp_enable_disable_vdev_tx_delay_stats() - Start/Stop tx delay stats capture
  836. * @soc: soc handle
  837. * @vdev_id: vdev id
  838. * @value: value to be set
  839. *
  840. * Return: None
  841. */
  842. static inline void
  843. cdp_enable_disable_vdev_tx_delay_stats(ol_txrx_soc_handle soc, uint8_t vdev_id,
  844. uint8_t value)
  845. {
  846. if (!soc || !soc->ops) {
  847. dp_cdp_debug("Invalid Instance");
  848. return;
  849. }
  850. if (!soc->ops->host_stats_ops ||
  851. !soc->ops->host_stats_ops->enable_disable_vdev_tx_delay_stats)
  852. return;
  853. soc->ops->host_stats_ops->enable_disable_vdev_tx_delay_stats(soc,
  854. vdev_id,
  855. value);
  856. }
  857. /**
  858. * cdp_vdev_is_tx_delay_stats_enabled() - Check if the Tx delay stats
  859. * is enabled or not for the given vdev_id
  860. * @soc: soc handle
  861. * @vdev_id: vdev_id
  862. *
  863. * Return: 1 if enabled, 0 if disabled
  864. */
  865. static inline uint8_t
  866. cdp_vdev_is_tx_delay_stats_enabled(ol_txrx_soc_handle soc, uint8_t vdev_id)
  867. {
  868. if (!soc || !soc->ops || !soc->ops->host_stats_ops) {
  869. dp_cdp_debug("Invalid Instance:");
  870. return 0;
  871. }
  872. if (soc->ops->host_stats_ops->is_tx_delay_stats_enabled)
  873. return soc->ops->host_stats_ops->is_tx_delay_stats_enabled(soc,
  874. vdev_id);
  875. return 0;
  876. }
  877. #endif
  878. /**
  879. * cdp_get_pdev_tid_stats() - Get pdev tid stats
  880. * @soc: soc handle
  881. * @pdev_id: Pdev id
  882. * @tid_stats: Pointer to cdp_tid_stats_intf
  883. *
  884. * Return: status Success/Failure
  885. */
  886. static inline QDF_STATUS
  887. cdp_get_pdev_tid_stats(ol_txrx_soc_handle soc, uint8_t pdev_id,
  888. struct cdp_tid_stats_intf *tid_stats)
  889. {
  890. if (!soc || !soc->ops || !soc->ops->host_stats_ops) {
  891. dp_cdp_debug("Invalid Instance:");
  892. return QDF_STATUS_E_FAILURE;
  893. }
  894. if (!soc->ops->host_stats_ops->txrx_get_pdev_tid_stats)
  895. return QDF_STATUS_E_FAILURE;
  896. return soc->ops->host_stats_ops->txrx_get_pdev_tid_stats(soc, pdev_id,
  897. tid_stats);
  898. }
  899. #ifdef WLAN_CONFIG_TELEMETRY_AGENT
  900. /**
  901. * cdp_get_pdev_telemetry_stats() - function to get pdev telemetry stats
  902. * @soc: soc handle
  903. * @pdev_id: pdev id
  904. * @stats: pointer to pdev telemetry stats
  905. *
  906. * Return: status
  907. */
  908. static inline QDF_STATUS cdp_get_pdev_telemetry_stats(
  909. ol_txrx_soc_handle soc,
  910. uint8_t pdev_id,
  911. struct cdp_pdev_telemetry_stats *stats)
  912. {
  913. if (!soc || !soc->ops) {
  914. dp_cdp_debug("Invalid Instance");
  915. QDF_BUG(0);
  916. return QDF_STATUS_E_FAILURE;
  917. }
  918. if (!soc->ops->host_stats_ops ||
  919. !soc->ops->host_stats_ops->txrx_pdev_telemetry_stats)
  920. return QDF_STATUS_E_FAILURE;
  921. return soc->ops->host_stats_ops->txrx_pdev_telemetry_stats(
  922. soc, pdev_id, stats);
  923. }
  924. /**
  925. * cdp_get_peer_telemetry_stats() - function to get peer telemetry stats
  926. * @soc: soc handle
  927. * @addr: peer address
  928. * @stats: pointer to peer telemetry stats
  929. *
  930. * Return: status
  931. */
  932. static inline QDF_STATUS cdp_get_peer_telemetry_stats(
  933. ol_txrx_soc_handle soc,
  934. uint8_t *addr,
  935. struct cdp_peer_telemetry_stats *stats)
  936. {
  937. if (!soc || !soc->ops) {
  938. dp_cdp_debug("Invalid Instance");
  939. QDF_BUG(0);
  940. return QDF_STATUS_E_FAILURE;
  941. }
  942. if (!soc->ops->host_stats_ops ||
  943. !soc->ops->host_stats_ops->txrx_peer_telemetry_stats)
  944. return QDF_STATUS_E_FAILURE;
  945. return soc->ops->host_stats_ops->txrx_peer_telemetry_stats(
  946. soc, addr, stats);
  947. }
  948. /**
  949. * cdp_get_pdev_deter_stats(): function to get pdev deterministic stats
  950. * @soc: soc handle
  951. * @pdev_id: pdev id
  952. * @stats: pointer to pdev deterministic stats
  953. *
  954. * return: status
  955. */
  956. static inline QDF_STATUS cdp_get_pdev_deter_stats(
  957. ol_txrx_soc_handle soc,
  958. uint8_t pdev_id,
  959. struct cdp_pdev_deter_stats *stats)
  960. {
  961. if (!soc || !soc->ops) {
  962. dp_cdp_debug("Invalid Instance");
  963. QDF_BUG(0);
  964. return QDF_STATUS_E_FAILURE;
  965. }
  966. if (!soc->ops->host_stats_ops ||
  967. !soc->ops->host_stats_ops->txrx_pdev_deter_stats)
  968. return QDF_STATUS_E_FAILURE;
  969. return soc->ops->host_stats_ops->txrx_pdev_deter_stats(
  970. soc, pdev_id, stats);
  971. }
  972. /**
  973. * cdp_get_peer_deter_stats(): function to get peer deterministic stats
  974. * @soc: soc handle
  975. * @vdev_id: id of vdev handle
  976. * @addr: peer address
  977. * @stats: pointer to peer telemetry stats
  978. *
  979. * return: status
  980. */
  981. static inline QDF_STATUS cdp_get_peer_deter_stats(
  982. ol_txrx_soc_handle soc,
  983. uint8_t vdev_id,
  984. uint8_t *addr,
  985. struct cdp_peer_deter_stats *stats)
  986. {
  987. if (!soc || !soc->ops) {
  988. dp_cdp_debug("Invalid Instance");
  989. QDF_BUG(0);
  990. return QDF_STATUS_E_FAILURE;
  991. }
  992. if (!soc->ops->host_stats_ops ||
  993. !soc->ops->host_stats_ops->txrx_peer_deter_stats)
  994. return QDF_STATUS_E_FAILURE;
  995. return soc->ops->host_stats_ops->txrx_peer_deter_stats(
  996. soc, vdev_id, addr, stats);
  997. }
  998. /**
  999. * cdp_update_pdev_chan_util_stats(): function to update pdev channel util stats
  1000. * @soc: soc handle
  1001. * @pdev_id: pdev id
  1002. * @ch_util: pointer to pdev ch util stats
  1003. *
  1004. * return: status
  1005. */
  1006. static inline QDF_STATUS cdp_update_pdev_chan_util_stats(
  1007. ol_txrx_soc_handle soc,
  1008. uint8_t pdev_id,
  1009. struct cdp_pdev_chan_util_stats *ch_util)
  1010. {
  1011. if (!soc || !soc->ops) {
  1012. dp_cdp_debug("Invalid Instance");
  1013. QDF_BUG(0);
  1014. return QDF_STATUS_E_FAILURE;
  1015. }
  1016. if (!soc->ops->host_stats_ops ||
  1017. !soc->ops->host_stats_ops->txrx_update_pdev_chan_util_stats)
  1018. return QDF_STATUS_E_FAILURE;
  1019. return soc->ops->host_stats_ops->txrx_update_pdev_chan_util_stats(
  1020. soc, pdev_id, ch_util);
  1021. }
  1022. #endif
  1023. /**
  1024. * cdp_get_peer_extd_rate_link_stats() - cdp function to get peer
  1025. * extended rate and link stats
  1026. * @soc: soc handle
  1027. * @mac_addr: mac address
  1028. *
  1029. * Return: status
  1030. */
  1031. static inline QDF_STATUS cdp_get_peer_extd_rate_link_stats(
  1032. ol_txrx_soc_handle soc,
  1033. uint8_t *mac_addr)
  1034. {
  1035. if (!soc || !soc->ops) {
  1036. dp_cdp_debug("Invalid Instance");
  1037. QDF_BUG(0);
  1038. return QDF_STATUS_E_FAILURE;
  1039. }
  1040. if (!soc->ops->host_stats_ops ||
  1041. !soc->ops->host_stats_ops->txrx_get_peer_extd_rate_link_stats)
  1042. return QDF_STATUS_E_FAILURE;
  1043. return soc->ops->host_stats_ops->txrx_get_peer_extd_rate_link_stats(
  1044. soc, mac_addr);
  1045. }
  1046. /**
  1047. * cdp_get_pdev_obss_pd_stats() - function to get pdev obss stats
  1048. * @soc: soc handle
  1049. * @pdev_id: pdev id
  1050. * @stats: pointer to pdev obss stats
  1051. * @req: Pointer to CDP TxRx stats
  1052. *
  1053. * Return: status
  1054. */
  1055. static inline QDF_STATUS cdp_get_pdev_obss_pd_stats(
  1056. ol_txrx_soc_handle soc,
  1057. uint8_t pdev_id,
  1058. struct cdp_pdev_obss_pd_stats_tlv *stats,
  1059. struct cdp_txrx_stats_req *req)
  1060. {
  1061. if (!soc || !soc->ops) {
  1062. dp_cdp_debug("Invalid Instance");
  1063. QDF_BUG(0);
  1064. return QDF_STATUS_E_FAILURE;
  1065. }
  1066. if (!soc->ops->host_stats_ops ||
  1067. !soc->ops->host_stats_ops->get_pdev_obss_stats)
  1068. return QDF_STATUS_E_FAILURE;
  1069. return soc->ops->host_stats_ops->get_pdev_obss_stats(
  1070. soc, pdev_id, stats, req);
  1071. }
  1072. /**
  1073. * cdp_clear_pdev_obss_pd_stats() - function to clear pdev obss stats
  1074. * @soc: soc handle
  1075. * @pdev_id: pdev id
  1076. * @req: Pointer to CDP TxRx stats request. mac_id will be pre-filled
  1077. * and should not be overwritten
  1078. *
  1079. * Return: status
  1080. */
  1081. static inline QDF_STATUS cdp_clear_pdev_obss_pd_stats(
  1082. ol_txrx_soc_handle soc,
  1083. uint8_t pdev_id, struct cdp_txrx_stats_req *req)
  1084. {
  1085. if (!soc || !soc->ops) {
  1086. dp_cdp_debug("Invalid Instance");
  1087. QDF_BUG(0);
  1088. return QDF_STATUS_E_FAILURE;
  1089. }
  1090. if (!soc->ops->host_stats_ops ||
  1091. !soc->ops->host_stats_ops->clear_pdev_obss_pd_stats)
  1092. return QDF_STATUS_E_FAILURE;
  1093. return soc->ops->host_stats_ops->clear_pdev_obss_pd_stats(
  1094. soc, pdev_id, req);
  1095. }
  1096. #endif /* _CDP_TXRX_HOST_STATS_H_ */