aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/nsxfname.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/acpica/nsxfname.c')
-rw-r--r--drivers/acpi/acpica/nsxfname.c66
1 files changed, 42 insertions, 24 deletions
diff --git a/drivers/acpi/acpica/nsxfname.c b/drivers/acpi/acpica/nsxfname.c
index 08e9610b34ca..811c6f13f476 100644
--- a/drivers/acpi/acpica/nsxfname.c
+++ b/drivers/acpi/acpica/nsxfname.c
@@ -53,8 +53,8 @@
53ACPI_MODULE_NAME("nsxfname") 53ACPI_MODULE_NAME("nsxfname")
54 54
55/* Local prototypes */ 55/* Local prototypes */
56static char *acpi_ns_copy_device_id(struct acpica_device_id *dest, 56static char *acpi_ns_copy_device_id(struct acpi_pnp_device_id *dest,
57 struct acpica_device_id *source, 57 struct acpi_pnp_device_id *source,
58 char *string_area); 58 char *string_area);
59 59
60/****************************************************************************** 60/******************************************************************************
@@ -69,8 +69,8 @@ static char *acpi_ns_copy_device_id(struct acpica_device_id *dest,
69 * RETURN: Status 69 * RETURN: Status
70 * 70 *
71 * DESCRIPTION: This routine will search for a caller specified name in the 71 * DESCRIPTION: This routine will search for a caller specified name in the
72 * name space. The caller can restrict the search region by 72 * name space. The caller can restrict the search region by
73 * specifying a non NULL parent. The parent value is itself a 73 * specifying a non NULL parent. The parent value is itself a
74 * namespace handle. 74 * namespace handle.
75 * 75 *
76 ******************************************************************************/ 76 ******************************************************************************/
@@ -149,7 +149,7 @@ ACPI_EXPORT_SYMBOL(acpi_get_handle)
149 * RETURN: Pointer to a string containing the fully qualified Name. 149 * RETURN: Pointer to a string containing the fully qualified Name.
150 * 150 *
151 * DESCRIPTION: This routine returns the fully qualified name associated with 151 * DESCRIPTION: This routine returns the fully qualified name associated with
152 * the Handle parameter. This and the acpi_pathname_to_handle are 152 * the Handle parameter. This and the acpi_pathname_to_handle are
153 * complementary functions. 153 * complementary functions.
154 * 154 *
155 ******************************************************************************/ 155 ******************************************************************************/
@@ -202,8 +202,7 @@ acpi_get_name(acpi_handle handle, u32 name_type, struct acpi_buffer * buffer)
202 202
203 /* Just copy the ACPI name from the Node and zero terminate it */ 203 /* Just copy the ACPI name from the Node and zero terminate it */
204 204
205 ACPI_STRNCPY(buffer->pointer, acpi_ut_get_node_name(node), 205 ACPI_MOVE_NAME(buffer->pointer, acpi_ut_get_node_name(node));
206 ACPI_NAME_SIZE);
207 ((char *)buffer->pointer)[ACPI_NAME_SIZE] = 0; 206 ((char *)buffer->pointer)[ACPI_NAME_SIZE] = 0;
208 status = AE_OK; 207 status = AE_OK;
209 208
@@ -219,20 +218,21 @@ ACPI_EXPORT_SYMBOL(acpi_get_name)
219 * 218 *
220 * FUNCTION: acpi_ns_copy_device_id 219 * FUNCTION: acpi_ns_copy_device_id
221 * 220 *
222 * PARAMETERS: dest - Pointer to the destination DEVICE_ID 221 * PARAMETERS: dest - Pointer to the destination PNP_DEVICE_ID
223 * source - Pointer to the source DEVICE_ID 222 * source - Pointer to the source PNP_DEVICE_ID
224 * string_area - Pointer to where to copy the dest string 223 * string_area - Pointer to where to copy the dest string
225 * 224 *
226 * RETURN: Pointer to the next string area 225 * RETURN: Pointer to the next string area
227 * 226 *
228 * DESCRIPTION: Copy a single DEVICE_ID, including the string data. 227 * DESCRIPTION: Copy a single PNP_DEVICE_ID, including the string data.
229 * 228 *
230 ******************************************************************************/ 229 ******************************************************************************/
231static char *acpi_ns_copy_device_id(struct acpica_device_id *dest, 230static char *acpi_ns_copy_device_id(struct acpi_pnp_device_id *dest,
232 struct acpica_device_id *source, 231 struct acpi_pnp_device_id *source,
233 char *string_area) 232 char *string_area)
234{ 233{
235 /* Create the destination DEVICE_ID */ 234
235 /* Create the destination PNP_DEVICE_ID */
236 236
237 dest->string = string_area; 237 dest->string = string_area;
238 dest->length = source->length; 238 dest->length = source->length;
@@ -256,8 +256,8 @@ static char *acpi_ns_copy_device_id(struct acpica_device_id *dest,
256 * namespace node and possibly by running several standard 256 * namespace node and possibly by running several standard
257 * control methods (Such as in the case of a device.) 257 * control methods (Such as in the case of a device.)
258 * 258 *
259 * For Device and Processor objects, run the Device _HID, _UID, _CID, _STA, 259 * For Device and Processor objects, run the Device _HID, _UID, _CID, _SUB,
260 * _ADR, _sx_w, and _sx_d methods. 260 * _STA, _ADR, _sx_w, and _sx_d methods.
261 * 261 *
262 * Note: Allocates the return buffer, must be freed by the caller. 262 * Note: Allocates the return buffer, must be freed by the caller.
263 * 263 *
@@ -269,9 +269,10 @@ acpi_get_object_info(acpi_handle handle,
269{ 269{
270 struct acpi_namespace_node *node; 270 struct acpi_namespace_node *node;
271 struct acpi_device_info *info; 271 struct acpi_device_info *info;
272 struct acpica_device_id_list *cid_list = NULL; 272 struct acpi_pnp_device_id_list *cid_list = NULL;
273 struct acpica_device_id *hid = NULL; 273 struct acpi_pnp_device_id *hid = NULL;
274 struct acpica_device_id *uid = NULL; 274 struct acpi_pnp_device_id *uid = NULL;
275 struct acpi_pnp_device_id *sub = NULL;
275 char *next_id_string; 276 char *next_id_string;
276 acpi_object_type type; 277 acpi_object_type type;
277 acpi_name name; 278 acpi_name name;
@@ -316,7 +317,7 @@ acpi_get_object_info(acpi_handle handle,
316 if ((type == ACPI_TYPE_DEVICE) || (type == ACPI_TYPE_PROCESSOR)) { 317 if ((type == ACPI_TYPE_DEVICE) || (type == ACPI_TYPE_PROCESSOR)) {
317 /* 318 /*
318 * Get extra info for ACPI Device/Processor objects only: 319 * Get extra info for ACPI Device/Processor objects only:
319 * Run the Device _HID, _UID, and _CID methods. 320 * Run the Device _HID, _UID, _SUB, and _CID methods.
320 * 321 *
321 * Note: none of these methods are required, so they may or may 322 * Note: none of these methods are required, so they may or may
322 * not be present for this device. The Info->Valid bitfield is used 323 * not be present for this device. The Info->Valid bitfield is used
@@ -339,6 +340,14 @@ acpi_get_object_info(acpi_handle handle,
339 valid |= ACPI_VALID_UID; 340 valid |= ACPI_VALID_UID;
340 } 341 }
341 342
343 /* Execute the Device._SUB method */
344
345 status = acpi_ut_execute_SUB(node, &sub);
346 if (ACPI_SUCCESS(status)) {
347 info_size += sub->length;
348 valid |= ACPI_VALID_SUB;
349 }
350
342 /* Execute the Device._CID method */ 351 /* Execute the Device._CID method */
343 352
344 status = acpi_ut_execute_CID(node, &cid_list); 353 status = acpi_ut_execute_CID(node, &cid_list);
@@ -348,7 +357,7 @@ acpi_get_object_info(acpi_handle handle,
348 357
349 info_size += 358 info_size +=
350 (cid_list->list_size - 359 (cid_list->list_size -
351 sizeof(struct acpica_device_id_list)); 360 sizeof(struct acpi_pnp_device_id_list));
352 valid |= ACPI_VALID_CID; 361 valid |= ACPI_VALID_CID;
353 } 362 }
354 } 363 }
@@ -418,16 +427,17 @@ acpi_get_object_info(acpi_handle handle,
418 next_id_string = ACPI_CAST_PTR(char, info->compatible_id_list.ids); 427 next_id_string = ACPI_CAST_PTR(char, info->compatible_id_list.ids);
419 if (cid_list) { 428 if (cid_list) {
420 429
421 /* Point past the CID DEVICE_ID array */ 430 /* Point past the CID PNP_DEVICE_ID array */
422 431
423 next_id_string += 432 next_id_string +=
424 ((acpi_size) cid_list->count * 433 ((acpi_size) cid_list->count *
425 sizeof(struct acpica_device_id)); 434 sizeof(struct acpi_pnp_device_id));
426 } 435 }
427 436
428 /* 437 /*
429 * Copy the HID, UID, and CIDs to the return buffer. The variable-length 438 * Copy the HID, UID, SUB, and CIDs to the return buffer.
430 * strings are copied to the reserved area at the end of the buffer. 439 * The variable-length strings are copied to the reserved area
440 * at the end of the buffer.
431 * 441 *
432 * For HID and CID, check if the ID is a PCI Root Bridge. 442 * For HID and CID, check if the ID is a PCI Root Bridge.
433 */ 443 */
@@ -445,6 +455,11 @@ acpi_get_object_info(acpi_handle handle,
445 uid, next_id_string); 455 uid, next_id_string);
446 } 456 }
447 457
458 if (sub) {
459 next_id_string = acpi_ns_copy_device_id(&info->subsystem_id,
460 sub, next_id_string);
461 }
462
448 if (cid_list) { 463 if (cid_list) {
449 info->compatible_id_list.count = cid_list->count; 464 info->compatible_id_list.count = cid_list->count;
450 info->compatible_id_list.list_size = cid_list->list_size; 465 info->compatible_id_list.list_size = cid_list->list_size;
@@ -481,6 +496,9 @@ acpi_get_object_info(acpi_handle handle,
481 if (uid) { 496 if (uid) {
482 ACPI_FREE(uid); 497 ACPI_FREE(uid);
483 } 498 }
499 if (sub) {
500 ACPI_FREE(sub);
501 }
484 if (cid_list) { 502 if (cid_list) {
485 ACPI_FREE(cid_list); 503 ACPI_FREE(cid_list);
486 } 504 }