summaryrefslogtreecommitdiffstats
path: root/sys/dev/mfi/mfi_pci.c
diff options
context:
space:
mode:
authorambrisko <ambrisko@FreeBSD.org>2008-11-12 22:44:50 +0000
committerambrisko <ambrisko@FreeBSD.org>2008-11-12 22:44:50 +0000
commit13c44404b238af1070b494b7d268a4aa4a5a0ee0 (patch)
tree756bc15fb68d3f863768b7bbe9a5a9aabe238f27 /sys/dev/mfi/mfi_pci.c
parent8a2e5505edb61903e9ed697c4bc6e3479b9b0147 (diff)
downloadFreeBSD-src-13c44404b238af1070b494b7d268a4aa4a5a0ee0.zip
FreeBSD-src-13c44404b238af1070b494b7d268a4aa4a5a0ee0.tar.gz
- Fix from jhb for failing I/O request when bus_dmamap_load fails.
- Fix to ioctl path in which the length could be 0 which means no data in/out from LSI. - Fix to ioctl path in which the data in the sense data space of the ioctl packet is a really a pointer to some location in user-space. From LSI re-worked a bit by me. - Add HW support for next gen cards from LSI. Thanks to LSI for their support! Submitted by: jhb, LSI MFC after: 3 days
Diffstat (limited to 'sys/dev/mfi/mfi_pci.c')
-rw-r--r--sys/dev/mfi/mfi_pci.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/sys/dev/mfi/mfi_pci.c b/sys/dev/mfi/mfi_pci.c
index 3becba0..deef9ba 100644
--- a/sys/dev/mfi/mfi_pci.c
+++ b/sys/dev/mfi/mfi_pci.c
@@ -118,7 +118,14 @@ struct mfi_ident {
{0x1000, 0x0413, 0xffff, 0xffff, MFI_FLAGS_1064R, "LSI MegaSAS 1064R"}, /* Verde ZCR */
{0x1028, 0x0015, 0xffff, 0xffff, MFI_FLAGS_1064R, "Dell PERC 5/i"},
{0x1000, 0x0060, 0x1028, 0xffff, MFI_FLAGS_1078, "Dell PERC 6"},
- {0x1000, 0x0060, 0xffff, 0xffff, MFI_FLAGS_1078, "LSI MegaSAS 1078"},
+ {0x1000, 0x0060, 0xffff, 0xffff, MFI_FLAGS_1078, "LSI MegaSAS 1078"},
+ {0x1000, 0x0079, 0x1028, 0x1f15, MFI_FLAGS_GEN2, "Dell PERC 607E Adapter"},
+ {0x1000, 0x0079, 0x1028, 0x1f16, MFI_FLAGS_GEN2, "Dell PERC 607I Adapter"},
+ {0x1000, 0x0079, 0x1028, 0x1f17, MFI_FLAGS_GEN2, "Dell PERC 607I Integrated"},
+ {0x1000, 0x0079, 0x1028, 0x1f18, MFI_FLAGS_GEN2, "Dell PERC 607I Modular"},
+ {0x1000, 0x0078, 0xffff, 0xffff, MFI_FLAGS_GEN2, "LSI MegaSAS Gen2"},
+ {0x1000, 0x0079, 0xffff, 0xffff, MFI_FLAGS_GEN2, "LSI MegaSAS Gen2"},
+ {0x1000, 0x007c, 0xffff, 0xffff, MFI_FLAGS_1078, "LSI MegaSAS 1078"},
{0, 0, 0, 0, 0, NULL}
};
@@ -163,6 +170,8 @@ mfi_pci_attach(device_t dev)
sc = device_get_softc(dev);
bzero(sc, sizeof(*sc));
sc->mfi_dev = dev;
+ m = mfi_find_ident(dev);
+ sc->mfi_flags = m->flags;
/* Verify that the adapter can be set up in PCI space */
command = pci_read_config(dev, PCIR_COMMAND, 2);
@@ -179,7 +188,14 @@ mfi_pci_attach(device_t dev)
}
/* Allocate PCI registers */
- sc->mfi_regs_rid = PCIR_BAR(0);
+ if ((sc->mfi_flags & MFI_FLAGS_1064R) ||
+ (sc->mfi_flags & MFI_FLAGS_1078)) {
+ /* 1068/1078: Memory mapped BAR is at offset 0x10 */
+ sc->mfi_regs_rid = PCIR_BAR(0);
+ } else if (sc->mfi_flags & MFI_FLAGS_GEN2) {
+ /* GEN2: Memory mapped BAR is at offset 0x14 */
+ sc->mfi_regs_rid = PCIR_BAR(1);
+ }
if ((sc->mfi_regs_resource = bus_alloc_resource_any(sc->mfi_dev,
SYS_RES_MEMORY, &sc->mfi_regs_rid, RF_ACTIVE)) == NULL) {
device_printf(dev, "Cannot allocate PCI registers\n");
@@ -206,9 +222,6 @@ mfi_pci_attach(device_t dev)
goto out;
}
- m = mfi_find_ident(dev);
- sc->mfi_flags = m->flags;
-
error = mfi_attach(sc);
out:
if (error) {
OpenPOWER on IntegriCloud