aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2006-01-20 01:11:37 -0500
committerLen Brown <len.brown@intel.com>2006-01-20 01:11:37 -0500
commit0af5853bccd263161df80c259d61fc71211c5ac3 (patch)
treec6617e20b4c03b8be4ff89ea58badbd965ae89e1
parent2ae4117435b30c7f9c12c89bcb323ce48b08c16a (diff)
[ACPI] better fix for pnpacpi regression resulting from ACPICA 20051117
Rather than tweaking acpi_walk_resource() again not return end tags, modify the pnpacpi code to ignore them. The pnpacpi resource type switch statements now include all known types in the order that they're defined -- so it is easy to see what is not implemented. The code will squawk only if it sees a truly undefined type. Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r--drivers/pnp/pnpacpi/rsparser.c145
1 files changed, 102 insertions, 43 deletions
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c
index c6db14d30ed6..407b4eaddcbf 100644
--- a/drivers/pnp/pnpacpi/rsparser.c
+++ b/drivers/pnp/pnpacpi/rsparser.c
@@ -177,29 +177,34 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
177 } 177 }
178 break; 178 break;
179 179
180 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
181 for (i = 0; i < res->data.extended_irq.interrupt_count; i++) {
182 pnpacpi_parse_allocated_irqresource(res_table,
183 res->data.extended_irq.interrupts[i],
184 res->data.extended_irq.triggering,
185 res->data.extended_irq.polarity);
186 }
187 break;
188 case ACPI_RESOURCE_TYPE_DMA: 180 case ACPI_RESOURCE_TYPE_DMA:
189 if (res->data.dma.channel_count > 0) 181 if (res->data.dma.channel_count > 0)
190 pnpacpi_parse_allocated_dmaresource(res_table, 182 pnpacpi_parse_allocated_dmaresource(res_table,
191 res->data.dma.channels[0]); 183 res->data.dma.channels[0]);
192 break; 184 break;
185
193 case ACPI_RESOURCE_TYPE_IO: 186 case ACPI_RESOURCE_TYPE_IO:
194 pnpacpi_parse_allocated_ioresource(res_table, 187 pnpacpi_parse_allocated_ioresource(res_table,
195 res->data.io.minimum, 188 res->data.io.minimum,
196 res->data.io.address_length); 189 res->data.io.address_length);
197 break; 190 break;
191
192 case ACPI_RESOURCE_TYPE_START_DEPENDENT:
193 case ACPI_RESOURCE_TYPE_END_DEPENDENT:
194 break;
195
198 case ACPI_RESOURCE_TYPE_FIXED_IO: 196 case ACPI_RESOURCE_TYPE_FIXED_IO:
199 pnpacpi_parse_allocated_ioresource(res_table, 197 pnpacpi_parse_allocated_ioresource(res_table,
200 res->data.fixed_io.address, 198 res->data.fixed_io.address,
201 res->data.fixed_io.address_length); 199 res->data.fixed_io.address_length);
202 break; 200 break;
201
202 case ACPI_RESOURCE_TYPE_VENDOR:
203 break;
204
205 case ACPI_RESOURCE_TYPE_END_TAG:
206 break;
207
203 case ACPI_RESOURCE_TYPE_MEMORY24: 208 case ACPI_RESOURCE_TYPE_MEMORY24:
204 pnpacpi_parse_allocated_memresource(res_table, 209 pnpacpi_parse_allocated_memresource(res_table,
205 res->data.memory24.minimum, 210 res->data.memory24.minimum,
@@ -230,8 +235,22 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
230 res->data.address64.minimum, 235 res->data.address64.minimum,
231 res->data.address64.address_length); 236 res->data.address64.address_length);
232 break; 237 break;
233 case ACPI_RESOURCE_TYPE_VENDOR: 238
239 case ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64:
240 break;
241
242 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
243 for (i = 0; i < res->data.extended_irq.interrupt_count; i++) {
244 pnpacpi_parse_allocated_irqresource(res_table,
245 res->data.extended_irq.interrupts[i],
246 res->data.extended_irq.triggering,
247 res->data.extended_irq.polarity);
248 }
249 break;
250
251 case ACPI_RESOURCE_TYPE_GENERIC_REGISTER:
234 break; 252 break;
253
235 default: 254 default:
236 pnp_warn("PnPACPI: unknown resource type %d", res->type); 255 pnp_warn("PnPACPI: unknown resource type %d", res->type);
237 return AE_ERROR; 256 return AE_ERROR;
@@ -510,35 +529,11 @@ static acpi_status pnpacpi_option_resource(struct acpi_resource *res,
510 case ACPI_RESOURCE_TYPE_IRQ: 529 case ACPI_RESOURCE_TYPE_IRQ:
511 pnpacpi_parse_irq_option(option, &res->data.irq); 530 pnpacpi_parse_irq_option(option, &res->data.irq);
512 break; 531 break;
513 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: 532
514 pnpacpi_parse_ext_irq_option(option,
515 &res->data.extended_irq);
516 break;
517 case ACPI_RESOURCE_TYPE_DMA: 533 case ACPI_RESOURCE_TYPE_DMA:
518 pnpacpi_parse_dma_option(option, &res->data.dma); 534 pnpacpi_parse_dma_option(option, &res->data.dma);
519 break; 535 break;
520 case ACPI_RESOURCE_TYPE_IO: 536
521 pnpacpi_parse_port_option(option, &res->data.io);
522 break;
523 case ACPI_RESOURCE_TYPE_FIXED_IO:
524 pnpacpi_parse_fixed_port_option(option,
525 &res->data.fixed_io);
526 break;
527 case ACPI_RESOURCE_TYPE_MEMORY24:
528 pnpacpi_parse_mem24_option(option, &res->data.memory24);
529 break;
530 case ACPI_RESOURCE_TYPE_MEMORY32:
531 pnpacpi_parse_mem32_option(option, &res->data.memory32);
532 break;
533 case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:
534 pnpacpi_parse_fixed_mem32_option(option,
535 &res->data.fixed_memory32);
536 break;
537 case ACPI_RESOURCE_TYPE_ADDRESS16:
538 case ACPI_RESOURCE_TYPE_ADDRESS32:
539 case ACPI_RESOURCE_TYPE_ADDRESS64:
540 pnpacpi_parse_address_option(option, res);
541 break;
542 case ACPI_RESOURCE_TYPE_START_DEPENDENT: 537 case ACPI_RESOURCE_TYPE_START_DEPENDENT:
543 switch (res->data.start_dpf.compatibility_priority) { 538 switch (res->data.start_dpf.compatibility_priority) {
544 case ACPI_GOOD_CONFIGURATION: 539 case ACPI_GOOD_CONFIGURATION:
@@ -562,6 +557,7 @@ static acpi_status pnpacpi_option_resource(struct acpi_resource *res,
562 return AE_ERROR; 557 return AE_ERROR;
563 parse_data->option = option; 558 parse_data->option = option;
564 break; 559 break;
560
565 case ACPI_RESOURCE_TYPE_END_DEPENDENT: 561 case ACPI_RESOURCE_TYPE_END_DEPENDENT:
566 /*only one EndDependentFn is allowed*/ 562 /*only one EndDependentFn is allowed*/
567 if (!parse_data->option_independent) { 563 if (!parse_data->option_independent) {
@@ -571,6 +567,50 @@ static acpi_status pnpacpi_option_resource(struct acpi_resource *res,
571 parse_data->option = parse_data->option_independent; 567 parse_data->option = parse_data->option_independent;
572 parse_data->option_independent = NULL; 568 parse_data->option_independent = NULL;
573 break; 569 break;
570
571 case ACPI_RESOURCE_TYPE_IO:
572 pnpacpi_parse_port_option(option, &res->data.io);
573 break;
574
575 case ACPI_RESOURCE_TYPE_FIXED_IO:
576 pnpacpi_parse_fixed_port_option(option,
577 &res->data.fixed_io);
578 break;
579
580 case ACPI_RESOURCE_TYPE_VENDOR:
581 case ACPI_RESOURCE_TYPE_END_TAG:
582 break;
583
584 case ACPI_RESOURCE_TYPE_MEMORY24:
585 pnpacpi_parse_mem24_option(option, &res->data.memory24);
586 break;
587
588 case ACPI_RESOURCE_TYPE_MEMORY32:
589 pnpacpi_parse_mem32_option(option, &res->data.memory32);
590 break;
591
592 case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:
593 pnpacpi_parse_fixed_mem32_option(option,
594 &res->data.fixed_memory32);
595 break;
596
597 case ACPI_RESOURCE_TYPE_ADDRESS16:
598 case ACPI_RESOURCE_TYPE_ADDRESS32:
599 case ACPI_RESOURCE_TYPE_ADDRESS64:
600 pnpacpi_parse_address_option(option, res);
601 break;
602
603 case ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64:
604 break;
605
606 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
607 pnpacpi_parse_ext_irq_option(option,
608 &res->data.extended_irq);
609 break;
610
611 case ACPI_RESOURCE_TYPE_GENERIC_REGISTER:
612 break;
613
574 default: 614 default:
575 pnp_warn("PnPACPI: unknown resource type %d", res->type); 615 pnp_warn("PnPACPI: unknown resource type %d", res->type);
576 return AE_ERROR; 616 return AE_ERROR;
@@ -605,7 +645,6 @@ static acpi_status pnpacpi_count_resources(struct acpi_resource *res,
605 int *res_cnt = (int *)data; 645 int *res_cnt = (int *)data;
606 switch (res->type) { 646 switch (res->type) {
607 case ACPI_RESOURCE_TYPE_IRQ: 647 case ACPI_RESOURCE_TYPE_IRQ:
608 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
609 case ACPI_RESOURCE_TYPE_DMA: 648 case ACPI_RESOURCE_TYPE_DMA:
610 case ACPI_RESOURCE_TYPE_IO: 649 case ACPI_RESOURCE_TYPE_IO:
611 case ACPI_RESOURCE_TYPE_FIXED_IO: 650 case ACPI_RESOURCE_TYPE_FIXED_IO:
@@ -615,7 +654,13 @@ static acpi_status pnpacpi_count_resources(struct acpi_resource *res,
615 case ACPI_RESOURCE_TYPE_ADDRESS16: 654 case ACPI_RESOURCE_TYPE_ADDRESS16:
616 case ACPI_RESOURCE_TYPE_ADDRESS32: 655 case ACPI_RESOURCE_TYPE_ADDRESS32:
617 case ACPI_RESOURCE_TYPE_ADDRESS64: 656 case ACPI_RESOURCE_TYPE_ADDRESS64:
657 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
618 (*res_cnt) ++; 658 (*res_cnt) ++;
659 case ACPI_RESOURCE_TYPE_START_DEPENDENT:
660 case ACPI_RESOURCE_TYPE_END_DEPENDENT:
661 case ACPI_RESOURCE_TYPE_VENDOR:
662 case ACPI_RESOURCE_TYPE_END_TAG:
663 case ACPI_RESOURCE_TYPE_GENERIC_REGISTER:
619 default: 664 default:
620 return AE_OK; 665 return AE_OK;
621 } 666 }
@@ -628,7 +673,6 @@ static acpi_status pnpacpi_type_resources(struct acpi_resource *res,
628 struct acpi_resource **resource = (struct acpi_resource **)data; 673 struct acpi_resource **resource = (struct acpi_resource **)data;
629 switch (res->type) { 674 switch (res->type) {
630 case ACPI_RESOURCE_TYPE_IRQ: 675 case ACPI_RESOURCE_TYPE_IRQ:
631 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
632 case ACPI_RESOURCE_TYPE_DMA: 676 case ACPI_RESOURCE_TYPE_DMA:
633 case ACPI_RESOURCE_TYPE_IO: 677 case ACPI_RESOURCE_TYPE_IO:
634 case ACPI_RESOURCE_TYPE_FIXED_IO: 678 case ACPI_RESOURCE_TYPE_FIXED_IO:
@@ -638,8 +682,14 @@ static acpi_status pnpacpi_type_resources(struct acpi_resource *res,
638 case ACPI_RESOURCE_TYPE_ADDRESS16: 682 case ACPI_RESOURCE_TYPE_ADDRESS16:
639 case ACPI_RESOURCE_TYPE_ADDRESS32: 683 case ACPI_RESOURCE_TYPE_ADDRESS32:
640 case ACPI_RESOURCE_TYPE_ADDRESS64: 684 case ACPI_RESOURCE_TYPE_ADDRESS64:
685 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
641 (*resource)->type = res->type; 686 (*resource)->type = res->type;
642 (*resource)++; 687 (*resource)++;
688 case ACPI_RESOURCE_TYPE_START_DEPENDENT:
689 case ACPI_RESOURCE_TYPE_END_DEPENDENT:
690 case ACPI_RESOURCE_TYPE_VENDOR:
691 case ACPI_RESOURCE_TYPE_END_TAG:
692 case ACPI_RESOURCE_TYPE_GENERIC_REGISTER:
643 default: 693 default:
644 return AE_OK; 694 return AE_OK;
645 } 695 }
@@ -828,12 +878,6 @@ int pnpacpi_encode_resources(struct pnp_resource_table *res_table,
828 irq++; 878 irq++;
829 break; 879 break;
830 880
831 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
832 pnp_dbg("Encode ext irq");
833 pnpacpi_encode_ext_irq(resource,
834 &res_table->irq_resource[irq]);
835 irq++;
836 break;
837 case ACPI_RESOURCE_TYPE_DMA: 881 case ACPI_RESOURCE_TYPE_DMA:
838 pnp_dbg("Encode dma"); 882 pnp_dbg("Encode dma");
839 pnpacpi_encode_dma(resource, 883 pnpacpi_encode_dma(resource,
@@ -870,6 +914,21 @@ int pnpacpi_encode_resources(struct pnp_resource_table *res_table,
870 &res_table->mem_resource[mem]); 914 &res_table->mem_resource[mem]);
871 mem ++; 915 mem ++;
872 break; 916 break;
917 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
918 pnp_dbg("Encode ext irq");
919 pnpacpi_encode_ext_irq(resource,
920 &res_table->irq_resource[irq]);
921 irq++;
922 break;
923 case ACPI_RESOURCE_TYPE_START_DEPENDENT:
924 case ACPI_RESOURCE_TYPE_END_DEPENDENT:
925 case ACPI_RESOURCE_TYPE_VENDOR:
926 case ACPI_RESOURCE_TYPE_END_TAG:
927 case ACPI_RESOURCE_TYPE_ADDRESS16:
928 case ACPI_RESOURCE_TYPE_ADDRESS32:
929 case ACPI_RESOURCE_TYPE_ADDRESS64:
930 case ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64:
931 case ACPI_RESOURCE_TYPE_GENERIC_REGISTER:
873 default: /* other type */ 932 default: /* other type */
874 pnp_warn("unknown resource type %d", resource->type); 933 pnp_warn("unknown resource type %d", resource->type);
875 return -EINVAL; 934 return -EINVAL;