Lines Matching refs:slot

153 	struct acpiphp_slot *slot, *next;  in free_bridge()  local
160 list_for_each_entry_safe(slot, next, &bridge->slots, node) { in free_bridge()
161 list_for_each_entry_safe(func, tmp, &slot->funcs, sibling) in free_bridge()
164 kfree(slot); in free_bridge()
198 bus = context->func.slot->bus; in acpiphp_post_dock_fixup()
232 struct acpiphp_slot *slot; in acpiphp_add_context() local
277 list_for_each_entry(slot, &bridge->slots, node) in acpiphp_add_context()
278 if (slot->device == device) in acpiphp_add_context()
281 slot = kzalloc(sizeof(struct acpiphp_slot), GFP_KERNEL); in acpiphp_add_context()
282 if (!slot) { in acpiphp_add_context()
289 slot->bus = bridge->pci_bus; in acpiphp_add_context()
290 slot->device = device; in acpiphp_add_context()
291 INIT_LIST_HEAD(&slot->funcs); in acpiphp_add_context()
293 list_add_tail(&slot->node, &bridge->slots); in acpiphp_add_context()
315 retval = acpiphp_register_hotplug_slot(slot, sun); in acpiphp_add_context()
317 slot->slot = NULL; in acpiphp_add_context()
328 newfunc->slot = slot; in acpiphp_add_context()
329 list_add_tail(&newfunc->sibling, &slot->funcs); in acpiphp_add_context()
333 slot->flags |= SLOT_ENABLED; in acpiphp_add_context()
340 struct acpiphp_slot *slot; in cleanup_bridge() local
343 list_for_each_entry(slot, &bridge->slots, node) { in cleanup_bridge()
344 list_for_each_entry(func, &slot->funcs, sibling) { in cleanup_bridge()
352 slot->flags |= SLOT_IS_GOING_AWAY; in cleanup_bridge()
353 if (slot->slot) in cleanup_bridge()
354 acpiphp_unregister_hotplug_slot(slot); in cleanup_bridge()
393 static void acpiphp_set_acpi_region(struct acpiphp_slot *slot) in acpiphp_set_acpi_region() argument
399 list_for_each_entry(func, &slot->funcs, sibling) { in acpiphp_set_acpi_region()
412 static void check_hotplug_bridge(struct acpiphp_slot *slot, struct pci_dev *dev) in check_hotplug_bridge() argument
420 list_for_each_entry(func, &slot->funcs, sibling) { in check_hotplug_bridge()
428 static int acpiphp_rescan_slot(struct acpiphp_slot *slot) in acpiphp_rescan_slot() argument
432 list_for_each_entry(func, &slot->funcs, sibling) { in acpiphp_rescan_slot()
439 return pci_scan_slot(slot->bus, PCI_DEVFN(slot->device, 0)); in acpiphp_rescan_slot()
480 static void enable_slot(struct acpiphp_slot *slot, bool bridge) in enable_slot() argument
483 struct pci_bus *bus = slot->bus; in enable_slot()
495 if (PCI_SLOT(dev->devfn) == slot->device) in enable_slot()
502 acpiphp_rescan_slot(slot); in enable_slot()
506 if (PCI_SLOT(dev->devfn) != slot->device) in enable_slot()
511 check_hotplug_bridge(slot, dev); in enable_slot()
526 acpiphp_set_acpi_region(slot); in enable_slot()
536 slot->flags |= SLOT_ENABLED; in enable_slot()
537 list_for_each_entry(func, &slot->funcs, sibling) { in enable_slot()
538 dev = pci_get_slot(bus, PCI_DEVFN(slot->device, in enable_slot()
543 slot->flags &= ~SLOT_ENABLED; in enable_slot()
554 static void disable_slot(struct acpiphp_slot *slot) in disable_slot() argument
556 struct pci_bus *bus = slot->bus; in disable_slot()
567 if (PCI_SLOT(dev->devfn) == slot->device) in disable_slot()
570 list_for_each_entry(func, &slot->funcs, sibling) in disable_slot()
573 slot->flags &= ~SLOT_ENABLED; in disable_slot()
576 static bool slot_no_hotplug(struct acpiphp_slot *slot) in slot_no_hotplug() argument
578 struct pci_bus *bus = slot->bus; in slot_no_hotplug()
582 if (PCI_SLOT(dev->devfn) == slot->device && dev->ignore_hotplug) in slot_no_hotplug()
600 static unsigned int get_slot_status(struct acpiphp_slot *slot) in get_slot_status() argument
606 list_for_each_entry(func, &slot->funcs, sibling) { in get_slot_status()
615 if (pci_bus_read_dev_vendor_id(slot->bus, in get_slot_status()
616 PCI_DEVFN(slot->device, func->function), in get_slot_status()
630 if (pci_bus_read_dev_vendor_id(slot->bus, in get_slot_status()
631 PCI_DEVFN(slot->device, 0), &dvid, 0)) { in get_slot_status()
700 struct acpiphp_slot *slot; in acpiphp_check_bridge() local
709 list_for_each_entry(slot, &bridge->slots, node) { in acpiphp_check_bridge()
710 struct pci_bus *bus = slot->bus; in acpiphp_check_bridge()
713 if (slot_no_hotplug(slot)) { in acpiphp_check_bridge()
715 } else if (device_status_valid(get_slot_status(slot))) { in acpiphp_check_bridge()
719 if (PCI_SLOT(dev->devfn) == slot->device) in acpiphp_check_bridge()
723 enable_slot(slot, true); in acpiphp_check_bridge()
725 disable_slot(slot); in acpiphp_check_bridge()
782 static int acpiphp_disable_and_eject_slot(struct acpiphp_slot *slot);
788 struct acpiphp_slot *slot = func->slot; in hotplug_event() local
806 else if (!(slot->flags & SLOT_IS_GOING_AWAY)) in hotplug_event()
807 enable_slot(slot, false); in hotplug_event()
816 } else if (!(slot->flags & SLOT_IS_GOING_AWAY)) { in hotplug_event()
821 if (acpiphp_rescan_slot(slot)) in hotplug_event()
829 acpiphp_disable_and_eject_slot(slot); in hotplug_event()
984 int acpiphp_enable_slot(struct acpiphp_slot *slot) in acpiphp_enable_slot() argument
988 if (slot->flags & SLOT_IS_GOING_AWAY) { in acpiphp_enable_slot()
994 if (!(slot->flags & SLOT_ENABLED)) in acpiphp_enable_slot()
995 enable_slot(slot, false); in acpiphp_enable_slot()
1005 static int acpiphp_disable_and_eject_slot(struct acpiphp_slot *slot) in acpiphp_disable_and_eject_slot() argument
1009 if (slot->flags & SLOT_IS_GOING_AWAY) in acpiphp_disable_and_eject_slot()
1013 disable_slot(slot); in acpiphp_disable_and_eject_slot()
1015 list_for_each_entry(func, &slot->funcs, sibling) in acpiphp_disable_and_eject_slot()
1028 int acpiphp_disable_slot(struct acpiphp_slot *slot) in acpiphp_disable_slot() argument
1038 ret = acpiphp_disable_and_eject_slot(slot); in acpiphp_disable_slot()
1048 u8 acpiphp_get_power_status(struct acpiphp_slot *slot) in acpiphp_get_power_status() argument
1050 return (slot->flags & SLOT_ENABLED); in acpiphp_get_power_status()
1057 u8 acpiphp_get_latch_status(struct acpiphp_slot *slot) in acpiphp_get_latch_status() argument
1059 return !(get_slot_status(slot) & ACPI_STA_DEVICE_UI); in acpiphp_get_latch_status()
1066 u8 acpiphp_get_adapter_status(struct acpiphp_slot *slot) in acpiphp_get_adapter_status() argument
1068 return !!get_slot_status(slot); in acpiphp_get_adapter_status()