cdp_txrx_ctrl.h 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189
  1. /*
  2. * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. /**
  19. * @file cdp_txrx_ctrl.h
  20. * @brief Define the host data path control API functions
  21. * called by the host control SW and the OS interface module
  22. */
  23. #ifndef _CDP_TXRX_CTRL_H_
  24. #define _CDP_TXRX_CTRL_H_
  25. #include "cdp_txrx_handle.h"
  26. #include "cdp_txrx_cmn_struct.h"
  27. #include "cdp_txrx_cmn.h"
  28. #include "cdp_txrx_ops.h"
  29. static inline int cdp_is_target_ar900b
  30. (ol_txrx_soc_handle soc)
  31. {
  32. if (!soc || !soc->ops) {
  33. dp_cdp_debug("Invalid Instance:");
  34. QDF_BUG(0);
  35. return 0;
  36. }
  37. if (!soc->ops->ctrl_ops ||
  38. !soc->ops->ctrl_ops->txrx_is_target_ar900b)
  39. return 0;
  40. return soc->ops->ctrl_ops->txrx_is_target_ar900b(soc);
  41. }
  42. /* WIN */
  43. static inline int
  44. cdp_mempools_attach(ol_txrx_soc_handle soc)
  45. {
  46. if (!soc || !soc->ops) {
  47. dp_cdp_debug("Invalid Instance:");
  48. QDF_BUG(0);
  49. return 0;
  50. }
  51. if (!soc->ops->ctrl_ops ||
  52. !soc->ops->ctrl_ops->txrx_mempools_attach)
  53. return 0;
  54. return soc->ops->ctrl_ops->txrx_mempools_attach(soc);
  55. }
  56. #if defined(ATH_SUPPORT_NAC) || defined(ATH_SUPPORT_NAC_RSSI)
  57. /**
  58. * @brief update the neighbour peer addresses
  59. * @details
  60. * This defines interface function to update neighbour peers addresses
  61. * which needs to be filtered
  62. *
  63. * @param soc - the pointer to soc object
  64. * @param vdev_id - id of the pointer to vdev
  65. * @param cmd - add/del entry into peer table
  66. * @param macaddr - the address of neighbour peer
  67. * @return - int
  68. */
  69. static inline int
  70. cdp_update_filter_neighbour_peers(ol_txrx_soc_handle soc,
  71. uint8_t vdev_id, uint32_t cmd, uint8_t *macaddr)
  72. {
  73. if (!soc || !soc->ops) {
  74. dp_cdp_debug("Invalid Instance:");
  75. QDF_BUG(0);
  76. return 0;
  77. }
  78. if (!soc->ops->ctrl_ops ||
  79. !soc->ops->ctrl_ops->txrx_update_filter_neighbour_peers)
  80. return 0;
  81. return soc->ops->ctrl_ops->txrx_update_filter_neighbour_peers
  82. (soc, vdev_id, cmd, macaddr);
  83. }
  84. #endif /* ATH_SUPPORT_NAC || ATH_SUPPORT_NAC_RSSI*/
  85. #ifdef WLAN_SUPPORT_MSCS
  86. /**
  87. * @brief record the MSCS data and send it to the Data path
  88. * @details
  89. * This defines interface function to record the MSCS procedure
  90. * based data parameters so that the data path layer can access it
  91. *
  92. * @param soc - the pointer to soc object
  93. * @param vdev_id - id of the pointer to vdev
  94. * @param macaddr - the address of neighbour peer
  95. * @param mscs_params - Structure having MSCS params
  96. * obtained from handshake
  97. * @return - QDF_STATUS
  98. */
  99. static inline QDF_STATUS
  100. cdp_record_vdev_mscs_params(ol_txrx_soc_handle soc, uint8_t
  101. *macaddr, uint8_t vdev_id, struct cdp_mscs_params *mscs_params,
  102. bool active)
  103. {
  104. if (!soc || !soc->ops) {
  105. dp_cdp_debug("Invalid Instance:");
  106. QDF_BUG(0);
  107. return QDF_STATUS_E_FAILURE;
  108. }
  109. if (!soc->ops->ctrl_ops ||
  110. !soc->ops->ctrl_ops->txrx_record_mscs_params)
  111. return QDF_STATUS_E_FAILURE;
  112. return soc->ops->ctrl_ops->txrx_record_mscs_params
  113. (soc, macaddr, vdev_id, mscs_params, active);
  114. }
  115. #endif
  116. /**
  117. * @brief set the Reo Destination ring for the pdev
  118. * @details
  119. * This will be used to configure the Reo Destination ring for this pdev.
  120. *
  121. * @param soc - pointer to the soc
  122. * @param pdev_id - id of the data physical device object
  123. * @param val - the Reo destination ring index (1 to 4)
  124. * @return - QDF_STATUS
  125. */
  126. static inline QDF_STATUS
  127. cdp_set_pdev_reo_dest(ol_txrx_soc_handle soc,
  128. uint8_t pdev_id, enum cdp_host_reo_dest_ring val)
  129. {
  130. if (!soc || !soc->ops) {
  131. dp_cdp_debug("Invalid Instance:");
  132. QDF_BUG(0);
  133. return QDF_STATUS_E_FAILURE;
  134. }
  135. if (!soc->ops->ctrl_ops ||
  136. !soc->ops->ctrl_ops->txrx_set_pdev_reo_dest)
  137. return QDF_STATUS_E_FAILURE;
  138. return soc->ops->ctrl_ops->txrx_set_pdev_reo_dest
  139. (soc, pdev_id, val);
  140. }
  141. /**
  142. * @brief get the Reo Destination ring for the pdev
  143. *
  144. * @param soc - pointer to the soc
  145. * @param pdev_id - id of physical device object
  146. * @return - the Reo destination ring index (1 to 4), 0 if not supported.
  147. */
  148. static inline enum cdp_host_reo_dest_ring
  149. cdp_get_pdev_reo_dest(ol_txrx_soc_handle soc, uint8_t pdev_id)
  150. {
  151. if (!soc || !soc->ops) {
  152. dp_cdp_debug("Invalid Instance:");
  153. QDF_BUG(0);
  154. return cdp_host_reo_dest_ring_unknown;
  155. }
  156. if (!soc->ops->ctrl_ops ||
  157. !soc->ops->ctrl_ops->txrx_get_pdev_reo_dest)
  158. return cdp_host_reo_dest_ring_unknown;
  159. return soc->ops->ctrl_ops->txrx_get_pdev_reo_dest(soc, pdev_id);
  160. }
  161. /* Is this similar to ol_txrx_peer_state_update() in MCL */
  162. /**
  163. * @brief Update the authorize peer object at association time
  164. * @details
  165. * For the host-based implementation of rate-control, it
  166. * updates the peer/node-related parameters within rate-control
  167. * context of the peer at association.
  168. *
  169. * @param soc - pointer to the soc
  170. * @param vdev_id - id of the pointer to vdev
  171. * @param peer_mac - mac address of the node's object
  172. * @authorize - either to authorize or unauthorize peer
  173. *
  174. * @return QDF_STATUS
  175. */
  176. static inline QDF_STATUS
  177. cdp_peer_authorize(ol_txrx_soc_handle soc, uint8_t vdev_id, uint8_t *peer_mac,
  178. u_int32_t authorize)
  179. {
  180. if (!soc || !soc->ops) {
  181. dp_cdp_debug("Invalid Instance:");
  182. QDF_BUG(0);
  183. return QDF_STATUS_E_FAILURE;
  184. }
  185. if (!soc->ops->ctrl_ops ||
  186. !soc->ops->ctrl_ops->txrx_peer_authorize)
  187. return QDF_STATUS_E_FAILURE;
  188. return soc->ops->ctrl_ops->txrx_peer_authorize
  189. (soc, vdev_id, peer_mac, authorize);
  190. }
  191. static inline void cdp_tx_flush_buffers
  192. (ol_txrx_soc_handle soc, uint8_t vdev_id)
  193. {
  194. if (!soc || !soc->ops) {
  195. dp_cdp_debug("Invalid Instance:");
  196. QDF_BUG(0);
  197. return;
  198. }
  199. if (!soc->ops->ctrl_ops ||
  200. !soc->ops->ctrl_ops->tx_flush_buffers)
  201. return;
  202. soc->ops->ctrl_ops->tx_flush_buffers(soc, vdev_id);
  203. }
  204. static inline QDF_STATUS cdp_txrx_get_vdev_param(ol_txrx_soc_handle soc,
  205. uint8_t vdev_id,
  206. enum cdp_vdev_param_type type,
  207. cdp_config_param_type *val)
  208. {
  209. if (!soc || !soc->ops) {
  210. dp_cdp_debug("Invalid Instance:");
  211. QDF_BUG(0);
  212. return QDF_STATUS_E_FAILURE;
  213. }
  214. if (!soc->ops->ctrl_ops ||
  215. !soc->ops->ctrl_ops->txrx_get_vdev_param) {
  216. dp_cdp_debug("callback not registered:");
  217. return QDF_STATUS_E_FAILURE;
  218. }
  219. return soc->ops->ctrl_ops->txrx_get_vdev_param(soc, vdev_id,
  220. type, val);
  221. }
  222. static inline QDF_STATUS
  223. cdp_txrx_set_vdev_param(ol_txrx_soc_handle soc,
  224. uint8_t vdev_id, enum cdp_vdev_param_type type,
  225. cdp_config_param_type val)
  226. {
  227. if (!soc || !soc->ops) {
  228. dp_cdp_debug("Invalid Instance:");
  229. QDF_BUG(0);
  230. return QDF_STATUS_E_FAILURE;
  231. }
  232. if (!soc->ops->ctrl_ops ||
  233. !soc->ops->ctrl_ops->txrx_set_vdev_param) {
  234. dp_cdp_nofl_debug("NULL vdev params callback");
  235. return QDF_STATUS_E_FAILURE;
  236. }
  237. return soc->ops->ctrl_ops->txrx_set_vdev_param(soc, vdev_id,
  238. type, val);
  239. }
  240. static inline QDF_STATUS
  241. cdp_txrx_set_psoc_param(ol_txrx_soc_handle soc,
  242. enum cdp_psoc_param_type type,
  243. cdp_config_param_type val)
  244. {
  245. if (!soc || !soc->ops) {
  246. dp_cdp_debug("Invalid Instance:");
  247. QDF_BUG(0);
  248. return QDF_STATUS_E_FAILURE;
  249. }
  250. if (!soc->ops->ctrl_ops ||
  251. !soc->ops->ctrl_ops->txrx_set_psoc_param)
  252. return QDF_STATUS_E_FAILURE;
  253. return soc->ops->ctrl_ops->txrx_set_psoc_param(soc, type, val);
  254. }
  255. static inline QDF_STATUS
  256. cdp_txrx_get_psoc_param(ol_txrx_soc_handle soc,
  257. enum cdp_psoc_param_type type,
  258. cdp_config_param_type *val)
  259. {
  260. if (!soc || !soc->ops) {
  261. dp_cdp_debug("Invalid Instance:");
  262. QDF_BUG(0);
  263. return QDF_STATUS_E_FAILURE;
  264. }
  265. if (!soc->ops->ctrl_ops ||
  266. !soc->ops->ctrl_ops->txrx_get_psoc_param)
  267. return QDF_STATUS_E_FAILURE;
  268. return soc->ops->ctrl_ops->txrx_get_psoc_param(soc, type, val);
  269. }
  270. #ifdef VDEV_PEER_PROTOCOL_COUNT
  271. /**
  272. * cdp_set_vdev_peer_protocol_count() - set per-peer protocol count tracking
  273. *
  274. * @soc - pointer to the soc
  275. * @vdev - the data virtual device object
  276. * @enable - enable per-peer protocol count
  277. *
  278. * Set per-peer protocol count feature enable
  279. *
  280. * Return: void
  281. */
  282. static inline
  283. void cdp_set_vdev_peer_protocol_count(ol_txrx_soc_handle soc, int8_t vdev_id,
  284. bool enable)
  285. {
  286. if (!soc || !soc->ops) {
  287. dp_cdp_debug("Invalid Instance:");
  288. QDF_BUG(0);
  289. return;
  290. }
  291. if (!soc->ops->ctrl_ops ||
  292. !soc->ops->ctrl_ops->txrx_enable_peer_protocol_count)
  293. return;
  294. soc->ops->ctrl_ops->txrx_enable_peer_protocol_count(soc, vdev_id,
  295. enable);
  296. }
  297. /**
  298. * cdp_set_vdev_peer_protocol_drop_mask() - set per-peer protocol drop mask
  299. *
  300. * @soc - pointer to the soc
  301. * @vdev - the data virtual device object
  302. * @drop_mask - drop_mask
  303. *
  304. * Set per-peer protocol drop_mask
  305. *
  306. * Return - void
  307. */
  308. static inline
  309. void cdp_set_vdev_peer_protocol_drop_mask(ol_txrx_soc_handle soc,
  310. int8_t vdev_id, int drop_mask)
  311. {
  312. if (!soc || !soc->ops) {
  313. dp_cdp_debug("Invalid Instance:");
  314. QDF_BUG(0);
  315. return;
  316. }
  317. if (!soc->ops->ctrl_ops ||
  318. !soc->ops->ctrl_ops->txrx_set_peer_protocol_drop_mask)
  319. return;
  320. soc->ops->ctrl_ops->txrx_set_peer_protocol_drop_mask(soc, vdev_id,
  321. drop_mask);
  322. }
  323. /**
  324. * cdp_is_vdev_peer_protocol_count_enabled() - whether peer-protocol tracking
  325. * enabled
  326. *
  327. * @soc - pointer to the soc
  328. * @vdev - the data virtual device object
  329. *
  330. * Get whether peer protocol count feature enabled or not
  331. *
  332. * Return: whether feature enabled or not
  333. */
  334. static inline
  335. int cdp_is_vdev_peer_protocol_count_enabled(ol_txrx_soc_handle soc,
  336. int8_t vdev_id)
  337. {
  338. if (!soc || !soc->ops) {
  339. dp_cdp_debug("Invalid Instance:");
  340. QDF_BUG(0);
  341. return 0;
  342. }
  343. if (!soc->ops->ctrl_ops ||
  344. !soc->ops->ctrl_ops->txrx_is_peer_protocol_count_enabled)
  345. return 0;
  346. return soc->ops->ctrl_ops->txrx_is_peer_protocol_count_enabled(soc,
  347. vdev_id);
  348. }
  349. /**
  350. * cdp_get_peer_protocol_drop_mask() - get per-peer protocol count drop-mask
  351. *
  352. * @soc - pointer to the soc
  353. * @vdev - the data virtual device object
  354. *
  355. * Get peer-protocol-count drop-mask
  356. *
  357. * Return: peer-protocol-count drop-mask
  358. */
  359. static inline
  360. int cdp_get_peer_protocol_drop_mask(ol_txrx_soc_handle soc, int8_t vdev_id)
  361. {
  362. if (!soc || !soc->ops) {
  363. dp_cdp_debug("Invalid Instance:");
  364. QDF_BUG(0);
  365. return 0;
  366. }
  367. if (!soc->ops->ctrl_ops ||
  368. !soc->ops->ctrl_ops->txrx_get_peer_protocol_drop_mask)
  369. return 0;
  370. return soc->ops->ctrl_ops->txrx_get_peer_protocol_drop_mask(soc,
  371. vdev_id);
  372. }
  373. /*
  374. * Rx-Ingress and Tx-Egress are in the lower level DP layer
  375. * Rx-Egress and Tx-ingress are handled in osif layer for DP
  376. * So
  377. * Rx-Ingress and Tx-Egress definitions are in DP layer
  378. * Rx-Egress and Tx-ingress mask definitions are here below
  379. */
  380. #define VDEV_PEER_PROTOCOL_RX_INGRESS_MASK 1
  381. #define VDEV_PEER_PROTOCOL_TX_INGRESS_MASK 2
  382. #define VDEV_PEER_PROTOCOL_RX_EGRESS_MASK 4
  383. #define VDEV_PEER_PROTOCOL_TX_EGRESS_MASK 8
  384. #else
  385. #define cdp_set_vdev_peer_protocol_count(soc, vdev_id, enable)
  386. #define cdp_set_vdev_peer_protocol_drop_mask(soc, vdev_id, drop_mask)
  387. #define cdp_is_vdev_peer_protocol_count_enabled(soc, vdev_id) 0
  388. #define cdp_get_peer_protocol_drop_mask(soc, vdev_id) 0
  389. #endif
  390. /**
  391. * cdp_txrx_set_pdev_param() - set pdev parameter
  392. * @soc: opaque soc handle
  393. * @pdev_id: id of data path pdev handle
  394. * @type: param type
  395. * @val: value
  396. *
  397. * Return: status: 0 - Success, non-zero: Failure
  398. */
  399. static inline QDF_STATUS cdp_txrx_set_pdev_param(ol_txrx_soc_handle soc,
  400. uint8_t pdev_id,
  401. enum cdp_pdev_param_type type,
  402. cdp_config_param_type val)
  403. {
  404. if (!soc || !soc->ops) {
  405. dp_cdp_debug("Invalid Instance:");
  406. QDF_BUG(0);
  407. return QDF_STATUS_E_FAILURE;
  408. }
  409. if (!soc->ops->ctrl_ops ||
  410. !soc->ops->ctrl_ops->txrx_set_pdev_param)
  411. return QDF_STATUS_E_FAILURE;
  412. return soc->ops->ctrl_ops->txrx_set_pdev_param
  413. (soc, pdev_id, type, val);
  414. }
  415. /**
  416. * cdp_txrx_set_peer_param() - set pdev parameter
  417. * @soc: opaque soc handle
  418. * @vdev_id: id of data path vdev handle
  419. * @peer_mac: peer mac address
  420. * @type: param type
  421. * @val: value
  422. *
  423. * Return: status: 0 - Success, non-zero: Failure
  424. */
  425. static inline QDF_STATUS cdp_txrx_set_peer_param(ol_txrx_soc_handle soc,
  426. uint8_t vdev_id,
  427. uint8_t *peer_mac,
  428. enum cdp_peer_param_type type,
  429. cdp_config_param_type val)
  430. {
  431. if (!soc || !soc->ops) {
  432. dp_cdp_debug("Invalid Instance:");
  433. QDF_BUG(0);
  434. return QDF_STATUS_E_FAILURE;
  435. }
  436. if (!soc->ops->ctrl_ops ||
  437. !soc->ops->ctrl_ops->txrx_set_peer_param)
  438. return QDF_STATUS_E_FAILURE;
  439. return soc->ops->ctrl_ops->txrx_set_peer_param
  440. (soc, vdev_id, peer_mac, type, val);
  441. }
  442. /**
  443. * cdp_txrx_get_peer_param() - set pdev parameter
  444. * @soc: opaque soc handle
  445. * @vdev_id: id of data path vdev handle
  446. * @peer_mac: peer mac address
  447. * @type: param type
  448. * @val: address of buffer
  449. *
  450. * Return: status
  451. */
  452. static inline QDF_STATUS cdp_txrx_get_peer_param(ol_txrx_soc_handle soc,
  453. uint8_t vdev_id,
  454. uint8_t *peer_mac,
  455. enum cdp_peer_param_type type,
  456. cdp_config_param_type *val)
  457. {
  458. if (!soc || !soc->ops) {
  459. dp_cdp_debug("Invalid Instance:");
  460. QDF_BUG(0);
  461. return QDF_STATUS_E_FAILURE;
  462. }
  463. if (!soc->ops->ctrl_ops ||
  464. !soc->ops->ctrl_ops->txrx_get_peer_param)
  465. return QDF_STATUS_E_FAILURE;
  466. return soc->ops->ctrl_ops->txrx_get_peer_param
  467. (soc, vdev_id, peer_mac, type, val);
  468. }
  469. #ifdef QCA_MULTIPASS_SUPPORT
  470. static inline void
  471. cdp_peer_set_vlan_id(ol_txrx_soc_handle soc, uint8_t vdev_id,
  472. uint8_t *peer_mac, uint16_t vlan_id)
  473. {
  474. if (!soc || !soc->ops) {
  475. dp_cdp_debug("Invalid Instance:");
  476. QDF_BUG(0);
  477. return;
  478. }
  479. if (!soc->ops->ctrl_ops ||
  480. !soc->ops->ctrl_ops->txrx_peer_set_vlan_id)
  481. return;
  482. soc->ops->ctrl_ops->txrx_peer_set_vlan_id(soc, vdev_id, peer_mac,
  483. vlan_id);
  484. }
  485. #endif
  486. /**
  487. * cdp_txrx_get_pdev_param() - get pdev parameter
  488. * @soc: opaque soc handle
  489. * @pdev_id: id of data path pdev handle
  490. * @type: param type
  491. * @value: address of value buffer
  492. *
  493. * Return: status
  494. */
  495. static inline QDF_STATUS cdp_txrx_get_pdev_param(ol_txrx_soc_handle soc,
  496. uint8_t pdev_id,
  497. enum cdp_pdev_param_type type,
  498. cdp_config_param_type *value)
  499. {
  500. if (!soc || !soc->ops) {
  501. dp_cdp_debug("Invalid Instance:");
  502. QDF_BUG(0);
  503. return QDF_STATUS_E_FAILURE;
  504. }
  505. if (!soc->ops->ctrl_ops ||
  506. !soc->ops->ctrl_ops->txrx_get_pdev_param)
  507. return QDF_STATUS_E_FAILURE;
  508. return soc->ops->ctrl_ops->txrx_get_pdev_param
  509. (soc, pdev_id, type, value);
  510. }
  511. /**
  512. * cdp_txrx_peer_protocol_cnt() - set peer protocol count
  513. * @soc: opaque soc handle
  514. * @vdev: opaque vdev handle
  515. * @nbuf: data packet
  516. * @is_egress: whether egress or ingress
  517. * @is_rx: whether tx or rx
  518. *
  519. * Return: void
  520. */
  521. #ifdef VDEV_PEER_PROTOCOL_COUNT
  522. static inline void
  523. cdp_txrx_peer_protocol_cnt(ol_txrx_soc_handle soc,
  524. int8_t vdev_id,
  525. qdf_nbuf_t nbuf,
  526. enum vdev_peer_protocol_enter_exit is_egress,
  527. enum vdev_peer_protocol_tx_rx is_rx)
  528. {
  529. if (!soc || !soc->ops) {
  530. dp_cdp_debug("Invalid Instance:");
  531. QDF_BUG(0);
  532. return;
  533. }
  534. if (!soc->ops->ctrl_ops ||
  535. !soc->ops->ctrl_ops->txrx_peer_protocol_cnt)
  536. return;
  537. soc->ops->ctrl_ops->txrx_peer_protocol_cnt(soc, vdev_id, nbuf,
  538. is_egress, is_rx);
  539. }
  540. #else
  541. #define cdp_txrx_peer_protocol_cnt(soc, vdev_id, nbuf, is_egress, is_rx)
  542. #endif
  543. /**
  544. * cdp_enable_peer_based_pktlog()- Set flag in peer structure
  545. *
  546. * @soc: pointer to the soc
  547. * @pdev_id: id of the data physical device object
  548. * @enable: enable or disable peer based filter based pktlog
  549. * @peer_macaddr: Mac address of peer which needs to be
  550. * filtered
  551. *
  552. * This function will set flag in peer structure if peer based filtering
  553. * is enabled for pktlog
  554. *
  555. * Return: int
  556. */
  557. static inline int
  558. cdp_enable_peer_based_pktlog(ol_txrx_soc_handle soc, uint8_t pdev_id,
  559. char *peer_macaddr,
  560. uint8_t enable)
  561. {
  562. if (!soc || !soc->ops) {
  563. QDF_TRACE_ERROR(QDF_MODULE_ID_DP,
  564. "%s invalid instance", __func__);
  565. QDF_BUG(0);
  566. return 0;
  567. }
  568. if (!soc->ops->ctrl_ops ||
  569. !soc->ops->ctrl_ops->enable_peer_based_pktlog)
  570. return 0;
  571. return soc->ops->ctrl_ops->enable_peer_based_pktlog
  572. (soc, pdev_id, peer_macaddr, enable);
  573. }
  574. /**
  575. * cdp_calculate_delay_stats()- get rx delay stats
  576. *
  577. * @soc: pointer to the soc
  578. * @vdev_id: id of vdev handle
  579. * @nbuf: nbuf which is passed
  580. *
  581. * This function will calculate rx delay statistics.
  582. */
  583. static inline QDF_STATUS
  584. cdp_calculate_delay_stats(ol_txrx_soc_handle soc, uint8_t vdev_id,
  585. qdf_nbuf_t nbuf)
  586. {
  587. if (!soc || !soc->ops) {
  588. dp_cdp_debug("Invalid Instance:");
  589. QDF_BUG(0);
  590. return QDF_STATUS_E_FAILURE;
  591. }
  592. if (!soc->ops->ctrl_ops ||
  593. !soc->ops->ctrl_ops->calculate_delay_stats) {
  594. dp_cdp_debug("callback not registered:");
  595. return QDF_STATUS_E_FAILURE;
  596. }
  597. return soc->ops->ctrl_ops->calculate_delay_stats(soc, vdev_id, nbuf);
  598. }
  599. /**
  600. * @brief Subscribe to a specified WDI event.
  601. * @details
  602. * This function adds the provided wdi_event_subscribe object to a list of
  603. * subscribers for the specified WDI event.
  604. * When the event in question happens, each subscriber for the event will
  605. * have their callback function invoked.
  606. * The order in which callback functions from multiple subscribers are
  607. * invoked is unspecified.
  608. *
  609. * @param soc - pointer to the soc
  610. * @param pdev_id - id of the data physical device object
  611. * @param event_cb_sub - the callback and context for the event subscriber
  612. * @param event - which event's notifications are being subscribed to
  613. * @return - int
  614. */
  615. static inline int
  616. cdp_wdi_event_sub(ol_txrx_soc_handle soc, uint8_t pdev_id,
  617. wdi_event_subscribe *event_cb_sub, uint32_t event)
  618. {
  619. if (!soc || !soc->ops) {
  620. dp_cdp_debug("invalid instance");
  621. QDF_BUG(0);
  622. return 0;
  623. }
  624. if (!soc->ops->ctrl_ops ||
  625. !soc->ops->ctrl_ops->txrx_wdi_event_sub)
  626. return 0;
  627. return soc->ops->ctrl_ops->txrx_wdi_event_sub
  628. (soc, pdev_id, event_cb_sub, event);
  629. }
  630. /**
  631. * @brief Unsubscribe from a specified WDI event.
  632. * @details
  633. * This function removes the provided event subscription object from the
  634. * list of subscribers for its event.
  635. * This function shall only be called if there was a successful prior call
  636. * to event_sub() on the same wdi_event_subscribe object.
  637. *
  638. * @param soc - pointer to the soc
  639. * @param pdev_id - id of the data physical device object
  640. * @param event_cb_sub - the callback and context for the event subscriber
  641. * @param event - which event's notifications are being subscribed to
  642. * @return - int
  643. */
  644. static inline int
  645. cdp_wdi_event_unsub(ol_txrx_soc_handle soc,
  646. uint8_t pdev_id, wdi_event_subscribe *event_cb_sub,
  647. uint32_t event)
  648. {
  649. if (!soc || !soc->ops) {
  650. dp_cdp_debug("invalid instance");
  651. QDF_BUG(0);
  652. return 0;
  653. }
  654. if (!soc->ops->ctrl_ops ||
  655. !soc->ops->ctrl_ops->txrx_wdi_event_unsub)
  656. return 0;
  657. return soc->ops->ctrl_ops->txrx_wdi_event_unsub
  658. (soc, pdev_id, event_cb_sub, event);
  659. }
  660. /**
  661. * @brief Get security type from the from peer.
  662. * @details
  663. * This function gets the Security information from the peer handler.
  664. * The security information is got from the rx descriptor and filled in
  665. * to the peer handler.
  666. *
  667. * @param soc - pointer to the soc
  668. * @param vdev_id - id of vdev handle
  669. * @param peer mac - peer mac address
  670. * @param sec_idx - mcast or ucast frame type.
  671. * @return - int
  672. */
  673. static inline int
  674. cdp_get_sec_type(ol_txrx_soc_handle soc, uint8_t vdev_id, uint8_t *peer_mac,
  675. uint8_t sec_idx)
  676. {
  677. if (!soc || !soc->ops) {
  678. dp_cdp_debug("invalid instance");
  679. QDF_BUG(0);
  680. return A_ERROR;
  681. }
  682. if (!soc->ops->ctrl_ops ||
  683. !soc->ops->ctrl_ops->txrx_get_sec_type)
  684. return A_ERROR;
  685. return soc->ops->ctrl_ops->txrx_get_sec_type
  686. (soc, vdev_id, peer_mac, sec_idx);
  687. }
  688. /**
  689. * cdp_set_mgmt_tx_power(): function to set tx power for mgmt frames
  690. * @param soc - pointer to the soc
  691. * @vdev_id : id of vdev handle
  692. * @subtype_index: subtype
  693. * @tx_power: Tx power
  694. * Return: QDF_STATUS
  695. */
  696. static inline QDF_STATUS
  697. cdp_set_mgmt_tx_power(ol_txrx_soc_handle soc,
  698. uint8_t vdev_id, uint8_t subtype, uint8_t tx_power)
  699. {
  700. if (!soc || !soc->ops) {
  701. dp_cdp_debug("Invalid Instance:");
  702. QDF_BUG(0);
  703. return QDF_STATUS_E_FAILURE;
  704. }
  705. if (!soc->ops->ctrl_ops ||
  706. !soc->ops->ctrl_ops->txrx_update_mgmt_txpow_vdev)
  707. return QDF_STATUS_E_FAILURE;
  708. return soc->ops->ctrl_ops->txrx_update_mgmt_txpow_vdev(soc, vdev_id,
  709. subtype, tx_power);
  710. }
  711. /**
  712. * cdp_get_pldev() - function to get pktlog device handle
  713. * @soc: datapath soc handle
  714. * @pdev_id: physical device id
  715. *
  716. * Return: pktlog device handle or NULL
  717. */
  718. static inline void *
  719. cdp_get_pldev(ol_txrx_soc_handle soc, uint8_t pdev_id)
  720. {
  721. if (!soc || !soc->ops) {
  722. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  723. "%s invalid instance", __func__);
  724. QDF_BUG(0);
  725. return NULL;
  726. }
  727. if (!soc->ops->ctrl_ops || !soc->ops->ctrl_ops->txrx_get_pldev)
  728. return NULL;
  729. return soc->ops->ctrl_ops->txrx_get_pldev(soc, pdev_id);
  730. }
  731. #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE)
  732. /**
  733. * cdp_cfr_filter() - Configure Host RX monitor status ring for CFR
  734. * @soc: SOC TXRX handle
  735. * @pdev_id: ID of the physical device object
  736. * @enable: Enable or disable CFR
  737. * @filter_val: Flag to select filter for monitor mode
  738. */
  739. static inline void
  740. cdp_cfr_filter(ol_txrx_soc_handle soc,
  741. uint8_t pdev_id,
  742. bool enable,
  743. struct cdp_monitor_filter *filter_val)
  744. {
  745. if (!soc || !soc->ops) {
  746. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  747. "%s invalid instance", __func__);
  748. QDF_BUG(0);
  749. return;
  750. }
  751. if (!soc->ops->cfr_ops || !soc->ops->cfr_ops->txrx_cfr_filter)
  752. return;
  753. soc->ops->cfr_ops->txrx_cfr_filter(soc, pdev_id, enable, filter_val);
  754. }
  755. /**
  756. * cdp_get_cfr_rcc() - get cfr rcc config
  757. * @soc: Datapath soc handle
  758. * @pdev_id: id of objmgr pdev
  759. *
  760. * Return: true/false based on cfr mode setting
  761. */
  762. static inline
  763. bool cdp_get_cfr_rcc(ol_txrx_soc_handle soc, uint8_t pdev_id)
  764. {
  765. if (!soc || !soc->ops) {
  766. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  767. "%s invalid instance", __func__);
  768. QDF_BUG(0);
  769. return 0;
  770. }
  771. if (!soc->ops->cfr_ops || !soc->ops->cfr_ops->txrx_get_cfr_rcc)
  772. return 0;
  773. return soc->ops->cfr_ops->txrx_get_cfr_rcc(soc, pdev_id);
  774. }
  775. /**
  776. * cdp_set_cfr_rcc() - enable/disable cfr rcc config
  777. * @soc: Datapath soc handle
  778. * @pdev_id: id of objmgr pdev
  779. * @enable: Enable/Disable cfr rcc mode
  780. *
  781. * Return: none
  782. */
  783. static inline
  784. void cdp_set_cfr_rcc(ol_txrx_soc_handle soc, uint8_t pdev_id, bool enable)
  785. {
  786. if (!soc || !soc->ops) {
  787. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  788. "%s invalid instance", __func__);
  789. QDF_BUG(0);
  790. return;
  791. }
  792. if (!soc->ops->cfr_ops || !soc->ops->cfr_ops->txrx_set_cfr_rcc)
  793. return;
  794. return soc->ops->cfr_ops->txrx_set_cfr_rcc(soc, pdev_id, enable);
  795. }
  796. /**
  797. * cdp_get_cfr_dbg_stats() - Get debug statistics for CFR
  798. *
  799. * @soc: SOC TXRX handle
  800. * @pdev_id: ID of the physical device object
  801. * @buf: CFR RCC debug statistics buffer
  802. *
  803. * Return: None
  804. */
  805. static inline void
  806. cdp_get_cfr_dbg_stats(ol_txrx_soc_handle soc, uint8_t pdev_id,
  807. struct cdp_cfr_rcc_stats *buf)
  808. {
  809. if (!soc || !soc->ops) {
  810. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  811. "%s invalid instance", __func__);
  812. QDF_BUG(0);
  813. return;
  814. }
  815. if (!soc->ops->cfr_ops || !soc->ops->cfr_ops->txrx_get_cfr_dbg_stats)
  816. return;
  817. soc->ops->cfr_ops->txrx_get_cfr_dbg_stats(soc, pdev_id, buf);
  818. }
  819. /**
  820. * cdp_cfr_clr_dbg_stats() - Clear debug statistics for CFR
  821. *
  822. * @soc: SOC TXRX handle
  823. * @pdev_id: ID of the physical device object
  824. */
  825. static inline void
  826. cdp_cfr_clr_dbg_stats(ol_txrx_soc_handle soc, uint8_t pdev_id)
  827. {
  828. if (!soc || !soc->ops) {
  829. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  830. "%s invalid instance", __func__);
  831. QDF_BUG(0);
  832. return;
  833. }
  834. if (!soc->ops->cfr_ops || !soc->ops->cfr_ops->txrx_clear_cfr_dbg_stats)
  835. return;
  836. soc->ops->cfr_ops->txrx_clear_cfr_dbg_stats(soc, pdev_id);
  837. }
  838. /**
  839. * cdp_enable_mon_reap_timer() - enable/disable reap timer
  840. * @soc: Datapath soc handle
  841. * @pdev_id: id of objmgr pdev
  842. * @enable: enable/disable reap timer of monitor status ring
  843. *
  844. * Return: none
  845. */
  846. static inline void
  847. cdp_enable_mon_reap_timer(ol_txrx_soc_handle soc, uint8_t pdev_id,
  848. bool enable)
  849. {
  850. if (!soc || !soc->ops) {
  851. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  852. "%s invalid instance", __func__);
  853. QDF_BUG(0);
  854. return;
  855. }
  856. if (!soc->ops->cfr_ops ||
  857. !soc->ops->cfr_ops->txrx_enable_mon_reap_timer)
  858. return;
  859. return soc->ops->cfr_ops->txrx_enable_mon_reap_timer(soc, pdev_id,
  860. enable);
  861. }
  862. #endif
  863. #if defined(WLAN_TX_PKT_CAPTURE_ENH) || defined(WLAN_RX_PKT_CAPTURE_ENH)
  864. /**
  865. * cdp_update_peer_pkt_capture_params() - Sets Rx & Tx Capture params for a peer
  866. * @soc: SOC TXRX handle
  867. * @pdev_id: id of CDP pdev pointer
  868. * @is_rx_pkt_cap_enable: enable/disable rx pkt capture for this peer
  869. * @is_tx_pkt_cap_enable: enable/disable tx pkt capture for this peer
  870. * @peer_mac: MAC address of peer for which pkt_cap is to be enabled/disabled
  871. *
  872. * Return: Success when matching peer is found & flags are set, error otherwise
  873. */
  874. static inline QDF_STATUS
  875. cdp_update_peer_pkt_capture_params(ol_txrx_soc_handle soc,
  876. uint8_t pdev_id,
  877. bool is_rx_pkt_cap_enable,
  878. uint8_t is_tx_pkt_cap_enable,
  879. uint8_t *peer_mac)
  880. {
  881. if (!soc || !soc->ops) {
  882. dp_err("Invalid SOC instance");
  883. QDF_BUG(0);
  884. return QDF_STATUS_E_FAILURE;
  885. }
  886. if (!soc->ops->ctrl_ops ||
  887. !soc->ops->ctrl_ops->txrx_update_peer_pkt_capture_params)
  888. return QDF_STATUS_E_FAILURE;
  889. return soc->ops->ctrl_ops->txrx_update_peer_pkt_capture_params
  890. (soc, pdev_id, is_rx_pkt_cap_enable,
  891. is_tx_pkt_cap_enable, peer_mac);
  892. }
  893. #endif /* WLAN_TX_PKT_CAPTURE_ENH || WLAN_RX_PKT_CAPTURE_ENH */
  894. #ifdef WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG
  895. /**
  896. * cdp_update_pdev_rx_protocol_tag() - wrapper function to set the protocol
  897. * tag in CDP layer from cfg layer
  898. * @soc: SOC TXRX handle
  899. * @pdev_id: id of CDP pdev pointer
  900. * @protocol_mask: Bitmap for protocol for which tagging is enabled
  901. * @protocol_type: Protocol type for which the tag should be update
  902. * @tag: Actual tag value for the given prototype
  903. * Return: Returns QDF_STATUS_SUCCESS/FAILURE
  904. */
  905. static inline QDF_STATUS
  906. cdp_update_pdev_rx_protocol_tag(ol_txrx_soc_handle soc,
  907. uint8_t pdev_id, uint32_t protocol_mask,
  908. uint16_t protocol_type, uint16_t tag)
  909. {
  910. if (!soc || !soc->ops) {
  911. dp_err("Invalid SOC instance");
  912. QDF_BUG(0);
  913. return QDF_STATUS_E_FAILURE;
  914. }
  915. if (!soc->ops->ctrl_ops ||
  916. !soc->ops->ctrl_ops->txrx_update_pdev_rx_protocol_tag)
  917. return QDF_STATUS_E_FAILURE;
  918. return soc->ops->ctrl_ops->txrx_update_pdev_rx_protocol_tag
  919. (soc, pdev_id, protocol_mask, protocol_type, tag);
  920. }
  921. #ifdef WLAN_SUPPORT_RX_TAG_STATISTICS
  922. /**
  923. * cdp_dump_pdev_rx_protocol_tag_stats() - wrapper function to dump the protocol
  924. tag statistics for given or all protocols
  925. * @soc: SOC TXRX handle
  926. * @pdev_id: id of CDP pdev pointer
  927. * @protocol_type: Protocol type for which the tag should be update
  928. * Return: Returns QDF_STATUS_SUCCESS/FAILURE
  929. */
  930. static inline QDF_STATUS
  931. cdp_dump_pdev_rx_protocol_tag_stats(ol_txrx_soc_handle soc,
  932. uint8_t pdev_id,
  933. uint16_t protocol_type)
  934. {
  935. if (!soc || !soc->ops) {
  936. dp_err("Invalid SOC instance");
  937. QDF_BUG(0);
  938. return QDF_STATUS_E_FAILURE;
  939. }
  940. if (!soc->ops->ctrl_ops ||
  941. !soc->ops->ctrl_ops->txrx_dump_pdev_rx_protocol_tag_stats)
  942. return QDF_STATUS_E_FAILURE;
  943. soc->ops->ctrl_ops->txrx_dump_pdev_rx_protocol_tag_stats(soc, pdev_id,
  944. protocol_type);
  945. return QDF_STATUS_SUCCESS;
  946. }
  947. #endif /* WLAN_SUPPORT_RX_TAG_STATISTICS */
  948. #endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG */
  949. #ifdef ATH_SUPPORT_NAC_RSSI
  950. /**
  951. * cdp_vdev_config_for_nac_rssi(): To invoke dp callback for nac rssi config
  952. * @soc: soc pointer
  953. * @vdev_id: id of vdev
  954. * @nac_cmd: specfies nac_rss config action add, del, list
  955. * @bssid: Neighbour bssid
  956. * @client_macaddr: Non-Associated client MAC
  957. * @chan_num: channel number to scan
  958. *
  959. * Return: QDF_STATUS
  960. */
  961. static inline QDF_STATUS cdp_vdev_config_for_nac_rssi(ol_txrx_soc_handle soc,
  962. uint8_t vdev_id, enum cdp_nac_param_cmd nac_cmd,
  963. char *bssid, char *client_macaddr, uint8_t chan_num)
  964. {
  965. if (!soc || !soc->ops) {
  966. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  967. "%s invalid instance", __func__);
  968. QDF_BUG(0);
  969. return QDF_STATUS_E_FAILURE;
  970. }
  971. if (!soc->ops->ctrl_ops ||
  972. !soc->ops->ctrl_ops->txrx_vdev_config_for_nac_rssi)
  973. return QDF_STATUS_E_FAILURE;
  974. return soc->ops->ctrl_ops->txrx_vdev_config_for_nac_rssi(soc, vdev_id,
  975. nac_cmd, bssid, client_macaddr, chan_num);
  976. }
  977. /*
  978. * cdp_vdev_get_neighbour_rssi(): To invoke dp callback to get rssi value of nac
  979. * @soc: soc pointer
  980. * @vdev_id: id of vdev
  981. * @macaddr: Non-Associated client MAC
  982. * @rssi: rssi
  983. *
  984. * Return: QDF_STATUS
  985. */
  986. static inline QDF_STATUS cdp_vdev_get_neighbour_rssi(ol_txrx_soc_handle soc,
  987. uint8_t vdev_id,
  988. char *macaddr,
  989. uint8_t *rssi)
  990. {
  991. if (!soc || !soc->ops) {
  992. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
  993. "%s invalid instance", __func__);
  994. QDF_BUG(0);
  995. return QDF_STATUS_E_FAILURE;
  996. }
  997. if (!soc->ops->ctrl_ops ||
  998. !soc->ops->ctrl_ops->txrx_vdev_get_neighbour_rssi)
  999. return QDF_STATUS_E_FAILURE;
  1000. return soc->ops->ctrl_ops->txrx_vdev_get_neighbour_rssi(soc, vdev_id,
  1001. macaddr,
  1002. rssi);
  1003. }
  1004. #endif
  1005. #ifdef WLAN_SUPPORT_RX_FLOW_TAG
  1006. /**
  1007. * cdp_set_rx_flow_tag() - wrapper function to set the flow
  1008. * tag in CDP layer from cfg layer
  1009. * @soc: SOC TXRX handle
  1010. * @pdev_id: id of CDP pdev pointer
  1011. * @flow_info: Flow 5-tuple, along with tag, if any, that needs to added/deleted
  1012. *
  1013. * Return: Success when add/del operation is successful, error otherwise
  1014. */
  1015. static inline QDF_STATUS
  1016. cdp_set_rx_flow_tag(ol_txrx_soc_handle soc, uint8_t pdev_id,
  1017. struct cdp_rx_flow_info *flow_info)
  1018. {
  1019. if (!soc || !soc->ops) {
  1020. dp_err("Invalid SOC instance");
  1021. QDF_BUG(0);
  1022. return QDF_STATUS_E_FAILURE;
  1023. }
  1024. if (!soc->ops->ctrl_ops ||
  1025. !soc->ops->ctrl_ops->txrx_set_rx_flow_tag)
  1026. return QDF_STATUS_E_FAILURE;
  1027. return soc->ops->ctrl_ops->txrx_set_rx_flow_tag(soc, pdev_id,
  1028. flow_info);
  1029. }
  1030. /**
  1031. * cdp_dump_rx_flow_tag_stats() - wrapper function to dump the flow
  1032. * tag statistics for given flow
  1033. * @soc: SOC TXRX handle
  1034. * @pdev_id: id of CDP pdev
  1035. * @flow_info: Flow tuple for which we want to print the statistics
  1036. *
  1037. * Return: Success when flow is found and stats are printed, error otherwise
  1038. */
  1039. static inline QDF_STATUS
  1040. cdp_dump_rx_flow_tag_stats(ol_txrx_soc_handle soc, uint8_t pdev_id,
  1041. struct cdp_rx_flow_info *flow_info)
  1042. {
  1043. if (!soc || !soc->ops) {
  1044. dp_err("Invalid SOC instance");
  1045. QDF_BUG(0);
  1046. return QDF_STATUS_E_FAILURE;
  1047. }
  1048. if (!soc->ops->ctrl_ops ||
  1049. !soc->ops->ctrl_ops->txrx_dump_rx_flow_tag_stats)
  1050. return QDF_STATUS_E_FAILURE;
  1051. return soc->ops->ctrl_ops->txrx_dump_rx_flow_tag_stats(soc,
  1052. pdev_id,
  1053. flow_info);
  1054. }
  1055. #endif /* WLAN_SUPPORT_RX_FLOW_TAG */
  1056. #endif /* _CDP_TXRX_CTRL_H_ */