dp_rings.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700
  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. void dp_drain_txrx(struct cdp_soc_t *soc_handle);
  331. /*
  332. * dp_update_ring_hptp() - update dp rings hptp
  333. * @soc: dp soc handler
  334. * @force_flush_tx: force flush the Tx ring hp
  335. */
  336. void dp_update_ring_hptp(struct dp_soc *soc, bool force_flush_tx);
  337. #endif
  338. #ifdef WLAN_FEATURE_STATS_EXT
  339. /**
  340. * dp_request_rx_hw_stats - request rx hardware stats
  341. * @soc_hdl: soc handle
  342. * @vdev_id: vdev id
  343. *
  344. * Return: None
  345. */
  346. QDF_STATUS
  347. dp_request_rx_hw_stats(struct cdp_soc_t *soc_hdl, uint8_t vdev_id);
  348. #endif
  349. /**
  350. * dp_reset_rx_hw_ext_stats - Reset rx hardware ext stats
  351. * @soc_hdl: soc handle
  352. *
  353. * Return: None
  354. */
  355. void dp_reset_rx_hw_ext_stats(struct cdp_soc_t *soc_hdl);
  356. void dp_pdev_set_default_reo(struct dp_pdev *pdev);
  357. /**
  358. * dp_soc_init() - Initialize txrx SOC
  359. * @soc: Opaque DP SOC handle
  360. * @htc_handle: Opaque HTC handle
  361. * @hif_handle: Opaque HIF handle
  362. *
  363. * Return: DP SOC handle on success, NULL on failure
  364. */
  365. void *dp_soc_init(struct dp_soc *soc, HTC_HANDLE htc_handle,
  366. struct hif_opaque_softc *hif_handle);
  367. void dp_tx_init_cmd_credit_ring(struct dp_soc *soc);
  368. /**
  369. * dp_soc_srng_deinit() - de-initialize soc srng rings
  370. * @soc: Datapath soc handle
  371. *
  372. */
  373. void dp_soc_srng_deinit(struct dp_soc *soc);
  374. /**
  375. * dp_soc_srng_init() - Initialize soc level srng rings
  376. * @soc: Datapath soc handle
  377. *
  378. * return: QDF_STATUS_SUCCESS on success
  379. * QDF_STATUS_E_FAILURE on failure
  380. */
  381. QDF_STATUS dp_soc_srng_init(struct dp_soc *soc);
  382. /**
  383. * dp_soc_srng_free() - free soc level srng rings
  384. * @soc: Datapath soc handle
  385. *
  386. */
  387. void dp_soc_srng_free(struct dp_soc *soc);
  388. /**
  389. * dp_soc_srng_alloc() - Allocate memory for soc level srng rings
  390. * @soc: Datapath soc handle
  391. *
  392. * return: QDF_STATUS_SUCCESS on success
  393. * QDF_STATUS_E_NOMEM on failure
  394. */
  395. QDF_STATUS dp_soc_srng_alloc(struct dp_soc *soc);
  396. /**
  397. * dp_soc_cfg_attach() - set target specific configuration in
  398. * dp soc cfg.
  399. * @soc: dp soc handle
  400. */
  401. void dp_soc_cfg_attach(struct dp_soc *soc);
  402. /**
  403. * dp_soc_set_interrupt_mode() - Set the interrupt mode in soc
  404. * @soc: DP soc handle
  405. *
  406. * Set the appropriate interrupt mode flag in the soc
  407. */
  408. void dp_soc_set_interrupt_mode(struct dp_soc *soc);
  409. #else /* WLAN_SOFTUMAC_SUPPORT */
  410. static inline void dp_service_lmac_rings(void *arg)
  411. {
  412. }
  413. static inline
  414. uint32_t dp_service_srngs(void *dp_ctx, uint32_t dp_budget, int cpu)
  415. {
  416. return 0;
  417. }
  418. static inline void dp_soc_interrupt_detach(struct cdp_soc_t *txrx_soc)
  419. {
  420. struct dp_soc *soc = (struct dp_soc *)txrx_soc;
  421. if (soc->intr_mode == DP_INTR_POLL)
  422. qdf_timer_free(&soc->int_timer);
  423. qdf_mem_set(&soc->mon_intr_id_lmac_map,
  424. sizeof(soc->mon_intr_id_lmac_map),
  425. DP_MON_INVALID_LMAC_ID);
  426. }
  427. /*
  428. * dp_soc_interrupt_attach() - Register handlers for DP interrupts
  429. * @txrx_soc: DP SOC handle
  430. *
  431. * Host driver will register for “DP_NUM_INTERRUPT_CONTEXTS” number of NAPI
  432. * contexts. Each NAPI context will have a tx_ring_mask , rx_ring_mask ,and
  433. * rx_monitor_ring mask to indicate the rings that are processed by the handler.
  434. *
  435. * Return: 0 for success. nonzero for failure.
  436. */
  437. static inline QDF_STATUS dp_soc_interrupt_attach(struct cdp_soc_t *txrx_soc)
  438. {
  439. struct dp_soc *soc = (struct dp_soc *)txrx_soc;
  440. qdf_mem_set(&soc->mon_intr_id_lmac_map,
  441. sizeof(soc->mon_intr_id_lmac_map),
  442. DP_MON_INVALID_LMAC_ID);
  443. return QDF_STATUS_SUCCESS;
  444. }
  445. static inline void dp_hw_link_desc_ring_free(struct dp_soc *soc)
  446. {
  447. }
  448. static inline QDF_STATUS dp_hw_link_desc_ring_alloc(struct dp_soc *soc)
  449. {
  450. return QDF_STATUS_SUCCESS;
  451. }
  452. static inline QDF_STATUS dp_hw_link_desc_ring_init(struct dp_soc *soc)
  453. {
  454. return QDF_STATUS_SUCCESS;
  455. }
  456. static inline void dp_hw_link_desc_ring_deinit(struct dp_soc *soc)
  457. {
  458. }
  459. static inline void dp_ipa_hal_tx_init_alt_data_ring(struct dp_soc *soc)
  460. {
  461. }
  462. static inline void dp_soc_reset_cpu_ring_map(struct dp_soc *soc)
  463. {
  464. }
  465. static inline void dp_soc_reset_ipa_vlan_intr_mask(struct dp_soc *soc)
  466. {
  467. }
  468. static inline void dp_soc_reset_intr_mask(struct dp_soc *soc)
  469. {
  470. }
  471. static inline
  472. void dp_reo_frag_dst_set(struct dp_soc *soc, uint8_t *frag_dst_ring)
  473. {
  474. }
  475. /**
  476. * dp_dscp_tid_map_setup(): Initialize the dscp-tid maps
  477. * @pdev: DP_PDEV handle
  478. *
  479. * Return: void
  480. */
  481. static inline void
  482. dp_dscp_tid_map_setup(struct dp_pdev *pdev)
  483. {
  484. }
  485. /**
  486. * dp_pcp_tid_map_setup(): Initialize the pcp-tid maps
  487. * @pdev: DP_PDEV handle
  488. *
  489. * Return: void
  490. */
  491. static inline void
  492. dp_pcp_tid_map_setup(struct dp_pdev *pdev)
  493. {
  494. }
  495. #ifdef QCA_HOST2FW_RXBUF_RING
  496. static inline void
  497. dp_htt_setup_rxdma_err_dst_ring(struct dp_soc *soc, int mac_id,
  498. int lmac_id)
  499. {
  500. }
  501. #endif
  502. /* *
  503. * dp_dump_wbm_idle_hptp() -dump wbm idle ring, hw hp tp info.
  504. * @soc: dp soc.
  505. * @pdev: dp pdev.
  506. *
  507. * Return: None.
  508. */
  509. static inline void
  510. dp_dump_wbm_idle_hptp(struct dp_soc *soc, struct dp_pdev *pdev)
  511. {
  512. }
  513. static inline void dp_pdev_set_default_reo(struct dp_pdev *pdev)
  514. {
  515. }
  516. static inline void dp_tx_init_cmd_credit_ring(struct dp_soc *soc)
  517. {
  518. }
  519. /**
  520. * dp_soc_srng_deinit() - de-initialize soc srng rings
  521. * @soc: Datapath soc handle
  522. *
  523. */
  524. static inline void dp_soc_srng_deinit(struct dp_soc *soc)
  525. {
  526. }
  527. /**
  528. * dp_soc_srng_init() - Initialize soc level srng rings
  529. * @soc: Datapath soc handle
  530. *
  531. * return: QDF_STATUS_SUCCESS on success
  532. * QDF_STATUS_E_FAILURE on failure
  533. */
  534. static inline QDF_STATUS dp_soc_srng_init(struct dp_soc *soc)
  535. {
  536. dp_enable_verbose_debug(soc);
  537. return QDF_STATUS_SUCCESS;
  538. }
  539. /**
  540. * dp_soc_srng_free() - free soc level srng rings
  541. * @soc: Datapath soc handle
  542. *
  543. */
  544. static inline void dp_soc_srng_free(struct dp_soc *soc)
  545. {
  546. }
  547. /**
  548. * dp_soc_srng_alloc() - Allocate memory for soc level srng rings
  549. * @soc: Datapath soc handle
  550. *
  551. * return: QDF_STATUS_SUCCESS on success
  552. * QDF_STATUS_E_NOMEM on failure
  553. */
  554. static inline QDF_STATUS dp_soc_srng_alloc(struct dp_soc *soc)
  555. {
  556. return QDF_STATUS_SUCCESS;
  557. }
  558. /*
  559. * dp_soc_attach_poll() - Register handlers for DP interrupts
  560. * @txrx_soc: DP SOC handle
  561. *
  562. * Host driver will register for “DP_NUM_INTERRUPT_CONTEXTS” number of NAPI
  563. * contexts. Each NAPI context will have a tx_ring_mask , rx_ring_mask ,and
  564. * rx_monitor_ring mask to indicate the rings that are processed by the handler.
  565. *
  566. * Return: 0 for success, nonzero for failure.
  567. */
  568. static inline QDF_STATUS dp_soc_attach_poll(struct cdp_soc_t *txrx_soc)
  569. {
  570. struct dp_soc *soc = (struct dp_soc *)txrx_soc;
  571. qdf_mem_set(&soc->mon_intr_id_lmac_map,
  572. sizeof(soc->mon_intr_id_lmac_map), DP_MON_INVALID_LMAC_ID);
  573. soc->intr_mode = DP_INTR_POLL;
  574. qdf_timer_init(soc->osdev, &soc->int_timer,
  575. dp_interrupt_timer, (void *)soc,
  576. QDF_TIMER_TYPE_WAKE_APPS);
  577. return QDF_STATUS_SUCCESS;
  578. }
  579. static inline void dp_soc_set_interrupt_mode(struct dp_soc *soc)
  580. {
  581. soc->intr_mode = DP_INTR_INTEGRATED;
  582. if (!(soc->wlan_cfg_ctx->napi_enabled) ||
  583. (dp_is_monitor_mode_using_poll(soc) &&
  584. soc->cdp_soc.ol_ops->get_con_mode &&
  585. soc->cdp_soc.ol_ops->get_con_mode() == QDF_GLOBAL_MONITOR_MODE)) {
  586. soc->intr_mode = DP_INTR_POLL;
  587. } else {
  588. soc->intr_mode = DP_INTR_MSI;
  589. }
  590. }
  591. /**
  592. * dp_display_srng_info() - Dump the ring Read/Write idx info
  593. * @soc_hdl: CDP Soc handle
  594. *
  595. * This function dumps the SW Read/Write idx for the important rings.
  596. *
  597. * Return: none
  598. */
  599. static inline void dp_display_srng_info(struct cdp_soc_t *soc_hdl)
  600. {
  601. /*TODO add support display SOFTUMAC data rings info*/
  602. }
  603. #if defined(DP_POWER_SAVE) || defined(FEATURE_RUNTIME_PM)
  604. static inline void dp_drain_txrx(struct cdp_soc_t *soc_handle)
  605. {
  606. }
  607. #endif
  608. #endif /* WLAN_SOFTUMAC_SUPPORT */
  609. #endif /* _DP_RINGS_H_ */