提交 eca008c8 编写于 作者: L Len Brown

[ACPI] handle ACPICA 20050916's acpi_resource.type rename

Signed-off-by: NLen Brown <len.brown@intel.com>
上级 bda663d3
...@@ -1151,7 +1151,7 @@ acpi_ec_io_ports(struct acpi_resource *resource, void *context) ...@@ -1151,7 +1151,7 @@ acpi_ec_io_ports(struct acpi_resource *resource, void *context)
union acpi_ec *ec = (union acpi_ec *)context; union acpi_ec *ec = (union acpi_ec *)context;
struct acpi_generic_address *addr; struct acpi_generic_address *addr;
if (resource->id != ACPI_RSTYPE_IO) { if (resource->type != ACPI_RSTYPE_IO) {
return AE_OK; return AE_OK;
} }
......
...@@ -99,9 +99,9 @@ do_root_bridge_busnr_callback(struct acpi_resource *resource, void *data) ...@@ -99,9 +99,9 @@ do_root_bridge_busnr_callback(struct acpi_resource *resource, void *data)
int *busnr = (int *)data; int *busnr = (int *)data;
struct acpi_resource_address64 address; struct acpi_resource_address64 address;
if (resource->id != ACPI_RSTYPE_ADDRESS16 && if (resource->type != ACPI_RSTYPE_ADDRESS16 &&
resource->id != ACPI_RSTYPE_ADDRESS32 && resource->type != ACPI_RSTYPE_ADDRESS32 &&
resource->id != ACPI_RSTYPE_ADDRESS64) resource->type != ACPI_RSTYPE_ADDRESS64)
return AE_OK; return AE_OK;
acpi_resource_to_address64(resource, &address); acpi_resource_to_address64(resource, &address);
......
...@@ -54,7 +54,7 @@ static acpi_status acpi_reserve_io_ranges(struct acpi_resource *res, void *data) ...@@ -54,7 +54,7 @@ static acpi_status acpi_reserve_io_ranges(struct acpi_resource *res, void *data)
ACPI_FUNCTION_TRACE("acpi_reserve_io_ranges"); ACPI_FUNCTION_TRACE("acpi_reserve_io_ranges");
if (res->id == ACPI_RSTYPE_IO) { if (res->type == ACPI_RSTYPE_IO) {
struct acpi_resource_io *io_res = &res->data.io; struct acpi_resource_io *io_res = &res->data.io;
if (io_res->min_base_address != io_res->max_base_address) if (io_res->min_base_address != io_res->max_base_address)
...@@ -70,7 +70,7 @@ static acpi_status acpi_reserve_io_ranges(struct acpi_resource *res, void *data) ...@@ -70,7 +70,7 @@ static acpi_status acpi_reserve_io_ranges(struct acpi_resource *res, void *data)
request_region(io_res->min_base_address, request_region(io_res->min_base_address,
io_res->range_length, "motherboard"); io_res->range_length, "motherboard");
} }
} else if (res->id == ACPI_RSTYPE_FIXED_IO) { } else if (res->type == ACPI_RSTYPE_FIXED_IO) {
struct acpi_resource_fixed_io *fixed_io_res = struct acpi_resource_fixed_io *fixed_io_res =
&res->data.fixed_io; &res->data.fixed_io;
......
...@@ -108,7 +108,7 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context) ...@@ -108,7 +108,7 @@ acpi_pci_link_check_possible(struct acpi_resource *resource, void *context)
ACPI_FUNCTION_TRACE("acpi_pci_link_check_possible"); ACPI_FUNCTION_TRACE("acpi_pci_link_check_possible");
switch (resource->id) { switch (resource->type) {
case ACPI_RSTYPE_START_DPF: case ACPI_RSTYPE_START_DPF:
return_ACPI_STATUS(AE_OK); return_ACPI_STATUS(AE_OK);
case ACPI_RSTYPE_IRQ: case ACPI_RSTYPE_IRQ:
...@@ -201,7 +201,7 @@ acpi_pci_link_check_current(struct acpi_resource *resource, void *context) ...@@ -201,7 +201,7 @@ acpi_pci_link_check_current(struct acpi_resource *resource, void *context)
ACPI_FUNCTION_TRACE("acpi_pci_link_check_current"); ACPI_FUNCTION_TRACE("acpi_pci_link_check_current");
switch (resource->id) { switch (resource->type) {
case ACPI_RSTYPE_IRQ: case ACPI_RSTYPE_IRQ:
{ {
struct acpi_resource_irq *p = &resource->data.irq; struct acpi_resource_irq *p = &resource->data.irq;
...@@ -326,7 +326,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) ...@@ -326,7 +326,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
switch (link->irq.resource_type) { switch (link->irq.resource_type) {
case ACPI_RSTYPE_IRQ: case ACPI_RSTYPE_IRQ:
resource->res.id = ACPI_RSTYPE_IRQ; resource->res.type = ACPI_RSTYPE_IRQ;
resource->res.length = sizeof(struct acpi_resource); resource->res.length = sizeof(struct acpi_resource);
resource->res.data.irq.edge_level = link->irq.edge_level; resource->res.data.irq.edge_level = link->irq.edge_level;
resource->res.data.irq.active_high_low = resource->res.data.irq.active_high_low =
...@@ -341,7 +341,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) ...@@ -341,7 +341,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
break; break;
case ACPI_RSTYPE_EXT_IRQ: case ACPI_RSTYPE_EXT_IRQ:
resource->res.id = ACPI_RSTYPE_EXT_IRQ; resource->res.type = ACPI_RSTYPE_EXT_IRQ;
resource->res.length = sizeof(struct acpi_resource); resource->res.length = sizeof(struct acpi_resource);
resource->res.data.extended_irq.producer_consumer = resource->res.data.extended_irq.producer_consumer =
ACPI_CONSUMER; ACPI_CONSUMER;
...@@ -364,7 +364,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) ...@@ -364,7 +364,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
goto end; goto end;
} }
resource->end.id = ACPI_RSTYPE_END_TAG; resource->end.type = ACPI_RSTYPE_END_TAG;
/* Attempt to set the resource */ /* Attempt to set the resource */
status = acpi_set_current_resources(link->handle, &buffer); status = acpi_set_current_resources(link->handle, &buffer);
......
...@@ -122,9 +122,9 @@ get_root_bridge_busnr_callback(struct acpi_resource *resource, void *data) ...@@ -122,9 +122,9 @@ get_root_bridge_busnr_callback(struct acpi_resource *resource, void *data)
int *busnr = (int *)data; int *busnr = (int *)data;
struct acpi_resource_address64 address; struct acpi_resource_address64 address;
if (resource->id != ACPI_RSTYPE_ADDRESS16 && if (resource->type != ACPI_RSTYPE_ADDRESS16 &&
resource->id != ACPI_RSTYPE_ADDRESS32 && resource->type != ACPI_RSTYPE_ADDRESS32 &&
resource->id != ACPI_RSTYPE_ADDRESS64) resource->type != ACPI_RSTYPE_ADDRESS64)
return AE_OK; return AE_OK;
acpi_resource_to_address64(resource, &address); acpi_resource_to_address64(resource, &address);
......
...@@ -897,7 +897,7 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data) ...@@ -897,7 +897,7 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data)
for (hpetp = hpets; hpetp; hpetp = hpetp->hp_next) for (hpetp = hpets; hpetp; hpetp = hpetp->hp_next)
if (hpetp->hp_hpet == hdp->hd_address) if (hpetp->hp_hpet == hdp->hd_address)
return -EBUSY; return -EBUSY;
} else if (res->id == ACPI_RSTYPE_EXT_IRQ) { } else if (res->type == ACPI_RSTYPE_EXT_IRQ) {
struct acpi_resource_ext_irq *irqp; struct acpi_resource_ext_irq *irqp;
int i; int i;
......
...@@ -163,7 +163,7 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res, ...@@ -163,7 +163,7 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
struct pnp_resource_table * res_table = (struct pnp_resource_table *)data; struct pnp_resource_table * res_table = (struct pnp_resource_table *)data;
int i; int i;
switch (res->id) { switch (res->type) {
case ACPI_RSTYPE_IRQ: case ACPI_RSTYPE_IRQ:
/* /*
* Per spec, only one interrupt per descriptor is allowed in * Per spec, only one interrupt per descriptor is allowed in
...@@ -233,7 +233,7 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res, ...@@ -233,7 +233,7 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
case ACPI_RSTYPE_VENDOR: case ACPI_RSTYPE_VENDOR:
break; break;
default: default:
pnp_warn("PnPACPI: unknown resource type %d", res->id); pnp_warn("PnPACPI: unknown resource type %d", res->type);
return AE_ERROR; return AE_ERROR;
} }
...@@ -467,7 +467,7 @@ static acpi_status pnpacpi_option_resource(struct acpi_resource *res, ...@@ -467,7 +467,7 @@ static acpi_status pnpacpi_option_resource(struct acpi_resource *res,
struct pnp_dev *dev = parse_data->dev; struct pnp_dev *dev = parse_data->dev;
struct pnp_option *option = parse_data->option; struct pnp_option *option = parse_data->option;
switch (res->id) { switch (res->type) {
case ACPI_RSTYPE_IRQ: case ACPI_RSTYPE_IRQ:
pnpacpi_parse_irq_option(option, &res->data.irq); pnpacpi_parse_irq_option(option, &res->data.irq);
break; break;
...@@ -528,7 +528,7 @@ static acpi_status pnpacpi_option_resource(struct acpi_resource *res, ...@@ -528,7 +528,7 @@ static acpi_status pnpacpi_option_resource(struct acpi_resource *res,
parse_data->option_independent = NULL; parse_data->option_independent = NULL;
break; break;
default: default:
pnp_warn("PnPACPI: unknown resource type %d", res->id); pnp_warn("PnPACPI: unknown resource type %d", res->type);
return AE_ERROR; return AE_ERROR;
} }
...@@ -559,7 +559,7 @@ static acpi_status pnpacpi_count_resources(struct acpi_resource *res, ...@@ -559,7 +559,7 @@ static acpi_status pnpacpi_count_resources(struct acpi_resource *res,
void *data) void *data)
{ {
int *res_cnt = (int *)data; int *res_cnt = (int *)data;
switch (res->id) { switch (res->type) {
case ACPI_RSTYPE_IRQ: case ACPI_RSTYPE_IRQ:
case ACPI_RSTYPE_EXT_IRQ: case ACPI_RSTYPE_EXT_IRQ:
case ACPI_RSTYPE_DMA: case ACPI_RSTYPE_DMA:
...@@ -584,7 +584,7 @@ static acpi_status pnpacpi_type_resources(struct acpi_resource *res, ...@@ -584,7 +584,7 @@ static acpi_status pnpacpi_type_resources(struct acpi_resource *res,
void *data) void *data)
{ {
struct acpi_resource **resource = (struct acpi_resource **)data; struct acpi_resource **resource = (struct acpi_resource **)data;
switch (res->id) { switch (res->type) {
case ACPI_RSTYPE_IRQ: case ACPI_RSTYPE_IRQ:
case ACPI_RSTYPE_EXT_IRQ: case ACPI_RSTYPE_EXT_IRQ:
case ACPI_RSTYPE_DMA: case ACPI_RSTYPE_DMA:
...@@ -598,7 +598,7 @@ static acpi_status pnpacpi_type_resources(struct acpi_resource *res, ...@@ -598,7 +598,7 @@ static acpi_status pnpacpi_type_resources(struct acpi_resource *res,
case ACPI_RSTYPE_ADDRESS32: case ACPI_RSTYPE_ADDRESS32:
case ACPI_RSTYPE_ADDRESS64: case ACPI_RSTYPE_ADDRESS64:
#endif #endif
(*resource)->id = res->id; (*resource)->type = res->type;
(*resource)++; (*resource)++;
default: default:
return AE_OK; return AE_OK;
...@@ -636,7 +636,7 @@ int pnpacpi_build_resource_template(acpi_handle handle, ...@@ -636,7 +636,7 @@ int pnpacpi_build_resource_template(acpi_handle handle,
return -EINVAL; return -EINVAL;
} }
/* resource will pointer the end resource now */ /* resource will pointer the end resource now */
resource->id = ACPI_RSTYPE_END_TAG; resource->type = ACPI_RSTYPE_END_TAG;
return 0; return 0;
} }
...@@ -648,7 +648,7 @@ static void pnpacpi_encode_irq(struct acpi_resource *resource, ...@@ -648,7 +648,7 @@ static void pnpacpi_encode_irq(struct acpi_resource *resource,
decode_irq_flags(p->flags & IORESOURCE_BITS, &edge_level, decode_irq_flags(p->flags & IORESOURCE_BITS, &edge_level,
&active_high_low); &active_high_low);
resource->id = ACPI_RSTYPE_IRQ; resource->type = ACPI_RSTYPE_IRQ;
resource->length = sizeof(struct acpi_resource); resource->length = sizeof(struct acpi_resource);
resource->data.irq.edge_level = edge_level; resource->data.irq.edge_level = edge_level;
resource->data.irq.active_high_low = active_high_low; resource->data.irq.active_high_low = active_high_low;
...@@ -667,7 +667,7 @@ static void pnpacpi_encode_ext_irq(struct acpi_resource *resource, ...@@ -667,7 +667,7 @@ static void pnpacpi_encode_ext_irq(struct acpi_resource *resource,
decode_irq_flags(p->flags & IORESOURCE_BITS, &edge_level, decode_irq_flags(p->flags & IORESOURCE_BITS, &edge_level,
&active_high_low); &active_high_low);
resource->id = ACPI_RSTYPE_EXT_IRQ; resource->type = ACPI_RSTYPE_EXT_IRQ;
resource->length = sizeof(struct acpi_resource); resource->length = sizeof(struct acpi_resource);
resource->data.extended_irq.producer_consumer = ACPI_CONSUMER; resource->data.extended_irq.producer_consumer = ACPI_CONSUMER;
resource->data.extended_irq.edge_level = edge_level; resource->data.extended_irq.edge_level = edge_level;
...@@ -683,7 +683,7 @@ static void pnpacpi_encode_ext_irq(struct acpi_resource *resource, ...@@ -683,7 +683,7 @@ static void pnpacpi_encode_ext_irq(struct acpi_resource *resource,
static void pnpacpi_encode_dma(struct acpi_resource *resource, static void pnpacpi_encode_dma(struct acpi_resource *resource,
struct resource *p) struct resource *p)
{ {
resource->id = ACPI_RSTYPE_DMA; resource->type = ACPI_RSTYPE_DMA;
resource->length = sizeof(struct acpi_resource); resource->length = sizeof(struct acpi_resource);
/* Note: pnp_assign_dma will copy pnp_dma->flags into p->flags */ /* Note: pnp_assign_dma will copy pnp_dma->flags into p->flags */
if (p->flags & IORESOURCE_DMA_COMPATIBLE) if (p->flags & IORESOURCE_DMA_COMPATIBLE)
...@@ -708,7 +708,7 @@ static void pnpacpi_encode_dma(struct acpi_resource *resource, ...@@ -708,7 +708,7 @@ static void pnpacpi_encode_dma(struct acpi_resource *resource,
static void pnpacpi_encode_io(struct acpi_resource *resource, static void pnpacpi_encode_io(struct acpi_resource *resource,
struct resource *p) struct resource *p)
{ {
resource->id = ACPI_RSTYPE_IO; resource->type = ACPI_RSTYPE_IO;
resource->length = sizeof(struct acpi_resource); resource->length = sizeof(struct acpi_resource);
/* Note: pnp_assign_port will copy pnp_port->flags into p->flags */ /* Note: pnp_assign_port will copy pnp_port->flags into p->flags */
resource->data.io.io_decode = (p->flags & PNP_PORT_FLAG_16BITADDR)? resource->data.io.io_decode = (p->flags & PNP_PORT_FLAG_16BITADDR)?
...@@ -722,7 +722,7 @@ static void pnpacpi_encode_io(struct acpi_resource *resource, ...@@ -722,7 +722,7 @@ static void pnpacpi_encode_io(struct acpi_resource *resource,
static void pnpacpi_encode_fixed_io(struct acpi_resource *resource, static void pnpacpi_encode_fixed_io(struct acpi_resource *resource,
struct resource *p) struct resource *p)
{ {
resource->id = ACPI_RSTYPE_FIXED_IO; resource->type = ACPI_RSTYPE_FIXED_IO;
resource->length = sizeof(struct acpi_resource); resource->length = sizeof(struct acpi_resource);
resource->data.fixed_io.base_address = p->start; resource->data.fixed_io.base_address = p->start;
resource->data.fixed_io.range_length = p->end - p->start + 1; resource->data.fixed_io.range_length = p->end - p->start + 1;
...@@ -731,7 +731,7 @@ static void pnpacpi_encode_fixed_io(struct acpi_resource *resource, ...@@ -731,7 +731,7 @@ static void pnpacpi_encode_fixed_io(struct acpi_resource *resource,
static void pnpacpi_encode_mem24(struct acpi_resource *resource, static void pnpacpi_encode_mem24(struct acpi_resource *resource,
struct resource *p) struct resource *p)
{ {
resource->id = ACPI_RSTYPE_MEM24; resource->type = ACPI_RSTYPE_MEM24;
resource->length = sizeof(struct acpi_resource); resource->length = sizeof(struct acpi_resource);
/* Note: pnp_assign_mem will copy pnp_mem->flags into p->flags */ /* Note: pnp_assign_mem will copy pnp_mem->flags into p->flags */
resource->data.memory24.read_write_attribute = resource->data.memory24.read_write_attribute =
...@@ -746,7 +746,7 @@ static void pnpacpi_encode_mem24(struct acpi_resource *resource, ...@@ -746,7 +746,7 @@ static void pnpacpi_encode_mem24(struct acpi_resource *resource,
static void pnpacpi_encode_mem32(struct acpi_resource *resource, static void pnpacpi_encode_mem32(struct acpi_resource *resource,
struct resource *p) struct resource *p)
{ {
resource->id = ACPI_RSTYPE_MEM32; resource->type = ACPI_RSTYPE_MEM32;
resource->length = sizeof(struct acpi_resource); resource->length = sizeof(struct acpi_resource);
resource->data.memory32.read_write_attribute = resource->data.memory32.read_write_attribute =
(p->flags & IORESOURCE_MEM_WRITEABLE) ? (p->flags & IORESOURCE_MEM_WRITEABLE) ?
...@@ -760,7 +760,7 @@ static void pnpacpi_encode_mem32(struct acpi_resource *resource, ...@@ -760,7 +760,7 @@ static void pnpacpi_encode_mem32(struct acpi_resource *resource,
static void pnpacpi_encode_fixed_mem32(struct acpi_resource *resource, static void pnpacpi_encode_fixed_mem32(struct acpi_resource *resource,
struct resource *p) struct resource *p)
{ {
resource->id = ACPI_RSTYPE_FIXED_MEM32; resource->type = ACPI_RSTYPE_FIXED_MEM32;
resource->length = sizeof(struct acpi_resource); resource->length = sizeof(struct acpi_resource);
resource->data.fixed_memory32.read_write_attribute = resource->data.fixed_memory32.read_write_attribute =
(p->flags & IORESOURCE_MEM_WRITEABLE) ? (p->flags & IORESOURCE_MEM_WRITEABLE) ?
...@@ -780,7 +780,7 @@ int pnpacpi_encode_resources(struct pnp_resource_table *res_table, ...@@ -780,7 +780,7 @@ int pnpacpi_encode_resources(struct pnp_resource_table *res_table,
pnp_dbg("res cnt %d", res_cnt); pnp_dbg("res cnt %d", res_cnt);
while (i < res_cnt) { while (i < res_cnt) {
switch(resource->id) { switch(resource->type) {
case ACPI_RSTYPE_IRQ: case ACPI_RSTYPE_IRQ:
pnp_dbg("Encode irq"); pnp_dbg("Encode irq");
pnpacpi_encode_irq(resource, pnpacpi_encode_irq(resource,
...@@ -831,7 +831,7 @@ int pnpacpi_encode_resources(struct pnp_resource_table *res_table, ...@@ -831,7 +831,7 @@ int pnpacpi_encode_resources(struct pnp_resource_table *res_table,
mem ++; mem ++;
break; break;
default: /* other type */ default: /* other type */
pnp_warn("unknown resource type %d", resource->id); pnp_warn("unknown resource type %d", resource->type);
return -EINVAL; return -EINVAL;
} }
resource ++; resource ++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册