diff options
author | jhb <jhb@FreeBSD.org> | 2003-11-14 21:36:09 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2003-11-14 21:36:09 +0000 |
commit | a8b3e2b2efc31b02082a0211f65d2d17b7180124 (patch) | |
tree | 90ee6f27f6f54b8c81fd27e33b8bceca6a60d4ae /sys/dev/acpica/acpi_pci_link.c | |
parent | 29faf9e47052f4559ee204783d6091f63361d8ca (diff) | |
download | FreeBSD-src-a8b3e2b2efc31b02082a0211f65d2d17b7180124.zip FreeBSD-src-a8b3e2b2efc31b02082a0211f65d2d17b7180124.tar.gz |
Improve support for extended IRQ resources:
- For acpi_pci_link_entry_dump(), add a few helper functions to display
the trigger mode, polarity, and sharemode of an individual IRQ resource.
These functions are then called for both regular and extended IRQ
resources.
- In acpi_pci_link_set_irq(), use the same type of IRQ resource
(regular vs. extended) for the new current resource as the type of
the resources from _PRS.
- When routing an interrupt don't ignore extended IRQ resources. Also,
use the same type of IRQ resource (regular vs. extended) for the new
current resource when as the type of the resource from _PRS.
Tested by: peter
Diffstat (limited to 'sys/dev/acpica/acpi_pci_link.c')
-rw-r--r-- | sys/dev/acpica/acpi_pci_link.c | 137 |
1 files changed, 80 insertions, 57 deletions
diff --git a/sys/dev/acpica/acpi_pci_link.c b/sys/dev/acpica/acpi_pci_link.c index 9549f68..88d6c0a 100644 --- a/sys/dev/acpica/acpi_pci_link.c +++ b/sys/dev/acpica/acpi_pci_link.c @@ -87,10 +87,68 @@ static int irq_penalty[MAX_ACPI_INTERRUPTS]; */ static void +acpi_pci_link_dump_polarity(UINT32 ActiveHighLow) +{ + + switch (ActiveHighLow) { + case ACPI_ACTIVE_HIGH: + printf("high,"); + break; + + case ACPI_ACTIVE_LOW: + printf("low,"); + break; + + default: + printf("unknown,"); + break; + } +} + +static void +acpi_pci_link_dump_trigger(UINT32 EdgeLevel) +{ + + switch (EdgeLevel) { + case ACPI_EDGE_SENSITIVE: + printf("edge,"); + break; + + case ACPI_LEVEL_SENSITIVE: + printf("level,"); + break; + + default: + printf("unknown,"); + break; + } +} + +static void +acpi_pci_link_dump_sharemode(UINT32 SharedExclusive) +{ + + switch (SharedExclusive) { + case ACPI_EXCLUSIVE: + printf("exclusive"); + break; + + case ACPI_SHARED: + printf("sharable"); + break; + + default: + printf("unknown"); + break; + } +} + +static void acpi_pci_link_entry_dump(struct acpi_prt_entry *entry) { UINT8 i; ACPI_RESOURCE_IRQ *Irq; + ACPI_RESOURCE_EXT_IRQ *ExtIrq; if (entry == NULL || entry->pci_link == NULL) { return; @@ -105,57 +163,21 @@ acpi_pci_link_entry_dump(struct acpi_prt_entry *entry) } printf("] "); - Irq = NULL; switch (entry->pci_link->possible_resources.Id) { case ACPI_RSTYPE_IRQ: Irq = &entry->pci_link->possible_resources.Data.Irq; - switch (Irq->ActiveHighLow) { - case ACPI_ACTIVE_HIGH: - printf("high,"); - break; - - case ACPI_ACTIVE_LOW: - printf("low,"); - break; - - default: - printf("unknown,"); - break; - } - - switch (Irq->EdgeLevel) { - case ACPI_EDGE_SENSITIVE: - printf("edge,"); - break; - - case ACPI_LEVEL_SENSITIVE: - printf("level,"); - break; - - default: - printf("unknown,"); - break; - } - - switch (Irq->SharedExclusive) { - case ACPI_EXCLUSIVE: - printf("exclusive"); - break; - - case ACPI_SHARED: - printf("sharable"); - break; - - default: - printf("unknown"); - break; - } - + acpi_pci_link_dump_polarity(Irq->ActiveHighLow); + acpi_pci_link_dump_trigger(Irq->EdgeLevel); + acpi_pci_link_dump_sharemode(Irq->SharedExclusive); break; case ACPI_RSTYPE_EXT_IRQ: - /* TBD */ + ExtIrq = &entry->pci_link->possible_resources.Data.ExtendedIrq; + + acpi_pci_link_dump_polarity(ExtIrq->ActiveHighLow); + acpi_pci_link_dump_trigger(ExtIrq->EdgeLevel); + acpi_pci_link_dump_sharemode(ExtIrq->SharedExclusive); break; } @@ -565,34 +587,35 @@ acpi_pci_link_set_irq(struct acpi_pci_link_entry *link, UINT8 irq) bzero(&resbuf, sizeof(resbuf)); crsbuf.Pointer = NULL; - resbuf.Id = ACPI_RSTYPE_IRQ; - resbuf.Length = ACPI_SIZEOF_RESOURCE(ACPI_RESOURCE_IRQ); - if (link->possible_resources.Id != ACPI_RSTYPE_IRQ && - link->possible_resources.Id != ACPI_RSTYPE_EXT_IRQ) { + switch (link->possible_resources.Id) { + default: ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Resource is not an IRQ entry %s - %d\n", acpi_name(link->handle), link->possible_resources.Id)); return_ACPI_STATUS (AE_TYPE); - } - switch (link->possible_resources.Id) { case ACPI_RSTYPE_IRQ: + resbuf.Id = ACPI_RSTYPE_IRQ; + resbuf.Length = ACPI_SIZEOF_RESOURCE(ACPI_RESOURCE_IRQ); + /* structure copy other fields */ resbuf.Data.Irq = link->possible_resources.Data.Irq; + resbuf.Data.Irq.NumberOfInterrupts = 1; + resbuf.Data.Irq.Interrupts[0] = irq; break; case ACPI_RSTYPE_EXT_IRQ: - /* XXX */ - resbuf.Data.Irq.EdgeLevel = ACPI_LEVEL_SENSITIVE; - resbuf.Data.Irq.ActiveHighLow = ACPI_ACTIVE_LOW; - resbuf.Data.Irq.SharedExclusive = ACPI_SHARED; + resbuf.Id = ACPI_RSTYPE_EXT_IRQ; + resbuf.Length = ACPI_SIZEOF_RESOURCE(ACPI_RESOURCE_EXT_IRQ); + + /* structure copy other fields */ + resbuf.Data.ExtendedIrq = link->possible_resources.Data.ExtendedIrq; + resbuf.Data.ExtendedIrq.NumberOfInterrupts = 1; + resbuf.Data.ExtendedIrq.Interrupts[0] = irq; break; } - resbuf.Data.Irq.NumberOfInterrupts = 1; - resbuf.Data.Irq.Interrupts[0] = irq; - error = acpi_AppendBufferResource(&crsbuf, &resbuf); if (ACPI_FAILURE(error)) { ACPI_DEBUG_PRINT((ACPI_DB_ERROR, |