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
277 /* search for objects that share the same slot */ in acpiphp_add_context()
278 list_for_each_entry(slot, &bridge->slots, node) in acpiphp_add_context()
279 if (slot->device == device) in acpiphp_add_context()
282 slot = kzalloc(sizeof(struct acpiphp_slot), GFP_KERNEL); in acpiphp_add_context()
283 if (!slot) { in acpiphp_add_context()
290 slot->bus = bridge->pci_bus; in acpiphp_add_context()
291 slot->device = device; in acpiphp_add_context()
292 INIT_LIST_HEAD(&slot->funcs); in acpiphp_add_context()
294 list_add_tail(&slot->node, &bridge->slots); in acpiphp_add_context()
313 pr_debug("found ACPI PCI Hotplug slot %llu at PCI %04x:%02x:%02x\n", in acpiphp_add_context()
316 retval = acpiphp_register_hotplug_slot(slot, sun); in acpiphp_add_context()
318 slot->slot = NULL; in acpiphp_add_context()
321 pr_warn("Slot %llu already registered by another hotplug driver\n", sun); in acpiphp_add_context()
325 /* Even if the slot registration fails, we can still use it. */ in acpiphp_add_context()
329 newfunc->slot = slot; in acpiphp_add_context()
330 list_add_tail(&newfunc->sibling, &slot->funcs); in acpiphp_add_context()
334 slot->flags |= SLOT_ENABLED; in acpiphp_add_context()
341 struct acpiphp_slot *slot; in cleanup_bridge() local
344 list_for_each_entry(slot, &bridge->slots, node) { in cleanup_bridge()
345 list_for_each_entry(func, &slot->funcs, sibling) { in cleanup_bridge()
353 slot->flags |= SLOT_IS_GOING_AWAY; in cleanup_bridge()
354 if (slot->slot) in cleanup_bridge()
355 acpiphp_unregister_hotplug_slot(slot); in cleanup_bridge()
394 static void acpiphp_set_acpi_region(struct acpiphp_slot *slot) in acpiphp_set_acpi_region() argument
398 list_for_each_entry(func, &slot->funcs, sibling) { in acpiphp_set_acpi_region()
406 static void check_hotplug_bridge(struct acpiphp_slot *slot, struct pci_dev *dev) in check_hotplug_bridge() argument
422 list_for_each_entry(func, &slot->funcs, sibling) { in check_hotplug_bridge()
430 static int acpiphp_rescan_slot(struct acpiphp_slot *slot) in acpiphp_rescan_slot() argument
434 list_for_each_entry(func, &slot->funcs, sibling) { in acpiphp_rescan_slot()
441 return pci_scan_slot(slot->bus, PCI_DEVFN(slot->device, 0)); in acpiphp_rescan_slot()
475 * enable_slot - enable, configure a slot
476 * @slot: slot to be enabled
477 * @bridge: true if enable is for the whole bridge (not a single slot)
479 * This function should be called per *physical slot*,
480 * not per each slot object in ACPI namespace.
482 static void enable_slot(struct acpiphp_slot *slot, bool bridge) in enable_slot() argument
485 struct pci_bus *bus = slot->bus; in enable_slot()
491 * slot management and resource allocation for hotplug in enable_slot()
497 if (PCI_SLOT(dev->devfn) == slot->device) in enable_slot()
504 acpiphp_rescan_slot(slot); in enable_slot()
508 if (PCI_SLOT(dev->devfn) != slot->device) in enable_slot()
513 check_hotplug_bridge(slot, dev); in enable_slot()
525 acpiphp_set_acpi_region(slot); in enable_slot()
535 slot->flags |= SLOT_ENABLED; in enable_slot()
536 list_for_each_entry(func, &slot->funcs, sibling) { in enable_slot()
537 dev = pci_get_slot(bus, PCI_DEVFN(slot->device, in enable_slot()
542 slot->flags &= ~SLOT_ENABLED; in enable_slot()
550 * disable_slot - disable a slot
551 * @slot: ACPI PHP slot
553 static void disable_slot(struct acpiphp_slot *slot) in disable_slot() argument
555 struct pci_bus *bus = slot->bus; in disable_slot()
566 if (PCI_SLOT(dev->devfn) == slot->device) in disable_slot()
569 list_for_each_entry(func, &slot->funcs, sibling) in disable_slot()
572 slot->flags &= ~SLOT_ENABLED; in disable_slot()
575 static bool slot_no_hotplug(struct acpiphp_slot *slot) in slot_no_hotplug() argument
577 struct pci_bus *bus = slot->bus; in slot_no_hotplug()
581 if (PCI_SLOT(dev->devfn) == slot->device && dev->ignore_hotplug) in slot_no_hotplug()
588 * get_slot_status - get ACPI slot status
589 * @slot: ACPI PHP slot
591 * If a slot has _STA for each function and if any one of them
594 * If a slot doesn't have _STA and if any one of its functions'
599 static unsigned int get_slot_status(struct acpiphp_slot *slot) in get_slot_status() argument
605 list_for_each_entry(func, &slot->funcs, sibling) { in get_slot_status()
614 if (pci_bus_read_dev_vendor_id(slot->bus, in get_slot_status()
615 PCI_DEVFN(slot->device, func->function), in get_slot_status()
625 * Check for the slot itself since it may be that the in get_slot_status()
626 * ACPI slot is a device below PCIe upstream port so in in get_slot_status()
629 if (pci_bus_read_dev_vendor_id(slot->bus, in get_slot_status()
630 PCI_DEVFN(slot->device, 0), &dvid, 0)) { in get_slot_status()
699 struct acpiphp_slot *slot; in acpiphp_check_bridge() local
708 list_for_each_entry(slot, &bridge->slots, node) { in acpiphp_check_bridge()
709 struct pci_bus *bus = slot->bus; in acpiphp_check_bridge()
712 if (slot_no_hotplug(slot)) { in acpiphp_check_bridge()
714 } else if (device_status_valid(get_slot_status(slot))) { in acpiphp_check_bridge()
718 if (PCI_SLOT(dev->devfn) == slot->device) in acpiphp_check_bridge()
722 enable_slot(slot, true); in acpiphp_check_bridge()
724 disable_slot(slot); in acpiphp_check_bridge()
781 static int acpiphp_disable_and_eject_slot(struct acpiphp_slot *slot);
787 struct acpiphp_slot *slot = func->slot; in hotplug_event() local
805 else if (!(slot->flags & SLOT_IS_GOING_AWAY)) in hotplug_event()
806 enable_slot(slot, false); in hotplug_event()
815 } else if (!(slot->flags & SLOT_IS_GOING_AWAY)) { in hotplug_event()
817 * Check if anything has changed in the slot and rescan in hotplug_event()
820 if (acpiphp_rescan_slot(slot)) in hotplug_event()
828 acpiphp_disable_and_eject_slot(slot); in hotplug_event()
854 * A "slot" is an object associated with a PCI device number. All functions
855 * (PCI devices) with the same bus and device number belong to the same slot.
923 /* register all slot objects under this bridge */ in acpiphp_enumerate_slots()
958 * acpiphp_remove_slots - Remove slot objects associated with a given bus.
959 * @bus: PCI bus to remove the slot objects for.
980 * acpiphp_enable_slot - power on slot
981 * @slot: ACPI PHP slot
983 int acpiphp_enable_slot(struct acpiphp_slot *slot) in acpiphp_enable_slot() argument
987 if (slot->flags & SLOT_IS_GOING_AWAY) { in acpiphp_enable_slot()
993 if (!(slot->flags & SLOT_ENABLED)) in acpiphp_enable_slot()
994 enable_slot(slot, false); in acpiphp_enable_slot()
1001 * acpiphp_disable_and_eject_slot - power off and eject slot
1002 * @slot: ACPI PHP slot
1004 static int acpiphp_disable_and_eject_slot(struct acpiphp_slot *slot) in acpiphp_disable_and_eject_slot() argument
1008 if (slot->flags & SLOT_IS_GOING_AWAY) in acpiphp_disable_and_eject_slot()
1012 disable_slot(slot); in acpiphp_disable_and_eject_slot()
1014 list_for_each_entry(func, &slot->funcs, sibling) in acpiphp_disable_and_eject_slot()
1027 int acpiphp_disable_slot(struct acpiphp_slot *slot) in acpiphp_disable_slot() argument
1037 ret = acpiphp_disable_and_eject_slot(slot); in acpiphp_disable_slot()
1044 * slot enabled: 1
1045 * slot disabled: 0
1047 u8 acpiphp_get_power_status(struct acpiphp_slot *slot) in acpiphp_get_power_status() argument
1049 return (slot->flags & SLOT_ENABLED); in acpiphp_get_power_status()
1056 u8 acpiphp_get_latch_status(struct acpiphp_slot *slot) in acpiphp_get_latch_status() argument
1058 return !(get_slot_status(slot) & ACPI_STA_DEVICE_UI); in acpiphp_get_latch_status()
1065 u8 acpiphp_get_adapter_status(struct acpiphp_slot *slot) in acpiphp_get_adapter_status() argument
1067 return !!get_slot_status(slot); in acpiphp_get_adapter_status()