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
This commit is contained in:
Scott Long 2005-01-23 23:25:41 +00:00
parent a56d2b5a51
commit 35e050281e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=140688
4 changed files with 17 additions and 8 deletions

View file

@ -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);
}

View file

@ -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)) {
/*

View file

@ -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? */

View file

@ -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)