Lines Matching refs:scn
93 static int hif_ce_msi_map_ce_to_irq(struct hif_softc *scn, int ce_id) in hif_ce_msi_map_ce_to_irq() argument
95 struct hif_ipci_softc *ipci_scn = HIF_GET_IPCI_SOFTC(scn); in hif_ce_msi_map_ce_to_irq()
159 static int hif_ce_srng_msi_free_irq(struct hif_softc *scn) in hif_ce_srng_msi_free_irq() argument
166 struct HIF_CE_state *ce_sc = HIF_GET_CE_STATE(scn); in hif_ce_srng_msi_free_irq()
168 ret = pld_get_user_msi_assignment(scn->qdf_dev->dev, "CE", in hif_ce_srng_msi_free_irq()
177 for (ce_id = 0; ce_id < scn->ce_count; ce_id++) { in hif_ce_srng_msi_free_irq()
184 irq = pld_get_msi_irq(scn->qdf_dev->dev, msi_data); in hif_ce_srng_msi_free_irq()
191 pfrm_free_irq(scn->qdf_dev->dev, irq, &ce_sc->tasklets[ce_id]); in hif_ce_srng_msi_free_irq()
203 void hif_ipci_deconfigure_grp_irq(struct hif_softc *scn) in hif_ipci_deconfigure_grp_irq() argument
206 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_ipci_deconfigure_grp_irq()
215 pfrm_free_irq(scn->qdf_dev->dev, in hif_ipci_deconfigure_grp_irq()
223 void hif_ipci_nointrs(struct hif_softc *scn) in hif_ipci_nointrs() argument
226 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_ipci_nointrs()
228 scn->free_irq_done = true; in hif_ipci_nointrs()
231 if (scn->request_irq_done == false) in hif_ipci_nointrs()
234 hif_ipci_deconfigure_grp_irq(scn); in hif_ipci_nointrs()
236 ret = hif_ce_srng_msi_free_irq(scn); in hif_ipci_nointrs()
238 scn->request_irq_done = false; in hif_ipci_nointrs()
241 void hif_ipci_disable_bus(struct hif_softc *scn) in hif_ipci_disable_bus() argument
243 struct hif_ipci_softc *sc = HIF_GET_IPCI_SOFTC(scn); in hif_ipci_disable_bus()
254 hif_dump_pipe_debug_count(scn); in hif_ipci_disable_bus()
255 if (scn->athdiag_procfs_inited) { in hif_ipci_disable_bus()
257 scn->athdiag_procfs_inited = false; in hif_ipci_disable_bus()
259 scn->mem = NULL; in hif_ipci_disable_bus()
265 void hif_ipci_prevent_linkdown(struct hif_softc *scn, bool flag) in hif_ipci_prevent_linkdown() argument
270 hif_runtime_prevent_linkdown(scn, flag); in hif_ipci_prevent_linkdown()
272 errno = pld_wlan_pm_control(scn->qdf_dev->dev, flag); in hif_ipci_prevent_linkdown()
277 void hif_ipci_prevent_linkdown(struct hif_softc *scn, bool flag) in hif_ipci_prevent_linkdown() argument
282 int hif_ipci_bus_suspend(struct hif_softc *scn) in hif_ipci_bus_suspend() argument
286 ret = hif_apps_disable_irqs_except_wake_irq(GET_HIF_OPAQUE_HDL(scn)); in hif_ipci_bus_suspend()
292 ret = hif_apps_enable_irq_wake(GET_HIF_OPAQUE_HDL(scn)); in hif_ipci_bus_suspend()
298 if (QDF_IS_STATUS_ERROR(hif_try_complete_tasks(scn))) { in hif_ipci_bus_suspend()
308 ret = hif_drain_fw_diag_ce(scn); in hif_ipci_bus_suspend()
314 scn->bus_suspended = true; in hif_ipci_bus_suspend()
319 hif_apps_disable_irq_wake(GET_HIF_OPAQUE_HDL(scn)); in hif_ipci_bus_suspend()
322 hif_apps_enable_irqs_except_wake_irq(GET_HIF_OPAQUE_HDL(scn)); in hif_ipci_bus_suspend()
328 int hif_ipci_bus_resume(struct hif_softc *scn) in hif_ipci_bus_resume() argument
332 ret = hif_apps_disable_irq_wake(GET_HIF_OPAQUE_HDL(scn)); in hif_ipci_bus_resume()
338 ret = hif_apps_enable_irqs_except_wake_irq(GET_HIF_OPAQUE_HDL(scn)); in hif_ipci_bus_resume()
342 scn->bus_suspended = false; in hif_ipci_bus_resume()
348 int hif_ipci_bus_suspend_noirq(struct hif_softc *scn) in hif_ipci_bus_suspend_noirq() argument
361 hif_get_num_active_tasklets(scn)) { in hif_ipci_bus_suspend_noirq()
369 int hif_ipci_bus_resume_noirq(struct hif_softc *scn) in hif_ipci_bus_resume_noirq() argument
374 void hif_ipci_disable_isr(struct hif_softc *scn) in hif_ipci_disable_isr() argument
376 struct hif_ipci_softc *sc = HIF_GET_IPCI_SOFTC(scn); in hif_ipci_disable_isr()
378 hif_exec_kill(&scn->osc); in hif_ipci_disable_isr()
379 hif_nointrs(scn); in hif_ipci_disable_isr()
381 ce_tasklet_kill(scn); in hif_ipci_disable_isr()
383 qdf_atomic_set(&scn->active_tasklet_cnt, 0); in hif_ipci_disable_isr()
384 qdf_atomic_set(&scn->active_grp_tasklet_cnt, 0); in hif_ipci_disable_isr()
390 struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); in hif_ipci_dump_registers() local
392 status = hif_dump_ce_registers(scn); in hif_ipci_dump_registers()
448 static int hif_ce_msi_configure_irq(struct hif_softc *scn) in hif_ce_msi_configure_irq() argument
455 struct HIF_CE_state *ce_sc = HIF_GET_CE_STATE(scn); in hif_ce_msi_configure_irq()
456 struct hif_ipci_softc *ipci_sc = HIF_GET_IPCI_SOFTC(scn); in hif_ce_msi_configure_irq()
459 ret = hif_get_wake_ce_id(scn, &wake_ce_id); in hif_ce_msi_configure_irq()
464 ret = pld_get_user_msi_assignment(scn->qdf_dev->dev, "CE", in hif_ce_msi_configure_irq()
470 scn->bus_ops.hif_irq_disable = &hif_ce_srng_msi_irq_disable; in hif_ce_msi_configure_irq()
471 scn->bus_ops.hif_irq_enable = &hif_ce_srng_msi_irq_enable; in hif_ce_msi_configure_irq()
472 scn->bus_ops.hif_map_ce_to_irq = &hif_ce_msi_map_ce_to_irq; in hif_ce_msi_configure_irq()
477 for (ce_id = 0; ce_id < scn->ce_count; ce_id++) { in hif_ce_msi_configure_irq()
481 irq = pld_get_msi_irq(scn->qdf_dev->dev, msi_data); in hif_ce_msi_configure_irq()
491 ret = pfrm_request_irq(scn->qdf_dev->dev, in hif_ce_msi_configure_irq()
504 while (ce_id > 0 && ce_id < scn->ce_count) { in hif_ce_msi_configure_irq()
509 irq = pld_get_msi_irq(scn->qdf_dev->dev, msi_data); in hif_ce_msi_configure_irq()
510 pfrm_free_irq(scn->qdf_dev->dev, irq, &ce_sc->tasklets[ce_id]); in hif_ce_msi_configure_irq()
525 struct hif_softc *scn = HIF_GET_SOFTC(hif_ext_group->hif); in hif_exec_grp_irq_disable() local
528 pfrm_disable_irq_nosync(scn->qdf_dev->dev, in hif_exec_grp_irq_disable()
541 struct hif_softc *scn = HIF_GET_SOFTC(hif_ext_group->hif); in hif_exec_grp_irq_enable() local
544 pfrm_enable_irq(scn->qdf_dev->dev, hif_ext_group->os_irq[i]); in hif_exec_grp_irq_enable()
596 void hif_ipci_set_grp_intr_affinity(struct hif_softc *scn, in hif_ipci_set_grp_intr_affinity() argument
600 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_ipci_set_grp_intr_affinity()
615 static void hif_ipci_ce_irq_set_affinity_hint(struct hif_softc *scn) in hif_ipci_ce_irq_set_affinity_hint() argument
619 struct HIF_CE_state *ce_sc = HIF_GET_CE_STATE(scn); in hif_ipci_ce_irq_set_affinity_hint()
620 struct hif_ipci_softc *ipci_sc = HIF_GET_IPCI_SOFTC(scn); in hif_ipci_ce_irq_set_affinity_hint()
641 for (ce_id = 0; ce_id < scn->ce_count; ce_id++) { in hif_ipci_ce_irq_set_affinity_hint()
645 ret = hif_affinity_mgr_set_ce_irq_affinity(scn, ipci_sc->ce_msi_irq_num[ce_id], in hif_ipci_ce_irq_set_affinity_hint()
664 void hif_ipci_config_irq_affinity(struct hif_softc *scn) in hif_ipci_config_irq_affinity() argument
668 hif_ipci_ce_irq_set_affinity_hint(scn); in hif_ipci_config_irq_affinity()
673 void hif_ipci_config_irq_clear_cpu_affinity(struct hif_softc *scn, in hif_ipci_config_irq_clear_cpu_affinity() argument
676 struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn); in hif_ipci_config_irq_clear_cpu_affinity()
705 int hif_ipci_configure_grp_irq(struct hif_softc *scn, in hif_ipci_configure_grp_irq() argument
722 ret = pfrm_request_irq(scn->qdf_dev->dev, irq, in hif_ipci_configure_grp_irq()
737 int hif_configure_irq(struct hif_softc *scn) in hif_configure_irq() argument
741 if (hif_is_polled_mode_enabled(GET_HIF_OPAQUE_HDL(scn))) { in hif_configure_irq()
742 scn->request_irq_done = false; in hif_configure_irq()
746 ret = hif_ce_msi_configure_irq(scn); in hif_configure_irq()
755 scn->request_irq_done = true; in hif_configure_irq()
770 struct hif_softc *scn = HIF_GET_SOFTC(sc); in hif_ipci_get_soc_info_pld() local
777 scn->target_info.target_version = info.soc_id; in hif_ipci_get_soc_info_pld()
778 scn->target_info.target_revision = 0; in hif_ipci_get_soc_info_pld()
884 bool hif_ipci_needs_bmi(struct hif_softc *scn) in hif_ipci_needs_bmi() argument
886 return !ce_srng_based(scn); in hif_ipci_needs_bmi()
893 struct hif_softc *scn = (struct hif_softc *)hif_handle; in hif_force_wake_request() local
894 struct hif_ipci_softc *ipci_scn = HIF_GET_IPCI_SOFTC(scn); in hif_force_wake_request()
896 if (pld_force_wake_request(scn->qdf_dev->dev)) { in hif_force_wake_request()
902 while (!pld_is_device_awake(scn->qdf_dev->dev) && in hif_force_wake_request()
912 if (pld_is_device_awake(scn->qdf_dev->dev) <= 0) { in hif_force_wake_request()
928 struct hif_softc *scn = (struct hif_softc *)hif_handle; in hif_force_wake_release() local
929 struct hif_ipci_softc *ipci_scn = HIF_GET_IPCI_SOFTC(scn); in hif_force_wake_release()
931 ret = pld_force_wake_release(scn->qdf_dev->dev); in hif_force_wake_release()
971 struct hif_softc *scn = HIF_GET_SOFTC(hif); in hif_prevent_link_low_power_states() local
972 struct hif_ipci_softc *ipci_scn = HIF_GET_IPCI_SOFTC(scn); in hif_prevent_link_low_power_states()
976 if (pld_is_pci_ep_awake(scn->qdf_dev->dev) == -ENOTSUPP) in hif_prevent_link_low_power_states()
979 if (hif_is_ep_vote_access_disabled(scn)) { in hif_prevent_link_low_power_states()
985 while (pld_is_pci_ep_awake(scn->qdf_dev->dev) && in hif_prevent_link_low_power_states()
997 if (pld_is_pci_ep_awake(scn->qdf_dev->dev)) { in hif_prevent_link_low_power_states()
1003 if (pld_prevent_l1(scn->qdf_dev->dev)) { in hif_prevent_link_low_power_states()
1012 while (!pld_is_pci_ep_awake(scn->qdf_dev->dev) && in hif_prevent_link_low_power_states()
1024 if (pld_is_pci_ep_awake(scn->qdf_dev->dev) <= 0) { in hif_prevent_link_low_power_states()
1035 struct hif_softc *scn = HIF_GET_SOFTC(hif); in hif_allow_link_low_power_states() local
1036 struct hif_ipci_softc *ipci_scn = HIF_GET_IPCI_SOFTC(scn); in hif_allow_link_low_power_states()
1039 pld_allow_l1(scn->qdf_dev->dev); in hif_allow_link_low_power_states()
1046 int hif_ipci_enable_grp_irqs(struct hif_softc *scn) in hif_ipci_enable_grp_irqs() argument
1048 struct hif_ipci_softc *ipci_scn = HIF_GET_IPCI_SOFTC(scn); in hif_ipci_enable_grp_irqs()
1056 status = hif_apps_grp_irqs_enable(GET_HIF_OPAQUE_HDL(scn)); in hif_ipci_enable_grp_irqs()
1063 int hif_ipci_disable_grp_irqs(struct hif_softc *scn) in hif_ipci_disable_grp_irqs() argument
1065 struct hif_ipci_softc *ipci_scn = HIF_GET_IPCI_SOFTC(scn); in hif_ipci_disable_grp_irqs()
1073 status = hif_apps_grp_irqs_disable(GET_HIF_OPAQUE_HDL(scn)); in hif_ipci_disable_grp_irqs()