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
414 list_for_each_entry(func, &slot->funcs, sibling) { in check_hotplug_bridge()
422 static int acpiphp_rescan_slot(struct acpiphp_slot *slot) in acpiphp_rescan_slot() argument
426 list_for_each_entry(func, &slot->funcs, sibling) { in acpiphp_rescan_slot()
433 return pci_scan_slot(slot->bus, PCI_DEVFN(slot->device, 0)); in acpiphp_rescan_slot()
467 * enable_slot - enable, configure a slot
468 * @slot: slot to be enabled
469 * @bridge: true if enable is for the whole bridge (not a single slot)
471 * This function should be called per *physical slot*,
472 * not per each slot object in ACPI namespace.
474 static void enable_slot(struct acpiphp_slot *slot, bool bridge) in enable_slot() argument
477 struct pci_bus *bus = slot->bus; in enable_slot()
483 * slot management and resource allocation for hotplug in enable_slot()
489 if (PCI_SLOT(dev->devfn) == slot->device) in enable_slot()
496 acpiphp_rescan_slot(slot); in enable_slot()
500 if (PCI_SLOT(dev->devfn) != slot->device) in enable_slot()
505 check_hotplug_bridge(slot, dev); in enable_slot()
517 acpiphp_set_acpi_region(slot); in enable_slot()
527 slot->flags |= SLOT_ENABLED; in enable_slot()
528 list_for_each_entry(func, &slot->funcs, sibling) { in enable_slot()
529 dev = pci_get_slot(bus, PCI_DEVFN(slot->device, in enable_slot()
534 slot->flags &= ~SLOT_ENABLED; in enable_slot()
542 * disable_slot - disable a slot
543 * @slot: ACPI PHP slot
545 static void disable_slot(struct acpiphp_slot *slot) in disable_slot() argument
547 struct pci_bus *bus = slot->bus; in disable_slot()
558 if (PCI_SLOT(dev->devfn) == slot->device) in disable_slot()
561 list_for_each_entry(func, &slot->funcs, sibling) in disable_slot()
564 slot->flags &= ~SLOT_ENABLED; in disable_slot()
567 static bool slot_no_hotplug(struct acpiphp_slot *slot) in slot_no_hotplug() argument
569 struct pci_bus *bus = slot->bus; in slot_no_hotplug()
573 if (PCI_SLOT(dev->devfn) == slot->device && dev->ignore_hotplug) in slot_no_hotplug()
580 * get_slot_status - get ACPI slot status
581 * @slot: ACPI PHP slot
583 * If a slot has _STA for each function and if any one of them
586 * If a slot doesn't have _STA and if any one of its functions'
591 static unsigned int get_slot_status(struct acpiphp_slot *slot) in get_slot_status() argument
597 list_for_each_entry(func, &slot->funcs, sibling) { in get_slot_status()
606 if (pci_bus_read_dev_vendor_id(slot->bus, in get_slot_status()
607 PCI_DEVFN(slot->device, func->function), in get_slot_status()
617 * Check for the slot itself since it may be that the in get_slot_status()
618 * ACPI slot is a device below PCIe upstream port so in in get_slot_status()
621 if (pci_bus_read_dev_vendor_id(slot->bus, in get_slot_status()
622 PCI_DEVFN(slot->device, 0), &dvid, 0)) { in get_slot_status()
691 struct acpiphp_slot *slot; in acpiphp_check_bridge() local
700 list_for_each_entry(slot, &bridge->slots, node) { in acpiphp_check_bridge()
701 struct pci_bus *bus = slot->bus; in acpiphp_check_bridge()
704 if (slot_no_hotplug(slot)) { in acpiphp_check_bridge()
706 } else if (device_status_valid(get_slot_status(slot))) { in acpiphp_check_bridge()
710 if (PCI_SLOT(dev->devfn) == slot->device) in acpiphp_check_bridge()
714 enable_slot(slot, true); in acpiphp_check_bridge()
716 disable_slot(slot); in acpiphp_check_bridge()
773 static int acpiphp_disable_and_eject_slot(struct acpiphp_slot *slot);
779 struct acpiphp_slot *slot = func->slot; in hotplug_event() local
797 else if (!(slot->flags & SLOT_IS_GOING_AWAY)) in hotplug_event()
798 enable_slot(slot, false); in hotplug_event()
807 } else if (!(slot->flags & SLOT_IS_GOING_AWAY)) { in hotplug_event()
809 * Check if anything has changed in the slot and rescan in hotplug_event()
812 if (acpiphp_rescan_slot(slot)) in hotplug_event()
820 acpiphp_disable_and_eject_slot(slot); in hotplug_event()
846 * A "slot" is an object associated with a PCI device number. All functions
847 * (PCI devices) with the same bus and device number belong to the same slot.
915 /* register all slot objects under this bridge */ in acpiphp_enumerate_slots()
950 * acpiphp_remove_slots - Remove slot objects associated with a given bus.
951 * @bus: PCI bus to remove the slot objects for.
972 * acpiphp_enable_slot - power on slot
973 * @slot: ACPI PHP slot
975 int acpiphp_enable_slot(struct acpiphp_slot *slot) in acpiphp_enable_slot() argument
979 if (slot->flags & SLOT_IS_GOING_AWAY) { in acpiphp_enable_slot()
985 if (!(slot->flags & SLOT_ENABLED)) in acpiphp_enable_slot()
986 enable_slot(slot, false); in acpiphp_enable_slot()
993 * acpiphp_disable_and_eject_slot - power off and eject slot
994 * @slot: ACPI PHP slot
996 static int acpiphp_disable_and_eject_slot(struct acpiphp_slot *slot) in acpiphp_disable_and_eject_slot() argument
1000 if (slot->flags & SLOT_IS_GOING_AWAY) in acpiphp_disable_and_eject_slot()
1004 disable_slot(slot); in acpiphp_disable_and_eject_slot()
1006 list_for_each_entry(func, &slot->funcs, sibling) in acpiphp_disable_and_eject_slot()
1019 int acpiphp_disable_slot(struct acpiphp_slot *slot) in acpiphp_disable_slot() argument
1029 ret = acpiphp_disable_and_eject_slot(slot); in acpiphp_disable_slot()
1036 * slot enabled: 1
1037 * slot disabled: 0
1039 u8 acpiphp_get_power_status(struct acpiphp_slot *slot) in acpiphp_get_power_status() argument
1041 return (slot->flags & SLOT_ENABLED); in acpiphp_get_power_status()
1048 u8 acpiphp_get_latch_status(struct acpiphp_slot *slot) in acpiphp_get_latch_status() argument
1050 return !(get_slot_status(slot) & ACPI_STA_DEVICE_UI); in acpiphp_get_latch_status()
1057 u8 acpiphp_get_adapter_status(struct acpiphp_slot *slot) in acpiphp_get_adapter_status() argument
1059 return !!get_slot_status(slot); in acpiphp_get_adapter_status()