diff options
author | scottl <scottl@FreeBSD.org> | 2005-01-23 23:25:41 +0000 |
---|---|---|
committer | scottl <scottl@FreeBSD.org> | 2005-01-23 23:25:41 +0000 |
commit | 0098f30d189c86b04152009ffae05923045fb70d (patch) | |
tree | e248aac00cf66cce7f47f7da92d7af76b3f8fb2d | |
parent | 85c8899f0085779ca955feab1f5bd19cda108487 (diff) | |
download | FreeBSD-src-0098f30d189c86b04152009ffae05923045fb70d.zip FreeBSD-src-0098f30d189c86b04152009ffae05923045fb70d.tar.gz |
Add support for the LSI 320-2E PCI-Express controller. Fix a couple of bugs
in the ioctl handler. Update the LSI copyrights for these.
Obtained from: LSI, Corp
-rw-r--r-- | sys/dev/amr/amr.c | 14 | ||||
-rw-r--r-- | sys/dev/amr/amr_pci.c | 7 | ||||
-rw-r--r-- | sys/dev/amr/amrreg.h | 2 | ||||
-rw-r--r-- | sys/dev/amr/amrvar.h | 2 |
4 files changed, 17 insertions, 8 deletions
diff --git a/sys/dev/amr/amr.c b/sys/dev/amr/amr.c index 3b9d317..72dd89f 100644 --- a/sys/dev/amr/amr.c +++ b/sys/dev/amr/amr.c @@ -27,7 +27,7 @@ */ /*- * Copyright (c) 2002 Eric Moore - * Copyright (c) 2002 LSI Logic Corporation + * Copyright (c) 2002, 2004 LSI Logic Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -463,8 +463,12 @@ amr_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int32_t flag, d_thread_t * dp = NULL; ac = NULL; + /* Logical Drive not supported by the driver */ + if (au_cmd[0] == 0xa4 && au_cmd[1] == 0x1c) + return (ENOIOCTL); + /* handle inbound data buffer */ - if (au_length != 0) { + if (au_length != 0 && au_cmd[0] != 0x06) { if ((dp = malloc(au_length, M_DEVBUF, M_WAITOK)) == NULL) return(ENOMEM); @@ -1049,7 +1053,7 @@ amr_quartz_poll_command1(struct amr_softc *sc, struct amr_command *ac) { int count, error; - if ((sc->amr_state & AMR_STATE_CRASHDUMP) == 0) { + if ((sc->amr_state & AMR_STATE_INTEN) == 0) { count=0; while (sc->amr_busyslots) { msleep(sc, &sc->amr_io_lock, PRIBIO | PCATCH, "amrpoll", hz); @@ -1924,7 +1928,7 @@ amr_dump_blocks(struct amr_softc *sc, int unit, u_int32_t lba, void *data, int b debug_called(1); - sc->amr_state |= AMR_STATE_CRASHDUMP; + sc->amr_state |= AMR_STATE_INTEN; /* get ourselves a command buffer */ if ((ac = amr_alloccmd(sc)) == NULL) @@ -1951,7 +1955,7 @@ amr_dump_blocks(struct amr_softc *sc, int unit, u_int32_t lba, void *data, int b if (ac != NULL) amr_releasecmd(ac); - sc->amr_state &= ~AMR_STATE_CRASHDUMP; + sc->amr_state &= ~AMR_STATE_INTEN; return (error); } diff --git a/sys/dev/amr/amr_pci.c b/sys/dev/amr/amr_pci.c index d408eef..c70159b 100644 --- a/sys/dev/amr/amr_pci.c +++ b/sys/dev/amr/amr_pci.c @@ -26,7 +26,7 @@ */ /*- * Copyright (c) 2002 Eric Moore - * Copyright (c) 2002 LSI Logic Corporation + * Copyright (c) 2002, 2004 LSI Logic Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -128,6 +128,8 @@ static struct {0x101e, 0x1960, 0}, {0x1000, 0x1960, PROBE_SIGNATURE}, {0x1000, 0x0407, 0}, + {0x1000, 0x0408, 0}, + {0x1000, 0x0409, 0}, {0x1028, 0x000e, PROBE_SIGNATURE}, /* perc4/di i960 */ {0x1028, 0x000f, 0}, /* perc4/di Verde*/ {0x1028, 0x0013, 0}, /* perc4/di */ @@ -151,7 +153,7 @@ amr_pci_probe(device_t dev) if ((sig != AMR_SIGNATURE_1) && (sig != AMR_SIGNATURE_2)) continue; } - device_set_desc(dev, "LSILogic MegaRAID"); + device_set_desc(dev, LSI_DESC_PCI); return(-10); /* allow room to be overridden */ } } @@ -183,6 +185,7 @@ amr_pci_attach(device_t dev) */ command = pci_read_config(dev, PCIR_COMMAND, 1); if ((pci_get_device(dev) == 0x1960) || (pci_get_device(dev) == 0x0407) || + (pci_get_device(dev) == 0x0408) || (pci_get_device(dev) == 0x0409) || (pci_get_device(dev) == 0x000e) || (pci_get_device(dev) == 0x000f) || (pci_get_device(dev) == 0x0013)) { /* diff --git a/sys/dev/amr/amrreg.h b/sys/dev/amr/amrreg.h index 0785038..f08b113 100644 --- a/sys/dev/amr/amrreg.h +++ b/sys/dev/amr/amrreg.h @@ -82,7 +82,7 @@ #define AMR_LIMITCMD 120 /* maximum count of outstanding commands */ #define AMR_MAXLD 40 -#define AMR_MAX_CHANNELS 4 +#define AMR_MAX_CHANNELS 8 #define AMR_MAX_TARGETS 15 #define AMR_MAX_LUNS 7 #define AMR_MAX_SCSI_CMDS (15 * AMR_MAX_CHANNELS) /* one for every target? */ diff --git a/sys/dev/amr/amrvar.h b/sys/dev/amr/amrvar.h index a36b684..3af12a3 100644 --- a/sys/dev/amr/amrvar.h +++ b/sys/dev/amr/amrvar.h @@ -62,6 +62,8 @@ # include <sys/mutex.h> #endif +#define LSI_DESC_PCI "LSILogic MegaRAID 1.51" + #ifdef AMR_DEBUG # define debug(level, fmt, args...) do {if (level <= AMR_DEBUG) printf("%s: " fmt "\n", __func__ , ##args);} while(0) # define debug_called(level) do {if (level <= AMR_DEBUG) printf("%s: called\n", __func__);} while(0) |