Lines Matching refs:scn

87 static void hif_config_rri_on_ddr(struct hif_softc *scn);
448 struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); in hif_trigger_dump() local
453 priv_start_agc(scn); in hif_trigger_dump()
455 priv_dump_agc(scn); in hif_trigger_dump()
459 priv_start_cap_chaninfo(scn); in hif_trigger_dump()
461 priv_dump_chaninfo(scn); in hif_trigger_dump()
464 priv_dump_bbwatchdog(scn); in hif_trigger_dump()
482 ce_per_engine_service(CE_state->scn, CE_state->id); in ce_poll_timeout()
1365 void hif_set_ce_config_qcn9224(struct hif_softc *scn, in hif_set_ce_config_qcn9224() argument
1372 scn->ce_count = QCN_9224_CE_COUNT; in hif_set_ce_config_qcn9224()
1373 scn->ini_cfg.disable_wake_irq = 1; in hif_set_ce_config_qcn9224()
1385 void hif_set_ce_config_qcn9224(struct hif_softc *scn, in hif_set_ce_config_qcn9224() argument
1410 hif_select_service_to_pipe_map_kiwi(struct hif_softc *scn, in hif_select_service_to_pipe_map_kiwi() argument
1414 if (pld_is_direct_link_supported(scn->qdf_dev->dev)) { in hif_select_service_to_pipe_map_kiwi()
1425 hif_select_service_to_pipe_map_kiwi(struct hif_softc *scn, in hif_select_service_to_pipe_map_kiwi() argument
1434 static void hif_select_service_to_pipe_map(struct hif_softc *scn, in hif_select_service_to_pipe_map() argument
1438 uint32_t mode = hif_get_conparam(scn); in hif_select_service_to_pipe_map()
1439 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_select_service_to_pipe_map()
1440 struct hif_target_info *tgt_info = &scn->target_info; in hif_select_service_to_pipe_map()
1488 hif_select_service_to_pipe_map_kiwi(scn, in hif_select_service_to_pipe_map()
1572 hif_select_service_to_pipe_map(ce_state->scn, &svc_map, in ce_mark_datapath()
1597 static inline void ce_update_wrt_idx_offset(struct hif_softc *scn, in ce_update_wrt_idx_offset() argument
1610 hif_select_service_to_pipe_map(ce_state->scn, &svc_map, in ce_mark_datapath()
1637 static inline void ce_update_wrt_idx_offset(struct hif_softc *scn, in ce_update_wrt_idx_offset() argument
1647 CE_SRC_WR_IDX_OFFSET_GET(scn, ce_state->ctrl_addr); in ce_update_wrt_idx_offset()
1650 CE_DST_WR_IDX_OFFSET_GET(scn, ce_state->ctrl_addr); in ce_update_wrt_idx_offset()
1664 struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); in hif_ce_print_ring_stats() local
1668 for (i = 0; i < scn->ce_count; i++) { in hif_ce_print_ring_stats()
1669 ce_state = scn->ce_id_to_state[i]; in hif_ce_print_ring_stats()
1681 CE_SRC_RING_READ_IDX_GET_FROM_REGISTER(scn, ce_state->ctrl_addr), in hif_ce_print_ring_stats()
1682 CE_SRC_RING_WRITE_IDX_GET_FROM_REGISTER(scn, ce_state->ctrl_addr)); in hif_ce_print_ring_stats()
1693 CE_DEST_RING_READ_IDX_GET_FROM_REGISTER(scn, ce_state->ctrl_addr), in hif_ce_print_ring_stats()
1694 CE_DEST_RING_WRITE_IDX_GET_FROM_REGISTER(scn, ce_state->ctrl_addr)); in hif_ce_print_ring_stats()
1714 struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); in hif_get_max_wmi_ep() local
1720 hif_select_service_to_pipe_map(scn, &svc_map, in hif_get_max_wmi_ep()
1768 static QDF_STATUS ce_alloc_desc_ring(struct hif_softc *scn, unsigned int CE_id, in ce_alloc_desc_ring() argument
1774 !ce_srng_based(scn)) { in ce_alloc_desc_ring()
1775 if (!scn->ipa_ce_ring) { in ce_alloc_desc_ring()
1776 scn->ipa_ce_ring = qdf_mem_shared_mem_alloc( in ce_alloc_desc_ring()
1777 scn->qdf_dev, in ce_alloc_desc_ring()
1779 if (!scn->ipa_ce_ring) { in ce_alloc_desc_ring()
1785 *base_addr = qdf_mem_get_dma_addr(scn->qdf_dev, in ce_alloc_desc_ring()
1786 &scn->ipa_ce_ring->mem_info); in ce_alloc_desc_ring()
1788 scn->ipa_ce_ring->vaddr; in ce_alloc_desc_ring()
1792 (scn, in ce_alloc_desc_ring()
1817 static void ce_free_desc_ring(struct hif_softc *scn, unsigned int CE_id, in ce_free_desc_ring() argument
1821 !ce_srng_based(scn)) { in ce_free_desc_ring()
1822 if (scn->ipa_ce_ring) { in ce_free_desc_ring()
1823 qdf_mem_shared_mem_free(scn->qdf_dev, in ce_free_desc_ring()
1824 scn->ipa_ce_ring); in ce_free_desc_ring()
1825 scn->ipa_ce_ring = NULL; in ce_free_desc_ring()
1830 (scn, in ce_free_desc_ring()
1839 static QDF_STATUS ce_alloc_desc_ring(struct hif_softc *scn, unsigned int CE_id, in ce_alloc_desc_ring() argument
1846 (scn, in ce_alloc_desc_ring()
1861 static void ce_free_desc_ring(struct hif_softc *scn, unsigned int CE_id, in ce_free_desc_ring() argument
1865 (scn, in ce_free_desc_ring()
1900 bool ce_srng_based(struct hif_softc *scn) in ce_srng_based() argument
1902 struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn); in ce_srng_based()
1933 static struct ce_ops *ce_services_attach(struct hif_softc *scn) in ce_services_attach() argument
1937 if (ce_srng_based(scn)) { in ce_services_attach()
1949 static struct ce_ops *ce_services_attach(struct hif_softc *scn) in ce_services_attach() argument
1958 static void hif_prepare_hal_shadow_register_cfg(struct hif_softc *scn, in hif_prepare_hal_shadow_register_cfg() argument
1961 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_prepare_hal_shadow_register_cfg()
1964 scn, shadow_config, num_shadow_registers_configured); in hif_prepare_hal_shadow_register_cfg()
1971 hif_prepare_hal_shadow_reg_cfg_v3(struct hif_softc *scn, in hif_prepare_hal_shadow_reg_cfg_v3() argument
1974 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_prepare_hal_shadow_reg_cfg_v3()
1980 scn, &cfg->shadow_reg_v3_cfg, in hif_prepare_hal_shadow_reg_cfg_v3()
1985 hif_prepare_hal_shadow_reg_cfg_v3(struct hif_softc *scn, in hif_prepare_hal_shadow_reg_cfg_v3() argument
1991 static inline uint32_t ce_get_desc_size(struct hif_softc *scn, in ce_get_desc_size() argument
1994 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in ce_get_desc_size()
2027 struct hif_softc *scn = CE_state->scn; in ce_alloc_ring_state() local
2045 desc_size = ce_get_desc_size(scn, ring_type); in ce_alloc_ring_state()
2050 if (ce_alloc_desc_ring(scn, CE_state->id, &base_addr, in ce_alloc_ring_state()
2087 static int ce_ring_setup(struct hif_softc *scn, uint8_t ring_type, in ce_ring_setup() argument
2091 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in ce_ring_setup()
2093 return hif_state->ce_services->ce_ring_setup(scn, ring_type, ce_id, in ce_ring_setup()
2097 static void ce_srng_cleanup(struct hif_softc *scn, struct CE_state *CE_state, in ce_srng_cleanup() argument
2100 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in ce_srng_cleanup()
2103 hif_state->ce_services->ce_srng_cleanup(scn, in ce_srng_cleanup()
2107 int hif_ce_bus_early_suspend(struct hif_softc *scn) in hif_ce_bus_early_suspend() argument
2113 status = hif_map_service_to_pipe(&scn->osc, WMI_CONTROL_SVC, in hif_ce_bus_early_suspend()
2121 for (ce_id = 0; ce_id < scn->ce_count; ce_id++) { in hif_ce_bus_early_suspend()
2127 ce_state = scn->ce_id_to_state[ce_id]; in hif_ce_bus_early_suspend()
2137 int hif_ce_bus_late_resume(struct hif_softc *scn) in hif_ce_bus_late_resume() argument
2144 for (ce_id = 0; ce_id < scn->ce_count; ce_id++) { in hif_ce_bus_late_resume()
2145 ce_state = scn->ce_id_to_state[ce_id]; in hif_ce_bus_late_resume()
2149 CE_SRC_RING_WRITE_IDX_SET(scn, ce_state->ctrl_addr, in hif_ce_bus_late_resume()
2162 hif_record_ce_desc_event(scn, ce_id, in hif_ce_bus_late_resume()
2182 struct hif_softc *scn = ce_state->scn; in ce_oom_recovery() local
2183 struct HIF_CE_state *ce_softc = HIF_GET_CE_STATE(scn); in ce_oom_recovery()
2189 qdf_atomic_dec(&scn->active_oom_work_cnt); in ce_oom_recovery()
2202 QDF_STATUS alloc_mem_ce_debug_hist_data(struct hif_softc *scn, uint32_t ce_id) in alloc_mem_ce_debug_hist_data() argument
2209 (struct hif_ce_desc_event *)scn->hif_ce_desc_hist.hist_ev[ce_id]; in alloc_mem_ce_debug_hist_data()
2214 scn->hif_ce_desc_hist.data_enable[ce_id] = true; in alloc_mem_ce_debug_hist_data()
2221 scn->hif_ce_desc_hist.data_enable[ce_id] = false; in alloc_mem_ce_debug_hist_data()
2236 void free_mem_ce_debug_hist_data(struct hif_softc *scn, uint32_t ce_id) in free_mem_ce_debug_hist_data() argument
2243 (struct hif_ce_desc_event *)scn->hif_ce_desc_hist.hist_ev[ce_id]; in free_mem_ce_debug_hist_data()
2292 __hif_ce_desc_history_log_register(struct hif_softc *scn) in __hif_ce_desc_history_log_register() argument
2298 &scn->hif_ce_desc_hist, in __hif_ce_desc_history_log_register()
2299 sizeof(scn->hif_ce_desc_hist)); in __hif_ce_desc_history_log_register()
2321 hif_ce_debug_history_buf_get(struct hif_softc *scn, unsigned int ce_id) in hif_ce_debug_history_buf_get() argument
2323 struct ce_desc_hist *ce_hist = &scn->hif_ce_desc_hist; in hif_ce_debug_history_buf_get()
2349 alloc_mem_ce_debug_history(struct hif_softc *scn, unsigned int ce_id, in alloc_mem_ce_debug_history() argument
2352 struct ce_desc_hist *ce_hist = &scn->hif_ce_desc_hist; in alloc_mem_ce_debug_history()
2363 ce_hist->hist_ev[ce_id] = hif_ce_debug_history_buf_get(scn, ce_id); in alloc_mem_ce_debug_history()
2367 status = alloc_mem_ce_debug_hist_data(scn, ce_id); in alloc_mem_ce_debug_history()
2387 static void free_mem_ce_debug_history(struct hif_softc *scn, unsigned int ce_id) in free_mem_ce_debug_history() argument
2389 struct ce_desc_hist *ce_hist = &scn->hif_ce_desc_hist; in free_mem_ce_debug_history()
2397 free_mem_ce_debug_hist_data(scn, ce_id); in free_mem_ce_debug_history()
2404 __hif_ce_desc_history_log_register(struct hif_softc *scn) in __hif_ce_desc_history_log_register() argument
2411 alloc_mem_ce_debug_history(struct hif_softc *scn, unsigned int CE_id, in alloc_mem_ce_debug_history() argument
2418 free_mem_ce_debug_history(struct hif_softc *scn, unsigned int CE_id) { } in free_mem_ce_debug_history() argument
2424 __hif_ce_desc_history_log_register(struct hif_softc *scn) in __hif_ce_desc_history_log_register() argument
2431 alloc_mem_ce_debug_history(struct hif_softc *scn, unsigned int CE_id, in alloc_mem_ce_debug_history() argument
2434 scn->hif_ce_desc_hist.hist_ev[CE_id] = (struct hif_ce_desc_event *) in alloc_mem_ce_debug_history()
2437 if (!scn->hif_ce_desc_hist.hist_ev[CE_id]) { in alloc_mem_ce_debug_history()
2438 scn->hif_ce_desc_hist.enable[CE_id] = 0; in alloc_mem_ce_debug_history()
2441 scn->hif_ce_desc_hist.enable[CE_id] = 1; in alloc_mem_ce_debug_history()
2446 static void free_mem_ce_debug_history(struct hif_softc *scn, unsigned int CE_id) in free_mem_ce_debug_history() argument
2448 struct ce_desc_hist *ce_hist = &scn->hif_ce_desc_hist; in free_mem_ce_debug_history()
2456 free_mem_ce_debug_hist_data(scn, CE_id); in free_mem_ce_debug_history()
2467 __hif_ce_desc_history_log_register(struct hif_softc *scn) in __hif_ce_desc_history_log_register() argument
2474 alloc_mem_ce_debug_history(struct hif_softc *scn, unsigned int CE_id, in alloc_mem_ce_debug_history() argument
2481 free_mem_ce_debug_history(struct hif_softc *scn, unsigned int CE_id) { } in free_mem_ce_debug_history() argument
2493 static inline void reset_ce_debug_history(struct hif_softc *scn) in reset_ce_debug_history() argument
2495 struct ce_desc_hist *ce_hist = &scn->hif_ce_desc_hist; in reset_ce_debug_history()
2503 static inline void reset_ce_debug_history(struct hif_softc *scn) { } in reset_ce_debug_history() argument
2642 struct CE_handle *ce_init(struct hif_softc *scn, in ce_init() argument
2653 QDF_ASSERT(CE_id < scn->ce_count); in ce_init()
2655 CE_state = scn->ce_id_to_state[CE_id]; in ce_init()
2674 CE_state->scn = scn; in ce_init()
2688 ce_init_ce_desc_event_log(scn, CE_id, in ce_init()
2738 status = ce_ring_setup(scn, CE_RING_SRC, CE_id, in ce_init()
2745 qdf_timer_init(scn->qdf_dev, in ce_init()
2779 status = ce_ring_setup(scn, CE_RING_DEST, CE_id, in ce_init()
2788 if (ce_srng_based(CE_state->scn)) { in ce_init()
2804 scn->ce_id_to_state[CE_id] = in ce_init()
2813 status = ce_ring_setup(scn, CE_RING_STATUS, in ce_init()
2824 qdf_timer_init(scn->qdf_dev, in ce_init()
2836 if (!ce_srng_based(scn)) { in ce_init()
2838 if (Q_TARGET_ACCESS_BEGIN(scn) < 0) in ce_init()
2840 CE_ERROR_INTR_ENABLE(scn, ctrl_addr); in ce_init()
2841 if (Q_TARGET_ACCESS_END(scn) < 0) in ce_init()
2845 qdf_create_work(scn->qdf_dev, &CE_state->oom_allocation_work, in ce_init()
2850 scn->ce_id_to_state[CE_id] = CE_state; in ce_init()
2854 mem_status = alloc_mem_ce_debug_history(scn, CE_id, attr->src_nentries); in ce_init()
2859 ce_update_wrt_idx_offset(scn, CE_state, attr); in ce_init()
2869 void hif_ce_desc_history_log_register(struct hif_softc *scn) in hif_ce_desc_history_log_register() argument
2871 __hif_ce_desc_history_log_register(scn); in hif_ce_desc_history_log_register()
2885 struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); in hif_is_polled_mode_enabled() local
2886 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_is_polled_mode_enabled()
2890 for (id = 0; id < scn->ce_count; id++) { in hif_is_polled_mode_enabled()
2900 static int hif_get_pktlog_ce_num(struct hif_softc *scn) in hif_get_pktlog_ce_num() argument
2902 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_get_pktlog_ce_num()
2916 static qdf_nbuf_t hif_ce_rx_nbuf_alloc(struct hif_softc *scn, uint8_t ce_id) in hif_ce_rx_nbuf_alloc() argument
2918 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_ce_rx_nbuf_alloc()
2922 nbuf = wbuff_buff_get(scn->wbuff_handle, ce_id, 0, __func__, in hif_ce_rx_nbuf_alloc()
2925 nbuf = qdf_nbuf_alloc(scn->qdf_dev, pipe_info->buf_sz, in hif_ce_rx_nbuf_alloc()
2942 hif_calc_wbuff_pool_size(struct hif_softc *scn, struct CE_state *ce_state) in hif_calc_wbuff_pool_size() argument
2956 status = hif_map_service_to_pipe(&scn->osc, WMI_CONTROL_SVC, in hif_calc_wbuff_pool_size()
2961 status = hif_map_service_to_pipe(GET_HIF_OPAQUE_HDL(scn), in hif_calc_wbuff_pool_size()
2982 static void hif_ce_rx_wbuff_register(struct hif_softc *scn) in hif_ce_rx_wbuff_register() argument
2985 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_ce_rx_wbuff_register()
2990 for (ce_id = 0; ce_id < scn->ce_count; ce_id++) { in hif_ce_rx_wbuff_register()
2992 ce_state = scn->ce_id_to_state[ce_id]; in hif_ce_rx_wbuff_register()
3006 hif_calc_wbuff_pool_size(scn, ce_state); in hif_ce_rx_wbuff_register()
3009 scn->wbuff_handle = in hif_ce_rx_wbuff_register()
3014 static void hif_ce_rx_wbuff_deregister(struct hif_softc *scn) in hif_ce_rx_wbuff_deregister() argument
3016 wbuff_module_deregister(scn->wbuff_handle); in hif_ce_rx_wbuff_deregister()
3017 scn->wbuff_handle = NULL; in hif_ce_rx_wbuff_deregister()
3021 hif_ce_rx_nbuf_alloc(struct hif_softc *scn, uint8_t ce_id) in hif_ce_rx_nbuf_alloc() argument
3023 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_ce_rx_nbuf_alloc()
3026 return qdf_nbuf_alloc(scn->qdf_dev, pipe_info->buf_sz, 0, 4, false); in hif_ce_rx_nbuf_alloc()
3034 static inline void hif_ce_rx_wbuff_register(struct hif_softc *scn) in hif_ce_rx_wbuff_register() argument
3038 static inline void hif_ce_rx_wbuff_deregister(struct hif_softc *scn) in hif_ce_rx_wbuff_deregister() argument
3054 struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); in hif_enable_fastpath() local
3056 if (ce_srng_based(scn)) { in hif_enable_fastpath()
3061 scn->fastpath_mode_on = true; in hif_enable_fastpath()
3074 struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); in hif_is_fastpath_mode_enabled() local
3076 return scn->fastpath_mode_on; in hif_is_fastpath_mode_enabled()
3090 struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); in hif_get_ce_handle() local
3092 return scn->ce_id_to_state[id]; in hif_get_ce_handle()
3113 struct hif_softc *sc = ce_state->scn; in ce_h2t_tx_ce_cleanup()
3149 if (ce_state->scn->fastpath_mode_on == false) in ce_t2h_msg_ce_cleanup()
3176 qdf_nbuf_unmap_single(ce_state->scn->qdf_dev, nbuf, in ce_t2h_msg_ce_cleanup()
3194 static void hif_update_fastpath_recv_bufs_cnt(struct hif_softc *scn) in hif_update_fastpath_recv_bufs_cnt() argument
3197 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_update_fastpath_recv_bufs_cnt()
3199 if (scn->fastpath_mode_on == false) in hif_update_fastpath_recv_bufs_cnt()
3202 for (pipe_num = 0; pipe_num < scn->ce_count; pipe_num++) { in hif_update_fastpath_recv_bufs_cnt()
3206 scn->ce_id_to_state[pipe_info->pipe_num]; in hif_update_fastpath_recv_bufs_cnt()
3213 static inline void hif_update_fastpath_recv_bufs_cnt(struct hif_softc *scn) in hif_update_fastpath_recv_bufs_cnt() argument
3217 static inline bool ce_is_fastpath_enabled(struct hif_softc *scn) in ce_is_fastpath_enabled() argument
3227 struct hif_softc *scn = CE_state->scn; in ce_fini() local
3232 scn->ce_id_to_state[CE_id] = NULL; in ce_fini()
3244 desc_size = ce_get_desc_size(scn, CE_RING_SRC); in ce_fini()
3248 ce_free_desc_ring(scn, CE_state->id, in ce_fini()
3251 ce_srng_cleanup(scn, CE_state, CE_RING_SRC); in ce_fini()
3258 desc_size = ce_get_desc_size(scn, CE_RING_DEST); in ce_fini()
3260 ce_free_desc_ring(scn, CE_state->id, in ce_fini()
3263 ce_srng_cleanup(scn, CE_state, CE_RING_DEST); in ce_fini()
3271 if ((ce_srng_based(CE_state->scn)) && (CE_state->status_ring)) { in ce_fini()
3279 desc_size = ce_get_desc_size(scn, CE_RING_STATUS); in ce_fini()
3281 ce_free_desc_ring(scn, CE_state->id, in ce_fini()
3284 ce_srng_cleanup(scn, CE_state, CE_RING_STATUS); in ce_fini()
3288 free_mem_ce_debug_history(scn, CE_id); in ce_fini()
3289 reset_ce_debug_history(scn); in ce_fini()
3290 ce_deinit_ce_desc_event_log(scn, CE_id); in ce_fini()
3320 struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); in hif_send_head() local
3406 struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); in hif_send_complete_check() local
3428 ce_per_engine_servicereap(scn, pipe); in hif_send_complete_check()
3430 ce_per_engine_service(scn, pipe); in hif_send_complete_check()
3439 struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); in hif_register_ce_custom_cb() local
3440 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_register_ce_custom_cb()
3455 struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); in hif_unregister_ce_custom_cb() local
3456 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_unregister_ce_custom_cb()
3471 struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); in hif_enable_ce_custom_cb() local
3472 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_enable_ce_custom_cb()
3488 struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); in hif_disable_ce_custom_cb() local
3489 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_disable_ce_custom_cb()
3618 hif_ce_rtpm_mark_last_busy(struct hif_softc *scn, uint32_t ce_id) in hif_ce_rtpm_mark_last_busy() argument
3624 hif_rtpm_record_ce_last_busy_evt(scn, ce_id); in hif_ce_rtpm_mark_last_busy()
3629 hif_ce_rtpm_mark_last_busy(struct hif_softc *scn, uint32_t ce_id) in hif_ce_rtpm_mark_last_busy() argument
3631 hif_rtpm_record_ce_last_busy_evt(scn, ce_id); in hif_ce_rtpm_mark_last_busy()
3647 struct hif_softc *scn = HIF_GET_SOFTC(hif_state); in hif_pci_ce_recv_data() local
3651 hif_ce_rtpm_mark_last_busy(scn, ce_state->id); in hif_pci_ce_recv_data()
3652 qdf_nbuf_unmap_single(scn->qdf_dev, in hif_pci_ce_recv_data()
3658 if (scn->target_status == TARGET_STATUS_RESET) in hif_pci_ce_recv_data()
3668 if (qdf_unlikely(hif_ce_service_should_yield(scn, ce_state))) { in hif_pci_ce_recv_data()
3699 struct hif_softc *scn = HIF_GET_SOFTC(hif_state); in hif_completion_thread_startup_by_ceid() local
3709 ce_state = scn->ce_id_to_state[pipe_num]; in hif_completion_thread_startup_by_ceid()
3751 struct hif_softc *scn = HIF_GET_SOFTC(hif_state); in hif_completion_thread_startup() local
3755 if (scn->ce_count == 0) { in hif_completion_thread_startup()
3761 A_TARGET_ACCESS_LIKELY(scn); in hif_completion_thread_startup()
3762 for (pipe_num = 0; pipe_num < scn->ce_count; pipe_num++) { in hif_completion_thread_startup()
3776 A_TARGET_ACCESS_UNLIKELY(scn); in hif_completion_thread_startup()
3788 static void hif_msg_callbacks_install(struct hif_softc *scn) in hif_msg_callbacks_install() argument
3790 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_msg_callbacks_install()
3814 void hif_dump_pipe_debug_count(struct hif_softc *scn) in hif_dump_pipe_debug_count() argument
3816 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_dump_pipe_debug_count()
3823 for (pipe_num = 0; pipe_num < scn->ce_count; pipe_num++) { in hif_dump_pipe_debug_count()
3848 struct hif_softc *scn = HIF_GET_SOFTC(pipe_info->HIF_CE_state); in hif_post_recv_buffers_failure() local
3858 hif_record_ce_desc_event(scn, ce_id, failure_type, in hif_post_recv_buffers_failure()
3865 (ce_srng_based(scn) && in hif_post_recv_buffers_failure()
3867 qdf_atomic_inc(&scn->active_oom_work_cnt); in hif_post_recv_buffers_failure()
3868 if (!qdf_sched_work(scn->qdf_dev, in hif_post_recv_buffers_failure()
3870 qdf_atomic_dec(&scn->active_oom_work_cnt); in hif_post_recv_buffers_failure()
3879 struct hif_softc *scn = HIF_GET_SOFTC(pipe_info->HIF_CE_state); in hif_post_recv_buffers_for_pipe() local
3906 hif_record_ce_desc_event(scn, ce_id, in hif_post_recv_buffers_for_pipe()
3909 nbuf = hif_ce_rx_nbuf_alloc(scn, ce_id); in hif_post_recv_buffers_for_pipe()
3918 hif_record_ce_desc_event(scn, ce_id, in hif_post_recv_buffers_for_pipe()
3926 status = qdf_nbuf_map_single(scn->qdf_dev, nbuf, in hif_post_recv_buffers_for_pipe()
3939 hif_record_ce_desc_event(scn, ce_id, in hif_post_recv_buffers_for_pipe()
3942 qdf_mem_dma_sync_single_for_device(scn->qdf_dev, CE_data, in hif_post_recv_buffers_for_pipe()
3951 qdf_nbuf_unmap_single(scn->qdf_dev, nbuf, in hif_post_recv_buffers_for_pipe()
3980 struct hif_softc *scn = HIF_GET_SOFTC(hif_ce_state); in hif_alloc_pages_for_direct_link_recv_pipe() local
4010 scn->dl_recv_pipe_num = pipe_num; in hif_alloc_pages_for_direct_link_recv_pipe()
4012 hif_prealloc_get_multi_pages(scn, QDF_DP_RX_DIRECT_LINK_CE_BUF_TYPE, in hif_alloc_pages_for_direct_link_recv_pipe()
4014 &scn->dl_recv_pages, false); in hif_alloc_pages_for_direct_link_recv_pipe()
4015 if (!scn->dl_recv_pages.num_pages) in hif_alloc_pages_for_direct_link_recv_pipe()
4018 num_elem_per_page = scn->dl_recv_pages.num_element_per_page; in hif_alloc_pages_for_direct_link_recv_pipe()
4020 dma_addr = scn->dl_recv_pages.dma_pages[i / num_elem_per_page].page_p_addr; in hif_alloc_pages_for_direct_link_recv_pipe()
4032 struct hif_softc *scn = HIF_GET_SOFTC(hif_ce_state); in hif_free_pages_for_direct_link_recv_pipe() local
4034 if (pipe_num != scn->dl_recv_pipe_num) in hif_free_pages_for_direct_link_recv_pipe()
4037 hif_prealloc_put_multi_pages(scn, QDF_DP_RX_DIRECT_LINK_CE_BUF_TYPE, in hif_free_pages_for_direct_link_recv_pipe()
4038 &scn->dl_recv_pages, false); in hif_free_pages_for_direct_link_recv_pipe()
4065 static QDF_STATUS hif_post_recv_buffers(struct hif_softc *scn) in hif_post_recv_buffers() argument
4067 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_post_recv_buffers()
4072 A_TARGET_ACCESS_LIKELY(scn); in hif_post_recv_buffers()
4073 for (pipe_num = 0; pipe_num < scn->ce_count; pipe_num++) { in hif_post_recv_buffers()
4077 A_TARGET_ACCESS_UNLIKELY(scn); in hif_post_recv_buffers()
4081 ce_state = scn->ce_id_to_state[pipe_num]; in hif_post_recv_buffers()
4091 if (hif_is_nss_wifi_enabled(scn) && in hif_post_recv_buffers()
4104 scn->fastpath_mode_on) { in hif_post_recv_buffers()
4105 A_TARGET_ACCESS_UNLIKELY(scn); in hif_post_recv_buffers()
4110 A_TARGET_ACCESS_UNLIKELY(scn); in hif_post_recv_buffers()
4117 struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); in hif_start() local
4118 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_start()
4121 hif_update_fastpath_recv_bufs_cnt(scn); in hif_start()
4123 hif_msg_callbacks_install(scn); in hif_start()
4128 hif_ce_rx_wbuff_register(scn); in hif_start()
4134 qdf_status = hif_post_recv_buffers(scn); in hif_start()
4146 struct hif_softc *scn; in hif_recv_buffer_cleanup_on_pipe() local
4165 scn = HIF_GET_SOFTC(hif_state); in hif_recv_buffer_cleanup_on_pipe()
4168 if (!scn->qdf_dev) in hif_recv_buffer_cleanup_on_pipe()
4180 qdf_nbuf_unmap_single(scn->qdf_dev, netbuf, in hif_recv_buffer_cleanup_on_pipe()
4191 struct hif_softc *scn; in hif_send_buffer_cleanup_on_pipe() local
4211 scn = HIF_GET_SOFTC(hif_state); in hif_send_buffer_cleanup_on_pipe()
4228 if (id == scn->htc_htt_tx_endpoint) in hif_send_buffer_cleanup_on_pipe()
4253 struct hif_softc *scn = HIF_GET_SOFTC(hif_state); in hif_buffer_cleanup() local
4256 for (pipe_num = 0; pipe_num < scn->ce_count; pipe_num++) { in hif_buffer_cleanup()
4259 ce_state = scn->ce_id_to_state[pipe_num]; in hif_buffer_cleanup()
4260 if (hif_is_nss_wifi_enabled(scn) && ce_state && in hif_buffer_cleanup()
4274 struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); in hif_flush_surprise_remove() local
4275 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_flush_surprise_remove()
4280 static void hif_destroy_oom_work(struct hif_softc *scn) in hif_destroy_oom_work() argument
4285 for (ce_id = 0; ce_id < scn->ce_count; ce_id++) { in hif_destroy_oom_work()
4286 ce_state = scn->ce_id_to_state[ce_id]; in hif_destroy_oom_work()
4288 qdf_destroy_work(scn->qdf_dev, in hif_destroy_oom_work()
4291 qdf_atomic_set(&scn->active_oom_work_cnt, 0); in hif_destroy_oom_work()
4294 void hif_ce_stop(struct hif_softc *scn) in hif_ce_stop() argument
4296 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_ce_stop()
4303 hif_disable_isr(&scn->osc); in hif_ce_stop()
4304 hif_destroy_oom_work(scn); in hif_ce_stop()
4305 scn->hif_init_done = false; in hif_ce_stop()
4314 if (scn->athdiag_procfs_inited) { in hif_ce_stop()
4316 scn->athdiag_procfs_inited = false; in hif_ce_stop()
4321 for (pipe_num = 0; pipe_num < scn->ce_count; pipe_num++) { in hif_ce_stop()
4342 hif_ce_rx_wbuff_deregister(scn); in hif_ce_stop()
4354 void hif_preare_shadow_register_cfg_v3(struct hif_softc *scn) in hif_preare_shadow_register_cfg_v3() argument
4356 int shadow_cfg_idx = scn->num_shadow_registers_configured; in hif_preare_shadow_register_cfg_v3()
4360 for (i = 0; i < scn->ce_count; i++) { in hif_preare_shadow_register_cfg_v3()
4361 scn->shadow_regs[shadow_cfg_idx].addr = in hif_preare_shadow_register_cfg_v3()
4367 for (i = 0; i < scn->ce_count; i++) { in hif_preare_shadow_register_cfg_v3()
4368 scn->shadow_regs[shadow_cfg_idx].addr = in hif_preare_shadow_register_cfg_v3()
4373 scn->num_shadow_registers_configured = shadow_cfg_idx; in hif_preare_shadow_register_cfg_v3()
4376 void hif_get_shadow_reg_config_v3(struct hif_softc *scn, in hif_get_shadow_reg_config_v3() argument
4380 *shadow_config = scn->shadow_regs; in hif_get_shadow_reg_config_v3()
4382 scn->num_shadow_registers_configured; in hif_get_shadow_reg_config_v3()
4386 static void hif_get_shadow_reg_cfg(struct hif_softc *scn, in hif_get_shadow_reg_cfg() argument
4414 void hif_get_target_ce_config(struct hif_softc *scn, in hif_get_target_ce_config() argument
4422 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_get_target_ce_config()
4427 hif_select_service_to_pipe_map(scn, target_service_to_ce_map_ret, in hif_get_target_ce_config()
4429 hif_get_shadow_reg_cfg(scn, target_shadow_reg_cfg_ret, in hif_get_target_ce_config()
4472 inline unsigned int hif_get_src_ring_read_index(struct hif_softc *scn, in hif_get_src_ring_read_index() argument
4476 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_get_src_ring_read_index()
4480 return CE_SRC_RING_READ_IDX_GET_FROM_DDR(scn, CE_ctrl_addr); in hif_get_src_ring_read_index()
4482 if (TARGET_REGISTER_ACCESS_ALLOWED(scn)) in hif_get_src_ring_read_index()
4483 return A_TARGET_READ(scn, in hif_get_src_ring_read_index()
4486 return CE_SRC_RING_READ_IDX_GET_FROM_DDR(scn, in hif_get_src_ring_read_index()
4502 inline unsigned int hif_get_dst_ring_read_index(struct hif_softc *scn, in hif_get_dst_ring_read_index() argument
4506 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_get_dst_ring_read_index()
4511 return CE_DEST_RING_READ_IDX_GET_FROM_DDR(scn, CE_ctrl_addr); in hif_get_dst_ring_read_index()
4513 if (TARGET_REGISTER_ACCESS_ALLOWED(scn)) in hif_get_dst_ring_read_index()
4514 return A_TARGET_READ(scn, in hif_get_dst_ring_read_index()
4517 return CE_DEST_RING_READ_IDX_GET_FROM_DDR(scn, in hif_get_dst_ring_read_index()
4528 static inline QDF_STATUS hif_alloc_rri_on_ddr(struct hif_softc *scn) in hif_alloc_rri_on_ddr() argument
4532 scn->vaddr_rri_on_ddr = in hif_alloc_rri_on_ddr()
4533 (void *)qdf_mem_alloc_consistent(scn->qdf_dev, in hif_alloc_rri_on_ddr()
4534 scn->qdf_dev->dev, RRI_ON_DDR_MEM_SIZE, in hif_alloc_rri_on_ddr()
4537 if (!scn->vaddr_rri_on_ddr) { in hif_alloc_rri_on_ddr()
4542 scn->paddr_rri_on_ddr = paddr_rri_on_ddr; in hif_alloc_rri_on_ddr()
4544 qdf_mem_zero(scn->vaddr_rri_on_ddr, RRI_ON_DDR_MEM_SIZE); in hif_alloc_rri_on_ddr()
4563 static inline void hif_config_rri_on_ddr(struct hif_softc *scn) in hif_config_rri_on_ddr() argument
4567 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_config_rri_on_ddr()
4570 if (hif_alloc_rri_on_ddr(scn) != QDF_STATUS_SUCCESS) in hif_config_rri_on_ddr()
4573 low_paddr = RRI_ON_DDR_PADDR_LOW(scn->paddr_rri_on_ddr); in hif_config_rri_on_ddr()
4574 high_paddr = RRI_ON_DDR_PADDR_HIGH(scn->paddr_rri_on_ddr); in hif_config_rri_on_ddr()
4578 WRITE_CE_DDR_ADDRESS_FOR_RRI_LOW(scn, low_paddr); in hif_config_rri_on_ddr()
4579 WRITE_CE_DDR_ADDRESS_FOR_RRI_HIGH(scn, high_paddr); in hif_config_rri_on_ddr()
4584 CE_IDX_UPD_EN_SET(scn, CE_BASE_ADDRESS(i)); in hif_config_rri_on_ddr()
4588 static inline void hif_config_rri_on_ddr(struct hif_softc *scn) in hif_config_rri_on_ddr() argument
4592 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_config_rri_on_ddr()
4595 if (hif_alloc_rri_on_ddr(scn) != QDF_STATUS_SUCCESS) in hif_config_rri_on_ddr()
4598 low_paddr = RRI_ON_DDR_PADDR_LOW(scn->paddr_rri_on_ddr); in hif_config_rri_on_ddr()
4599 high_paddr = RRI_ON_DDR_PADDR_HIGH(scn->paddr_rri_on_ddr); in hif_config_rri_on_ddr()
4603 WRITE_CE_DDR_ADDRESS_FOR_RRI_LOW(scn, low_paddr); in hif_config_rri_on_ddr()
4604 WRITE_CE_DDR_ADDRESS_FOR_RRI_HIGH(scn, high_paddr); in hif_config_rri_on_ddr()
4614 CE_IDX_UPD_EN_DMAX_LEN_SET(scn, CE_BASE_ADDRESS(i), in hif_config_rri_on_ddr()
4617 CE_IDX_UPD_EN_SET(scn, CE_BASE_ADDRESS(i)); in hif_config_rri_on_ddr()
4633 static inline void hif_config_rri_on_ddr(struct hif_softc *scn) in hif_config_rri_on_ddr() argument
4648 static void hif_update_rri_over_ddr_config(struct hif_softc *scn, in hif_update_rri_over_ddr_config() argument
4651 if (hif_alloc_rri_on_ddr(scn) != QDF_STATUS_SUCCESS) in hif_update_rri_over_ddr_config()
4656 BITS0_TO_31(scn->paddr_rri_on_ddr); in hif_update_rri_over_ddr_config()
4658 BITS32_TO_35(scn->paddr_rri_on_ddr); in hif_update_rri_over_ddr_config()
4661 static void hif_update_rri_over_ddr_config(struct hif_softc *scn, in hif_update_rri_over_ddr_config() argument
4676 int hif_wlan_enable(struct hif_softc *scn) in hif_wlan_enable() argument
4678 struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn); in hif_wlan_enable()
4682 uint32_t con_mode = hif_get_conparam(scn); in hif_wlan_enable()
4684 hif_get_target_ce_config(scn, in hif_wlan_enable()
4702 hif_prepare_hal_shadow_reg_cfg_v3(scn, &cfg); in hif_wlan_enable()
4705 hif_prepare_hal_shadow_register_cfg(scn, in hif_wlan_enable()
4713 hif_update_rri_over_ddr_config(scn, &cfg); in hif_wlan_enable()
4729 return pld_wlan_enable(scn->qdf_dev->dev, &cfg, mode); in hif_wlan_enable()
4736 void hif_ce_prepare_epping_config(struct hif_softc *scn, in hif_ce_prepare_epping_config() argument
4747 scn->ce_count = EPPING_HOST_CE_COUNT; in hif_ce_prepare_epping_config()
4753 void hif_set_ce_config_qcn7605(struct hif_softc *scn, in hif_set_ce_config_qcn7605() argument
4762 scn->ce_count = QCN7605_CE_COUNT; in hif_set_ce_config_qcn7605()
4766 void hif_set_ce_config_qcn7605(struct hif_softc *scn, in hif_set_ce_config_qcn7605() argument
4834 void hif_ce_prepare_config(struct hif_softc *scn) in hif_ce_prepare_config() argument
4836 uint32_t mode = hif_get_conparam(scn); in hif_ce_prepare_config()
4837 struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn); in hif_ce_prepare_config()
4839 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_ce_prepare_config()
4846 hif_state->ce_services = ce_services_attach(scn); in hif_ce_prepare_config()
4848 ret = pld_get_user_msi_assignment(scn->qdf_dev->dev, "CE", in hif_ce_prepare_config()
4852 scn->ce_count = HOST_CE_COUNT; in hif_ce_prepare_config()
4853 scn->int_assignment = &ce_int_context[msi_data_count]; in hif_ce_prepare_config()
4854 scn->free_irq_done = false; in hif_ce_prepare_config()
4857 hif_ce_prepare_epping_config(scn, hif_state); in hif_ce_prepare_config()
4868 hif_set_ce_config_qcn7605(scn, hif_state); in hif_ce_prepare_config()
4873 if (hif_is_attribute_set(scn, HIF_LOWDESC_CE_NO_PKTLOG_CFG)) { in hif_ce_prepare_config()
4876 } else if (hif_is_attribute_set(scn, HIF_LOWDESC_CE_CFG)) { in hif_ce_prepare_config()
4891 if (hif_is_attribute_set(scn, HIF_LOWDESC_CE_CFG)) { in hif_ce_prepare_config()
4906 if (scn->bus_type == QDF_BUS_TYPE_PCI) { in hif_ce_prepare_config()
4927 scn->ce_count = QCA_6290_CE_COUNT; in hif_ce_prepare_config()
4934 scn->ce_count = QCN_9000_CE_COUNT; in hif_ce_prepare_config()
4935 scn->ini_cfg.disable_wake_irq = 1; in hif_ce_prepare_config()
4938 hif_set_ce_config_qcn9224(scn, hif_state); in hif_ce_prepare_config()
4945 scn->ce_count = QCA_5332_CE_COUNT; in hif_ce_prepare_config()
4952 scn->ce_count = QCN_6122_CE_COUNT; in hif_ce_prepare_config()
4953 scn->ini_cfg.disable_wake_irq = 1; in hif_ce_prepare_config()
4960 scn->ce_count = QCN_9160_CE_COUNT; in hif_ce_prepare_config()
4961 scn->ini_cfg.disable_wake_irq = 1; in hif_ce_prepare_config()
4968 scn->ce_count = QCN_6432_CE_COUNT; in hif_ce_prepare_config()
4969 scn->ini_cfg.disable_wake_irq = 1; in hif_ce_prepare_config()
4976 scn->ce_count = QCA_5018_CE_COUNT; in hif_ce_prepare_config()
4990 scn->ce_count = QCA_6390_CE_COUNT; in hif_ce_prepare_config()
4998 scn->ce_count = QCA_6490_CE_COUNT; in hif_ce_prepare_config()
5006 scn->ce_count = QCA_6750_CE_COUNT; in hif_ce_prepare_config()
5012 scn->ce_count = KIWI_CE_COUNT; in hif_ce_prepare_config()
5015 if (hif_is_attribute_set(scn, HIF_LOWDESC_CE_NO_PKTLOG_CFG)) { in hif_ce_prepare_config()
5038 QDF_BUG(scn->ce_count <= CE_COUNT_MAX); in hif_ce_prepare_config()
5113 static void hif_post_static_buf_to_target(struct hif_softc *scn) in hif_post_static_buf_to_target() argument
5123 scn->vaddr_qmi_bypass = in hif_post_static_buf_to_target()
5124 (uint32_t *)qdf_mem_alloc_consistent(scn->qdf_dev, in hif_post_static_buf_to_target()
5125 scn->qdf_dev->dev, in hif_post_static_buf_to_target()
5128 if (!scn->vaddr_qmi_bypass) { in hif_post_static_buf_to_target()
5133 scn->paddr_qmi_bypass = target_pa; in hif_post_static_buf_to_target()
5135 ce_info_ptr = (struct ce_info *)scn->vaddr_qmi_bypass; in hif_post_static_buf_to_target()
5137 if (scn->vaddr_rri_on_ddr) { in hif_post_static_buf_to_target()
5139 BITS0_TO_31(scn->paddr_rri_on_ddr); in hif_post_static_buf_to_target()
5141 BITS32_TO_35(scn->paddr_rri_on_ddr); in hif_post_static_buf_to_target()
5144 ret = pld_get_user_msi_assignment(scn->qdf_dev->dev, "CE", in hif_post_static_buf_to_target()
5158 hif_write32_mb(scn, scn->mem + BYPASS_QMI_TEMP_REGISTER, target_pa); in hif_post_static_buf_to_target()
5159 hif_info("target va %pK target pa %pa", scn->vaddr_qmi_bypass, in hif_post_static_buf_to_target()
5170 void hif_cleanup_static_buf_to_target(struct hif_softc *scn) in hif_cleanup_static_buf_to_target() argument
5172 void *target_va = scn->vaddr_qmi_bypass; in hif_cleanup_static_buf_to_target()
5173 phys_addr_t target_pa = scn->paddr_qmi_bypass; in hif_cleanup_static_buf_to_target()
5175 qdf_mem_free_consistent(scn->qdf_dev, scn->qdf_dev->dev, in hif_cleanup_static_buf_to_target()
5178 hif_write32_mb(scn, scn->mem + BYPASS_QMI_TEMP_REGISTER, 0); in hif_cleanup_static_buf_to_target()
5189 static void hif_post_static_buf_to_target(struct hif_softc *scn) in hif_post_static_buf_to_target() argument
5193 scn->vaddr_qmi_bypass = in hif_post_static_buf_to_target()
5194 (uint32_t *)qdf_mem_alloc_consistent(scn->qdf_dev, in hif_post_static_buf_to_target()
5195 scn->qdf_dev->dev, in hif_post_static_buf_to_target()
5198 if (!scn->vaddr_qmi_bypass) { in hif_post_static_buf_to_target()
5203 scn->paddr_qmi_bypass = target_pa; in hif_post_static_buf_to_target()
5204 hif_write32_mb(scn, scn->mem + BYPASS_QMI_TEMP_REGISTER, target_pa); in hif_post_static_buf_to_target()
5214 void hif_cleanup_static_buf_to_target(struct hif_softc *scn) in hif_cleanup_static_buf_to_target() argument
5216 void *target_va = scn->vaddr_qmi_bypass; in hif_cleanup_static_buf_to_target()
5217 phys_addr_t target_pa = scn->paddr_qmi_bypass; in hif_cleanup_static_buf_to_target()
5219 qdf_mem_free_consistent(scn->qdf_dev, scn->qdf_dev->dev, in hif_cleanup_static_buf_to_target()
5222 hif_write32_mb(scn, scn->mem + BYPASS_QMI_TEMP_REGISTER, 0); in hif_cleanup_static_buf_to_target()
5227 static inline void hif_post_static_buf_to_target(struct hif_softc *scn) in hif_post_static_buf_to_target() argument
5231 void hif_cleanup_static_buf_to_target(struct hif_softc *scn) in hif_cleanup_static_buf_to_target() argument
5236 static int hif_srng_sleep_state_adjust(struct hif_softc *scn, bool sleep_ok, in hif_srng_sleep_state_adjust() argument
5243 int hif_config_ce_by_id(struct hif_softc *scn, int pipe_num) in hif_config_ce_by_id() argument
5245 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_config_ce_by_id()
5246 struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn); in hif_config_ce_by_id()
5259 ce_state = scn->ce_id_to_state[pipe_num]; in hif_config_ce_by_id()
5267 pipe_info->ce_hdl = ce_init(scn, pipe_num, attr); in hif_config_ce_by_id()
5268 ce_state = scn->ce_id_to_state[pipe_num]; in hif_config_ce_by_id()
5270 A_TARGET_ACCESS_UNLIKELY(scn); in hif_config_ce_by_id()
5278 A_TARGET_ACCESS_UNLIKELY(scn); in hif_config_ce_by_id()
5292 if (hif_is_nss_wifi_enabled(scn) && ce_state && in hif_config_ce_by_id()
5302 if (ce_srng_based(scn)) in hif_config_ce_by_id()
5318 static inline void hif_gen_ce_id_history_idx_mapping(struct hif_softc *scn) in hif_gen_ce_id_history_idx_mapping() argument
5320 struct ce_desc_hist *ce_hist = &scn->hif_ce_desc_hist; in hif_gen_ce_id_history_idx_mapping()
5323 for (ce_id = 0; ce_id < scn->ce_count; ce_id++) { in hif_gen_ce_id_history_idx_mapping()
5331 static inline void hif_gen_ce_id_history_idx_mapping(struct hif_softc *scn) in hif_gen_ce_id_history_idx_mapping() argument
5347 int hif_config_ce(struct hif_softc *scn) in hif_config_ce() argument
5349 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_config_ce()
5358 scn->notice_send = true; in hif_config_ce()
5359 scn->ce_service_max_rx_ind_flush = MSG_FLUSH_NUM; in hif_config_ce()
5361 hif_post_static_buf_to_target(scn); in hif_config_ce()
5365 hif_config_rri_on_ddr(scn); in hif_config_ce()
5367 if (ce_srng_based(scn)) in hif_config_ce()
5368 scn->bus_ops.hif_target_sleep_state_adjust = in hif_config_ce()
5374 reset_ce_debug_history(scn); in hif_config_ce()
5375 hif_gen_ce_id_history_idx_mapping(scn); in hif_config_ce()
5377 for (pipe_num = 0; pipe_num < scn->ce_count; pipe_num++) { in hif_config_ce()
5386 if (hif_config_ce_by_id(scn, pipe_num)) in hif_config_ce()
5390 if (athdiag_procfs_init(scn) != 0) { in hif_config_ce()
5391 A_TARGET_ACCESS_UNLIKELY(scn); in hif_config_ce()
5394 scn->athdiag_procfs_inited = true; in hif_config_ce()
5404 (A_TARGET_READ(scn, (SHADOW_ADDRESS(i))) << 2)); in hif_config_ce()
5411 hif_unconfig_ce(scn); in hif_config_ce()
5429 struct hif_softc *scn = HIF_GET_SOFTC(hif_hdl); in hif_config_ce_pktlog() local
5430 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_config_ce_pktlog()
5435 if (!scn) in hif_config_ce_pktlog()
5438 if (scn->pktlog_init) in hif_config_ce_pktlog()
5441 pipe_num = hif_get_pktlog_ce_num(scn); in hif_config_ce_pktlog()
5449 qdf_status = hif_config_ce_by_id(scn, pipe_num); in hif_config_ce_pktlog()
5454 qdf_status = hif_config_irq_by_ceid(scn, pipe_num); in hif_config_ce_pktlog()
5471 scn->pktlog_init = true; in hif_config_ce_pktlog()
5493 void hif_ce_ipa_get_ce_resource(struct hif_softc *scn, in hif_ce_ipa_get_ce_resource() argument
5498 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_ce_ipa_get_ce_resource()
5579 u32 shadow_sr_wr_ind_addr(struct hif_softc *scn, u32 ctrl_addr) in shadow_sr_wr_ind_addr() argument
5608 u32 shadow_dst_wr_ind_addr(struct hif_softc *scn, u32 ctrl_addr) in shadow_dst_wr_ind_addr() argument
5647 u32 shadow_sr_wr_ind_addr(struct hif_softc *scn, u32 ctrl_addr) in shadow_sr_wr_ind_addr() argument
5672 u32 shadow_dst_wr_ind_addr(struct hif_softc *scn, u32 ctrl_addr) in shadow_dst_wr_ind_addr() argument
5719 struct hif_softc *scn = HIF_GET_SOFTC(hif_hdl); in hif_ce_get_lro_ctx() local
5721 ce_state = scn->ce_id_to_state[ctx_id]; in hif_ce_get_lro_ctx()
5755 struct hif_softc *scn = HIF_GET_SOFTC(hif_hdl); in hif_map_service_to_pipe() local
5756 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_map_service_to_pipe()
5760 hif_select_service_to_pipe_map(scn, &tgt_svc_map_to_use, in hif_map_service_to_pipe()
5791 inline uint32_t DEBUG_CE_SRC_RING_READ_IDX_GET(struct hif_softc *scn, in DEBUG_CE_SRC_RING_READ_IDX_GET() argument
5796 read_from_hw = A_TARGET_READ(scn, CE_ctrl_addr + CURRENT_SRRI_ADDRESS); in DEBUG_CE_SRC_RING_READ_IDX_GET()
5798 srri_from_ddr = SRRI_FROM_DDR_ADDR(VADDR_FOR_CE(scn, CE_ctrl_addr)); in DEBUG_CE_SRC_RING_READ_IDX_GET()
5803 CE_MISC_INT_STATUS_GET(scn, CE_ctrl_addr)); in DEBUG_CE_SRC_RING_READ_IDX_GET()
5810 inline uint32_t DEBUG_CE_DEST_RING_READ_IDX_GET(struct hif_softc *scn, in DEBUG_CE_DEST_RING_READ_IDX_GET() argument
5815 read_from_hw = A_TARGET_READ(scn, CE_ctrl_addr + CURRENT_DRRI_ADDRESS); in DEBUG_CE_DEST_RING_READ_IDX_GET()
5817 drri_from_ddr = DRRI_FROM_DDR_ADDR(VADDR_FOR_CE(scn, CE_ctrl_addr)); in DEBUG_CE_DEST_RING_READ_IDX_GET()
5822 CE_MISC_INT_STATUS_GET(scn, CE_ctrl_addr)); in DEBUG_CE_DEST_RING_READ_IDX_GET()
5838 int hif_dump_ce_registers(struct hif_softc *scn) in hif_dump_ce_registers() argument
5840 struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn); in hif_dump_ce_registers()
5847 for (i = 0; i < scn->ce_count; i++, ce_reg_address += CE_OFFSET) { in hif_dump_ce_registers()
5848 if (!scn->ce_id_to_state[i]) { in hif_dump_ce_registers()
5886 struct hif_softc *scn = HIF_GET_SOFTC(osc); in hif_get_addl_pipe_info() local
5887 struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn); in hif_get_addl_pipe_info()
5929 struct hif_softc *scn = HIF_GET_SOFTC(osc); in hif_set_nss_wifiol_mode() local
5931 scn->nss_wifi_ol_mode = mode; in hif_set_nss_wifiol_mode()
5939 struct hif_softc *scn = HIF_GET_SOFTC(osc); in hif_set_attribute() local
5940 scn->hif_attribute = hif_attrib; in hif_set_attribute()
5947 struct hif_softc *scn = HIF_GET_SOFTC(osc); in hif_disable_interrupt() local
5948 struct CE_state *CE_state = scn->ce_id_to_state[pipe_num]; in hif_disable_interrupt()
5951 Q_TARGET_ACCESS_BEGIN(scn); in hif_disable_interrupt()
5952 CE_COPY_COMPLETE_INTR_DISABLE(scn, ctrl_addr); in hif_disable_interrupt()
5953 Q_TARGET_ACCESS_END(scn); in hif_disable_interrupt()
5992 struct hif_softc *scn = arg; in hif_fw_interrupt_handler() local
5993 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_fw_interrupt_handler()
5996 if (Q_TARGET_ACCESS_BEGIN(scn) < 0) in hif_fw_interrupt_handler()
6001 fw_indicator = A_TARGET_READ(scn, fw_indicator_address); in hif_fw_interrupt_handler()
6005 A_TARGET_WRITE(scn, fw_indicator_address, in hif_fw_interrupt_handler()
6007 if (Q_TARGET_ACCESS_END(scn) < 0) in hif_fw_interrupt_handler()
6026 if (Q_TARGET_ACCESS_END(scn) < 0) in hif_fw_interrupt_handler()
6049 void hif_wlan_disable(struct hif_softc *scn) in hif_wlan_disable() argument
6052 uint32_t con_mode = hif_get_conparam(scn); in hif_wlan_disable()
6054 if (scn->target_status == TARGET_STATUS_RESET) in hif_wlan_disable()
6064 pld_wlan_disable(scn->qdf_dev->dev, mode); in hif_wlan_disable()
6067 int hif_get_wake_ce_id(struct hif_softc *scn, uint8_t *ce_id) in hif_get_wake_ce_id() argument
6074 status = hif_map_service_to_pipe(GET_HIF_OPAQUE_HDL(scn), in hif_get_wake_ce_id()
6088 int hif_get_fw_diag_ce_id(struct hif_softc *scn, uint8_t *ce_id) in hif_get_fw_diag_ce_id() argument
6095 status = hif_map_service_to_pipe(GET_HIF_OPAQUE_HDL(scn), in hif_get_fw_diag_ce_id()
6119 int ce_get_index_info(struct hif_softc *scn, void *ce_state, in ce_get_index_info() argument
6122 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in ce_get_index_info()
6124 return hif_state->ce_services->ce_get_index_info(scn, ce_state, info); in ce_get_index_info()
6127 void hif_log_ce_info(struct hif_softc *scn, uint8_t *data, in hif_log_ce_info() argument
6137 info.active_tasklet_count = qdf_atomic_read(&scn->active_tasklet_cnt); in hif_log_ce_info()
6139 qdf_atomic_read(&scn->active_grp_tasklet_cnt); in hif_log_ce_info()
6141 for (i = 0; i < scn->ce_count; i++) { in hif_log_ce_info()
6142 if (!(tracked_ce & BIT(i)) || !scn->ce_id_to_state[i]) in hif_log_ce_info()
6145 if (ce_get_index_info(scn, scn->ce_id_to_state[i], in hif_log_ce_info()
6169 hif_set_irq_config_by_ceid(struct hif_opaque_softc *scn, uint8_t ce_id, in hif_set_irq_config_by_ceid() argument
6172 struct hif_softc *hif_ctx = HIF_GET_SOFTC(scn); in hif_set_irq_config_by_ceid()
6173 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_set_irq_config_by_ceid()
6185 uint16_t hif_get_direct_link_ce_dest_srng_buffers(struct hif_opaque_softc *scn, in hif_get_direct_link_ce_dest_srng_buffers() argument
6189 struct hif_softc *hif_ctx = HIF_GET_SOFTC(scn); in hif_get_direct_link_ce_dest_srng_buffers()
6190 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_get_direct_link_ce_dest_srng_buffers()
6202 hif_get_direct_link_ce_srng_info(struct hif_opaque_softc *scn, in hif_get_direct_link_ce_srng_info() argument
6206 struct hif_softc *hif_ctx = HIF_GET_SOFTC(scn); in hif_get_direct_link_ce_srng_info()
6207 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_get_direct_link_ce_srng_info()