dp_rings.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774
  1. /*
  2. * Copyright (c) 2016-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
  6. * any purpose with or without fee is hereby granted, provided that the
  7. * above copyright notice and this permission notice appear in all
  8. * copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  11. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  12. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  13. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  14. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  15. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  16. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  17. * PERFORMANCE OF THIS SOFTWARE.
  18. */
  19. #ifndef _DP_RINGS_H_
  20. #define _DP_RINGS_H_
  21. #include <dp_types.h>
  22. #include <dp_internal.h>
  23. #ifdef WIFI_MONITOR_SUPPORT
  24. #include <dp_mon.h>
  25. #endif
  26. #ifndef QCA_HOST_MODE_WIFI_DISABLED
  27. /**
  28. * dp_srng_get_cpu() - Get the smp processor id for srng processing
  29. *
  30. * Return: smp processor id
  31. */
  32. static inline int dp_srng_get_cpu(void)
  33. {
  34. return smp_processor_id();
  35. }
  36. #else /* QCA_HOST_MODE_WIFI_DISABLED */
  37. /**
  38. * dp_srng_get_cpu() - Get the smp processor id for srng processing
  39. *
  40. * Return: smp processor id
  41. */
  42. static inline int dp_srng_get_cpu(void)
  43. {
  44. return 0;
  45. }
  46. #endif /* QCA_HOST_MODE_WIFI_DISABLED */
  47. /**
  48. * dp_interrupt_timer() - timer poll for interrupts
  49. * @arg: SoC Handle
  50. *
  51. * Return:
  52. *
  53. */
  54. void dp_interrupt_timer(void *arg);
  55. /**
  56. * dp_soc_print_inactive_objects() - prints inactive peer and vdev list
  57. * @soc: DP SOC handle
  58. *
  59. */
  60. void dp_soc_print_inactive_objects(struct dp_soc *soc);
  61. /**
  62. * dp_get_tx_pending() - read pending tx
  63. * @pdev_handle: Datapath PDEV handle
  64. *
  65. * Return: outstanding tx
  66. */
  67. int32_t dp_get_tx_pending(struct cdp_pdev *pdev_handle);
  68. /**
  69. * dp_find_missing_tx_comp() - check for leaked descriptor in tx path
  70. * @soc: DP SOC context
  71. *
  72. * Parse through descriptors in all pools and validate magic number and
  73. * completion time. Trigger self recovery if magic value is corrupted.
  74. *
  75. * Return: None.
  76. */
  77. void dp_find_missing_tx_comp(struct dp_soc *soc);
  78. void dp_enable_verbose_debug(struct dp_soc *soc);
  79. QDF_STATUS dp_peer_legacy_setup(struct dp_soc *soc, struct dp_peer *peer);
  80. #ifndef WLAN_SOFTUMAC_SUPPORT
  81. /**
  82. * dp_service_lmac_rings()- timer to reap lmac rings
  83. * @arg: SoC Handle
  84. *
  85. * Return:
  86. *
  87. */
  88. void dp_service_lmac_rings(void *arg);
  89. /**
  90. * dp_service_srngs() - Top level interrupt handler for DP Ring interrupts
  91. * @dp_ctx: DP SOC handle
  92. * @dp_budget: Number of frames/descriptors that can be processed in one shot
  93. * @cpu: CPU on which this instance is running
  94. *
  95. * Return: remaining budget/quota for the soc device
  96. */
  97. uint32_t dp_service_srngs(void *dp_ctx, uint32_t dp_budget, int cpu);
  98. /**
  99. * dp_soc_attach_poll() - Register handlers for DP interrupts
  100. * @txrx_soc: DP SOC handle
  101. *
  102. * Host driver will register for “DP_NUM_INTERRUPT_CONTEXTS” number of NAPI
  103. * contexts. Each NAPI context will have a tx_ring_mask , rx_ring_mask ,and
  104. * rx_monitor_ring mask to indicate the rings that are processed by the handler.
  105. *
  106. * Return: 0 for success, nonzero for failure.
  107. */
  108. QDF_STATUS dp_soc_attach_poll(struct cdp_soc_t *txrx_soc);
  109. /**
  110. * dp_soc_interrupt_attach() - Register handlers for DP interrupts
  111. * @txrx_soc: DP SOC handle
  112. *
  113. * Host driver will register for “DP_NUM_INTERRUPT_CONTEXTS” number of NAPI
  114. * contexts. Each NAPI context will have a tx_ring_mask , rx_ring_mask ,and
  115. * rx_monitor_ring mask to indicate the rings that are processed by the handler.
  116. *
  117. * Return: 0 for success. nonzero for failure.
  118. */
  119. QDF_STATUS dp_soc_interrupt_attach(struct cdp_soc_t *txrx_soc);
  120. /**
  121. * dp_hw_link_desc_ring_free() - Free h/w link desc rings
  122. * @soc: DP SOC handle
  123. *
  124. * Return: none
  125. */
  126. void dp_hw_link_desc_ring_free(struct dp_soc *soc);
  127. /**
  128. * dp_hw_link_desc_ring_alloc() - Allocate hw link desc rings
  129. * @soc: DP SOC handle
  130. *
  131. * Allocate memory for WBM_IDLE_LINK srng ring if the number of
  132. * link descriptors is less then the max_allocated size. else
  133. * allocate memory for wbm_idle_scatter_buffer.
  134. *
  135. * Return: QDF_STATUS_SUCCESS: success
  136. * QDF_STATUS_E_NO_MEM: No memory (Failure)
  137. */
  138. QDF_STATUS dp_hw_link_desc_ring_alloc(struct dp_soc *soc);
  139. /**
  140. * dp_hw_link_desc_ring_init() - Initialize hw link desc rings
  141. * @soc: DP SOC handle
  142. *
  143. * Return: QDF_STATUS_SUCCESS: success
  144. * QDF_STATUS_E_FAILURE: failure
  145. */
  146. QDF_STATUS dp_hw_link_desc_ring_init(struct dp_soc *soc);
  147. /**
  148. * dp_hw_link_desc_ring_deinit() - Reset hw link desc rings
  149. * @soc: DP SOC handle
  150. *
  151. * Return: None
  152. */
  153. void dp_hw_link_desc_ring_deinit(struct dp_soc *soc);
  154. /**
  155. * dp_ipa_hal_tx_init_alt_data_ring() - IPA hal init data rings
  156. * @soc: DP SOC handle
  157. *
  158. * Return: None
  159. */
  160. void dp_ipa_hal_tx_init_alt_data_ring(struct dp_soc *soc);
  161. /*
  162. * dp_soc_reset_ring_map() - Reset cpu ring map
  163. * @soc: Datapath soc handler
  164. *
  165. * This api resets the default cpu ring map
  166. */
  167. void dp_soc_reset_cpu_ring_map(struct dp_soc *soc);
  168. /*
  169. * dp_soc_reset_ipa_vlan_intr_mask() - reset interrupt mask for IPA offloaded
  170. * ring for vlan tagged traffic
  171. * @dp_soc - DP Soc handle
  172. *
  173. * Return: Return void
  174. */
  175. void dp_soc_reset_ipa_vlan_intr_mask(struct dp_soc *soc);
  176. /*
  177. * dp_soc_reset_intr_mask() - reset interrupt mask
  178. * @dp_soc - DP Soc handle
  179. *
  180. * Return: Return void
  181. */
  182. void dp_soc_reset_intr_mask(struct dp_soc *soc);
  183. /*
  184. * dp_reo_frag_dst_set() - configure reo register to set the
  185. * fragment destination ring
  186. * @soc : Datapath soc
  187. * @frag_dst_ring : output parameter to set fragment destination ring
  188. *
  189. * Based on offload_radio below fragment destination rings is selected
  190. * 0 - TCL
  191. * 1 - SW1
  192. * 2 - SW2
  193. * 3 - SW3
  194. * 4 - SW4
  195. * 5 - Release
  196. * 6 - FW
  197. * 7 - alternate select
  198. *
  199. * return: void
  200. */
  201. void dp_reo_frag_dst_set(struct dp_soc *soc, uint8_t *frag_dst_ring);
  202. /**
  203. * dp_dscp_tid_map_setup(): Initialize the dscp-tid maps
  204. * @pdev: DP_PDEV handle
  205. *
  206. * Return: void
  207. */
  208. void
  209. dp_dscp_tid_map_setup(struct dp_pdev *pdev);
  210. /**
  211. * dp_pcp_tid_map_setup(): Initialize the pcp-tid maps
  212. * @pdev: DP_PDEV handle
  213. *
  214. * Return: void
  215. */
  216. void
  217. dp_pcp_tid_map_setup(struct dp_pdev *pdev);
  218. /**
  219. * dp_soc_deinit() - Deinitialize txrx SOC
  220. * @txrx_soc: Opaque DP SOC handle
  221. *
  222. * Return: None
  223. */
  224. void dp_soc_deinit(void *txrx_soc);
  225. #ifdef QCA_HOST2FW_RXBUF_RING
  226. void
  227. dp_htt_setup_rxdma_err_dst_ring(struct dp_soc *soc, int mac_id,
  228. int lmac_id);
  229. #endif
  230. /*
  231. * dp_peer_setup_wifi3() - initialize the peer
  232. * @soc_hdl: soc handle object
  233. * @vdev_id : vdev_id of vdev object
  234. * @peer_mac: Peer's mac address
  235. * @peer_setup_info: peer setup info for MLO
  236. *
  237. * Return: QDF_STATUS
  238. */
  239. QDF_STATUS
  240. dp_peer_setup_wifi3(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  241. uint8_t *peer_mac,
  242. struct cdp_peer_setup_info *setup_info);
  243. uint32_t dp_get_tx_rings_grp_bitmap(struct cdp_soc_t *soc_hdl);
  244. /*
  245. * dp_set_ba_aging_timeout() - set ba aging timeout per AC
  246. * @txrx_soc: cdp soc handle
  247. * @ac: Access category
  248. * @value: timeout value in millisec
  249. *
  250. * Return: void
  251. */
  252. void dp_set_ba_aging_timeout(struct cdp_soc_t *txrx_soc,
  253. uint8_t ac, uint32_t value);
  254. /*
  255. * dp_get_ba_aging_timeout() - get ba aging timeout per AC
  256. * @txrx_soc: cdp soc handle
  257. * @ac: access category
  258. * @value: timeout value in millisec
  259. *
  260. * Return: void
  261. */
  262. void dp_get_ba_aging_timeout(struct cdp_soc_t *txrx_soc,
  263. uint8_t ac, uint32_t *value);
  264. /*
  265. * dp_set_pdev_reo_dest() - set the reo destination ring for this pdev
  266. * @txrx_soc: cdp soc handle
  267. * @pdev_id: id of physical device object
  268. * @val: reo destination ring index (1 - 4)
  269. *
  270. * Return: QDF_STATUS
  271. */
  272. QDF_STATUS
  273. dp_set_pdev_reo_dest(struct cdp_soc_t *txrx_soc, uint8_t pdev_id,
  274. enum cdp_host_reo_dest_ring val);
  275. /*
  276. * dp_get_pdev_reo_dest() - get the reo destination for this pdev
  277. * @txrx_soc: cdp soc handle
  278. * @pdev_id: id of physical device object
  279. *
  280. * Return: reo destination ring index
  281. */
  282. enum cdp_host_reo_dest_ring
  283. dp_get_pdev_reo_dest(struct cdp_soc_t *txrx_soc, uint8_t pdev_id);
  284. /**
  285. * dp_set_pdev_pcp_tid_map_wifi3(): update pcp tid map in pdev
  286. * @psoc: dp soc handle
  287. * @pdev_id: id of DP_PDEV handle
  288. * @pcp: pcp value
  289. * @tid: tid value passed by the user
  290. *
  291. * Return: QDF_STATUS_SUCCESS on success
  292. */
  293. QDF_STATUS dp_set_pdev_pcp_tid_map_wifi3(ol_txrx_soc_handle psoc,
  294. uint8_t pdev_id,
  295. uint8_t pcp, uint8_t tid);
  296. /**
  297. * dp_set_vdev_pcp_tid_map_wifi3(): update pcp tid map in vdev
  298. * @soc_hdl: DP soc handle
  299. * @vdev_id: id of DP_VDEV handle
  300. * @pcp: pcp value
  301. * @tid: tid value passed by the user
  302. *
  303. * Return: QDF_STATUS_SUCCESS on success
  304. */
  305. QDF_STATUS dp_set_vdev_pcp_tid_map_wifi3(struct cdp_soc_t *soc_hdl,
  306. uint8_t vdev_id,
  307. uint8_t pcp, uint8_t tid);
  308. /* *
  309. * dp_dump_wbm_idle_hptp() -dump wbm idle ring, hw hp tp info.
  310. * @soc: dp soc.
  311. * @pdev: dp pdev.
  312. *
  313. * Return: None.
  314. */
  315. void
  316. dp_dump_wbm_idle_hptp(struct dp_soc *soc, struct dp_pdev *pdev);
  317. /**
  318. * dp_display_srng_info() - Dump the srng HP TP info
  319. * @soc_hdl: CDP Soc handle
  320. *
  321. * This function dumps the SW hp/tp values for the important rings.
  322. * HW hp/tp values are not being dumped, since it can lead to
  323. * READ NOC error when UMAC is in low power state. MCC does not have
  324. * device force wake working yet.
  325. *
  326. * Return: none
  327. */
  328. void dp_display_srng_info(struct cdp_soc_t *soc_hdl);
  329. #if defined(DP_POWER_SAVE) || defined(FEATURE_RUNTIME_PM)
  330. /**
  331. * dp_flush_ring_hptp() - Update ring shadow
  332. * register HP/TP address when runtime
  333. * resume
  334. * @soc: DP soc context
  335. * @hal_srng: HAL srng context
  336. *
  337. * Return: None
  338. */
  339. void dp_flush_ring_hptp(struct dp_soc *soc, hal_ring_handle_t hal_srng);
  340. void dp_drain_txrx(struct cdp_soc_t *soc_handle);
  341. #ifdef FEATURE_RUNTIME_PM
  342. /**
  343. * dp_runtime_suspend() - ensure DP is ready to runtime suspend
  344. * @soc_hdl: Datapath soc handle
  345. * @pdev_id: id of data path pdev handle
  346. *
  347. * DP is ready to runtime suspend if there are no pending TX packets.
  348. *
  349. * Return: QDF_STATUS
  350. */
  351. QDF_STATUS dp_runtime_suspend(struct cdp_soc_t *soc_hdl, uint8_t pdev_id);
  352. /**
  353. * dp_runtime_resume() - ensure DP is ready to runtime resume
  354. * @soc_hdl: Datapath soc handle
  355. * @pdev_id: id of data path pdev handle
  356. *
  357. * Resume DP for runtime PM.
  358. *
  359. * Return: QDF_STATUS
  360. */
  361. QDF_STATUS dp_runtime_resume(struct cdp_soc_t *soc_hdl, uint8_t pdev_id);
  362. #endif
  363. #endif
  364. #ifdef WLAN_FEATURE_STATS_EXT
  365. /**
  366. * dp_request_rx_hw_stats - request rx hardware stats
  367. * @soc_hdl: soc handle
  368. * @vdev_id: vdev id
  369. *
  370. * Return: None
  371. */
  372. QDF_STATUS
  373. dp_request_rx_hw_stats(struct cdp_soc_t *soc_hdl, uint8_t vdev_id);
  374. #endif
  375. /**
  376. * dp_reset_rx_hw_ext_stats - Reset rx hardware ext stats
  377. * @soc_hdl: soc handle
  378. *
  379. * Return: None
  380. */
  381. void dp_reset_rx_hw_ext_stats(struct cdp_soc_t *soc_hdl);
  382. void dp_pdev_set_default_reo(struct dp_pdev *pdev);
  383. /**
  384. * dp_soc_init() - Initialize txrx SOC
  385. * @soc: Opaque DP SOC handle
  386. * @htc_handle: Opaque HTC handle
  387. * @hif_handle: Opaque HIF handle
  388. *
  389. * Return: DP SOC handle on success, NULL on failure
  390. */
  391. void *dp_soc_init(struct dp_soc *soc, HTC_HANDLE htc_handle,
  392. struct hif_opaque_softc *hif_handle);
  393. void dp_tx_init_cmd_credit_ring(struct dp_soc *soc);
  394. /**
  395. * dp_soc_srng_deinit() - de-initialize soc srng rings
  396. * @soc: Datapath soc handle
  397. *
  398. */
  399. void dp_soc_srng_deinit(struct dp_soc *soc);
  400. /**
  401. * dp_soc_srng_init() - Initialize soc level srng rings
  402. * @soc: Datapath soc handle
  403. *
  404. * return: QDF_STATUS_SUCCESS on success
  405. * QDF_STATUS_E_FAILURE on failure
  406. */
  407. QDF_STATUS dp_soc_srng_init(struct dp_soc *soc);
  408. /**
  409. * dp_soc_srng_free() - free soc level srng rings
  410. * @soc: Datapath soc handle
  411. *
  412. */
  413. void dp_soc_srng_free(struct dp_soc *soc);
  414. /**
  415. * dp_soc_srng_alloc() - Allocate memory for soc level srng rings
  416. * @soc: Datapath soc handle
  417. *
  418. * return: QDF_STATUS_SUCCESS on success
  419. * QDF_STATUS_E_NOMEM on failure
  420. */
  421. QDF_STATUS dp_soc_srng_alloc(struct dp_soc *soc);
  422. /**
  423. * dp_soc_cfg_attach() - set target specific configuration in
  424. * dp soc cfg.
  425. * @soc: dp soc handle
  426. */
  427. void dp_soc_cfg_attach(struct dp_soc *soc);
  428. /**
  429. * dp_soc_set_interrupt_mode() - Set the interrupt mode in soc
  430. * @soc: DP soc handle
  431. *
  432. * Set the appropriate interrupt mode flag in the soc
  433. */
  434. void dp_soc_set_interrupt_mode(struct dp_soc *soc);
  435. #else /* WLAN_SOFTUMAC_SUPPORT */
  436. static inline void dp_service_lmac_rings(void *arg)
  437. {
  438. }
  439. static inline
  440. uint32_t dp_service_srngs(void *dp_ctx, uint32_t dp_budget, int cpu)
  441. {
  442. return 0;
  443. }
  444. static inline void dp_soc_interrupt_detach(struct cdp_soc_t *txrx_soc)
  445. {
  446. struct dp_soc *soc = (struct dp_soc *)txrx_soc;
  447. if (soc->intr_mode == DP_INTR_POLL)
  448. qdf_timer_free(&soc->int_timer);
  449. qdf_mem_set(&soc->mon_intr_id_lmac_map,
  450. sizeof(soc->mon_intr_id_lmac_map),
  451. DP_MON_INVALID_LMAC_ID);
  452. }
  453. /*
  454. * dp_soc_interrupt_attach() - Register handlers for DP interrupts
  455. * @txrx_soc: DP SOC handle
  456. *
  457. * Host driver will register for “DP_NUM_INTERRUPT_CONTEXTS” number of NAPI
  458. * contexts. Each NAPI context will have a tx_ring_mask , rx_ring_mask ,and
  459. * rx_monitor_ring mask to indicate the rings that are processed by the handler.
  460. *
  461. * Return: 0 for success. nonzero for failure.
  462. */
  463. static inline QDF_STATUS dp_soc_interrupt_attach(struct cdp_soc_t *txrx_soc)
  464. {
  465. struct dp_soc *soc = (struct dp_soc *)txrx_soc;
  466. qdf_mem_set(&soc->mon_intr_id_lmac_map,
  467. sizeof(soc->mon_intr_id_lmac_map),
  468. DP_MON_INVALID_LMAC_ID);
  469. return QDF_STATUS_SUCCESS;
  470. }
  471. static inline void dp_hw_link_desc_ring_free(struct dp_soc *soc)
  472. {
  473. }
  474. static inline QDF_STATUS dp_hw_link_desc_ring_alloc(struct dp_soc *soc)
  475. {
  476. return QDF_STATUS_SUCCESS;
  477. }
  478. static inline QDF_STATUS dp_hw_link_desc_ring_init(struct dp_soc *soc)
  479. {
  480. return QDF_STATUS_SUCCESS;
  481. }
  482. static inline void dp_hw_link_desc_ring_deinit(struct dp_soc *soc)
  483. {
  484. }
  485. static inline void dp_ipa_hal_tx_init_alt_data_ring(struct dp_soc *soc)
  486. {
  487. }
  488. static inline void dp_soc_reset_cpu_ring_map(struct dp_soc *soc)
  489. {
  490. }
  491. static inline void dp_soc_reset_ipa_vlan_intr_mask(struct dp_soc *soc)
  492. {
  493. }
  494. static inline void dp_soc_reset_intr_mask(struct dp_soc *soc)
  495. {
  496. }
  497. static inline
  498. void dp_reo_frag_dst_set(struct dp_soc *soc, uint8_t *frag_dst_ring)
  499. {
  500. }
  501. /**
  502. * dp_dscp_tid_map_setup(): Initialize the dscp-tid maps
  503. * @pdev: DP_PDEV handle
  504. *
  505. * Return: void
  506. */
  507. static inline void
  508. dp_dscp_tid_map_setup(struct dp_pdev *pdev)
  509. {
  510. }
  511. /**
  512. * dp_pcp_tid_map_setup(): Initialize the pcp-tid maps
  513. * @pdev: DP_PDEV handle
  514. *
  515. * Return: void
  516. */
  517. static inline void
  518. dp_pcp_tid_map_setup(struct dp_pdev *pdev)
  519. {
  520. }
  521. #ifdef QCA_HOST2FW_RXBUF_RING
  522. static inline void
  523. dp_htt_setup_rxdma_err_dst_ring(struct dp_soc *soc, int mac_id,
  524. int lmac_id)
  525. {
  526. }
  527. #endif
  528. /* *
  529. * dp_dump_wbm_idle_hptp() -dump wbm idle ring, hw hp tp info.
  530. * @soc: dp soc.
  531. * @pdev: dp pdev.
  532. *
  533. * Return: None.
  534. */
  535. static inline void
  536. dp_dump_wbm_idle_hptp(struct dp_soc *soc, struct dp_pdev *pdev)
  537. {
  538. }
  539. static inline void dp_pdev_set_default_reo(struct dp_pdev *pdev)
  540. {
  541. }
  542. static inline void dp_tx_init_cmd_credit_ring(struct dp_soc *soc)
  543. {
  544. }
  545. /**
  546. * dp_soc_srng_deinit() - de-initialize soc srng rings
  547. * @soc: Datapath soc handle
  548. *
  549. */
  550. static inline void dp_soc_srng_deinit(struct dp_soc *soc)
  551. {
  552. }
  553. /**
  554. * dp_soc_srng_init() - Initialize soc level srng rings
  555. * @soc: Datapath soc handle
  556. *
  557. * return: QDF_STATUS_SUCCESS on success
  558. * QDF_STATUS_E_FAILURE on failure
  559. */
  560. static inline QDF_STATUS dp_soc_srng_init(struct dp_soc *soc)
  561. {
  562. dp_enable_verbose_debug(soc);
  563. return QDF_STATUS_SUCCESS;
  564. }
  565. /**
  566. * dp_soc_srng_free() - free soc level srng rings
  567. * @soc: Datapath soc handle
  568. *
  569. */
  570. static inline void dp_soc_srng_free(struct dp_soc *soc)
  571. {
  572. }
  573. /**
  574. * dp_soc_srng_alloc() - Allocate memory for soc level srng rings
  575. * @soc: Datapath soc handle
  576. *
  577. * return: QDF_STATUS_SUCCESS on success
  578. * QDF_STATUS_E_NOMEM on failure
  579. */
  580. static inline QDF_STATUS dp_soc_srng_alloc(struct dp_soc *soc)
  581. {
  582. return QDF_STATUS_SUCCESS;
  583. }
  584. /*
  585. * dp_soc_attach_poll() - Register handlers for DP interrupts
  586. * @txrx_soc: DP SOC handle
  587. *
  588. * Host driver will register for “DP_NUM_INTERRUPT_CONTEXTS” number of NAPI
  589. * contexts. Each NAPI context will have a tx_ring_mask , rx_ring_mask ,and
  590. * rx_monitor_ring mask to indicate the rings that are processed by the handler.
  591. *
  592. * Return: 0 for success, nonzero for failure.
  593. */
  594. static inline QDF_STATUS dp_soc_attach_poll(struct cdp_soc_t *txrx_soc)
  595. {
  596. struct dp_soc *soc = (struct dp_soc *)txrx_soc;
  597. qdf_mem_set(&soc->mon_intr_id_lmac_map,
  598. sizeof(soc->mon_intr_id_lmac_map), DP_MON_INVALID_LMAC_ID);
  599. soc->intr_mode = DP_INTR_POLL;
  600. qdf_timer_init(soc->osdev, &soc->int_timer,
  601. dp_interrupt_timer, (void *)soc,
  602. QDF_TIMER_TYPE_WAKE_APPS);
  603. return QDF_STATUS_SUCCESS;
  604. }
  605. static inline void dp_soc_set_interrupt_mode(struct dp_soc *soc)
  606. {
  607. soc->intr_mode = DP_INTR_INTEGRATED;
  608. if (!(soc->wlan_cfg_ctx->napi_enabled) ||
  609. (dp_is_monitor_mode_using_poll(soc) &&
  610. soc->cdp_soc.ol_ops->get_con_mode &&
  611. soc->cdp_soc.ol_ops->get_con_mode() == QDF_GLOBAL_MONITOR_MODE)) {
  612. soc->intr_mode = DP_INTR_POLL;
  613. } else {
  614. soc->intr_mode = DP_INTR_MSI;
  615. }
  616. }
  617. /**
  618. * dp_display_srng_info() - Dump the ring Read/Write idx info
  619. * @soc_hdl: CDP Soc handle
  620. *
  621. * This function dumps the SW Read/Write idx for the important rings.
  622. *
  623. * Return: none
  624. */
  625. static inline void dp_display_srng_info(struct cdp_soc_t *soc_hdl)
  626. {
  627. /*TODO add support display SOFTUMAC data rings info*/
  628. }
  629. #if defined(DP_POWER_SAVE) || defined(FEATURE_RUNTIME_PM)
  630. /**
  631. * dp_flush_ring_hptp() - Update ring shadow
  632. * register HP/TP address when runtime
  633. * resume
  634. * @soc: DP soc context
  635. * @hal_srng: HAL srng context
  636. *
  637. * Return: None
  638. */
  639. static inline void
  640. dp_flush_ring_hptp(struct dp_soc *soc, hal_ring_handle_t hal_srng)
  641. {
  642. }
  643. static inline void dp_drain_txrx(struct cdp_soc_t *soc_handle)
  644. {
  645. }
  646. #ifdef FEATURE_RUNTIME_PM
  647. /**
  648. * dp_runtime_suspend() - ensure DP is ready to runtime suspend
  649. * @soc_hdl: Datapath soc handle
  650. * @pdev_id: id of data path pdev handle
  651. *
  652. * DP is ready to runtime suspend if there are no pending TX packets.
  653. *
  654. * Return: QDF_STATUS
  655. */
  656. static inline
  657. QDF_STATUS dp_runtime_suspend(struct cdp_soc_t *soc_hdl, uint8_t pdev_id)
  658. {
  659. return QDF_STATUS_SUCCESS;
  660. }
  661. /**
  662. * dp_runtime_resume() - ensure DP is ready to runtime resume
  663. * @soc_hdl: Datapath soc handle
  664. * @pdev_id: id of data path pdev handle
  665. *
  666. * Resume DP for runtime PM.
  667. *
  668. * Return: QDF_STATUS
  669. */
  670. static inline
  671. QDF_STATUS dp_runtime_resume(struct cdp_soc_t *soc_hdl, uint8_t pdev_id)
  672. {
  673. return QDF_STATUS_SUCCESS;
  674. }
  675. #endif
  676. #endif
  677. #endif /* WLAN_SOFTUMAC_SUPPORT */
  678. #endif /* _DP_RINGS_H_ */