diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2015-11-25 21:04:42 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2015-11-25 21:04:42 +0000 |
commit | b9098066cd6284319bca922f13e59517f774a103 (patch) | |
tree | f01fd6c9053cb01ed84c00cb42ee789adafceaf5 /source/components/utilities/utids.c | |
parent | 1e24cf365bc9c8df179b145c90d52852724e54ee (diff) |
Notes
Diffstat (limited to 'source/components/utilities/utids.c')
-rw-r--r-- | source/components/utilities/utids.c | 93 |
1 files changed, 13 insertions, 80 deletions
diff --git a/source/components/utilities/utids.c b/source/components/utilities/utids.c index 1b7f1f5dad8a..528d78c64936 100644 --- a/source/components/utilities/utids.c +++ b/source/components/utilities/utids.c @@ -83,7 +83,7 @@ AcpiUtExecute_HID ( Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__HID, - ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING, &ObjDesc); + ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING, &ObjDesc); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -102,7 +102,8 @@ AcpiUtExecute_HID ( /* Allocate a buffer for the HID */ - Hid = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length); + Hid = ACPI_ALLOCATE_ZEROED ( + sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length); if (!Hid) { Status = AE_NO_MEMORY; @@ -139,77 +140,6 @@ Cleanup: /******************************************************************************* * - * FUNCTION: AcpiUtExecute_SUB - * - * PARAMETERS: DeviceNode - Node for the device - * ReturnId - Where the _SUB is returned - * - * RETURN: Status - * - * DESCRIPTION: Executes the _SUB control method that returns the subsystem - * ID of the device. The _SUB value is always a string containing - * either a valid PNP or ACPI ID. - * - * NOTE: Internal function, no parameter validation - * - ******************************************************************************/ - -ACPI_STATUS -AcpiUtExecute_SUB ( - ACPI_NAMESPACE_NODE *DeviceNode, - ACPI_PNP_DEVICE_ID **ReturnId) -{ - ACPI_OPERAND_OBJECT *ObjDesc; - ACPI_PNP_DEVICE_ID *Sub; - UINT32 Length; - ACPI_STATUS Status; - - - ACPI_FUNCTION_TRACE (UtExecute_SUB); - - - Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__SUB, - ACPI_BTYPE_STRING, &ObjDesc); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - /* Get the size of the String to be returned, includes null terminator */ - - Length = ObjDesc->String.Length + 1; - - /* Allocate a buffer for the SUB */ - - Sub = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length); - if (!Sub) - { - Status = AE_NO_MEMORY; - goto Cleanup; - } - - /* Area for the string starts after PNP_DEVICE_ID struct */ - - Sub->String = ACPI_ADD_PTR (char, Sub, sizeof (ACPI_PNP_DEVICE_ID)); - - /* Simply copy existing string */ - - strcpy (Sub->String, ObjDesc->String.Pointer); - Sub->Length = Length; - *ReturnId = Sub; - - -Cleanup: - - /* On exit, we must delete the return object */ - - AcpiUtRemoveReference (ObjDesc); - return_ACPI_STATUS (Status); -} - - -/******************************************************************************* - * * FUNCTION: AcpiUtExecute_UID * * PARAMETERS: DeviceNode - Node for the device @@ -241,7 +171,7 @@ AcpiUtExecute_UID ( Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__UID, - ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING, &ObjDesc); + ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING, &ObjDesc); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -260,7 +190,8 @@ AcpiUtExecute_UID ( /* Allocate a buffer for the UID */ - Uid = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length); + Uid = ACPI_ALLOCATE_ZEROED ( + sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length); if (!Uid) { Status = AE_NO_MEMORY; @@ -341,8 +272,8 @@ AcpiUtExecute_CID ( /* Evaluate the _CID method for this device */ Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__CID, - ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_PACKAGE, - &ObjDesc); + ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_PACKAGE, + &ObjDesc); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -419,7 +350,8 @@ AcpiUtExecute_CID ( { /* Convert the Integer (EISAID) CID to a string */ - AcpiExEisaIdToString (NextIdString, CidObjects[i]->Integer.Value); + AcpiExEisaIdToString ( + NextIdString, CidObjects[i]->Integer.Value); Length = ACPI_EISAID_STRING_SIZE; } else /* ACPI_TYPE_STRING */ @@ -488,7 +420,7 @@ AcpiUtExecute_CLS ( Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__CLS, - ACPI_BTYPE_PACKAGE, &ObjDesc); + ACPI_BTYPE_PACKAGE, &ObjDesc); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -518,7 +450,8 @@ AcpiUtExecute_CLS ( /* Allocate a buffer for the CLS */ - Cls = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length); + Cls = ACPI_ALLOCATE_ZEROED ( + sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length); if (!Cls) { Status = AE_NO_MEMORY; |