dp_ipa.h 19 KB

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