Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/pci/isa_pci.c
Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | |||||
static int isab_pci_probe(device_t dev); | static int isab_pci_probe(device_t dev); | ||||
static int isab_pci_attach(device_t dev); | static int isab_pci_attach(device_t dev); | ||||
static struct resource * isab_pci_alloc_resource(device_t dev, | static struct resource * isab_pci_alloc_resource(device_t dev, | ||||
device_t child, int type, int *rid, rman_res_t start, rman_res_t end, | device_t child, int type, int *rid, rman_res_t start, rman_res_t end, | ||||
rman_res_t count, u_int flags); | rman_res_t count, u_int flags); | ||||
static int isab_pci_release_resource(device_t dev, device_t child, | static int isab_pci_release_resource(device_t dev, device_t child, | ||||
int type, int rid, struct resource *r); | int type, int rid, struct resource *r); | ||||
static struct isab_pci_dev { | |||||
uint32_t devid; | |||||
const char *description; | |||||
} isab_pci_devs[] = { | |||||
{0x04848086, "PCI-ISA bridge"}, /* Intel 82378ZB/82378IB */ | |||||
{0x122e8086, "PCI-ISA bridge"}, /* Intel 82371FB */ | |||||
{0x70008086, "PCI-ISA bridge"}, /* Intel 82371SB */ | |||||
{0x71108086, "PCI-ISA bridge"}, /* Intel 82371AB */ | |||||
{0x71988086, "PCI-ISA bridge"}, /* Intel 82443MX */ | |||||
{0x24108086, "PCI-ISA bridge"}, /* Intel 82801AA (ICH) */ | |||||
{0x24208086, "PCI-ISA bridge"}, /* Intel 82801AB (ICH0) */ | |||||
{0x24408086, "PCI-ISA bridge"}, /* Intel 82801AB (ICH2) */ | |||||
{0x00061004, "PCI-ISA bridge"}, /* VLSI 82C593 */ | |||||
{0x05861106, "PCI-ISA bridge"}, /* VIA 82C586 */ | |||||
{0x05961106, "PCI-ISA bridge"}, /* VIA 82C596 */ | |||||
{0x06861106, "PCI-ISA bridge"}, /* VIA 82C686 */ | |||||
{0x153310b9, "PCI-ISA bridge"}, /* AcerLabs M1533 */ | |||||
{0x154310b9, "PCI-ISA bridge"}, /* AcerLabs M1543 */ | |||||
{0x00081039, "PCI-ISA bridge"}, /* SiS 85c503 */ | |||||
{0x00001078, "PCI-ISA bridge"}, /* Cyrix Cx5510 */ | |||||
{0x01001078, "PCI-ISA bridge"}, /* Cyrix Cx5530 */ | |||||
{0xc7001045, "PCI-ISA bridge"}, /* OPTi 82C700 (FireStar) */ | |||||
{0x886a1060, "PCI-ISA bridge"}, /* UMC UM8886 ISA */ | |||||
{0x02001166, "PCI-ISA bridge"}, /* ServerWorks IB6566 PCI */ | |||||
{0, 0}, /* sentinel */ | |||||
} | |||||
static device_method_t isab_methods[] = { | static device_method_t isab_methods[] = { | ||||
/* Device interface */ | /* Device interface */ | ||||
DEVMETHOD(device_probe, isab_pci_probe), | DEVMETHOD(device_probe, isab_pci_probe), | ||||
DEVMETHOD(device_attach, isab_pci_attach), | DEVMETHOD(device_attach, isab_pci_attach), | ||||
DEVMETHOD(device_detach, bus_generic_detach), | DEVMETHOD(device_detach, bus_generic_detach), | ||||
DEVMETHOD(device_shutdown, bus_generic_shutdown), | DEVMETHOD(device_shutdown, bus_generic_shutdown), | ||||
DEVMETHOD(device_suspend, bus_generic_suspend), | DEVMETHOD(device_suspend, bus_generic_suspend), | ||||
DEVMETHOD(device_resume, bus_generic_resume), | DEVMETHOD(device_resume, bus_generic_resume), | ||||
Show All 21 Lines | |||||
static driver_t isab_driver = { | static driver_t isab_driver = { | ||||
"isab", | "isab", | ||||
isab_methods, | isab_methods, | ||||
sizeof(struct isab_pci_softc), | sizeof(struct isab_pci_softc), | ||||
}; | }; | ||||
DRIVER_MODULE(isab, pci, isab_driver, isab_devclass, 0, 0); | DRIVER_MODULE(isab, pci, isab_driver, isab_devclass, 0, 0); | ||||
MODULE_PNP_INFO("U32:vendor/device", pci, isab, isab_pci_devs, | |||||
sizeof(isab_pci_devs[0]), nitems(isab_pci_devs) - 1); | |||||
/* | /* | ||||
* XXX we need to add a quirk list here for bridges that don't correctly | * XXX we need to add a quirk list here for bridges that don't correctly | ||||
* report themselves. | * report themselves. | ||||
*/ | */ | ||||
static int | static int | ||||
isab_pci_probe(device_t dev) | isab_pci_probe(device_t dev) | ||||
{ | { | ||||
int matched = 0; | int matched = 0; | ||||
const struct isab_pci_dev *isad; | |||||
uint32_t did; | |||||
size_t i; | |||||
did = pci_get_devid(dev); | |||||
/* | /* | ||||
* Try for a generic match based on class/subclass. | * Try for a generic match based on class/subclass. | ||||
*/ | */ | ||||
if ((pci_get_class(dev) == PCIC_BRIDGE) && | if ((pci_get_class(dev) == PCIC_BRIDGE) && | ||||
(pci_get_subclass(dev) == PCIS_BRIDGE_ISA)) { | (pci_get_subclass(dev) == PCIS_BRIDGE_ISA)) { | ||||
matched = 1; | matched = 1; | ||||
} else { | } else { | ||||
/* | /* | ||||
* These are devices that we *know* are PCI:ISA bridges. | * These are devices that we *know* are PCI:ISA bridges. | ||||
* Sometimes, however, they don't report themselves as | * Sometimes, however, they don't report themselves as | ||||
* such. Check in case one of them is pretending to be | * such. Check in case one of them is pretending to be | ||||
* something else. | * something else. | ||||
*/ | */ | ||||
switch (pci_get_devid(dev)) { | for(i=0; i<nitems(isab_pci_devs) - 1; i++) { | ||||
case 0x04848086: /* Intel 82378ZB/82378IB */ | isad = &isab_pci_devs[i]; | ||||
chuck: `style(9)` | |||||
Done Inline Actionsfor looks fine to me. lakhanshiva_gmail.com: for looks fine to me.
Between if and left parenthseses there was no space, which i fixed now. | |||||
Done Inline ActionsUnderstood, fixed it now! lakhanshiva_gmail.com: Understood, fixed it now! | |||||
case 0x122e8086: /* Intel 82371FB */ | if(isad->devid == did){ | ||||
case 0x70008086: /* Intel 82371SB */ | matched = 1; | ||||
case 0x71108086: /* Intel 82371AB */ | |||||
case 0x71988086: /* Intel 82443MX */ | |||||
case 0x24108086: /* Intel 82801AA (ICH) */ | |||||
case 0x24208086: /* Intel 82801AB (ICH0) */ | |||||
case 0x24408086: /* Intel 82801AB (ICH2) */ | |||||
case 0x00061004: /* VLSI 82C593 */ | |||||
case 0x05861106: /* VIA 82C586 */ | |||||
case 0x05961106: /* VIA 82C596 */ | |||||
case 0x06861106: /* VIA 82C686 */ | |||||
case 0x153310b9: /* AcerLabs M1533 */ | |||||
case 0x154310b9: /* AcerLabs M1543 */ | |||||
case 0x00081039: /* SiS 85c503 */ | |||||
case 0x00001078: /* Cyrix Cx5510 */ | |||||
case 0x01001078: /* Cyrix Cx5530 */ | |||||
case 0xc7001045: /* OPTi 82C700 (FireStar) */ | |||||
case 0x886a1060: /* UMC UM8886 ISA */ | |||||
case 0x02001166: /* ServerWorks IB6566 PCI */ | |||||
if (bootverbose) | if (bootverbose) | ||||
printf("PCI-ISA bridge with incorrect subclass 0x%x\n", | printf("PCI-ISA bridge with incorrect subclass 0x%x\n", | ||||
pci_get_subclass(dev)); | pci_get_subclass(dev)); | ||||
matched = 1; | } | ||||
break; | |||||
default: | |||||
break; | |||||
} | } | ||||
} | } | ||||
if (matched) { | if (matched) { | ||||
device_set_desc(dev, "PCI-ISA bridge"); | device_set_desc(dev, "PCI-ISA bridge"); | ||||
return(-10000); | return(-10000); | ||||
} | } | ||||
return(ENXIO); | return(ENXIO); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 85 Lines • Show Last 20 Lines |
style(9)