ACPI: Make acpi_pci* compile; they are not used yet.
authorAlexander Polakov <polachok@gmail.com>
Tue, 9 Jun 2009 08:59:33 +0000 (12:59 +0400)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 11 Jul 2009 05:22:09 +0000 (13:22 +0800)
Submitted-by: Alexander Polakov <polachok@gmail.com> w/ modification
sys/conf/files
sys/dev/acpica5/Makefile
sys/dev/acpica5/acpi_pci.c
sys/dev/acpica5/acpi_pci_link.c
sys/dev/acpica5/acpi_pcib.c
sys/dev/acpica5/acpi_pcib_acpi.c
sys/dev/acpica5/acpi_pcib_pci.c

index 5d2ab77..fcda4c5 100644 (file)
@@ -1673,12 +1673,11 @@ ${OSACPI_MI_DIR}/acpi_if.m              optional acpi
 ${OSACPI_MI_DIR}/acpi_isab.c           optional acpi isa
 ${OSACPI_MI_DIR}/acpi_lid.c            optional acpi
 ${OSACPI_MI_DIR}/acpi_package.c                optional acpi
-# commented out to avoid PCI-routing problems
-#${OSACPI_MI_DIR}/acpi_pci.c           optional acpi pci
-#${OSACPI_MI_DIR}/acpi_pci_link.c      optional acpi pci
-#${OSACPI_MI_DIR}/acpi_pcib.c          optional acpi pci
-#${OSACPI_MI_DIR}/acpi_pcib_acpi.c     optional acpi pci
-#${OSACPI_MI_DIR}/acpi_pcib_pci.c      optional acpi pci
+${OSACPI_MI_DIR}/acpi_pci.c            optional acpi pci
+${OSACPI_MI_DIR}/acpi_pci_link.c       optional acpi pci
+${OSACPI_MI_DIR}/acpi_pcib.c           optional acpi pci
+${OSACPI_MI_DIR}/acpi_pcib_acpi.c      optional acpi pci
+${OSACPI_MI_DIR}/acpi_pcib_pci.c       optional acpi pci
 ${OSACPI_MI_DIR}/acpi_powerres.c       optional acpi
 ${OSACPI_MI_DIR}/acpi_resource.c       optional acpi
 ${OSACPI_MI_DIR}/acpi_thermal.c                optional acpi
index fe9ae8a..2b6bc6d 100644 (file)
@@ -67,8 +67,8 @@ SRCS+=        acpi_cpu.c acpi_cpu_cstate.c acpi_cpu_pstate.c
 SRCS+=  acpi_ec.c acpi_isab.c acpi_lid.c
 SRCS+=  acpi_package.c
 # The PCI part of ACPI5 doesn't work with the current infrastructure
-# SRCS+=       acpi_pci.c acpi_pcib.c acpi_pcib_acpi.c acpi_pcib_pci.c
-# SRCS+=       acpi_pci_link.c
+SRCS+= acpi_pci.c acpi_pcib.c acpi_pcib_acpi.c acpi_pcib_pci.c
+SRCS+= acpi_pci_link.c
 SRCS+=  acpi_powerres.c acpi_resource.c acpi_thermal.c
 SRCS+=  acpi_timer.c acpi_hpet.c acpi_if.c
 SRCS+=  OsdDebug.c
index 25ccd57..b28ee1a 100644 (file)
@@ -119,6 +119,8 @@ static driver_t acpi_pci_driver = {
        0,                      /* no softc */
 };
 
+static devclass_t pci_devclass;
+
 DRIVER_MODULE(acpi_pci, pcib, acpi_pci_driver, pci_devclass, 0, 0);
 MODULE_DEPEND(acpi_pci, acpi, 1, 1, 1);
 MODULE_VERSION(acpi_pci, 1);
@@ -253,7 +255,7 @@ acpi_pci_probe(device_t dev)
 static int
 acpi_pci_attach(device_t dev)
 {
-       int busno;
+       int busno, domain;
 
        /*
         * Since there can be multiple independantly numbered PCI
@@ -265,6 +267,8 @@ acpi_pci_attach(device_t dev)
        if (bootverbose)
                device_printf(dev, "physical bus=%d\n", busno);
 
+       domain = pcib_get_domain(device_get_parent(dev));
+
        /*
         * First, PCI devices are added as in the normal PCI bus driver.
         * Afterwards, the ACPI namespace under the bridge driver is
@@ -275,7 +279,7 @@ acpi_pci_attach(device_t dev)
         * pci_add_children() doesn't find.  We currently just ignore
         * these devices.
         */
-       pci_add_children(dev, busno, sizeof(struct acpi_pci_devinfo));
+       pci_add_children(dev, domain, busno, sizeof(struct acpi_pci_devinfo));
        AcpiWalkNamespace(ACPI_TYPE_DEVICE, acpi_get_handle(dev), 1,
            acpi_pci_save_handle, dev, NULL);
 
index 856b910..913431e 100644 (file)
@@ -83,10 +83,10 @@ static int  irq_penalty[MAX_ACPI_INTERRUPTS];
  */
 
 static void
-acpi_pci_link_dump_polarity(UINT32 ActiveHighLow)
+acpi_pci_link_dump_polarity(UINT32 Polarity)
 {
 
-       switch (ActiveHighLow) {
+       switch (Polarity) {
        case ACPI_ACTIVE_HIGH:
                kprintf("high,");
                break;
@@ -100,10 +100,10 @@ acpi_pci_link_dump_polarity(UINT32 ActiveHighLow)
 }
 
 static void
-acpi_pci_link_dump_trigger(UINT32 EdgeLevel)
+acpi_pci_link_dump_trigger(UINT32 Triggering)
 {
 
-       switch (EdgeLevel) {
+       switch (Triggering) {
        case ACPI_EDGE_SENSITIVE:
                kprintf("edge,");
                break;
@@ -138,7 +138,7 @@ acpi_pci_link_entry_dump(struct acpi_prt_entry *entry)
 {
        UINT8                   i;
        ACPI_RESOURCE_IRQ       *Irq;
-       ACPI_RESOURCE_EXT_IRQ   *ExtIrq;
+       ACPI_RESOURCE_EXTENDED_IRQ      *ExtIrq;
 
        if (entry == NULL || entry->pci_link == NULL)
                return;
@@ -151,18 +151,18 @@ acpi_pci_link_entry_dump(struct acpi_prt_entry *entry)
                kprintf("%3d", entry->pci_link->interrupts[i]);
        kprintf("] ");
 
-       switch (entry->pci_link->possible_resources.Id) {
-       case ACPI_RSTYPE_IRQ:
+       switch (entry->pci_link->possible_resources.Type) {
+       case ACPI_RESOURCE_TYPE_IRQ:
                Irq = &entry->pci_link->possible_resources.Data.Irq;
-               acpi_pci_link_dump_polarity(Irq->ActiveHighLow);
-               acpi_pci_link_dump_trigger(Irq->EdgeLevel);
-               acpi_pci_link_dump_sharemode(Irq->SharedExclusive);
+               acpi_pci_link_dump_polarity(Irq->Polarity);
+               acpi_pci_link_dump_trigger(Irq->Triggering);
+               acpi_pci_link_dump_sharemode(Irq->Sharable);
                break;
-       case ACPI_RSTYPE_EXT_IRQ:
+       case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
                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);
+               acpi_pci_link_dump_polarity(ExtIrq->Polarity);
+               acpi_pci_link_dump_trigger(ExtIrq->Triggering);
+               acpi_pci_link_dump_sharemode(ExtIrq->Sharable);
                break;
        }
 
@@ -222,8 +222,9 @@ acpi_pci_link_get_irq_resources(ACPI_RESOURCE *resources,
 {
        UINT8                   count;
        UINT8                   i;
-       UINT32                  NumberOfInterrupts;
-       UINT32                  *Interrupts;
+       UINT32                  InterruptCount;
+       UINT32                  *Interrupts32;
+       UINT8                   *Interrupts8;
 
        ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
 
@@ -233,49 +234,59 @@ acpi_pci_link_get_irq_resources(ACPI_RESOURCE *resources,
        }
 
        *number_of_interrupts = 0;
-       NumberOfInterrupts = 0;
-       Interrupts = NULL;
+       InterruptCount = 0;
+       Interrupts8 = NULL;
+       Interrupts32 = NULL;
 
-       if (resources->Id == ACPI_RSTYPE_START_DPF)
+       if (resources->Type == ACPI_RESOURCE_TYPE_START_DEPENDENT)
                resources = ACPI_NEXT_RESOURCE(resources);
 
-       if (resources->Id != ACPI_RSTYPE_IRQ &&
-           resources->Id != ACPI_RSTYPE_EXT_IRQ) {
+       if (resources->Type != ACPI_RESOURCE_TYPE_IRQ &&
+           resources->Type != ACPI_RESOURCE_TYPE_EXTENDED_IRQ) {
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                   "Resource is not an IRQ entry - %d\n", resources->Id));
+                   "Resource is not an IRQ entry - %d\n", resources->Type));
                return_ACPI_STATUS (AE_TYPE);
        }
 
-       switch (resources->Id) {
-       case ACPI_RSTYPE_IRQ:
-               NumberOfInterrupts = resources->Data.Irq.NumberOfInterrupts;
-               Interrupts = resources->Data.Irq.Interrupts;
+       switch (resources->Type) {
+       case ACPI_RESOURCE_TYPE_IRQ:
+               InterruptCount = resources->Data.Irq.InterruptCount;
+               Interrupts8 = resources->Data.Irq.Interrupts;
                break;
-       case ACPI_RSTYPE_EXT_IRQ:
-                NumberOfInterrupts =
-                   resources->Data.ExtendedIrq.NumberOfInterrupts;
-                Interrupts = resources->Data.ExtendedIrq.Interrupts;
+       case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
+                InterruptCount =
+                   resources->Data.ExtendedIrq.InterruptCount;
+                Interrupts32 = resources->Data.ExtendedIrq.Interrupts;
                break;
        }
        
-       if (NumberOfInterrupts == 0) {
+       if (InterruptCount == 0) {
                ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Blank IRQ resource\n"));
                return_ACPI_STATUS (AE_NULL_ENTRY);
        }
 
        count = 0;
-       for (i = 0; i < NumberOfInterrupts; i++) {
+       for (i = 0; i < InterruptCount; i++) {
+               UINT32 intr;
+
                if (i >= MAX_POSSIBLE_INTERRUPTS) {
                        ACPI_DEBUG_PRINT((ACPI_DB_WARN, "too many IRQs (%d)\n",
                            i));
                        break;
                }
-               if (Interrupts[i] == 0) {
+
+               KKASSERT(Interrupts8 != NULL || Interrupts32 != NULL);
+               if (Interrupts8 != NULL)
+                       intr = Interrupts8[i];
+               else
+                       intr = Interrupts32[i];
+
+               if (intr == 0) {
                        ACPI_DEBUG_PRINT((ACPI_DB_WARN, "invalid IRQ %d\n",
-                           Interrupts[i]));
+                           intr));
                        continue;
                }
-               interrupts[count] = Interrupts[i];
+               interrupts[count] = intr;
                count++;
        }
        *number_of_interrupts = count;
@@ -563,30 +574,30 @@ acpi_pci_link_set_irq(struct acpi_pci_link_entry *link, UINT8 irq)
        bzero(&resbuf, sizeof(resbuf));
        crsbuf.Pointer = NULL;
 
-       switch (link->possible_resources.Id) {
-       case ACPI_RSTYPE_IRQ:
-               resbuf.Id = ACPI_RSTYPE_IRQ;
-               resbuf.Length = ACPI_SIZEOF_RESOURCE(ACPI_RESOURCE_IRQ);
+       switch (link->possible_resources.Type) {
+       case ACPI_RESOURCE_TYPE_IRQ:
+               resbuf.Type = ACPI_RESOURCE_TYPE_IRQ;
+               resbuf.Length = sizeof(ACPI_RESOURCE_IRQ);
 
                /* structure copy other fields */
                resbuf.Data.Irq = link->possible_resources.Data.Irq;
-               resbuf.Data.Irq.NumberOfInterrupts = 1;
+               resbuf.Data.Irq.InterruptCount = 1;
                resbuf.Data.Irq.Interrupts[0] = irq;
                break;
-       case ACPI_RSTYPE_EXT_IRQ:
-               resbuf.Id = ACPI_RSTYPE_EXT_IRQ;
-               resbuf.Length = ACPI_SIZEOF_RESOURCE(ACPI_RESOURCE_EXT_IRQ);
+       case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
+               resbuf.Type = ACPI_RESOURCE_TYPE_EXTENDED_IRQ;
+               resbuf.Length = sizeof(ACPI_RESOURCE_EXTENDED_IRQ);
 
                /* structure copy other fields */
                resbuf.Data.ExtendedIrq =
                    link->possible_resources.Data.ExtendedIrq;
-               resbuf.Data.ExtendedIrq.NumberOfInterrupts = 1;
+               resbuf.Data.ExtendedIrq.InterruptCount = 1;
                resbuf.Data.ExtendedIrq.Interrupts[0] = irq;
                break;
        default:
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
                    "Resource is not an IRQ entry %s - %d\n",
-                   acpi_name(link->handle), link->possible_resources.Id));
+                   acpi_name(link->handle), link->possible_resources.Type));
                return_ACPI_STATUS (AE_TYPE);
        }
 
@@ -716,14 +727,14 @@ static int
 link_exclusive(ACPI_RESOURCE *res)
 {
        if (res == NULL ||
-           (res->Id != ACPI_RSTYPE_IRQ &&
-           res->Id != ACPI_RSTYPE_EXT_IRQ))
+           (res->Type != ACPI_RESOURCE_TYPE_IRQ &&
+           res->Type != ACPI_RESOURCE_TYPE_EXTENDED_IRQ))
                return (0);
 
-       if ((res->Id == ACPI_RSTYPE_IRQ &&
-           res->Data.Irq.SharedExclusive == ACPI_EXCLUSIVE) ||
-           (res->Id == ACPI_RSTYPE_EXT_IRQ &&
-           res->Data.ExtendedIrq.SharedExclusive == ACPI_EXCLUSIVE))
+       if ((res->Type == ACPI_RESOURCE_TYPE_IRQ &&
+           res->Data.Irq.Sharable == ACPI_EXCLUSIVE) ||
+           (res->Type == ACPI_RESOURCE_TYPE_EXTENDED_IRQ &&
+           res->Data.ExtendedIrq.Sharable == ACPI_EXCLUSIVE))
                return (1);
 
        return (0);
index 37c96a9..7e45602 100644 (file)
@@ -113,8 +113,7 @@ acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin,
     ACPI_RESOURCE              *crsres, *prsres, resbuf;
     ACPI_DEVICE_INFO           *devinfo;
     ACPI_STATUS                        status;
-    UINT32                     NumberOfInterrupts;
-    UINT32                     *Interrupts;
+    UINT32                     InterruptCount, intr;
     u_int8_t                   *prtp;
     int                                interrupt;
     int                                i;
@@ -125,6 +124,7 @@ acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin,
     crsbuf.Pointer = NULL;
     prsbuf.Pointer = NULL;
     interrupt = 255;
+    intr = 0;
 
     /* ACPI numbers pins 0-3, not 1-4 like the BIOS. */
     pin--;
@@ -242,25 +242,27 @@ acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin,
     }
 
     /* Type-check the resource we've found. */
-    if (crsres->Id != ACPI_RSTYPE_IRQ && crsres->Id != ACPI_RSTYPE_EXT_IRQ) {
+    if (crsres->Type != ACPI_RESOURCE_TYPE_IRQ && crsres->Type != ACPI_RESOURCE_TYPE_EXTENDED_IRQ) {
        device_printf(pcib, "_CRS resource entry has unsupported type %d\n",
-                     crsres->Id);
+                     crsres->Type);
        goto out;
     }
 
     /* Set variables based on resource type. */
-    if (crsres->Id == ACPI_RSTYPE_IRQ) {
-       NumberOfInterrupts = crsres->Data.Irq.NumberOfInterrupts;
-       Interrupts = crsres->Data.Irq.Interrupts;
+    if (crsres->Type == ACPI_RESOURCE_TYPE_IRQ) {
+       InterruptCount = crsres->Data.Irq.InterruptCount;
+       if (InterruptCount >= 1)
+           intr = crsres->Data.Irq.Interrupts[0];
     } else {
-       NumberOfInterrupts = crsres->Data.ExtendedIrq.NumberOfInterrupts;
-       Interrupts = crsres->Data.ExtendedIrq.Interrupts;
+       InterruptCount = crsres->Data.ExtendedIrq.InterruptCount;
+       if (InterruptCount >= 1)
+           intr = crsres->Data.ExtendedIrq.Interrupts[0];
     }
 
     /* If there's more than one interrupt, this is an error. */
-    if (NumberOfInterrupts > 1) {
+    if (InterruptCount > 1) {
        device_printf(pcib, "device has too many interrupts (%d)\n",
-                     NumberOfInterrupts);
+                     InterruptCount);
        goto out;
     }
 
@@ -273,10 +275,10 @@ acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin,
      *
      * XXX check ASL examples to see if this is an acceptable set of tests
      */
-    if (NumberOfInterrupts == 1 && Interrupts[0] != 0) {
+    if (InterruptCount == 1 && intr != 0) {
        device_printf(pcib, "slot %d INT%c is routed to irq %d\n",
-                     pci_get_slot(dev), 'A' + pin, Interrupts[0]);
-       interrupt = Interrupts[0];
+                     pci_get_slot(dev), 'A' + pin, intr);
+       interrupt = intr;
        goto out;
     }
     
@@ -302,26 +304,34 @@ acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin,
            device_printf(pcib, "_PRS lacks IRQ resource, routing failed\n");
            goto out;
        }
-       switch (prsres->Id) {
-       case ACPI_RSTYPE_IRQ:
-           NumberOfInterrupts = prsres->Data.Irq.NumberOfInterrupts;
-           Interrupts = prsres->Data.Irq.Interrupts;
+       switch (prsres->Type) {
+       case ACPI_RESOURCE_TYPE_IRQ:
+           InterruptCount = prsres->Data.Irq.InterruptCount;
+           device_printf(pcib, "possible interrupts:");
+           for (i = 0; i < InterruptCount; i++)
+               kprintf("  %d", prsres->Data.Irq.Interrupts[i]);
+           kprintf("\n");
+           intr = prsres->Data.Irq.Interrupts[0];
            break;
-       case ACPI_RSTYPE_EXT_IRQ:
-           NumberOfInterrupts = prsres->Data.ExtendedIrq.NumberOfInterrupts;
-           Interrupts = prsres->Data.ExtendedIrq.Interrupts;
+       case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
+           InterruptCount = prsres->Data.ExtendedIrq.InterruptCount;
+           device_printf(pcib, "possible interrupts:");
+           for (i = 0; i < InterruptCount; i++)
+               kprintf("  %d", prsres->Data.ExtendedIrq.Interrupts[i]);
+           kprintf("\n");
+           intr = prsres->Data.ExtendedIrq.Interrupts[0];
            break;
-       case ACPI_RSTYPE_START_DPF:
+       case ACPI_RESOURCE_TYPE_START_DEPENDENT:
            prsres = NULL;
            continue;
        default:
-           device_printf(pcib, "_PRS has invalid type %d\n", prsres->Id);
+           device_printf(pcib, "_PRS has invalid type %d\n", prsres->Type);
            goto out;
        }
     }
 
     /* There has to be at least one interrupt available. */
-    if (NumberOfInterrupts < 1) {
+    if (InterruptCount < 1) {
        device_printf(pcib, "device has no interrupts\n");
        goto out;
     }
@@ -337,10 +347,6 @@ acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin,
      * Build a resource buffer and pass it to AcpiSetCurrentResources to
      * route the new interrupt.
      */
-    device_printf(pcib, "possible interrupts:");
-    for (i = 0; i < NumberOfInterrupts; i++)
-       kprintf("  %d", Interrupts[i]);
-    kprintf("\n");
 
     /* This should never happen. */
     if (crsbuf.Pointer != NULL)
@@ -348,23 +354,22 @@ acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin,
 
     /* XXX Data.Irq and Data.ExtendedIrq are implicitly structure-copied. */
     crsbuf.Pointer = NULL;
-    if (prsres->Id == ACPI_RSTYPE_IRQ) {
-       resbuf.Id = ACPI_RSTYPE_IRQ;
-       resbuf.Length = ACPI_SIZEOF_RESOURCE(ACPI_RESOURCE_IRQ);
+    if (prsres->Type == ACPI_RESOURCE_TYPE_IRQ) {
+       resbuf.Type = ACPI_RESOURCE_TYPE_IRQ;
+       resbuf.Length = sizeof(ACPI_RESOURCE_IRQ);
        resbuf.Data.Irq = prsres->Data.Irq;
-       resbuf.Data.Irq.NumberOfInterrupts = 1;
-       resbuf.Data.Irq.Interrupts[0] = Interrupts[0];
+       resbuf.Data.Irq.InterruptCount = 1;
+       resbuf.Data.Irq.Interrupts[0] = intr;
     } else {
-       resbuf.Id = ACPI_RSTYPE_EXT_IRQ;
-       resbuf.Length = ACPI_SIZEOF_RESOURCE(ACPI_RESOURCE_EXT_IRQ);
+       resbuf.Type = ACPI_RESOURCE_TYPE_EXTENDED_IRQ;
+       resbuf.Length = sizeof(ACPI_RESOURCE_EXTENDED_IRQ);
        resbuf.Data.ExtendedIrq = prsres->Data.ExtendedIrq;
-       resbuf.Data.ExtendedIrq.NumberOfInterrupts = 1;
-       resbuf.Data.ExtendedIrq.Interrupts[0] = Interrupts[0];
+       resbuf.Data.ExtendedIrq.InterruptCount = 1;
+       resbuf.Data.ExtendedIrq.Interrupts[0] = intr;
     }
     if (ACPI_FAILURE(status = acpi_AppendBufferResource(&crsbuf, &resbuf))) {
        device_printf(pcib, "buf append failed for interrupt %d via %s - %s\n",
-                     Interrupts[0], acpi_name(lnkdev),
-                     AcpiFormatException(status));
+                     intr, acpi_name(lnkdev), AcpiFormatException(status));
        goto out;
     }
     /* XXX Figure out how this is happening when the append succeeds. */
@@ -374,16 +379,14 @@ acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin,
     }
     if (ACPI_FAILURE(status = AcpiSetCurrentResources(lnkdev, &crsbuf))) {
        device_printf(pcib, "_SRS failed for interrupt %d via %s - %s\n",
-                     Interrupts[0], acpi_name(lnkdev),
-                     AcpiFormatException(status));
+                     intr, acpi_name(lnkdev), AcpiFormatException(status));
        goto out;
     }
     
     /* Return the interrupt we just routed. */
     device_printf(pcib, "slot %d INT%c routed to irq %d via %s\n", 
-                 pci_get_slot(dev), 'A' + pin, Interrupts[0],
-                 acpi_name(lnkdev));
-    interrupt = Interrupts[0];
+                 pci_get_slot(dev), 'A' + pin, intr, acpi_name(lnkdev));
+    interrupt = intr;
 
 out:
     if (crsbuf.Pointer != NULL)
index 870c971..026faa4 100644 (file)
@@ -111,6 +111,8 @@ static driver_t acpi_pcib_acpi_driver = {
     sizeof(struct acpi_hpcib_softc),
 };
 
+static devclass_t pcib_devclass;
+
 DRIVER_MODULE(acpi_pcib, acpi, acpi_pcib_acpi_driver, pcib_devclass, 0, 0);
 MODULE_DEPEND(acpi_pcib, acpi, 1, 1, 1);
 
@@ -118,13 +120,12 @@ static int
 acpi_pcib_acpi_probe(device_t dev)
 {
 
-    if (acpi_get_type(dev) == ACPI_TYPE_DEVICE && acpi_enabled("pci") &&
-       acpi_MatchHid(dev, "PNP0A03")) {
-
+    if (acpi_get_type(dev) == ACPI_TYPE_DEVICE &&
+       acpi_enabled("pci") &&
+       acpi_MatchHid(acpi_get_handle(dev), "PNP0A03")) {
        if (pci_cfgregopen() == 0)
                return (ENXIO);
        device_set_desc(dev, "ACPI Host-PCI bridge");
-       pcib_owner = "acpi";
        return (0);
     }
     return (ENXIO);
index dacecbb..837fbe7 100644 (file)
@@ -62,6 +62,8 @@ struct acpi_pcib_lookup_info {
     ACPI_HANDLE                handle;
 };
 
+static devclass_t pcib_devclass;
+
 static int             acpi_pcib_pci_probe(device_t bus);
 static int             acpi_pcib_pci_attach(device_t bus);
 static int             acpi_pcib_pci_resume(device_t bus);
@@ -110,7 +112,6 @@ MODULE_DEPEND(acpi_pcib, acpi, 1, 1, 1);
 static int
 acpi_pcib_pci_probe(device_t dev)
 {
-
     if (pci_get_class(dev) != PCIC_BRIDGE ||
        pci_get_subclass(dev) != PCIS_BRIDGE_PCI ||
        !acpi_enabled("pci"))