Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/iir/iir_pci.c
Show First 20 Lines • Show All 135 Lines • ▼ Show 20 Lines | |||||
void gdt_mpr_copy_cmd(struct gdt_softc *, struct gdt_ccb *); | void gdt_mpr_copy_cmd(struct gdt_softc *, struct gdt_ccb *); | ||||
u_int8_t gdt_mpr_get_status(struct gdt_softc *); | u_int8_t gdt_mpr_get_status(struct gdt_softc *); | ||||
void gdt_mpr_intr(struct gdt_softc *, struct gdt_intr_ctx *); | void gdt_mpr_intr(struct gdt_softc *, struct gdt_intr_ctx *); | ||||
void gdt_mpr_release_event(struct gdt_softc *); | void gdt_mpr_release_event(struct gdt_softc *); | ||||
void gdt_mpr_set_sema0(struct gdt_softc *); | void gdt_mpr_set_sema0(struct gdt_softc *); | ||||
int gdt_mpr_test_busy(struct gdt_softc *); | int gdt_mpr_test_busy(struct gdt_softc *); | ||||
static struct iir_pci_dev { | |||||
uint16_t vendorid; | |||||
uint16_t deviceid; | |||||
const char *description; | |||||
} iir_pci_devs[] = { | |||||
{INTEL_VENDOR_ID_IIR, INTEL_DEVICE_ID_IIR, "Intel Integrated RAID Controller"}, | |||||
{GDT_VENDOR_ID, GDT_DEVICE_ID_NEWRX, "ICP Disk Array Controller"}, | |||||
{0, 0, NULL}, | |||||
}; | |||||
static device_method_t iir_pci_methods[] = { | static device_method_t iir_pci_methods[] = { | ||||
/* Device interface */ | /* Device interface */ | ||||
DEVMETHOD(device_probe, iir_pci_probe), | DEVMETHOD(device_probe, iir_pci_probe), | ||||
DEVMETHOD(device_attach, iir_pci_attach), | DEVMETHOD(device_attach, iir_pci_attach), | ||||
{ 0, 0} | { 0, 0} | ||||
}; | }; | ||||
static driver_t iir_pci_driver = | static driver_t iir_pci_driver = | ||||
{ | { | ||||
"iir", | "iir", | ||||
iir_pci_methods, | iir_pci_methods, | ||||
sizeof(struct gdt_softc) | sizeof(struct gdt_softc) | ||||
}; | }; | ||||
static devclass_t iir_devclass; | static devclass_t iir_devclass; | ||||
DRIVER_MODULE(iir, pci, iir_pci_driver, iir_devclass, 0, 0); | DRIVER_MODULE(iir, pci, iir_pci_driver, iir_devclass, 0, 0); | ||||
MODULE_PNP_INFO("U16:vendor;U16:device", pci, iir, iir_pci_devs, | |||||
imp: Same here. | |||||
sizeof(iir_pci_devs[0]), nitems(iir_pci_devs) - 1); | |||||
MODULE_DEPEND(iir, pci, 1, 1, 1); | MODULE_DEPEND(iir, pci, 1, 1, 1); | ||||
MODULE_DEPEND(iir, cam, 1, 1, 1); | MODULE_DEPEND(iir, cam, 1, 1, 1); | ||||
static int | static int | ||||
iir_pci_probe(device_t dev) | iir_pci_probe(device_t dev) | ||||
{ | { | ||||
if (pci_get_vendor(dev) == INTEL_VENDOR_ID_IIR && | if (pci_get_vendor(dev) == INTEL_VENDOR_ID_IIR && | ||||
chuckUnsubmitted Done Inline ActionsNow that the driver has a device table, should probe be modified to use it? chuck: Now that the driver has a device table, should probe be modified to use it? | |||||
pci_get_device(dev) == INTEL_DEVICE_ID_IIR) { | pci_get_device(dev) == INTEL_DEVICE_ID_IIR) { | ||||
device_set_desc(dev, "Intel Integrated RAID Controller"); | device_set_desc(dev, "Intel Integrated RAID Controller"); | ||||
return (BUS_PROBE_DEFAULT); | return (BUS_PROBE_DEFAULT); | ||||
} | } | ||||
if (pci_get_vendor(dev) == GDT_VENDOR_ID && | if (pci_get_vendor(dev) == GDT_VENDOR_ID && | ||||
((pci_get_device(dev) >= GDT_DEVICE_ID_MIN && | ((pci_get_device(dev) >= GDT_DEVICE_ID_MIN && | ||||
pci_get_device(dev) <= GDT_DEVICE_ID_MAX) || | pci_get_device(dev) <= GDT_DEVICE_ID_MAX) || | ||||
Not Done Inline ActionsI understand why this if-else is necessary, but that same necessity makes me wonder if a table lookup for this device class is "wrong". If it was possible to encode this as a part of PNP (can you combine L16 and G16?) maybe this would make more sense. chuck: I understand why this if-else is necessary, but that same necessity makes me wonder if a table… | |||||
Not Done Inline ActionsI need some help from @imp to use L16 and G16 correctly. lakhanshiva_gmail.com: I need some help from @imp to use L16 and G16 correctly. | |||||
pci_get_device(dev) == GDT_DEVICE_ID_NEWRX)) { | pci_get_device(dev) == GDT_DEVICE_ID_NEWRX)) { | ||||
device_set_desc(dev, "ICP Disk Array Controller"); | device_set_desc(dev, "ICP Disk Array Controller"); | ||||
return (BUS_PROBE_DEFAULT); | return (BUS_PROBE_DEFAULT); | ||||
} | } | ||||
return (ENXIO); | return (ENXIO); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 276 Lines • Show Last 20 Lines |
Same here.