acpiphp_glue.c (96075315c5e7077fc5a3ac54c9b9e97e376e66ed) acpiphp_glue.c (3b52b21fa1f44c8956e21dfba645eda959111b5e)
1/*
2 * ACPI PCI HotPlug glue functions to ACPI CA subsystem
3 *
4 * Copyright (C) 2002,2003 Takayoshi Kochi (t-kochi@bq.jp.nec.com)
5 * Copyright (C) 2002 Hiroshi Aono (h-aono@ap.jp.nec.com)
6 * Copyright (C) 2002,2003 NEC Corporation
7 * Copyright (C) 2003-2005 Matthew Wilcox (matthew.wilcox@hp.com)
8 * Copyright (C) 2003-2005 Hewlett Packard

--- 320 unchanged lines hidden (view full) ---

329 list_add_tail(&slot->node, &bridge->slots);
330
331 /*
332 * Expose slots to user space for functions that have _EJ0 or _RMV or
333 * are located in dock stations. Do not expose them for devices handled
334 * by the native PCIe hotplug (PCIeHP), becuase that code is supposed to
335 * expose slots to user space in those cases.
336 */
1/*
2 * ACPI PCI HotPlug glue functions to ACPI CA subsystem
3 *
4 * Copyright (C) 2002,2003 Takayoshi Kochi (t-kochi@bq.jp.nec.com)
5 * Copyright (C) 2002 Hiroshi Aono (h-aono@ap.jp.nec.com)
6 * Copyright (C) 2002,2003 NEC Corporation
7 * Copyright (C) 2003-2005 Matthew Wilcox (matthew.wilcox@hp.com)
8 * Copyright (C) 2003-2005 Hewlett Packard

--- 320 unchanged lines hidden (view full) ---

329 list_add_tail(&slot->node, &bridge->slots);
330
331 /*
332 * Expose slots to user space for functions that have _EJ0 or _RMV or
333 * are located in dock stations. Do not expose them for devices handled
334 * by the native PCIe hotplug (PCIeHP), becuase that code is supposed to
335 * expose slots to user space in those cases.
336 */
337 if ((acpi_pci_check_ejectable(pbus, handle) || is_dock_device(handle))
337 if ((acpi_pci_check_ejectable(pbus, handle) || is_dock_device(adev))
338 && !(pdev && device_is_managed_by_native_pciehp(pdev))) {
339 unsigned long long sun;
340 int retval;
341
342 bridge->nr_slots++;
343 status = acpi_evaluate_integer(handle, "_SUN", NULL, &sun);
344 if (ACPI_FAILURE(status))
345 sun = bridge->nr_slots;

--- 18 unchanged lines hidden (view full) ---

364 slot_found:
365 newfunc->slot = slot;
366 list_add_tail(&newfunc->sibling, &slot->funcs);
367
368 if (pci_bus_read_dev_vendor_id(pbus, PCI_DEVFN(device, function),
369 &val, 60*1000))
370 slot->flags |= SLOT_ENABLED;
371
338 && !(pdev && device_is_managed_by_native_pciehp(pdev))) {
339 unsigned long long sun;
340 int retval;
341
342 bridge->nr_slots++;
343 status = acpi_evaluate_integer(handle, "_SUN", NULL, &sun);
344 if (ACPI_FAILURE(status))
345 sun = bridge->nr_slots;

--- 18 unchanged lines hidden (view full) ---

364 slot_found:
365 newfunc->slot = slot;
366 list_add_tail(&newfunc->sibling, &slot->funcs);
367
368 if (pci_bus_read_dev_vendor_id(pbus, PCI_DEVFN(device, function),
369 &val, 60*1000))
370 slot->flags |= SLOT_ENABLED;
371
372 if (is_dock_device(handle)) {
372 if (is_dock_device(adev)) {
373 /* we don't want to call this device's _EJ0
374 * because we want the dock notify handler
375 * to call it after it calls _DCK
376 */
377 newfunc->flags &= ~FUNC_HAS_EJ0;
378 if (register_hotplug_dock_device(handle,
379 &acpiphp_dock_ops, context,
380 acpiphp_dock_init, acpiphp_dock_release))

--- 25 unchanged lines hidden (view full) ---

406{
407 struct acpiphp_slot *slot;
408 struct acpiphp_func *func;
409
410 list_for_each_entry(slot, &bridge->slots, node) {
411 list_for_each_entry(func, &slot->funcs, sibling) {
412 struct acpi_device *adev = func_to_acpi_device(func);
413
373 /* we don't want to call this device's _EJ0
374 * because we want the dock notify handler
375 * to call it after it calls _DCK
376 */
377 newfunc->flags &= ~FUNC_HAS_EJ0;
378 if (register_hotplug_dock_device(handle,
379 &acpiphp_dock_ops, context,
380 acpiphp_dock_init, acpiphp_dock_release))

--- 25 unchanged lines hidden (view full) ---

406{
407 struct acpiphp_slot *slot;
408 struct acpiphp_func *func;
409
410 list_for_each_entry(slot, &bridge->slots, node) {
411 list_for_each_entry(func, &slot->funcs, sibling) {
412 struct acpi_device *adev = func_to_acpi_device(func);
413
414 if (is_dock_device(adev->handle))
414 if (is_dock_device(adev))
415 unregister_hotplug_dock_device(adev->handle);
416
417 acpi_lock_hp_context();
418 adev->hp->event = NULL;
419 acpi_unlock_hp_context();
420 }
421 slot->flags |= SLOT_IS_GOING_AWAY;
422 if (slot->slot)

--- 638 unchanged lines hidden ---
415 unregister_hotplug_dock_device(adev->handle);
416
417 acpi_lock_hp_context();
418 adev->hp->event = NULL;
419 acpi_unlock_hp_context();
420 }
421 slot->flags |= SLOT_IS_GOING_AWAY;
422 if (slot->slot)

--- 638 unchanged lines hidden ---