dp_rings.h 18 KB

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