return;
}
- pnp_warn("PnPACPI: failed to convert resource type %d", r->id);
+ static void
+ pnpacpi_parse_address_option(struct pnp_option *option, struct acpi_resource *r)
+ {
+ struct acpi_resource_address64 addr, *p = &addr;
+ acpi_status status;
+ struct pnp_mem * mem;
+ struct pnp_port * port;
+
+ status = acpi_resource_to_address64(r, p);
+ if (!ACPI_SUCCESS(status)) {
- mem->min = mem->max = p->min_address_range;
++ pnp_warn("PnPACPI: failed to convert resource type %d", r->type);
+ return;
+ }
+
+ if (p->address_length == 0)
+ return;
+
+ if (p->resource_type == ACPI_MEMORY_RANGE) {
+ mem = kcalloc(1, sizeof(struct pnp_mem), GFP_KERNEL);
+ if (!mem)
+ return;
- mem->flags = (p->attribute.memory.read_write_attribute ==
++ mem->min = mem->max = p->minimum;
+ mem->size = p->address_length;
+ mem->align = 0;
- port->min = port->max = p->min_address_range;
++ mem->flags = (p->info.mem.write_protect ==
+ ACPI_READ_WRITE_MEMORY) ? IORESOURCE_MEM_WRITEABLE : 0;
+ pnp_register_mem_resource(option,mem);
+ } else if (p->resource_type == ACPI_IO_RANGE) {
+ port = kcalloc(1, sizeof(struct pnp_port), GFP_KERNEL);
+ if (!port)
+ return;
++ port->min = port->max = p->minimum;
+ port->size = p->address_length;
+ port->align = 0;
+ port->flags = PNP_PORT_FLAG_FIXED;
+ pnp_register_port_resource(option,port);
+ }
+ }
+
struct acpipnp_parse_option_s {
struct pnp_option *option;
struct pnp_option *option_independent;
pnpacpi_parse_fixed_mem32_option(option,
&res->data.fixed_memory32);
break;
- case ACPI_RSTYPE_ADDRESS16:
- case ACPI_RSTYPE_ADDRESS32:
- case ACPI_RSTYPE_ADDRESS64:
++ case ACPI_RESOURCE_TYPE_ADDRESS16:
++ case ACPI_RESOURCE_TYPE_ADDRESS32:
++ case ACPI_RESOURCE_TYPE_ADDRESS64:
+ pnpacpi_parse_address_option(option, res);
+ break;
- case ACPI_RSTYPE_START_DPF:
+ case ACPI_RESOURCE_TYPE_START_DEPENDENT:
switch (res->data.start_dpf.compatibility_priority) {
case ACPI_GOOD_CONFIGURATION:
priority = PNP_RES_PRIORITY_PREFERRED;
void *data)
{
int *res_cnt = (int *)data;
- switch (res->id) {
- case ACPI_RSTYPE_IRQ:
- case ACPI_RSTYPE_EXT_IRQ:
- case ACPI_RSTYPE_DMA:
- case ACPI_RSTYPE_IO:
- case ACPI_RSTYPE_FIXED_IO:
- case ACPI_RSTYPE_MEM24:
- case ACPI_RSTYPE_MEM32:
- case ACPI_RSTYPE_FIXED_MEM32:
- case ACPI_RSTYPE_ADDRESS16:
- case ACPI_RSTYPE_ADDRESS32:
- case ACPI_RSTYPE_ADDRESS64:
+ switch (res->type) {
+ case ACPI_RESOURCE_TYPE_IRQ:
+ case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
+ case ACPI_RESOURCE_TYPE_DMA:
+ case ACPI_RESOURCE_TYPE_IO:
+ case ACPI_RESOURCE_TYPE_FIXED_IO:
+ case ACPI_RESOURCE_TYPE_MEMORY24:
+ case ACPI_RESOURCE_TYPE_MEMORY32:
+ case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:
- #if 0
+ case ACPI_RESOURCE_TYPE_ADDRESS16:
+ case ACPI_RESOURCE_TYPE_ADDRESS32:
+ case ACPI_RESOURCE_TYPE_ADDRESS64:
- #endif
(*res_cnt) ++;
default:
return AE_OK;
void *data)
{
struct acpi_resource **resource = (struct acpi_resource **)data;
- switch (res->id) {
- case ACPI_RSTYPE_IRQ:
- case ACPI_RSTYPE_EXT_IRQ:
- case ACPI_RSTYPE_DMA:
- case ACPI_RSTYPE_IO:
- case ACPI_RSTYPE_FIXED_IO:
- case ACPI_RSTYPE_MEM24:
- case ACPI_RSTYPE_MEM32:
- case ACPI_RSTYPE_FIXED_MEM32:
- case ACPI_RSTYPE_ADDRESS16:
- case ACPI_RSTYPE_ADDRESS32:
- case ACPI_RSTYPE_ADDRESS64:
- (*resource)->id = res->id;
+ switch (res->type) {
+ case ACPI_RESOURCE_TYPE_IRQ:
+ case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
+ case ACPI_RESOURCE_TYPE_DMA:
+ case ACPI_RESOURCE_TYPE_IO:
+ case ACPI_RESOURCE_TYPE_FIXED_IO:
+ case ACPI_RESOURCE_TYPE_MEMORY24:
+ case ACPI_RESOURCE_TYPE_MEMORY32:
+ case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:
- #if 0
+ case ACPI_RESOURCE_TYPE_ADDRESS16:
+ case ACPI_RESOURCE_TYPE_ADDRESS32:
+ case ACPI_RESOURCE_TYPE_ADDRESS64:
- #endif
+ (*resource)->type = res->type;
(*resource)++;
default:
return AE_OK;