Lines Matching full: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()
203 * secondary bridge on slot in acpiphp_post_dock_fixup()
232 struct acpiphp_slot *slot; in acpiphp_add_context() local
276 /* search for objects that share the same slot */ in acpiphp_add_context()
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()
312 pr_debug("found ACPI PCI Hotplug slot %llu at PCI %04x:%02x:%02x\n", in acpiphp_add_context()
315 retval = acpiphp_register_hotplug_slot(slot, sun); in acpiphp_add_context()
317 slot->slot = NULL; in acpiphp_add_context()
320 pr_warn("Slot %llu already registered by another hotplug driver\n", sun); in acpiphp_add_context()
324 /* Even if the slot registration fails, we can still use it. */ 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
397 list_for_each_entry(func, &slot->funcs, sibling) { in acpiphp_set_acpi_region()
405 static void check_hotplug_bridge(struct acpiphp_slot *slot, struct pci_dev *dev) in check_hotplug_bridge() argument
413 list_for_each_entry(func, &slot->funcs, sibling) { in check_hotplug_bridge()
421 static int acpiphp_rescan_slot(struct acpiphp_slot *slot) in acpiphp_rescan_slot() argument
425 list_for_each_entry(func, &slot->funcs, sibling) { in acpiphp_rescan_slot()
432 return pci_scan_slot(slot->bus, PCI_DEVFN(slot->device, 0)); in acpiphp_rescan_slot()
466 * enable_slot - enable, configure a slot
467 * @slot: slot to be enabled
468 * @bridge: true if enable is for the whole bridge (not a single slot)
470 * This function should be called per *physical slot*,
471 * not per each slot object in ACPI namespace.
473 static void enable_slot(struct acpiphp_slot *slot, bool bridge) in enable_slot() argument
476 struct pci_bus *bus = slot->bus; in enable_slot()
482 * slot management and resource allocation for hotplug in enable_slot()
488 if (PCI_SLOT(dev->devfn) == slot->device) in enable_slot()
495 acpiphp_rescan_slot(slot); in enable_slot()
499 if (PCI_SLOT(dev->devfn) != slot->device) in enable_slot()
504 check_hotplug_bridge(slot, dev); in enable_slot()
516 acpiphp_set_acpi_region(slot); in enable_slot()
526 slot->flags |= SLOT_ENABLED; in enable_slot()
527 list_for_each_entry(func, &slot->funcs, sibling) { in enable_slot()
528 dev = pci_get_slot(bus, PCI_DEVFN(slot->device, in enable_slot()
533 slot->flags &= ~SLOT_ENABLED; in enable_slot()
540 * disable_slot - disable a slot
541 * @slot: ACPI PHP slot
543 static void disable_slot(struct acpiphp_slot *slot) in disable_slot() argument
545 struct pci_bus *bus = slot->bus; in disable_slot()
556 if (PCI_SLOT(dev->devfn) == slot->device) in disable_slot()
559 list_for_each_entry(func, &slot->funcs, sibling) in disable_slot()
562 slot->flags &= ~SLOT_ENABLED; in disable_slot()
565 static bool slot_no_hotplug(struct acpiphp_slot *slot) in slot_no_hotplug() argument
567 struct pci_bus *bus = slot->bus; in slot_no_hotplug()
571 if (PCI_SLOT(dev->devfn) == slot->device && dev->ignore_hotplug) in slot_no_hotplug()
578 * get_slot_status - get ACPI slot status
579 * @slot: ACPI PHP slot
581 * If a slot has _STA for each function and if any one of them
584 * If a slot doesn't have _STA and if any one of its functions'
589 static unsigned int get_slot_status(struct acpiphp_slot *slot) in get_slot_status() argument
595 list_for_each_entry(func, &slot->funcs, sibling) { in get_slot_status()
604 if (pci_bus_read_dev_vendor_id(slot->bus, in get_slot_status()
605 PCI_DEVFN(slot->device, func->function), in get_slot_status()
615 * Check for the slot itself since it may be that the in get_slot_status()
616 * ACPI slot is a device below PCIe upstream port so in in get_slot_status()
619 if (pci_bus_read_dev_vendor_id(slot->bus, in get_slot_status()
620 PCI_DEVFN(slot->device, 0), &dvid, 0)) { in get_slot_status()
689 struct acpiphp_slot *slot; in acpiphp_check_bridge() local
698 list_for_each_entry(slot, &bridge->slots, node) { in acpiphp_check_bridge()
699 struct pci_bus *bus = slot->bus; in acpiphp_check_bridge()
702 if (slot_no_hotplug(slot)) { in acpiphp_check_bridge()
704 } else if (device_status_valid(get_slot_status(slot))) { in acpiphp_check_bridge()
708 if (PCI_SLOT(dev->devfn) == slot->device) in acpiphp_check_bridge()
712 enable_slot(slot, true); in acpiphp_check_bridge()
714 disable_slot(slot); in acpiphp_check_bridge()
771 static int acpiphp_disable_and_eject_slot(struct acpiphp_slot *slot);
777 struct acpiphp_slot *slot = func->slot; in hotplug_event() local
795 else if (!(slot->flags & SLOT_IS_GOING_AWAY)) in hotplug_event()
796 enable_slot(slot, false); in hotplug_event()
805 } else if (!(slot->flags & SLOT_IS_GOING_AWAY)) { in hotplug_event()
807 * Check if anything has changed in the slot and rescan in hotplug_event()
810 if (acpiphp_rescan_slot(slot)) in hotplug_event()
818 acpiphp_disable_and_eject_slot(slot); in hotplug_event()
844 * A "slot" is an object associated with a PCI device number. All functions
845 * (PCI devices) with the same bus and device number belong to the same slot.
913 /* register all slot objects under this bridge */ in acpiphp_enumerate_slots()
948 * acpiphp_remove_slots - Remove slot objects associated with a given bus.
949 * @bus: PCI bus to remove the slot objects for.
970 * acpiphp_enable_slot - power on slot
971 * @slot: ACPI PHP slot
973 int acpiphp_enable_slot(struct acpiphp_slot *slot) in acpiphp_enable_slot() argument
977 if (slot->flags & SLOT_IS_GOING_AWAY) { in acpiphp_enable_slot()
983 if (!(slot->flags & SLOT_ENABLED)) in acpiphp_enable_slot()
984 enable_slot(slot, false); in acpiphp_enable_slot()
991 * acpiphp_disable_and_eject_slot - power off and eject slot
992 * @slot: ACPI PHP slot
994 static int acpiphp_disable_and_eject_slot(struct acpiphp_slot *slot) in acpiphp_disable_and_eject_slot() argument
998 if (slot->flags & SLOT_IS_GOING_AWAY) in acpiphp_disable_and_eject_slot()
1002 disable_slot(slot); in acpiphp_disable_and_eject_slot()
1004 list_for_each_entry(func, &slot->funcs, sibling) in acpiphp_disable_and_eject_slot()
1017 int acpiphp_disable_slot(struct acpiphp_slot *slot) in acpiphp_disable_slot() argument
1027 ret = acpiphp_disable_and_eject_slot(slot); in acpiphp_disable_slot()
1034 * slot enabled: 1
1035 * slot disabled: 0
1037 u8 acpiphp_get_power_status(struct acpiphp_slot *slot) in acpiphp_get_power_status() argument
1039 return (slot->flags & SLOT_ENABLED); in acpiphp_get_power_status()
1046 u8 acpiphp_get_latch_status(struct acpiphp_slot *slot) in acpiphp_get_latch_status() argument
1048 return !(get_slot_status(slot) & ACPI_STA_DEVICE_UI); in acpiphp_get_latch_status()
1055 u8 acpiphp_get_adapter_status(struct acpiphp_slot *slot) in acpiphp_get_adapter_status() argument
1057 return !!get_slot_status(slot); in acpiphp_get_adapter_status()