summaryrefslogtreecommitdiff
path: root/drivers/acpi/resources
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@athlon.transmeta.com>2002-02-04 17:57:11 -0800
committerLinus Torvalds <torvalds@athlon.transmeta.com>2002-02-04 17:57:11 -0800
commitc8ebfc888f9ee93f2dc7cd62b3be66263755d99a (patch)
treef449a3433c022ed8fd9aaa8f291a1b4e354fd5b9 /drivers/acpi/resources
parent5d12a58c4049a4839abbbdf87dd189505513b1b6 (diff)
v2.4.1.2 -> v2.4.1.3
- Jens: better ordering of requests when unable to merge - Neil Brown: make md work as a module again (we cannot autodetect in modules, not enough background information) - Neil Brown: raid5 SMP locking cleanups - Neil Brown: nfsd: handle Irix NFS clients named pipe behavior and dentry leak fix - maestro3 shutdown fix - fix dcache hash calculation that could cause bad hashes under certain circumstances (Dean Gaudet) - David Miller: networking and sparc updates - Jeff Garzik: include file cleanups - Andy Grover: ACPI update - Coda-fs error return fixes - rth: alpha Jensen update
Diffstat (limited to 'drivers/acpi/resources')
-rw-r--r--drivers/acpi/resources/rscalc.c29
-rw-r--r--drivers/acpi/resources/rscreate.c74
-rw-r--r--drivers/acpi/resources/rsdump.c14
-rw-r--r--drivers/acpi/resources/rslist.c6
4 files changed, 77 insertions, 46 deletions
diff --git a/drivers/acpi/resources/rscalc.c b/drivers/acpi/resources/rscalc.c
index 86ff91be87c5..bfceeac8baf9 100644
--- a/drivers/acpi/resources/rscalc.c
+++ b/drivers/acpi/resources/rscalc.c
@@ -2,7 +2,7 @@
*
* Module Name: rscalc - Acpi_rs_calculate_byte_stream_length
* Acpi_rs_calculate_list_length
- * $Revision: 18 $
+ * $Revision: 21 $
*
******************************************************************************/
@@ -27,6 +27,8 @@
#include "acpi.h"
#include "acresrc.h"
+#include "amlcode.h"
+#include "acnamesp.h"
#define _COMPONENT RESOURCE_MANAGER
MODULE_NAME ("rscalc")
@@ -704,6 +706,7 @@ acpi_rs_calculate_list_length (
*/
bytes_consumed = 2;
structure_size = RESOURCE_LENGTH;
+ byte_stream_buffer_length = bytes_parsed;
break;
@@ -810,7 +813,10 @@ acpi_rs_calculate_pci_routing_table_length (
name_found = FALSE;
for (table_index = 0; table_index < 4 && !name_found; table_index++) {
- if (ACPI_TYPE_STRING == (*sub_object_list)->common.type) {
+ if ((ACPI_TYPE_STRING == (*sub_object_list)->common.type) ||
+ ((INTERNAL_TYPE_REFERENCE == (*sub_object_list)->common.type) &&
+ ((*sub_object_list)->reference.op_code == AML_NAMEPATH_OP)))
+ {
name_found = TRUE;
}
@@ -822,17 +828,22 @@ acpi_rs_calculate_pci_routing_table_length (
}
}
- temp_size_needed += (sizeof (PCI_ROUTING_TABLE) - 1);
+ temp_size_needed += (sizeof (PCI_ROUTING_TABLE) - 4);
/*
* Was a String type found?
*/
if (TRUE == name_found) {
- /*
- * The length String.Length field includes the
- * terminating NULL
- */
- temp_size_needed += (*sub_object_list)->string.length;
+ if (ACPI_TYPE_STRING == (*sub_object_list)->common.type) {
+ /*
+ * The length String.Length field includes the
+ * terminating NULL
+ */
+ temp_size_needed += (*sub_object_list)->string.length;
+ }
+ else {
+ temp_size_needed += acpi_ns_get_pathname_length ((*sub_object_list)->reference.node);
+ }
}
else {
@@ -855,7 +866,7 @@ acpi_rs_calculate_pci_routing_table_length (
}
- *buffer_size_needed = temp_size_needed + sizeof (PCI_ROUTING_TABLE);
+ *buffer_size_needed = temp_size_needed;
return (AE_OK);
}
diff --git a/drivers/acpi/resources/rscreate.c b/drivers/acpi/resources/rscreate.c
index f221a41dc290..234684edb092 100644
--- a/drivers/acpi/resources/rscreate.c
+++ b/drivers/acpi/resources/rscreate.c
@@ -3,7 +3,7 @@
* Module Name: rscreate - Acpi_rs_create_resource_list
* Acpi_rs_create_pci_routing_table
* Acpi_rs_create_byte_stream
- * $Revision: 24 $
+ * $Revision: 25 $
*
******************************************************************************/
@@ -28,6 +28,8 @@
#include "acpi.h"
#include "acresrc.h"
+#include "amlcode.h"
+#include "acnamesp.h"
#define _COMPONENT RESOURCE_MANAGER
MODULE_NAME ("rscreate")
@@ -157,6 +159,7 @@ acpi_rs_create_pci_routing_table (
u32 number_of_elements = 0;
u32 index = 0;
PCI_ROUTING_TABLE *user_prt = NULL;
+ ACPI_NAMESPACE_NODE *node;
ACPI_STATUS status;
@@ -203,10 +206,10 @@ acpi_rs_create_pci_routing_table (
/*
* Fill in the Length field with the information we
* have at this point.
- * The minus one is to subtract the size of the
- * u8 Source[1] member because it is added below.
+ * The minus four is to subtract the size of the
+ * u8 Source[4] member because it is added below.
*/
- user_prt->length = (sizeof (PCI_ROUTING_TABLE) - 1);
+ user_prt->length = (sizeof (PCI_ROUTING_TABLE) -4);
/*
* Dereference the sub-package
@@ -221,11 +224,10 @@ acpi_rs_create_pci_routing_table (
sub_object_list = package_element->package.elements;
/*
- * Dereference the Address
+ * 1) First subobject: Dereference the Address
*/
if (ACPI_TYPE_INTEGER == (*sub_object_list)->common.type) {
- user_prt->data.address =
- (*sub_object_list)->integer.value;
+ user_prt->address = (*sub_object_list)->integer.value;
}
else {
@@ -233,12 +235,12 @@ acpi_rs_create_pci_routing_table (
}
/*
- * Dereference the Pin
+ * 2) Second subobject: Dereference the Pin
*/
sub_object_list++;
if (ACPI_TYPE_INTEGER == (*sub_object_list)->common.type) {
- user_prt->data.pin =
+ user_prt->pin =
(u32) (*sub_object_list)->integer.value;
}
@@ -247,37 +249,57 @@ acpi_rs_create_pci_routing_table (
}
/*
- * Dereference the Source Name
+ * 3) Third subobject: Dereference the Source Name
*/
sub_object_list++;
- if (ACPI_TYPE_STRING == (*sub_object_list)->common.type) {
- STRCPY (user_prt->data.source,
+ switch ((*sub_object_list)->common.type)
+ {
+ case INTERNAL_TYPE_REFERENCE:
+ if ((*sub_object_list)->reference.op_code != AML_NAMEPATH_OP) {
+ return (AE_BAD_DATA);
+ }
+
+ node = (*sub_object_list)->reference.node;
+
+ /* TBD: use *remaining* length of the buffer! */
+
+ status = acpi_ns_handle_to_pathname ((ACPI_HANDLE *) node,
+ output_buffer_length, user_prt->source);
+
+ user_prt->length += STRLEN (user_prt->source) + 1; /* include null terminator */
+ break;
+
+
+ case ACPI_TYPE_STRING:
+
+ STRCPY (user_prt->source,
(*sub_object_list)->string.pointer);
/*
* Add to the Length field the length of the string
*/
user_prt->length += (*sub_object_list)->string.length;
- }
+ break;
- else {
+
+ case ACPI_TYPE_INTEGER:
/*
* If this is a number, then the Source Name
* is NULL, since the entire buffer was zeroed
* out, we can leave this alone.
*/
- if (ACPI_TYPE_INTEGER == (*sub_object_list)->common.type) {
- /*
- * Add to the Length field the length of
- * the u32 NULL
- */
- user_prt->length += sizeof (u32);
- }
+ /*
+ * Add to the Length field the length of
+ * the u32 NULL
+ */
+ user_prt->length += sizeof (u32);
+ break;
- else {
- return (AE_BAD_DATA);
- }
+
+ default:
+ return (AE_BAD_DATA);
+ break;
}
/* Now align the current length */
@@ -285,12 +307,12 @@ acpi_rs_create_pci_routing_table (
user_prt->length = ROUND_UP_TO_64_bITS (user_prt->length);
/*
- * Dereference the Source Index
+ * 4) Fourth subobject: Dereference the Source Index
*/
sub_object_list++;
if (ACPI_TYPE_INTEGER == (*sub_object_list)->common.type) {
- user_prt->data.source_index =
+ user_prt->source_index =
(u32) (*sub_object_list)->integer.value;
}
diff --git a/drivers/acpi/resources/rsdump.c b/drivers/acpi/resources/rsdump.c
index 03d2da6f2150..367648afef02 100644
--- a/drivers/acpi/resources/rsdump.c
+++ b/drivers/acpi/resources/rsdump.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: rsdump - Functions do dump out the resource structures.
- * $Revision: 15 $
+ * $Revision: 16 $
*
******************************************************************************/
@@ -910,24 +910,24 @@ acpi_rs_dump_irq_list (
if (acpi_dbg_level & TRACE_RESOURCES && _COMPONENT & acpi_dbg_layer) {
- prt_element = (PCI_ROUTING_TABLE *)buffer;
+ prt_element = (PCI_ROUTING_TABLE *) buffer;
while (!done) {
acpi_os_printf ("\t_pCI IRQ Routing Table structure %X.\n", count++);
acpi_os_printf ("\t\t_address: %X\n",
- prt_element->data.address);
+ prt_element->address);
- acpi_os_printf ("\t\t_pin: %X\n", prt_element->data.pin);
+ acpi_os_printf ("\t\t_pin: %X\n", prt_element->pin);
- acpi_os_printf ("\t\t_source: %s\n", prt_element->data.source);
+ acpi_os_printf ("\t\t_source: %s\n", prt_element->source);
acpi_os_printf ("\t\t_source_index: %X\n",
- prt_element->data.source_index);
+ prt_element->source_index);
buffer += prt_element->length;
- prt_element = (PCI_ROUTING_TABLE *)buffer;
+ prt_element = (PCI_ROUTING_TABLE *) buffer;
if(0 == prt_element->length) {
done = TRUE;
diff --git a/drivers/acpi/resources/rslist.c b/drivers/acpi/resources/rslist.c
index de47563d0f8e..048db65a4644 100644
--- a/drivers/acpi/resources/rslist.c
+++ b/drivers/acpi/resources/rslist.c
@@ -2,7 +2,7 @@
*
* Module Name: rslist - Acpi_rs_byte_stream_to_list
* Acpi_list_to_byte_stream
- * $Revision: 10 $
+ * $Revision: 11 $
*
******************************************************************************/
@@ -302,9 +302,7 @@ acpi_rs_byte_stream_to_list (
/*
* Check the reason for exiting the while loop
*/
- if (!(byte_stream_buffer_length == bytes_parsed) ||
- (TRUE != end_tag_processed))
- {
+ if (TRUE != end_tag_processed) {
return (AE_AML_ERROR);
}