dp_ipa.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694
  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 componenet 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. #ifndef QCA_OL_DP_SRNG_LOCK_LESS_ACCESS
  403. static inline void
  404. dp_ipa_rx_buf_smmu_mapping_lock(struct dp_soc *soc)
  405. {
  406. if (soc->ipa_rx_buf_map_lock_initialized)
  407. qdf_spin_lock_bh(&soc->ipa_rx_buf_map_lock);
  408. }
  409. static inline void
  410. dp_ipa_rx_buf_smmu_mapping_unlock(struct dp_soc *soc)
  411. {
  412. if (soc->ipa_rx_buf_map_lock_initialized)
  413. qdf_spin_unlock_bh(&soc->ipa_rx_buf_map_lock);
  414. }
  415. static inline void
  416. dp_ipa_reo_ctx_buf_mapping_lock(struct dp_soc *soc,
  417. uint32_t reo_ring_num)
  418. {
  419. if (!soc->ipa_reo_ctx_lock_required[reo_ring_num])
  420. return;
  421. qdf_spin_lock_bh(&soc->ipa_rx_buf_map_lock);
  422. }
  423. static inline void
  424. dp_ipa_reo_ctx_buf_mapping_unlock(struct dp_soc *soc,
  425. uint32_t reo_ring_num)
  426. {
  427. if (!soc->ipa_reo_ctx_lock_required[reo_ring_num])
  428. return;
  429. qdf_spin_unlock_bh(&soc->ipa_rx_buf_map_lock);
  430. }
  431. #else
  432. static inline void
  433. dp_ipa_rx_buf_smmu_mapping_lock(struct dp_soc *soc)
  434. {
  435. }
  436. static inline void
  437. dp_ipa_rx_buf_smmu_mapping_unlock(struct dp_soc *soc)
  438. {
  439. }
  440. static inline void
  441. dp_ipa_reo_ctx_buf_mapping_lock(struct dp_soc *soc,
  442. uint32_t reo_ring_num)
  443. {
  444. }
  445. static inline void
  446. dp_ipa_reo_ctx_buf_mapping_unlock(struct dp_soc *soc,
  447. uint32_t reo_ring_num)
  448. {
  449. }
  450. #endif
  451. #ifdef IPA_WDS_EASYMESH_FEATURE
  452. /**
  453. * dp_ipa_ast_create() - Create/update AST entry in AST table
  454. * for learning/roaming packets from IPA
  455. * @soc_hdl: data path soc handle
  456. * @data: Structure used for updating the AST table
  457. *
  458. * Create/update AST entry in AST table for learning/roaming packets from IPA
  459. *
  460. * Return: QDF_STATUS
  461. */
  462. QDF_STATUS dp_ipa_ast_create(struct cdp_soc_t *soc_hdl,
  463. qdf_ipa_ast_info_type_t *data);
  464. /**
  465. * dp_ipa_ast_notify_cb() - Provide ast notify cb to IPA
  466. * @pipe_in: WDI conn pipe in params
  467. * @ipa_ast_notify_cb: ipa ast notify cb
  468. *
  469. * Return: None
  470. */
  471. static inline void
  472. dp_ipa_ast_notify_cb(qdf_ipa_wdi_conn_in_params_t *pipe_in,
  473. void *ipa_ast_notify_cb)
  474. {
  475. QDF_IPA_WDI_CONN_IN_PARAMS_AST_NOTIFY(pipe_in) = ipa_ast_notify_cb;
  476. }
  477. #else
  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. }
  483. #endif
  484. #ifdef IPA_OPT_WIFI_DP
  485. static inline void dp_ipa_opt_dp_ixo_remap(uint8_t *ix0_map)
  486. {
  487. ix0_map[0] = REO_REMAP_SW1;
  488. ix0_map[1] = REO_REMAP_SW1;
  489. ix0_map[2] = REO_REMAP_SW2;
  490. ix0_map[3] = REO_REMAP_SW3;
  491. ix0_map[4] = REO_REMAP_SW4;
  492. ix0_map[5] = REO_REMAP_RELEASE;
  493. ix0_map[6] = REO_REMAP_FW;
  494. ix0_map[7] = REO_REMAP_FW;
  495. }
  496. #else
  497. static inline void dp_ipa_opt_dp_ixo_remap(uint8_t *ix0_map)
  498. {
  499. }
  500. #endif
  501. #ifdef QCA_ENHANCED_STATS_SUPPORT
  502. /**
  503. * dp_ipa_txrx_get_peer_stats - fetch peer stats
  504. * @soc: soc handle
  505. * @vdev_id: id of vdev handle
  506. * @peer_mac: peer mac address
  507. * @peer_stats: buffer to hold peer stats
  508. *
  509. * Return: status success/failure
  510. */
  511. QDF_STATUS dp_ipa_txrx_get_peer_stats(struct cdp_soc_t *soc, uint8_t vdev_id,
  512. uint8_t *peer_mac,
  513. struct cdp_peer_stats *peer_stats);
  514. /**
  515. * dp_ipa_txrx_get_vdev_stats - fetch vdev stats
  516. * @soc_hdl: soc handle
  517. * @vdev_id: id of vdev handle
  518. * @buf: buffer to hold vdev stats
  519. * @is_aggregate: for aggregation
  520. *
  521. * Return: int
  522. */
  523. int dp_ipa_txrx_get_vdev_stats(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  524. void *buf, bool is_aggregate);
  525. /**
  526. * dp_ipa_txrx_get_pdev_stats() - fetch pdev stats
  527. * @soc: DP soc handle
  528. * @pdev_id: id of DP pdev handle
  529. * @pdev_stats: buffer to hold pdev stats
  530. *
  531. * Return: status success/failure
  532. */
  533. QDF_STATUS dp_ipa_txrx_get_pdev_stats(struct cdp_soc_t *soc, uint8_t pdev_id,
  534. struct cdp_pdev_stats *pdev_stats);
  535. /**
  536. * dp_ipa_update_peer_rx_stats() - update peer rx stats
  537. * @soc: soc handle
  538. * @vdev_id: vdev id
  539. * @peer_mac: Peer Mac Address
  540. * @nbuf: data nbuf
  541. *
  542. * Return: status success/failure
  543. */
  544. QDF_STATUS dp_ipa_update_peer_rx_stats(struct cdp_soc_t *soc, uint8_t vdev_id,
  545. uint8_t *peer_mac, qdf_nbuf_t nbuf);
  546. #endif
  547. /**
  548. * dp_ipa_get_wdi_version() - Get WDI version
  549. * @soc_hdl: data path soc handle
  550. * @wdi_ver: Out parameter for wdi version
  551. *
  552. * Get WDI version based on soc arch
  553. *
  554. * Return: None
  555. */
  556. void dp_ipa_get_wdi_version(struct cdp_soc_t *soc_hdl, uint8_t *wdi_ver);
  557. #else
  558. static inline int dp_ipa_uc_detach(struct dp_soc *soc, struct dp_pdev *pdev)
  559. {
  560. return QDF_STATUS_SUCCESS;
  561. }
  562. static inline int dp_ipa_uc_attach(struct dp_soc *soc, struct dp_pdev *pdev)
  563. {
  564. return QDF_STATUS_SUCCESS;
  565. }
  566. static inline int dp_ipa_ring_resource_setup(struct dp_soc *soc,
  567. struct dp_pdev *pdev)
  568. {
  569. return 0;
  570. }
  571. static inline QDF_STATUS dp_ipa_handle_rx_buf_smmu_mapping(struct dp_soc *soc,
  572. qdf_nbuf_t nbuf,
  573. uint32_t size,
  574. bool create,
  575. const char *func,
  576. uint32_t line)
  577. {
  578. return QDF_STATUS_SUCCESS;
  579. }
  580. static inline void
  581. dp_ipa_rx_buf_smmu_mapping_lock(struct dp_soc *soc)
  582. {
  583. }
  584. static inline void
  585. dp_ipa_rx_buf_smmu_mapping_unlock(struct dp_soc *soc)
  586. {
  587. }
  588. static inline void
  589. dp_ipa_reo_ctx_buf_mapping_lock(struct dp_soc *soc,
  590. uint32_t reo_ring_num)
  591. {
  592. }
  593. static inline void
  594. dp_ipa_reo_ctx_buf_mapping_unlock(struct dp_soc *soc,
  595. uint32_t reo_ring_num)
  596. {
  597. }
  598. static inline qdf_nbuf_t dp_ipa_handle_rx_reo_reinject(struct dp_soc *soc,
  599. qdf_nbuf_t nbuf)
  600. {
  601. return nbuf;
  602. }
  603. static inline QDF_STATUS dp_ipa_tx_buf_smmu_mapping(struct cdp_soc_t *soc_hdl,
  604. uint8_t pdev_id,
  605. const char *func,
  606. uint32_t line)
  607. {
  608. return QDF_STATUS_SUCCESS;
  609. }
  610. static inline QDF_STATUS dp_ipa_tx_buf_smmu_unmapping(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. #ifdef IPA_WDS_EASYMESH_FEATURE
  618. static inline QDF_STATUS dp_ipa_ast_create(struct cdp_soc_t *soc_hdl,
  619. qdf_ipa_ast_info_type_t *data)
  620. {
  621. return QDF_STATUS_SUCCESS;
  622. }
  623. #endif
  624. static inline void dp_ipa_get_wdi_version(struct cdp_soc_t *soc_hdl,
  625. uint8_t *wdi_ver)
  626. {
  627. }
  628. #endif
  629. #endif /* _DP_IPA_H_ */