diff options
author | Toshi Kani <toshi.kani@hp.com> | 2012-05-23 22:25:19 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2012-06-04 01:09:14 -0400 |
commit | 275c58d77062bbb85dbeb3843ba04f34aa50cf8e (patch) | |
tree | d347bac51f1d7bb81a49b8abcd9961a4a997311f /drivers/acpi/utils.c | |
parent | f8f5701bdaf9134b1f90e5044a82c66324d2073f (diff) |
ACPI: Add an interface to evaluate _OST
Added acpi_evaluate_hotplug_opt(). All ACPI hotplug handlers must call
this function when evaluating _OST for hotplug operations. If the
platform does not support _OST, this function returns AE_NOT_FOUND and
has no effect on the platform.
ACPI_HOTPLUG_OST is defined when all relevant ACPI hotplug operations,
such as CPU, memory and container hotplug, are enabled. This assures
consistent behavior among the hotplug operations with regarding the
_OST support. When ACPI_HOTPLUG_OST is not defined, this function is
a no-op.
ACPI PCI hotplug is not enhanced to support _OST at this time since it
is a legacy method being replaced by PCIe native hotplug. _OST support
for ACPI PCI hotplug may be added in future if necessary.
Some platforms may require the OS to support _OST in order to support
ACPI hotplug operations. For example, if a platform has the management
console where user can request a hotplug operation from, this _OST
support would be required for the management console to show the result
of the hotplug request to user.
Added macro definitions of _OST source events and status codes.
Also renamed OSC_SB_CPUHP_OST_SUPPORT to OSC_SB_HOTPLUG_OST_SUPPORT
since this _OSC bit is not specific to CPU hotplug. This bit is
defined in Table 6-147 of ACPI 5.0 as follows.
Bits: 3
Field Name: Insertion / Ejection _OST Processing Support
Definition: This bit is set if OSPM will evaluate the _OST
object defined under a device when processing
insertion and ejection source event codes.
Signed-off-by: Toshi Kani <toshi.kani@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/utils.c')
-rw-r--r-- | drivers/acpi/utils.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index adbbc1c80a26..3e87c9c538aa 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c | |||
@@ -412,3 +412,45 @@ out: | |||
412 | return status; | 412 | return status; |
413 | } | 413 | } |
414 | EXPORT_SYMBOL(acpi_get_physical_device_location); | 414 | EXPORT_SYMBOL(acpi_get_physical_device_location); |
415 | |||
416 | /** | ||
417 | * acpi_evaluate_hotplug_ost: Evaluate _OST for hotplug operations | ||
418 | * @handle: ACPI device handle | ||
419 | * @source_event: source event code | ||
420 | * @status_code: status code | ||
421 | * @status_buf: optional detailed information (NULL if none) | ||
422 | * | ||
423 | * Evaluate _OST for hotplug operations. All ACPI hotplug handlers | ||
424 | * must call this function when evaluating _OST for hotplug operations. | ||
425 | * When the platform does not support _OST, this function has no effect. | ||
426 | */ | ||
427 | acpi_status | ||
428 | acpi_evaluate_hotplug_ost(acpi_handle handle, u32 source_event, | ||
429 | u32 status_code, struct acpi_buffer *status_buf) | ||
430 | { | ||
431 | #ifdef ACPI_HOTPLUG_OST | ||
432 | union acpi_object params[3] = { | ||
433 | {.type = ACPI_TYPE_INTEGER,}, | ||
434 | {.type = ACPI_TYPE_INTEGER,}, | ||
435 | {.type = ACPI_TYPE_BUFFER,} | ||
436 | }; | ||
437 | struct acpi_object_list arg_list = {3, params}; | ||
438 | acpi_status status; | ||
439 | |||
440 | params[0].integer.value = source_event; | ||
441 | params[1].integer.value = status_code; | ||
442 | if (status_buf != NULL) { | ||
443 | params[2].buffer.pointer = status_buf->pointer; | ||
444 | params[2].buffer.length = status_buf->length; | ||
445 | } else { | ||
446 | params[2].buffer.pointer = NULL; | ||
447 | params[2].buffer.length = 0; | ||
448 | } | ||
449 | |||
450 | status = acpi_evaluate_object(handle, "_OST", &arg_list, NULL); | ||
451 | return status; | ||
452 | #else | ||
453 | return AE_OK; | ||
454 | #endif | ||
455 | } | ||
456 | EXPORT_SYMBOL(acpi_evaluate_hotplug_ost); | ||