dp_ipa.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671
  1. /*
  2. * Copyright (c) 2017-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 any
  6. * purpose with or without fee is hereby granted, provided that the above
  7. * copyright notice and this permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  10. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  12. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  13. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  14. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  15. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  16. */
  17. #ifndef _DP_IPA_H_
  18. #define _DP_IPA_H_
  19. #if defined(QCA_WIFI_KIWI) || defined(QCA_WIFI_KIWI_V2)
  20. /* Index into soc->tcl_data_ring[] */
  21. #define IPA_TCL_DATA_RING_IDX 3
  22. #else
  23. #define IPA_TCL_DATA_RING_IDX 2
  24. #endif
  25. /* Index into soc->tx_comp_ring[] */
  26. #define IPA_TX_COMP_RING_IDX IPA_TCL_DATA_RING_IDX
  27. #ifdef IPA_OFFLOAD
  28. #define DP_IPA_MAX_IFACE 3
  29. #define IPA_REO_DEST_RING_IDX 3
  30. #define IPA_REO_DEST_RING_IDX_2 7
  31. #define IPA_RX_REFILL_BUF_RING_IDX 2
  32. #define IPA_ALT_REO_DEST_RING_IDX 2
  33. #define IPA_RX_ALT_REFILL_BUF_RING_IDX 3
  34. /* Adding delay before disabling ipa pipes if any Tx Completions are pending */
  35. #define TX_COMP_DRAIN_WAIT_MS 50
  36. #define TX_COMP_DRAIN_WAIT_TIMEOUT_MS 100
  37. #ifdef IPA_WDI3_TX_TWO_PIPES
  38. #if defined(QCA_WIFI_KIWI) || defined(QCA_WIFI_KIWI_V2)
  39. /* Index into soc->tcl_data_ring[] and soc->tx_comp_ring[] */
  40. #define IPA_TX_ALT_RING_IDX 4
  41. #define IPA_TX_ALT_COMP_RING_IDX IPA_TX_ALT_RING_IDX
  42. #else /* !KIWI */
  43. #define IPA_TX_ALT_RING_IDX 1
  44. /*
  45. * must be same as IPA_TX_ALT_RING_IDX as tcl and wbm ring
  46. * are initialized with same index as a pair.
  47. */
  48. #define IPA_TX_ALT_COMP_RING_IDX 1
  49. #endif /* KIWI */
  50. #define IPA_SESSION_ID_SHIFT 1
  51. #endif /* IPA_WDI3_TX_TWO_PIPES */
  52. /**
  53. * struct dp_ipa_uc_tx_hdr - full tx header registered to IPA hardware
  54. * @eth: ether II header
  55. */
  56. struct dp_ipa_uc_tx_hdr {
  57. struct ethhdr eth;
  58. } __packed;
  59. /**
  60. * struct dp_ipa_uc_tx_vlan_hdr - full tx header registered to IPA hardware
  61. * @eth: ether II header
  62. */
  63. struct dp_ipa_uc_tx_vlan_hdr {
  64. struct vlan_ethhdr eth;
  65. } __packed;
  66. /**
  67. * struct dp_ipa_uc_rx_hdr - full rx header registered to IPA hardware
  68. * @eth: ether II header
  69. */
  70. struct dp_ipa_uc_rx_hdr {
  71. struct ethhdr eth;
  72. } __packed;
  73. #define DP_IPA_UC_WLAN_TX_HDR_LEN sizeof(struct dp_ipa_uc_tx_hdr)
  74. #define DP_IPA_UC_WLAN_TX_VLAN_HDR_LEN sizeof(struct dp_ipa_uc_tx_vlan_hdr)
  75. #define DP_IPA_UC_WLAN_RX_HDR_LEN sizeof(struct dp_ipa_uc_rx_hdr)
  76. /* 28 <bytes of rx_msdu_end_tlv> + 16 <bytes of attn tlv> +
  77. * 52 <bytes of rx_mpdu_start_tlv> + <L2 Header>
  78. */
  79. #define DP_IPA_UC_WLAN_RX_HDR_LEN_AST 110
  80. #define DP_IPA_UC_WLAN_RX_HDR_LEN_AST_VLAN 114
  81. #define DP_IPA_UC_WLAN_HDR_DES_MAC_OFFSET 0
  82. #define DP_IPA_HDL_INVALID 0xFF
  83. #define DP_IPA_HDL_FIRST 0
  84. #define DP_IPA_HDL_SECOND 1
  85. /**
  86. * wlan_ipa_get_hdl() - Get ipa handle from IPA component
  87. * @psoc: control psoc object
  88. * @pdev_id: pdev id
  89. *
  90. * IPA componenet will return the IPA handle based on pdev_id
  91. *
  92. * Return: IPA handle
  93. */
  94. qdf_ipa_wdi_hdl_t wlan_ipa_get_hdl(void *psoc, uint8_t pdev_id);
  95. /**
  96. * dp_ipa_get_resource() - Client request resource information
  97. * @soc_hdl: data path soc handle
  98. * @pdev_id: device instance id
  99. *
  100. * IPA client will request IPA UC related resource information
  101. * Resource information will be distributed to IPA module
  102. * All of the required resources should be pre-allocated
  103. *
  104. * Return: QDF_STATUS
  105. */
  106. QDF_STATUS dp_ipa_get_resource(struct cdp_soc_t *soc_hdl, uint8_t pdev_id);
  107. /**
  108. * dp_ipa_set_doorbell_paddr() - Set doorbell register physical address to SRNG
  109. * @soc_hdl: data path soc handle
  110. * @pdev_id: device instance id
  111. *
  112. * Set TX_COMP_DOORBELL register physical address to WBM Head_Ptr_MemAddr_LSB
  113. * Set RX_READ_DOORBELL register physical address to REO Head_Ptr_MemAddr_LSB
  114. *
  115. * Return: QDF_STATUS
  116. */
  117. QDF_STATUS dp_ipa_set_doorbell_paddr(struct cdp_soc_t *soc_hdl,
  118. uint8_t pdev_id);
  119. /**
  120. * dp_ipa_iounmap_doorbell_vaddr() - unmap ipa RX db vaddr
  121. * @soc_hdl: data path soc handle
  122. * @pdev_id: device instance id
  123. *
  124. * Return: QDF_STATUS
  125. */
  126. QDF_STATUS dp_ipa_iounmap_doorbell_vaddr(struct cdp_soc_t *soc_hdl,
  127. uint8_t pdev_id);
  128. /**
  129. * dp_ipa_op_response() - Handle OP command response from firmware
  130. * @soc_hdl: data path soc handle
  131. * @pdev_id: device instance id
  132. * @op_msg: op response message from firmware
  133. *
  134. * Return: QDF_STATUS
  135. */
  136. QDF_STATUS dp_ipa_op_response(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  137. uint8_t *op_msg);
  138. /**
  139. * dp_ipa_register_op_cb() - Register OP handler function
  140. * @soc_hdl: data path soc handle
  141. * @pdev_id: device instance id
  142. * @op_cb: handler function pointer
  143. * @usr_ctxt: user context passed back to handler function
  144. *
  145. * Return: QDF_STATUS
  146. */
  147. QDF_STATUS dp_ipa_register_op_cb(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  148. ipa_uc_op_cb_type op_cb, void *usr_ctxt);
  149. /**
  150. * dp_ipa_deregister_op_cb() - Deregister OP handler function
  151. * @soc_hdl: data path soc handle
  152. * @pdev_id: device instance id
  153. *
  154. * Return: none
  155. */
  156. void dp_ipa_deregister_op_cb(struct cdp_soc_t *soc_hdl, uint8_t pdev_id);
  157. /**
  158. * dp_ipa_get_stat() - Get firmware wdi status
  159. * @soc_hdl: data path soc handle
  160. * @pdev_id: device instance id
  161. *
  162. * Return: QDF_STATUS
  163. */
  164. QDF_STATUS dp_ipa_get_stat(struct cdp_soc_t *soc_hdl, uint8_t pdev_id);
  165. /**
  166. * dp_tx_send_ipa_data_frame() - send IPA data frame
  167. * @soc_hdl: datapath soc handle
  168. * @vdev_id: virtual device/interface id
  169. * @skb: skb
  170. *
  171. * Return: skb/ NULL is for success
  172. */
  173. qdf_nbuf_t dp_tx_send_ipa_data_frame(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  174. qdf_nbuf_t skb);
  175. /**
  176. * dp_ipa_enable_autonomy() - Enable autonomy RX path
  177. * @soc_hdl: data path soc handle
  178. * @pdev_id: device instance id
  179. *
  180. * Set all RX packet route to IPA REO ring
  181. * Program Destination_Ring_Ctrl_IX_0 REO register to point IPA REO ring
  182. *
  183. * Return: QDF_STATUS
  184. */
  185. QDF_STATUS dp_ipa_enable_autonomy(struct cdp_soc_t *soc_hdl, uint8_t pdev_id);
  186. /**
  187. * dp_ipa_disable_autonomy() - Disable autonomy RX path
  188. * @soc_hdl: data path soc handle
  189. * @pdev_id: device instance id
  190. *
  191. * Disable RX packet routing to IPA REO
  192. * Program Destination_Ring_Ctrl_IX_0 REO register to disable
  193. *
  194. * Return: QDF_STATUS
  195. */
  196. QDF_STATUS dp_ipa_disable_autonomy(struct cdp_soc_t *soc_hdl, uint8_t pdev_id);
  197. #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)) || \
  198. defined(CONFIG_IPA_WDI_UNIFIED_API)
  199. /**
  200. * dp_ipa_setup() - Setup and connect IPA pipes
  201. * @soc_hdl: data path soc handle
  202. * @pdev_id: device instance id
  203. * @ipa_i2w_cb: IPA to WLAN callback
  204. * @ipa_w2i_cb: WLAN to IPA callback
  205. * @ipa_wdi_meter_notifier_cb: IPA WDI metering callback
  206. * @ipa_desc_size: IPA descriptor size
  207. * @ipa_priv: handle to the HTT instance
  208. * @is_rm_enabled: Is IPA RM enabled or not
  209. * @tx_pipe_handle: pointer to Tx pipe handle
  210. * @rx_pipe_handle: pointer to Rx pipe handle
  211. * @is_smmu_enabled: Is SMMU enabled or not
  212. * @sys_in: parameters to setup sys pipe in mcc mode
  213. * @over_gsi:
  214. * @hdl: IPA handle
  215. * @id: IPA instance id
  216. * @ipa_ast_notify_cb: IPA to WLAN callback for ast create and update
  217. *
  218. * Return: QDF_STATUS
  219. */
  220. QDF_STATUS dp_ipa_setup(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  221. void *ipa_i2w_cb, void *ipa_w2i_cb,
  222. void *ipa_wdi_meter_notifier_cb,
  223. uint32_t ipa_desc_size, void *ipa_priv,
  224. bool is_rm_enabled, uint32_t *tx_pipe_handle,
  225. uint32_t *rx_pipe_handle,
  226. bool is_smmu_enabled,
  227. qdf_ipa_sys_connect_params_t *sys_in, bool over_gsi,
  228. qdf_ipa_wdi_hdl_t hdl, qdf_ipa_wdi_hdl_t id,
  229. void *ipa_ast_notify_cb);
  230. #else /* CONFIG_IPA_WDI_UNIFIED_API */
  231. /**
  232. * dp_ipa_setup() - Setup and connect IPA pipes
  233. * @soc_hdl: data path soc handle
  234. * @pdev_id: device instance id
  235. * @ipa_i2w_cb: IPA to WLAN callback
  236. * @ipa_w2i_cb: WLAN to IPA callback
  237. * @ipa_wdi_meter_notifier_cb: IPA WDI metering callback
  238. * @ipa_desc_size: IPA descriptor size
  239. * @ipa_priv: handle to the HTT instance
  240. * @is_rm_enabled: Is IPA RM enabled or not
  241. * @tx_pipe_handle: pointer to Tx pipe handle
  242. * @rx_pipe_handle: pointer to Rx pipe handle
  243. *
  244. * Return: QDF_STATUS
  245. */
  246. QDF_STATUS dp_ipa_setup(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  247. void *ipa_i2w_cb, void *ipa_w2i_cb,
  248. void *ipa_wdi_meter_notifier_cb,
  249. uint32_t ipa_desc_size, void *ipa_priv,
  250. bool is_rm_enabled, uint32_t *tx_pipe_handle,
  251. uint32_t *rx_pipe_handle);
  252. #endif /* CONFIG_IPA_WDI_UNIFIED_API */
  253. /**
  254. * dp_ipa_cleanup() - Disconnect IPA pipes
  255. * @soc_hdl: dp soc handle
  256. * @pdev_id: dp pdev id
  257. * @tx_pipe_handle: Tx pipe handle
  258. * @rx_pipe_handle: Rx pipe handle
  259. * @hdl: IPA handle
  260. *
  261. * Return: QDF_STATUS
  262. */
  263. QDF_STATUS dp_ipa_cleanup(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  264. uint32_t tx_pipe_handle, uint32_t rx_pipe_handle,
  265. qdf_ipa_wdi_hdl_t hdl);
  266. /**
  267. * dp_ipa_setup_iface() - Setup IPA header and register interface
  268. * @ifname: Interface name
  269. * @mac_addr: Interface MAC address
  270. * @prod_client: IPA prod client type
  271. * @cons_client: IPA cons client type
  272. * @session_id: Session ID
  273. * @is_ipv6_enabled: Is IPV6 enabled or not
  274. * @hdl: IPA handle
  275. *
  276. * Return: QDF_STATUS
  277. */
  278. QDF_STATUS dp_ipa_setup_iface(char *ifname, uint8_t *mac_addr,
  279. qdf_ipa_client_type_t prod_client,
  280. qdf_ipa_client_type_t cons_client,
  281. uint8_t session_id, bool is_ipv6_enabled,
  282. qdf_ipa_wdi_hdl_t hdl);
  283. /**
  284. * dp_ipa_cleanup_iface() - Cleanup IPA header and deregister interface
  285. * @ifname: Interface name
  286. * @is_ipv6_enabled: Is IPV6 enabled or not
  287. * @hdl: IPA handle
  288. *
  289. * Return: QDF_STATUS
  290. */
  291. QDF_STATUS dp_ipa_cleanup_iface(char *ifname, bool is_ipv6_enabled,
  292. qdf_ipa_wdi_hdl_t hdl);
  293. /**
  294. * dp_ipa_enable_pipes() - Enable and resume traffic on Tx/Rx pipes
  295. * @soc_hdl: handle to the soc
  296. * @pdev_id: pdev id number, to get the handle
  297. * @hdl: IPA handle
  298. *
  299. * Return: QDF_STATUS
  300. */
  301. QDF_STATUS dp_ipa_enable_pipes(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  302. qdf_ipa_wdi_hdl_t hdl);
  303. /**
  304. * dp_ipa_disable_pipes() - Suspend traffic and disable Tx/Rx pipes
  305. * @soc_hdl: handle to the soc
  306. * @pdev_id: pdev id number, to get the handle
  307. * @hdl: IPA handle
  308. *
  309. * Return: QDF_STATUS
  310. */
  311. QDF_STATUS dp_ipa_disable_pipes(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  312. qdf_ipa_wdi_hdl_t hdl);
  313. /**
  314. * dp_ipa_set_perf_level() - Set IPA clock bandwidth based on data rates
  315. * @client: Client type
  316. * @max_supported_bw_mbps: Maximum bandwidth needed (in Mbps)
  317. * @hdl: IPA handle
  318. *
  319. * Return: QDF_STATUS
  320. */
  321. QDF_STATUS dp_ipa_set_perf_level(int client, uint32_t max_supported_bw_mbps,
  322. qdf_ipa_wdi_hdl_t hdl);
  323. /**
  324. * dp_ipa_rx_intrabss_fwd() - Perform intra-bss fwd for IPA RX path
  325. *
  326. * @soc_hdl: data path soc handle
  327. * @vdev_id: virtual device/interface id
  328. * @nbuf: pointer to skb of ethernet packet received from IPA RX path
  329. * @fwd_success: pointer to indicate if skb succeeded in intra-bss TX
  330. *
  331. * This function performs intra-bss forwarding for WDI 3.0 IPA RX path.
  332. *
  333. * Return: true if packet is intra-bss fwd-ed and no need to pass to
  334. * network stack. false if packet needs to be passed to network stack.
  335. */
  336. bool dp_ipa_rx_intrabss_fwd(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  337. qdf_nbuf_t nbuf, bool *fwd_success);
  338. int dp_ipa_uc_detach(struct dp_soc *soc, struct dp_pdev *pdev);
  339. int dp_ipa_uc_attach(struct dp_soc *soc, struct dp_pdev *pdev);
  340. /**
  341. * dp_ipa_ring_resource_setup() - setup IPA ring resources
  342. * @soc: data path SoC handle
  343. * @pdev:
  344. *
  345. * Return: status
  346. */
  347. int dp_ipa_ring_resource_setup(struct dp_soc *soc,
  348. struct dp_pdev *pdev);
  349. bool dp_reo_remap_config(struct dp_soc *soc, uint32_t *remap0,
  350. uint32_t *remap1, uint32_t *remap2);
  351. bool dp_ipa_is_mdm_platform(void);
  352. /**
  353. * dp_ipa_handle_rx_reo_reinject() - Handle RX REO reinject skb buffer
  354. * @soc: soc
  355. * @nbuf: skb
  356. *
  357. * Return: nbuf if success and otherwise NULL
  358. */
  359. qdf_nbuf_t dp_ipa_handle_rx_reo_reinject(struct dp_soc *soc, qdf_nbuf_t nbuf);
  360. QDF_STATUS dp_ipa_handle_rx_buf_smmu_mapping(struct dp_soc *soc,
  361. qdf_nbuf_t nbuf,
  362. uint32_t size,
  363. bool create,
  364. const char *func,
  365. uint32_t line);
  366. /**
  367. * dp_ipa_tx_buf_smmu_mapping() - Create SMMU mappings for IPA
  368. * allocated TX buffers
  369. * @soc_hdl: handle to the soc
  370. * @pdev_id: pdev id number, to get the handle
  371. * @func: caller function
  372. * @line: line number
  373. *
  374. * Return: QDF_STATUS
  375. */
  376. QDF_STATUS dp_ipa_tx_buf_smmu_mapping(struct cdp_soc_t *soc_hdl,
  377. uint8_t pdev_id, const char *func,
  378. uint32_t line);
  379. /**
  380. * dp_ipa_tx_buf_smmu_unmapping() - Release SMMU mappings for IPA
  381. * allocated TX buffers
  382. * @soc_hdl: handle to the soc
  383. * @pdev_id: pdev id number, to get the handle
  384. * @func: caller function
  385. * @line: line number
  386. *
  387. * Return: QDF_STATUS
  388. */
  389. QDF_STATUS dp_ipa_tx_buf_smmu_unmapping(struct cdp_soc_t *soc_hdl,
  390. uint8_t pdev_id, const char *func,
  391. uint32_t line);
  392. #ifndef QCA_OL_DP_SRNG_LOCK_LESS_ACCESS
  393. static inline void
  394. dp_ipa_rx_buf_smmu_mapping_lock(struct dp_soc *soc)
  395. {
  396. if (soc->ipa_rx_buf_map_lock_initialized)
  397. qdf_spin_lock_bh(&soc->ipa_rx_buf_map_lock);
  398. }
  399. static inline void
  400. dp_ipa_rx_buf_smmu_mapping_unlock(struct dp_soc *soc)
  401. {
  402. if (soc->ipa_rx_buf_map_lock_initialized)
  403. qdf_spin_unlock_bh(&soc->ipa_rx_buf_map_lock);
  404. }
  405. static inline void
  406. dp_ipa_reo_ctx_buf_mapping_lock(struct dp_soc *soc,
  407. uint32_t reo_ring_num)
  408. {
  409. if (!soc->ipa_reo_ctx_lock_required[reo_ring_num])
  410. return;
  411. qdf_spin_lock_bh(&soc->ipa_rx_buf_map_lock);
  412. }
  413. static inline void
  414. dp_ipa_reo_ctx_buf_mapping_unlock(struct dp_soc *soc,
  415. uint32_t reo_ring_num)
  416. {
  417. if (!soc->ipa_reo_ctx_lock_required[reo_ring_num])
  418. return;
  419. qdf_spin_unlock_bh(&soc->ipa_rx_buf_map_lock);
  420. }
  421. #else
  422. static inline void
  423. dp_ipa_rx_buf_smmu_mapping_lock(struct dp_soc *soc)
  424. {
  425. }
  426. static inline void
  427. dp_ipa_rx_buf_smmu_mapping_unlock(struct dp_soc *soc)
  428. {
  429. }
  430. static inline void
  431. dp_ipa_reo_ctx_buf_mapping_lock(struct dp_soc *soc,
  432. uint32_t reo_ring_num)
  433. {
  434. }
  435. static inline void
  436. dp_ipa_reo_ctx_buf_mapping_unlock(struct dp_soc *soc,
  437. uint32_t reo_ring_num)
  438. {
  439. }
  440. #endif
  441. #ifdef IPA_WDS_EASYMESH_FEATURE
  442. /**
  443. * dp_ipa_ast_create() - Create/update AST entry in AST table
  444. * for learning/roaming packets from IPA
  445. * @soc_hdl: data path soc handle
  446. * @data: Structure used for updating the AST table
  447. *
  448. * Create/update AST entry in AST table for learning/roaming packets from IPA
  449. *
  450. * Return: QDF_STATUS
  451. */
  452. QDF_STATUS dp_ipa_ast_create(struct cdp_soc_t *soc_hdl,
  453. qdf_ipa_ast_info_type_t *data);
  454. /**
  455. * dp_ipa_ast_notify_cb() - Provide ast notify cb to IPA
  456. * @pipe_in: WDI conn pipe in params
  457. * @ipa_ast_notify_cb: ipa ast notify cb
  458. *
  459. * Return: None
  460. */
  461. static inline void
  462. dp_ipa_ast_notify_cb(qdf_ipa_wdi_conn_in_params_t *pipe_in,
  463. void *ipa_ast_notify_cb)
  464. {
  465. QDF_IPA_WDI_CONN_IN_PARAMS_AST_NOTIFY(pipe_in) = ipa_ast_notify_cb;
  466. }
  467. #else
  468. static inline void
  469. dp_ipa_ast_notify_cb(qdf_ipa_wdi_conn_in_params_t *pipe_in,
  470. void *ipa_ast_notify_cb)
  471. {
  472. }
  473. #endif
  474. #ifdef IPA_OPT_WIFI_DP
  475. static inline void dp_ipa_opt_dp_ixo_remap(uint8_t *ix0_map)
  476. {
  477. ix0_map[0] = REO_REMAP_SW1;
  478. ix0_map[1] = REO_REMAP_SW1;
  479. ix0_map[2] = REO_REMAP_SW2;
  480. ix0_map[3] = REO_REMAP_SW3;
  481. ix0_map[4] = REO_REMAP_SW4;
  482. ix0_map[5] = REO_REMAP_RELEASE;
  483. ix0_map[6] = REO_REMAP_FW;
  484. ix0_map[7] = REO_REMAP_FW;
  485. }
  486. #else
  487. static inline void dp_ipa_opt_dp_ixo_remap(uint8_t *ix0_map)
  488. {
  489. }
  490. #endif
  491. #ifdef QCA_ENHANCED_STATS_SUPPORT
  492. /**
  493. * dp_ipa_txrx_get_peer_stats - fetch peer stats
  494. * @soc: soc handle
  495. * @vdev_id: id of vdev handle
  496. * @peer_mac: peer mac address
  497. * @peer_stats: buffer to hold peer stats
  498. *
  499. * Return: status success/failure
  500. */
  501. QDF_STATUS dp_ipa_txrx_get_peer_stats(struct cdp_soc_t *soc, uint8_t vdev_id,
  502. uint8_t *peer_mac,
  503. struct cdp_peer_stats *peer_stats);
  504. /**
  505. * dp_ipa_txrx_get_vdev_stats - fetch vdev stats
  506. * @soc_hdl: soc handle
  507. * @vdev_id: id of vdev handle
  508. * @buf: buffer to hold vdev stats
  509. * @is_aggregate: for aggregation
  510. *
  511. * Return: int
  512. */
  513. int dp_ipa_txrx_get_vdev_stats(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  514. void *buf, bool is_aggregate);
  515. /**
  516. * dp_ipa_txrx_get_pdev_stats() - fetch pdev stats
  517. * @soc: DP soc handle
  518. * @pdev_id: id of DP pdev handle
  519. * @pdev_stats: buffer to hold pdev stats
  520. *
  521. * Return: status success/failure
  522. */
  523. QDF_STATUS dp_ipa_txrx_get_pdev_stats(struct cdp_soc_t *soc, uint8_t pdev_id,
  524. struct cdp_pdev_stats *pdev_stats);
  525. /**
  526. * dp_ipa_update_peer_rx_stats() - update peer rx stats
  527. * @soc: soc handle
  528. * @vdev_id: vdev id
  529. * @peer_mac: Peer Mac Address
  530. * @nbuf: data nbuf
  531. *
  532. * Return: status success/failure
  533. */
  534. QDF_STATUS dp_ipa_update_peer_rx_stats(struct cdp_soc_t *soc, uint8_t vdev_id,
  535. uint8_t *peer_mac, qdf_nbuf_t nbuf);
  536. #endif
  537. #else
  538. static inline int dp_ipa_uc_detach(struct dp_soc *soc, struct dp_pdev *pdev)
  539. {
  540. return QDF_STATUS_SUCCESS;
  541. }
  542. static inline int dp_ipa_uc_attach(struct dp_soc *soc, struct dp_pdev *pdev)
  543. {
  544. return QDF_STATUS_SUCCESS;
  545. }
  546. static inline int dp_ipa_ring_resource_setup(struct dp_soc *soc,
  547. struct dp_pdev *pdev)
  548. {
  549. return 0;
  550. }
  551. static inline QDF_STATUS dp_ipa_handle_rx_buf_smmu_mapping(struct dp_soc *soc,
  552. qdf_nbuf_t nbuf,
  553. uint32_t size,
  554. bool create,
  555. const char *func,
  556. uint32_t line)
  557. {
  558. return QDF_STATUS_SUCCESS;
  559. }
  560. static inline void
  561. dp_ipa_rx_buf_smmu_mapping_lock(struct dp_soc *soc)
  562. {
  563. }
  564. static inline void
  565. dp_ipa_rx_buf_smmu_mapping_unlock(struct dp_soc *soc)
  566. {
  567. }
  568. static inline void
  569. dp_ipa_reo_ctx_buf_mapping_lock(struct dp_soc *soc,
  570. uint32_t reo_ring_num)
  571. {
  572. }
  573. static inline void
  574. dp_ipa_reo_ctx_buf_mapping_unlock(struct dp_soc *soc,
  575. uint32_t reo_ring_num)
  576. {
  577. }
  578. static inline qdf_nbuf_t dp_ipa_handle_rx_reo_reinject(struct dp_soc *soc,
  579. qdf_nbuf_t nbuf)
  580. {
  581. return nbuf;
  582. }
  583. static inline QDF_STATUS dp_ipa_tx_buf_smmu_mapping(struct cdp_soc_t *soc_hdl,
  584. uint8_t pdev_id,
  585. const char *func,
  586. uint32_t line)
  587. {
  588. return QDF_STATUS_SUCCESS;
  589. }
  590. static inline QDF_STATUS dp_ipa_tx_buf_smmu_unmapping(struct cdp_soc_t *soc_hdl,
  591. uint8_t pdev_id,
  592. const char *func,
  593. uint32_t line)
  594. {
  595. return QDF_STATUS_SUCCESS;
  596. }
  597. #ifdef IPA_WDS_EASYMESH_FEATURE
  598. static inline QDF_STATUS dp_ipa_ast_create(struct cdp_soc_t *soc_hdl,
  599. qdf_ipa_ast_info_type_t *data)
  600. {
  601. return QDF_STATUS_SUCCESS;
  602. }
  603. #endif
  604. #endif
  605. #endif /* _DP_IPA_H_ */