Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/pst/pst-pci.c
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | |||||
#include <machine/resource.h> | #include <machine/resource.h> | ||||
#include <machine/bus.h> | #include <machine/bus.h> | ||||
#include <sys/rman.h> | #include <sys/rman.h> | ||||
#include <dev/pci/pcivar.h> | #include <dev/pci/pcivar.h> | ||||
#include <dev/pci/pcireg.h> | #include <dev/pci/pcireg.h> | ||||
#include "dev/pst/pst-iop.h" | #include "dev/pst/pst-iop.h" | ||||
struct pci_device_table iop_devs[] = { | |||||
/* tested with actual hardware kindly donated by Promise */ | |||||
{PCI_DEVID(0x19628086), PCI_SUBVID(0x105a), | |||||
PCI_DESCR("Promise SuperTrak SX6000 ATA RAID controller")}, | |||||
/* support the older SuperTrak 100 as well */ | |||||
{PCI_DEVID(0x19608086), PCI_SUBVID(0x105a), | |||||
PCI_DESCR("Promise SuperTrak 100 ATA RAID controller")} | |||||
}; | |||||
static int | static int | ||||
iop_pci_probe(device_t dev) | iop_pci_probe(device_t dev) | ||||
{ | { | ||||
/* tested with actual hardware kindly donated by Promise */ | const struct pci_device_table *iopd; | ||||
if (pci_get_devid(dev) == 0x19628086 && pci_get_subvendor(dev) == 0x105a) { | |||||
device_set_desc(dev, "Promise SuperTrak SX6000 ATA RAID controller"); | |||||
return BUS_PROBE_DEFAULT; | |||||
} | |||||
/* support the older SuperTrak 100 as well */ | iopd = PCI_MATCH(dev, iop_devs); | ||||
if (pci_get_devid(dev) == 0x19608086 && pci_get_subvendor(dev) == 0x105a) { | if (iopd == NULL) | ||||
device_set_desc(dev, "Promise SuperTrak 100 ATA RAID controller"); | return (ENXIO); | ||||
return BUS_PROBE_DEFAULT; | device_set_desc(dev, iopd->descr); | ||||
return (BUS_PROBE_DEFAULT); | |||||
} | } | ||||
return ENXIO; | |||||
} | |||||
static int | static int | ||||
iop_pci_attach(device_t dev) | iop_pci_attach(device_t dev) | ||||
{ | { | ||||
struct iop_softc *sc = device_get_softc(dev); | struct iop_softc *sc = device_get_softc(dev); | ||||
int rid; | int rid; | ||||
/* get resources */ | /* get resources */ | ||||
rid = PCIR_BAR(0); | rid = PCIR_BAR(0); | ||||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | static driver_t pst_pci_driver = { | ||||
"pstpci", | "pstpci", | ||||
pst_pci_methods, | pst_pci_methods, | ||||
sizeof(struct iop_softc), | sizeof(struct iop_softc), | ||||
}; | }; | ||||
static devclass_t pst_pci_devclass; | static devclass_t pst_pci_devclass; | ||||
DRIVER_MODULE(pstpci, pci, pst_pci_driver, pst_pci_devclass, 0, 0); | DRIVER_MODULE(pstpci, pci, pst_pci_driver, pst_pci_devclass, 0, 0); | ||||
PCI_PNP_INFO(iop_devs); |