cdp_txrx_ctrl.h 31 KB

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