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()
528 acpiphp_set_acpi_region(slot); in enable_slot()
538 slot->flags |= SLOT_ENABLED; in enable_slot()
539 list_for_each_entry(func, &slot->funcs, sibling) { in enable_slot()
540 dev = pci_get_slot(bus, PCI_DEVFN(slot->device, in enable_slot()
545 slot->flags &= ~SLOT_ENABLED; in enable_slot()
553 * disable_slot - disable a slot
554 * @slot: ACPI PHP slot
556 static void disable_slot(struct acpiphp_slot *slot) in disable_slot() argument
558 struct pci_bus *bus = slot->bus; in disable_slot()
569 if (PCI_SLOT(dev->devfn) == slot->device) in disable_slot()
572 list_for_each_entry(func, &slot->funcs, sibling) in disable_slot()
575 slot->flags &= ~SLOT_ENABLED; in disable_slot()
578 static bool slot_no_hotplug(struct acpiphp_slot *slot) in slot_no_hotplug() argument
580 struct pci_bus *bus = slot->bus; in slot_no_hotplug()
584 if (PCI_SLOT(dev->devfn) == slot->device && dev->ignore_hotplug) in slot_no_hotplug()
591 * get_slot_status - get ACPI slot status
592 * @slot: ACPI PHP slot
594 * If a slot has _STA for each function and if any one of them
597 * If a slot doesn't have _STA and if any one of its functions'
602 static unsigned int get_slot_status(struct acpiphp_slot *slot) in get_slot_status() argument
608 list_for_each_entry(func, &slot->funcs, sibling) { in get_slot_status()
617 if (pci_bus_read_dev_vendor_id(slot->bus, in get_slot_status()
618 PCI_DEVFN(slot->device, func->function), in get_slot_status()
628 * Check for the slot itself since it may be that the in get_slot_status()
629 * ACPI slot is a device below PCIe upstream port so in in get_slot_status()
632 if (pci_bus_read_dev_vendor_id(slot->bus, in get_slot_status()
633 PCI_DEVFN(slot->device, 0), &dvid, 0)) { in get_slot_status()
702 struct acpiphp_slot *slot; in acpiphp_check_bridge() local
711 list_for_each_entry(slot, &bridge->slots, node) { in acpiphp_check_bridge()
712 struct pci_bus *bus = slot->bus; in acpiphp_check_bridge()
715 if (slot_no_hotplug(slot)) { in acpiphp_check_bridge()
717 } else if (device_status_valid(get_slot_status(slot))) { in acpiphp_check_bridge()
721 if (PCI_SLOT(dev->devfn) == slot->device) in acpiphp_check_bridge()
725 enable_slot(slot, true); in acpiphp_check_bridge()
727 disable_slot(slot); in acpiphp_check_bridge()
784 static int acpiphp_disable_and_eject_slot(struct acpiphp_slot *slot);
790 struct acpiphp_slot *slot = func->slot; in hotplug_event() local
808 else if (!(slot->flags & SLOT_IS_GOING_AWAY)) in hotplug_event()
809 enable_slot(slot, false); in hotplug_event()
818 } else if (!(slot->flags & SLOT_IS_GOING_AWAY)) { in hotplug_event()
820 * Check if anything has changed in the slot and rescan in hotplug_event()
823 if (acpiphp_rescan_slot(slot)) in hotplug_event()
831 acpiphp_disable_and_eject_slot(slot); in hotplug_event()
857 * A "slot" is an object associated with a PCI device number. All functions
858 * (PCI devices) with the same bus and device number belong to the same slot.
926 /* register all slot objects under this bridge */ in acpiphp_enumerate_slots()
961 * acpiphp_remove_slots - Remove slot objects associated with a given bus.
962 * @bus: PCI bus to remove the slot objects for.
983 * acpiphp_enable_slot - power on slot
984 * @slot: ACPI PHP slot
986 int acpiphp_enable_slot(struct acpiphp_slot *slot) in acpiphp_enable_slot() argument
990 if (slot->flags & SLOT_IS_GOING_AWAY) { in acpiphp_enable_slot()
996 if (!(slot->flags & SLOT_ENABLED)) in acpiphp_enable_slot()
997 enable_slot(slot, false); in acpiphp_enable_slot()
1004 * acpiphp_disable_and_eject_slot - power off and eject slot
1005 * @slot: ACPI PHP slot
1007 static int acpiphp_disable_and_eject_slot(struct acpiphp_slot *slot) in acpiphp_disable_and_eject_slot() argument
1011 if (slot->flags & SLOT_IS_GOING_AWAY) in acpiphp_disable_and_eject_slot()
1015 disable_slot(slot); in acpiphp_disable_and_eject_slot()
1017 list_for_each_entry(func, &slot->funcs, sibling) in acpiphp_disable_and_eject_slot()
1030 int acpiphp_disable_slot(struct acpiphp_slot *slot) in acpiphp_disable_slot() argument
1040 ret = acpiphp_disable_and_eject_slot(slot); in acpiphp_disable_slot()
1047 * slot enabled: 1
1048 * slot disabled: 0
1050 u8 acpiphp_get_power_status(struct acpiphp_slot *slot) in acpiphp_get_power_status() argument
1052 return (slot->flags & SLOT_ENABLED); in acpiphp_get_power_status()
1059 u8 acpiphp_get_latch_status(struct acpiphp_slot *slot) in acpiphp_get_latch_status() argument
1061 return !(get_slot_status(slot) & ACPI_STA_DEVICE_UI); in acpiphp_get_latch_status()
1068 u8 acpiphp_get_adapter_status(struct acpiphp_slot *slot) in acpiphp_get_adapter_status() argument
1070 return !!get_slot_status(slot); in acpiphp_get_adapter_status()