dp_ipa.h 19 KB

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