dp_ipa.h 20 KB

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