diff options
Diffstat (limited to 'drivers/acpi/utilities/uteval.c')
-rw-r--r-- | drivers/acpi/utilities/uteval.c | 88 |
1 files changed, 67 insertions, 21 deletions
diff --git a/drivers/acpi/utilities/uteval.c b/drivers/acpi/utilities/uteval.c index 68b9eff4b326..444d3a502c46 100644 --- a/drivers/acpi/utilities/uteval.c +++ b/drivers/acpi/utilities/uteval.c | |||
@@ -56,6 +56,34 @@ static acpi_status | |||
56 | acpi_ut_translate_one_cid(union acpi_operand_object *obj_desc, | 56 | acpi_ut_translate_one_cid(union acpi_operand_object *obj_desc, |
57 | struct acpi_compatible_id *one_cid); | 57 | struct acpi_compatible_id *one_cid); |
58 | 58 | ||
59 | /* | ||
60 | * Strings supported by the _OSI predefined (internal) method. | ||
61 | */ | ||
62 | static const char *acpi_interfaces_supported[] = { | ||
63 | /* Operating System Vendor Strings */ | ||
64 | |||
65 | "Linux", | ||
66 | "Windows 2000", | ||
67 | "Windows 2001", | ||
68 | "Windows 2001 SP0", | ||
69 | "Windows 2001 SP1", | ||
70 | "Windows 2001 SP2", | ||
71 | "Windows 2001 SP3", | ||
72 | "Windows 2001 SP4", | ||
73 | "Windows 2001.1", | ||
74 | "Windows 2001.1 SP1", /* Added 03/2006 */ | ||
75 | "Windows 2006", /* Added 03/2006 */ | ||
76 | |||
77 | /* Feature Group Strings */ | ||
78 | |||
79 | "Extended Address Space Descriptor" | ||
80 | /* | ||
81 | * All "optional" feature group strings (features that are implemented | ||
82 | * by the host) should be implemented in the host version of | ||
83 | * acpi_os_validate_interface and should not be added here. | ||
84 | */ | ||
85 | }; | ||
86 | |||
59 | /******************************************************************************* | 87 | /******************************************************************************* |
60 | * | 88 | * |
61 | * FUNCTION: acpi_ut_osi_implementation | 89 | * FUNCTION: acpi_ut_osi_implementation |
@@ -64,18 +92,18 @@ acpi_ut_translate_one_cid(union acpi_operand_object *obj_desc, | |||
64 | * | 92 | * |
65 | * RETURN: Status | 93 | * RETURN: Status |
66 | * | 94 | * |
67 | * DESCRIPTION: Implementation of _OSI predefined control method | 95 | * DESCRIPTION: Implementation of the _OSI predefined control method |
68 | * Supported = _OSI (String) | ||
69 | * | 96 | * |
70 | ******************************************************************************/ | 97 | ******************************************************************************/ |
71 | 98 | ||
72 | acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state) | 99 | acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state) |
73 | { | 100 | { |
101 | acpi_status status; | ||
74 | union acpi_operand_object *string_desc; | 102 | union acpi_operand_object *string_desc; |
75 | union acpi_operand_object *return_desc; | 103 | union acpi_operand_object *return_desc; |
76 | acpi_native_uint i; | 104 | acpi_native_uint i; |
77 | 105 | ||
78 | ACPI_FUNCTION_TRACE("ut_osi_implementation"); | 106 | ACPI_FUNCTION_TRACE(ut_osi_implementation); |
79 | 107 | ||
80 | /* Validate the string input argument */ | 108 | /* Validate the string input argument */ |
81 | 109 | ||
@@ -84,29 +112,47 @@ acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state) | |||
84 | return_ACPI_STATUS(AE_TYPE); | 112 | return_ACPI_STATUS(AE_TYPE); |
85 | } | 113 | } |
86 | 114 | ||
87 | /* Create a return object (Default value = 0) */ | 115 | /* Create a return object */ |
88 | 116 | ||
89 | return_desc = acpi_ut_create_internal_object(ACPI_TYPE_INTEGER); | 117 | return_desc = acpi_ut_create_internal_object(ACPI_TYPE_INTEGER); |
90 | if (!return_desc) { | 118 | if (!return_desc) { |
91 | return_ACPI_STATUS(AE_NO_MEMORY); | 119 | return_ACPI_STATUS(AE_NO_MEMORY); |
92 | } | 120 | } |
93 | 121 | ||
94 | /* Compare input string to table of supported strings */ | 122 | /* Default return value is SUPPORTED */ |
95 | 123 | ||
96 | for (i = 0; i < ACPI_NUM_OSI_STRINGS; i++) { | 124 | return_desc->integer.value = ACPI_UINT32_MAX; |
97 | if (!ACPI_STRCMP(string_desc->string.pointer, | 125 | walk_state->return_desc = return_desc; |
98 | ACPI_CAST_PTR(char, | 126 | |
99 | acpi_gbl_valid_osi_strings[i]))) | 127 | /* Compare input string to static table of supported interfaces */ |
100 | { | ||
101 | 128 | ||
102 | /* This string is supported */ | 129 | for (i = 0; i < ACPI_ARRAY_LENGTH(acpi_interfaces_supported); i++) { |
130 | if (!ACPI_STRCMP | ||
131 | (string_desc->string.pointer, | ||
132 | acpi_interfaces_supported[i])) { | ||
103 | 133 | ||
104 | return_desc->integer.value = 0xFFFFFFFF; | 134 | /* The interface is supported */ |
105 | break; | 135 | |
136 | return_ACPI_STATUS(AE_CTRL_TERMINATE); | ||
106 | } | 137 | } |
107 | } | 138 | } |
108 | 139 | ||
109 | walk_state->return_desc = return_desc; | 140 | /* |
141 | * Did not match the string in the static table, call the host OSL to | ||
142 | * check for a match with one of the optional strings (such as | ||
143 | * "Module Device", "3.0 Thermal Model", etc.) | ||
144 | */ | ||
145 | status = acpi_os_validate_interface(string_desc->string.pointer); | ||
146 | if (ACPI_SUCCESS(status)) { | ||
147 | |||
148 | /* The interface is supported */ | ||
149 | |||
150 | return_ACPI_STATUS(AE_CTRL_TERMINATE); | ||
151 | } | ||
152 | |||
153 | /* The interface is not supported */ | ||
154 | |||
155 | return_desc->integer.value = 0; | ||
110 | return_ACPI_STATUS(AE_CTRL_TERMINATE); | 156 | return_ACPI_STATUS(AE_CTRL_TERMINATE); |
111 | } | 157 | } |
112 | 158 | ||
@@ -139,7 +185,7 @@ acpi_ut_evaluate_object(struct acpi_namespace_node *prefix_node, | |||
139 | acpi_status status; | 185 | acpi_status status; |
140 | u32 return_btype; | 186 | u32 return_btype; |
141 | 187 | ||
142 | ACPI_FUNCTION_TRACE("ut_evaluate_object"); | 188 | ACPI_FUNCTION_TRACE(ut_evaluate_object); |
143 | 189 | ||
144 | info.node = prefix_node; | 190 | info.node = prefix_node; |
145 | info.parameters = NULL; | 191 | info.parameters = NULL; |
@@ -258,7 +304,7 @@ acpi_ut_evaluate_numeric_object(char *object_name, | |||
258 | union acpi_operand_object *obj_desc; | 304 | union acpi_operand_object *obj_desc; |
259 | acpi_status status; | 305 | acpi_status status; |
260 | 306 | ||
261 | ACPI_FUNCTION_TRACE("ut_evaluate_numeric_object"); | 307 | ACPI_FUNCTION_TRACE(ut_evaluate_numeric_object); |
262 | 308 | ||
263 | status = acpi_ut_evaluate_object(device_node, object_name, | 309 | status = acpi_ut_evaluate_object(device_node, object_name, |
264 | ACPI_BTYPE_INTEGER, &obj_desc); | 310 | ACPI_BTYPE_INTEGER, &obj_desc); |
@@ -334,7 +380,7 @@ acpi_ut_execute_HID(struct acpi_namespace_node *device_node, | |||
334 | union acpi_operand_object *obj_desc; | 380 | union acpi_operand_object *obj_desc; |
335 | acpi_status status; | 381 | acpi_status status; |
336 | 382 | ||
337 | ACPI_FUNCTION_TRACE("ut_execute_HID"); | 383 | ACPI_FUNCTION_TRACE(ut_execute_HID); |
338 | 384 | ||
339 | status = acpi_ut_evaluate_object(device_node, METHOD_NAME__HID, | 385 | status = acpi_ut_evaluate_object(device_node, METHOD_NAME__HID, |
340 | ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING, | 386 | ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING, |
@@ -438,7 +484,7 @@ acpi_ut_execute_CID(struct acpi_namespace_node * device_node, | |||
438 | struct acpi_compatible_id_list *cid_list; | 484 | struct acpi_compatible_id_list *cid_list; |
439 | acpi_native_uint i; | 485 | acpi_native_uint i; |
440 | 486 | ||
441 | ACPI_FUNCTION_TRACE("ut_execute_CID"); | 487 | ACPI_FUNCTION_TRACE(ut_execute_CID); |
442 | 488 | ||
443 | /* Evaluate the _CID method for this device */ | 489 | /* Evaluate the _CID method for this device */ |
444 | 490 | ||
@@ -536,7 +582,7 @@ acpi_ut_execute_UID(struct acpi_namespace_node *device_node, | |||
536 | union acpi_operand_object *obj_desc; | 582 | union acpi_operand_object *obj_desc; |
537 | acpi_status status; | 583 | acpi_status status; |
538 | 584 | ||
539 | ACPI_FUNCTION_TRACE("ut_execute_UID"); | 585 | ACPI_FUNCTION_TRACE(ut_execute_UID); |
540 | 586 | ||
541 | status = acpi_ut_evaluate_object(device_node, METHOD_NAME__UID, | 587 | status = acpi_ut_evaluate_object(device_node, METHOD_NAME__UID, |
542 | ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING, | 588 | ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING, |
@@ -586,7 +632,7 @@ acpi_ut_execute_STA(struct acpi_namespace_node *device_node, u32 * flags) | |||
586 | union acpi_operand_object *obj_desc; | 632 | union acpi_operand_object *obj_desc; |
587 | acpi_status status; | 633 | acpi_status status; |
588 | 634 | ||
589 | ACPI_FUNCTION_TRACE("ut_execute_STA"); | 635 | ACPI_FUNCTION_TRACE(ut_execute_STA); |
590 | 636 | ||
591 | status = acpi_ut_evaluate_object(device_node, METHOD_NAME__STA, | 637 | status = acpi_ut_evaluate_object(device_node, METHOD_NAME__STA, |
592 | ACPI_BTYPE_INTEGER, &obj_desc); | 638 | ACPI_BTYPE_INTEGER, &obj_desc); |
@@ -636,7 +682,7 @@ acpi_ut_execute_sxds(struct acpi_namespace_node *device_node, u8 * highest) | |||
636 | acpi_status status; | 682 | acpi_status status; |
637 | u32 i; | 683 | u32 i; |
638 | 684 | ||
639 | ACPI_FUNCTION_TRACE("ut_execute_Sxds"); | 685 | ACPI_FUNCTION_TRACE(ut_execute_sxds); |
640 | 686 | ||
641 | for (i = 0; i < 4; i++) { | 687 | for (i = 0; i < 4; i++) { |
642 | highest[i] = 0xFF; | 688 | highest[i] = 0xFF; |