Lines Matching refs:ctrl_p

50 static int pciehpc_acpi_hpc_init(pcie_hp_ctrl_t *ctrl_p);
51 static int pciehpc_acpi_hpc_uninit(pcie_hp_ctrl_t *ctrl_p);
52 static int pciehpc_acpi_slotinfo_init(pcie_hp_ctrl_t *ctrl_p);
53 static int pciehpc_acpi_slotinfo_uninit(pcie_hp_ctrl_t *ctrl_p);
54 static int pciehpc_acpi_enable_intr(pcie_hp_ctrl_t *ctrl_p);
55 static int pciehpc_acpi_disable_intr(pcie_hp_ctrl_t *ctrl_p);
60 static void pciehpc_acpi_setup_ops(pcie_hp_ctrl_t *ctrl_p);
62 static ACPI_STATUS pciehpc_acpi_install_event_handler(pcie_hp_ctrl_t *ctrl_p);
63 static void pciehpc_acpi_uninstall_event_handler(pcie_hp_ctrl_t *ctrl_p);
64 static ACPI_STATUS pciehpc_acpi_power_on_slot(pcie_hp_ctrl_t *ctrl_p);
65 static ACPI_STATUS pciehpc_acpi_power_off_slot(pcie_hp_ctrl_t *ctrl_p);
74 pciehpc_update_ops(pcie_hp_ctrl_t *ctrl_p)
89 if (pcie_acpi_osc(ctrl_p->hc_dip, &osc_flags) == DDI_SUCCESS) {
95 pcie_bus_t *bus_p = PCIE_DIP2BUS(ctrl_p->hc_dip);
98 pciehpc_acpi_setup_ops(ctrl_p);
105 pciehpc_acpi_setup_ops(pcie_hp_ctrl_t *ctrl_p)
107 ctrl_p->hc_ops.init_hpc_hw = pciehpc_acpi_hpc_init;
108 ctrl_p->hc_ops.uninit_hpc_hw = pciehpc_acpi_hpc_uninit;
109 ctrl_p->hc_ops.init_hpc_slotinfo = pciehpc_acpi_slotinfo_init;
110 ctrl_p->hc_ops.uninit_hpc_slotinfo = pciehpc_acpi_slotinfo_uninit;
111 ctrl_p->hc_ops.poweron_hpc_slot = pciehpc_acpi_slot_poweron;
112 ctrl_p->hc_ops.poweroff_hpc_slot = pciehpc_acpi_slot_poweroff;
113 ctrl_p->hc_ops.disable_hpc_intr = pciehpc_acpi_disable_intr;
114 ctrl_p->hc_ops.enable_hpc_intr = pciehpc_acpi_enable_intr;
121 pciehpc_acpi_hpc_init(pcie_hp_ctrl_t *ctrl_p)
132 status = acpica_get_handle(ctrl_p->hc_dip, &pcibus_obj);
173 ctrl_p->hc_misc_data = acpi_p;
182 pciehpc_acpi_hpc_uninit(pcie_hp_ctrl_t *ctrl_p)
185 if (ctrl_p->hc_misc_data) {
186 kmem_free(ctrl_p->hc_misc_data, sizeof (pciehpc_acpi_t));
187 ctrl_p->hc_misc_data = NULL;
199 pciehpc_acpi_enable_intr(pcie_hp_ctrl_t *ctrl_p)
210 pciehpc_acpi_disable_intr(pcie_hp_ctrl_t *ctrl_p)
226 pciehpc_acpi_slotinfo_init(pcie_hp_ctrl_t *ctrl_p)
229 pcie_hp_slot_t *slot_p = ctrl_p->hc_slots[0];
230 pcie_bus_t *bus_p = PCIE_DIP2BUS(ctrl_p->hc_dip);
232 mutex_enter(&ctrl_p->hc_mutex);
242 PCI_MINOR_NUM(ddi_get_instance(ctrl_p->hc_dip),
246 slot_capabilities = pciehpc_reg_get32(ctrl_p,
250 pciehpc_set_slot_name(ctrl_p);
253 ctrl_p->hc_has_attn = (slot_capabilities &
257 ctrl_p->hc_has_mrl = (slot_capabilities & PCIE_SLOTCAP_MRL_SENSOR) ?
264 ctrl_p->hc_has_emi_lock = (slot_capabilities &
272 mutex_exit(&ctrl_p->hc_mutex);
275 if (pciehpc_acpi_install_event_handler(ctrl_p) != AE_OK)
289 pciehpc_acpi_slotinfo_uninit(pcie_hp_ctrl_t *ctrl_p)
291 pcie_hp_slot_t *slot_p = ctrl_p->hc_slots[0];
294 pciehpc_acpi_uninstall_event_handler(ctrl_p);
311 pcie_hp_ctrl_t *ctrl_p = slot_p->hs_ctrl;
312 pcie_bus_t *bus_p = PCIE_DIP2BUS(ctrl_p->hc_dip);
315 ASSERT(MUTEX_HELD(&ctrl_p->hc_mutex));
331 status = pciehpc_reg_get16(ctrl_p,
335 if ((ctrl_p->hc_has_mrl) && (status & PCIE_SLOTSTS_MRL_SENSOR_OPEN)) {
350 control = pciehpc_reg_get16(ctrl_p,
364 if (pciehpc_acpi_power_on_slot(ctrl_p) != AE_OK)
383 pcie_hp_ctrl_t *ctrl_p = slot_p->hs_ctrl;
384 pcie_bus_t *bus_p = PCIE_DIP2BUS(ctrl_p->hc_dip);
387 ASSERT(MUTEX_HELD(&ctrl_p->hc_mutex));
404 status = pciehpc_reg_get16(ctrl_p,
415 if (pciehpc_acpi_power_off_slot(ctrl_p) != AE_OK)
434 pciehpc_acpi_install_event_handler(pcie_hp_ctrl_t *ctrl_p)
436 pcie_hp_slot_t *slot_p = ctrl_p->hc_slots[0];
442 acpi_p = ctrl_p->hc_misc_data;
451 ACPI_SYSTEM_NOTIFY, pciehpc_acpi_notify_handler, (void *)ctrl_p);
464 ACPI_SYSTEM_NOTIFY, pciehpc_acpi_notify_handler, (void *)ctrl_p);
477 pcie_hp_ctrl_t *ctrl_p = context;
478 pcie_hp_slot_t *slot_p = ctrl_p->hc_slots[0];
486 mutex_enter(&ctrl_p->hc_mutex);
491 acpi_p = ctrl_p->hc_misc_data;
517 if (ctrl_p->hc_has_attn == B_FALSE) {
553 mutex_exit(&ctrl_p->hc_mutex);
557 pciehpc_acpi_uninstall_event_handler(pcie_hp_ctrl_t *ctrl_p)
559 pciehpc_acpi_t *acpi_p = ctrl_p->hc_misc_data;
560 pcie_hp_slot_t *slot_p = ctrl_p->hc_slots[0];
574 pciehpc_acpi_power_on_slot(pcie_hp_ctrl_t *ctrl_p)
577 pciehpc_acpi_t *acpi_p = ctrl_p->hc_misc_data;
579 pcie_hp_slot_t *slot_p = ctrl_p->hc_slots[0];
612 pciehpc_acpi_power_off_slot(pcie_hp_ctrl_t *ctrl_p)
615 pciehpc_acpi_t *acpi_p = ctrl_p->hc_misc_data;
617 pcie_hp_slot_t *slot_p = ctrl_p->hc_slots[0];