summaryrefslogtreecommitdiffstats
path: root/sys/dev/amr
diff options
context:
space:
mode:
authoremoore <emoore@FreeBSD.org>2002-10-18 21:29:14 +0000
committeremoore <emoore@FreeBSD.org>2002-10-18 21:29:14 +0000
commitb9279f6877f2b6973359a4c2620abacf9fe78d21 (patch)
tree543c9d9de1e427dae274d7e5fe5e9624906f7c6f /sys/dev/amr
parentab9568ccbf846a052b4e3a0e94b346bfccd80d71 (diff)
downloadFreeBSD-src-b9279f6877f2b6973359a4c2620abacf9fe78d21.zip
FreeBSD-src-b9279f6877f2b6973359a4c2620abacf9fe78d21.tar.gz
(1) added LSI Logic copyright, and legal line 3 in license, and string
changes for "LSILogic" (2) enabled non-disk support through CAM interface (3) HA_INQ (a) enabled tagged queuing (b) disable reset during driver loading (b) renamed BSDi string to LSI (4) disabled detecting disk devices during SCSI INQUIRY (5) changed dcdb single element sglist to send one entire buffer chunk (6) nsgelem not set in sglist (7) ap_data_transfer_length not set for dcdb (8) changed "struct thread" to "d_thread_t" for compatibliity { xxx_open, xxx_close, xxx_ioctl } (9) miscellaneous compatiblity fixes (10) bug fix for 0x0409/0x1000 card (11) added compiling amr_cam.c in sys/conf/files (12) added compiling amr_cam.c in sys/modules/amr/Makefile Reviewed by:ps MFC after:1 week 1 week
Diffstat (limited to 'sys/dev/amr')
-rw-r--r--sys/dev/amr/amr.c74
-rw-r--r--sys/dev/amr/amr_cam.c103
-rw-r--r--sys/dev/amr/amr_compat.h24
-rw-r--r--sys/dev/amr/amr_disk.c38
-rw-r--r--sys/dev/amr/amr_pci.c17
-rw-r--r--sys/dev/amr/amr_tables.h7
-rw-r--r--sys/dev/amr/amrio.h7
-rw-r--r--sys/dev/amr/amrreg.h7
-rw-r--r--sys/dev/amr/amrvar.h8
9 files changed, 214 insertions, 71 deletions
diff --git a/sys/dev/amr/amr.c b/sys/dev/amr/amr.c
index 44c0a2d..379c67f 100644
--- a/sys/dev/amr/amr.c
+++ b/sys/dev/amr/amr.c
@@ -24,6 +24,13 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
+ * 3. The party using or redistributing the source code and binary forms
+ * agrees to the above disclaimer and the terms and conditions set forth
+ * herein.
+ *
+ * Additional Copyright (c) 2002 by Eric Moore under same license.
+ * Additional Copyright (c) 2002 LSI Logic Corporation
+ *
* $FreeBSD$
*/
@@ -203,14 +210,12 @@ amr_attach(struct amr_softc *sc)
debug(2, "controller query complete");
-#ifdef AMR_SCSI_PASSTHROUGH
/*
* Attach our 'real' SCSI channels to CAM.
*/
if (amr_cam_attach(sc))
return(ENXIO);
debug(2, "CAM attach done");
-#endif
/*
* Create the control device.
@@ -307,10 +312,8 @@ amr_free(struct amr_softc *sc)
{
struct amr_command_cluster *acc;
-#ifdef AMR_SCSI_PASSTHROUGH
/* detach from CAM */
amr_cam_detach(sc);
-#endif
/* cancel status timeout */
untimeout(amr_periodic, sc, sc->amr_timeout);
@@ -340,7 +343,7 @@ amr_submit_bio(struct amr_softc *sc, struct bio *bio)
* Accept an open operation on the control device.
*/
static int
-amr_open(dev_t dev, int flags, int fmt, struct thread *td)
+amr_open(dev_t dev, int flags, int fmt, d_thread_t *td)
{
int unit = minor(dev);
struct amr_softc *sc = devclass_get_softc(devclass_find("amr"), unit);
@@ -355,7 +358,7 @@ amr_open(dev_t dev, int flags, int fmt, struct thread *td)
* Accept the last close on the control device.
*/
static int
-amr_close(dev_t dev, int flags, int fmt, struct thread *td)
+amr_close(dev_t dev, int flags, int fmt, d_thread_t *td)
{
int unit = minor(dev);
struct amr_softc *sc = devclass_get_softc(devclass_find("amr"), unit);
@@ -370,7 +373,7 @@ amr_close(dev_t dev, int flags, int fmt, struct thread *td)
* Handle controller-specific control operations.
*/
static int
-amr_ioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, struct thread *td)
+amr_ioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, d_thread_t *td)
{
struct amr_softc *sc = (struct amr_softc *)dev->si_drv1;
int *arg = (int *)addr;
@@ -431,6 +434,7 @@ amr_ioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, struct thread *td)
ap->ap_channel = au->au_cmd[ap->ap_cdb_length + 5];
ap->ap_scsi_id = au->au_cmd[ap->ap_cdb_length + 6];
ap->ap_request_sense_length = 14;
+ ap->ap_data_transfer_length = au->au_length;
/* XXX what about the request-sense area? does the caller want it? */
/* build command */
@@ -478,7 +482,7 @@ amr_ioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, struct thread *td)
debug(2, "%16D", dp, " ");
au->au_status = ac->ac_status;
break;
-
+
default:
debug(1, "unknown ioctl 0x%lx", cmd);
error = ENOIOCTL;
@@ -719,12 +723,10 @@ amr_startio(struct amr_softc *sc)
if (ac == NULL)
(void)amr_bio_command(sc, &ac);
-#ifdef AMR_SCSI_PASSTHROUGH
/* if that failed, build a command from a ccb */
if (ac == NULL)
(void)amr_cam_command(sc, &ac);
-#endif
-
+
/* if we don't have anything to do, give up */
if (ac == NULL)
break;
@@ -960,8 +962,10 @@ amr_setup_dmamap(void *arg, bus_dma_segment_t *segs, int nsegments, int error)
/* decide whether we need to populate the s/g table */
if (nsegments < 2) {
*sgc = 0;
+ ac->ac_mailbox.mb_nsgelem = 0;
ac->ac_mailbox.mb_physaddr = ac->ac_dataphys;
} else {
+ ac->ac_mailbox.mb_nsgelem = nsegments;
*sgc = nsegments;
ac->ac_mailbox.mb_physaddr = sc->amr_sgbusaddr + (ac->ac_slot * AMR_NSEG * sizeof(struct amr_sgentry));
for (i = 0; i < nsegments; i++, sg++) {
@@ -974,31 +978,33 @@ amr_setup_dmamap(void *arg, bus_dma_segment_t *segs, int nsegments, int error)
static void
amr_setup_ccbmap(void *arg, bus_dma_segment_t *segs, int nsegments, int error)
{
- struct amr_command *ac = (struct amr_command *)arg;
- struct amr_softc *sc = ac->ac_sc;
- struct amr_sgentry *sg;
- struct amr_passthrough *ap = (struct amr_passthrough *)ac->ac_data;
- int i;
+ struct amr_command *ac = (struct amr_command *)arg;
+ struct amr_softc *sc = ac->ac_sc;
+ struct amr_sgentry *sg;
+ struct amr_passthrough *ap = (struct amr_passthrough *)ac->ac_data;
+ int i;
/* get base address of s/g table */
sg = sc->amr_sgtable + (ac->ac_slot * AMR_NSEG);
- /* save s/g table information in passthrough */
- ap->ap_no_sg_elements = nsegments;
- ap->ap_data_transfer_address = sc->amr_sgbusaddr + (ac->ac_slot * AMR_NSEG * sizeof(struct amr_sgentry));
-
- /* save pointer to passthrough in command XXX is this already done above? */
- ac->ac_mailbox.mb_physaddr = ac->ac_dataphys;
+ /* decide whether we need to populate the s/g table */
+ if (nsegments < 2) {
+ ap->ap_no_sg_elements = 0;
+ ap->ap_data_transfer_address = segs[0].ds_addr;
+ } else {
+ /* save s/g table information in passthrough */
+ ap->ap_no_sg_elements = nsegments;
+ ap->ap_data_transfer_address = sc->amr_sgbusaddr + (ac->ac_slot * AMR_NSEG * sizeof(struct amr_sgentry));
+ /* populate s/g table (overwrites previous call which mapped the passthrough) */
+ for (i = 0; i < nsegments; i++, sg++) {
+ sg->sg_addr = segs[i].ds_addr;
+ sg->sg_count = segs[i].ds_len;
+ debug(3, " %d: 0x%x/%d", i, sg->sg_addr, sg->sg_count);
+ }
+ }
debug(3, "slot %d %d segments at 0x%x, passthrough at 0x%x", ac->ac_slot,
- ap->ap_no_sg_elements, ap->ap_data_transfer_address, ac->ac_dataphys);
-
- /* populate s/g table (overwrites previous call which mapped the passthrough) */
- for (i = 0; i < nsegments; i++, sg++) {
- sg->sg_addr = segs[i].ds_addr;
- sg->sg_count = segs[i].ds_len;
- debug(3, " %d: 0x%x/%d", i, sg->sg_addr, sg->sg_count);
- }
+ ap->ap_no_sg_elements, ap->ap_data_transfer_address, ac->ac_dataphys);
}
static void
@@ -1013,7 +1019,7 @@ amr_mapcmd(struct amr_command *ac)
if (ac->ac_data != NULL) {
/* map the data buffers into bus space and build the s/g list */
- bus_dmamap_load(sc->amr_buffer_dmat, ac->ac_dmamap, ac->ac_data, ac->ac_length,
+ bus_dmamap_load(sc->amr_buffer_dmat, ac->ac_dmamap, ac->ac_data, ac->ac_length,
amr_setup_dmamap, ac, 0);
if (ac->ac_flags & AMR_CMD_DATAIN)
bus_dmamap_sync(sc->amr_buffer_dmat, ac->ac_dmamap, BUS_DMASYNC_PREREAD);
@@ -1022,7 +1028,7 @@ amr_mapcmd(struct amr_command *ac)
}
if (ac->ac_ccb_data != NULL) {
- bus_dmamap_load(sc->amr_buffer_dmat, ac->ac_ccb_dmamap, ac->ac_ccb_data, ac->ac_ccb_length,
+ bus_dmamap_load(sc->amr_buffer_dmat, ac->ac_ccb_dmamap, ac->ac_ccb_data, ac->ac_ccb_length,
amr_setup_ccbmap, ac, 0);
if (ac->ac_flags & AMR_CMD_CCB_DATAIN)
bus_dmamap_sync(sc->amr_buffer_dmat, ac->ac_ccb_dmamap, BUS_DMASYNC_PREREAD);
@@ -1071,7 +1077,7 @@ amr_start(struct amr_command *ac)
{
struct amr_softc *sc = ac->ac_sc;
int done, s, i;
-
+
debug_called(3);
/* mark command as busy so that polling consumer can tell */
@@ -1541,7 +1547,7 @@ amr_describe_controller(struct amr_softc *sc)
* Try to get 40LD product info, which tells us what the card is labelled as.
*/
if ((ap = amr_enquiry(sc, 2048, AMR_CMD_CONFIG, AMR_CONFIG_PRODUCT_INFO, 0)) != NULL) {
- device_printf(sc->amr_dev, "<%.80s> Firmware %.16s, BIOS %.16s, %dMB RAM\n",
+ device_printf(sc->amr_dev, "<LSILogic %.80s> Firmware %.16s, BIOS %.16s, %dMB RAM\n",
ap->ap_product, ap->ap_firmware, ap->ap_bios,
ap->ap_memsize);
diff --git a/sys/dev/amr/amr_cam.c b/sys/dev/amr/amr_cam.c
index b8d7be4..0a6eda8 100644
--- a/sys/dev/amr/amr_cam.c
+++ b/sys/dev/amr/amr_cam.c
@@ -24,6 +24,13 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
+ * 3. The party using or redistributing the source code and binary forms
+ * agrees to the above disclaimer and the terms and conditions set forth
+ * herein.
+ *
+ * Additional Copyright (c) 2002 by Eric Moore under same license.
+ * Additional Copyright (c) 2002 LSI Logic Corporation
+ *
* $FreeBSD$
*/
@@ -119,21 +126,21 @@ amr_cam_attach(struct amr_softc *sc)
* Iterate over our channels, registering them with CAM
*/
for (chn = 0; chn < sc->amr_maxchan; chn++) {
-
+
/* allocate a sim */
if ((sc->amr_cam_sim[chn] = cam_sim_alloc(amr_cam_action,
amr_cam_poll,
"amr",
- sc,
+ sc,
device_get_unit(sc->amr_dev),
- 1,
+ 1,
AMR_MAX_SCSI_CMDS,
devq)) == NULL) {
cam_simq_free(devq);
device_printf(sc->amr_dev, "CAM SIM attach failed\n");
return(ENOMEM);
}
-
+
/* register the bus ID so we can get it later */
if (xpt_bus_register(sc->amr_cam_sim[chn], chn)) {
device_printf(sc->amr_dev, "CAM XPT bus registration failed\n");
@@ -156,7 +163,7 @@ amr_cam_detach(struct amr_softc *sc)
int chn, first;
for (chn = 0, first = 1; chn < sc->amr_maxchan; chn++) {
-
+
/*
* If a sim was allocated for this channel, free it
*/
@@ -259,27 +266,77 @@ amr_cam_action(struct cam_sim *sim, union ccb *ccb)
*/
case XPT_PATH_INQ:
{
- struct ccb_pathinq *cpi = & ccb->cpi;
+ struct ccb_pathinq *cpi = & ccb->cpi;
- cpi->version_num = 1; /* XXX??? */
- cpi->hba_inquiry = PI_SDTR_ABLE;
+ debug(3, "XPT_PATH_INQ");
+ cpi->version_num = 1; /* XXX??? */
+ cpi->hba_inquiry = PI_SDTR_ABLE|PI_TAG_ABLE|PI_WIDE_16;
cpi->target_sprt = 0;
- cpi->hba_misc = 0;
+ cpi->hba_misc = PIM_NOBUSRESET;
cpi->hba_eng_cnt = 0;
cpi->max_target = AMR_MAX_TARGETS;
- cpi->max_lun = AMR_MAX_LUNS;
- cpi->initiator_id = 7; /* XXX variable? */
+ cpi->max_lun = 0 /* AMR_MAX_LUNS*/;
+ cpi->initiator_id = 7; /* XXX variable? */
strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
- strncpy(cpi->hba_vid, "BSDi", HBA_IDLEN);
+ strncpy(cpi->hba_vid, "LSI", HBA_IDLEN);
strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
cpi->unit_number = cam_sim_unit(sim);
cpi->bus_id = cam_sim_bus(sim);
- cpi->base_transfer_speed = 132 * 1024; /* XXX get from controller? */
+ cpi->base_transfer_speed = 132 * 1024; /* XXX get from controller? */
cpi->ccb_h.status = CAM_REQ_CMP;
break;
}
+ case XPT_RESET_BUS:
+ {
+ struct ccb_pathinq *cpi = & ccb->cpi;
+
+ debug(1, "XPT_RESET_BUS");
+ cpi->ccb_h.status = CAM_REQ_CMP;
+ break;
+ }
+
+ case XPT_RESET_DEV:
+ {
+ debug(1, "XPT_RESET_DEV");
+ ccb->ccb_h.status = CAM_REQ_CMP;
+ break;
+ }
+
+ case XPT_GET_TRAN_SETTINGS:
+ {
+ struct ccb_trans_settings *cts;
+
+ debug(3, "XPT_GET_TRAN_SETTINGS");
+
+ cts = &(ccb->cts);
+
+ if ((cts->flags & CCB_TRANS_USER_SETTINGS) == 0) {
+ ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
+ break;
+ }
+
+ cts->flags = CCB_TRANS_DISC_ENB|CCB_TRANS_TAG_ENB;
+ cts->bus_width = MSG_EXT_WDTR_BUS_32_BIT;
+ cts->sync_period = 6; /* 40MHz how wide is this bus? */
+ cts->sync_offset = 31; /* How to extract this from board? */
+
+ cts->valid = CCB_TRANS_SYNC_RATE_VALID
+ | CCB_TRANS_SYNC_OFFSET_VALID
+ | CCB_TRANS_BUS_WIDTH_VALID
+ | CCB_TRANS_DISC_VALID
+ | CCB_TRANS_TQ_VALID;
+ ccb->ccb_h.status = CAM_REQ_CMP;
+ break;
+ }
+
+ case XPT_SET_TRAN_SETTINGS:
+ debug(3, "XPT_SET_TRAN_SETTINGS");
+ ccb->ccb_h.status = CAM_FUNC_NOTAVAIL;
+ break;
+
+
/*
* Reject anything else as unsupported.
*/
@@ -314,7 +371,7 @@ amr_cam_command(struct amr_softc *sc, struct amr_command **acp)
bus = csio->ccb_h.sim_priv.entries[0].field;
target = csio->ccb_h.target_id;
- /*
+ /*
* Build a passthrough command.
*/
@@ -331,6 +388,7 @@ amr_cam_command(struct amr_softc *sc, struct amr_command **acp)
ap->ap_scsi_id = target;
ap->ap_logical_drive_no = csio->ccb_h.target_lun;
ap->ap_cdb_length = csio->cdb_len;
+ ap->ap_data_transfer_length = csio->dxfer_len;
if (csio->ccb_h.flags & CAM_CDB_POINTER) {
bcopy(csio->cdb_io.cdb_ptr, ap->ap_cdb, csio->cdb_len);
} else {
@@ -390,21 +448,21 @@ amr_cam_poll(struct cam_sim *sim)
static void
amr_cam_complete(struct amr_command *ac)
{
- struct amr_passthrough *ap = (struct amr_passthrough *)ac->ac_data;
- struct ccb_scsiio *csio = (struct ccb_scsiio *)ac->ac_private;
- struct scsi_inquiry_data *inq = (struct scsi_inquiry_data *)csio->data_ptr;
+ struct amr_passthrough *ap = (struct amr_passthrough *)ac->ac_data;
+ struct ccb_scsiio *csio = (struct ccb_scsiio *)ac->ac_private;
+ struct scsi_inquiry_data *inq = (struct scsi_inquiry_data *)csio->data_ptr;
/* XXX note that we're ignoring ac->ac_status - good idea? */
debug(1, "status 0x%x scsi_status 0x%x", ac->ac_status, ap->ap_scsi_status);
- /*
+ /*
* Hide disks from CAM so that they're not picked up and treated as 'normal' disks.
*
* If the configuration provides a mechanism to mark a disk a "not managed", we
* could add handling for that to allow disks to be selectively visible.
*/
-#if 0
+
if ((ap->ap_cdb[0] == INQUIRY) && (SID_TYPE(inq) == T_DIRECT)) {
bzero(csio->data_ptr, csio->dxfer_len);
if (ap->ap_scsi_status == 0xf0) {
@@ -413,9 +471,6 @@ amr_cam_complete(struct amr_command *ac)
csio->ccb_h.status = CAM_DEV_NOT_THERE;
}
} else {
-#else
- {
-#endif
/* handle passthrough SCSI status */
switch(ap->ap_scsi_status) {
@@ -434,13 +489,13 @@ amr_cam_complete(struct amr_command *ac)
case 0x08:
csio->ccb_h.status = CAM_SCSI_BUSY;
break;
-
+
case 0xf0:
case 0xf4:
default:
csio->ccb_h.status = CAM_REQ_CMP_ERR;
break;
- }
+ }
}
free(ap, M_DEVBUF);
if ((csio->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE)
diff --git a/sys/dev/amr/amr_compat.h b/sys/dev/amr/amr_compat.h
index ff517b3..be53867 100644
--- a/sys/dev/amr/amr_compat.h
+++ b/sys/dev/amr/amr_compat.h
@@ -24,6 +24,13 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
+ * 3. The party using or redistributing the source code and binary forms
+ * agrees to the above disclaimer and the terms and conditions set forth
+ * herein.
+ *
+ * Additional Copyright (c) 2002 by Eric Moore under same license.
+ * Additional Copyright (c) 2002 LSI Logic Corporation
+ *
* $FreeBSD$
*/
/*
@@ -33,6 +40,7 @@
#if __FreeBSD_version < 500003 /* old buf style */
# include <sys/buf.h>
# include <machine/clock.h>
+# define INTR_ENTROPY 0
# define FREEBSD_4
# define bio buf
@@ -55,8 +63,24 @@
# define BIO_ERROR B_ERROR
# define devstat_end_transaction_bio(x, y) devstat_end_transaction_buf(x, y)
# define BIO_IS_READ(x) ((x)->b_flags & B_READ)
+# define AMR_BIO_FINISH(x) devstat_end_transaction_bio(&sc->amrd_stats, x);\
+ biodone(x)
#else
# include <sys/bio.h>
# define BIO_IS_READ(x) ((x)->bio_cmd == BIO_READ)
+# define AMR_BIO_FINISH(x) biofinish(x, &sc->amrd_stats, 0)
+#endif
+
+/************************************************************************
+ * Compatibility with older versions of FreeBSD
+ */
+#if __FreeBSD_version < 440001
+typedef struct proc d_thread_t;
+#define M_ZERO 0x0008 /* bzero the allocation */
+#endif
+
+
+#ifndef __packed
+#define __packed __attribute__ ((packed))
#endif
diff --git a/sys/dev/amr/amr_disk.c b/sys/dev/amr/amr_disk.c
index e486e87..9f4e343 100644
--- a/sys/dev/amr/amr_disk.c
+++ b/sys/dev/amr/amr_disk.c
@@ -25,6 +25,13 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
+ * 3. The party using or redistributing the source code and binary forms
+ * agrees to the above disclaimer and the terms and conditions set forth
+ * herein.
+ *
+ * Additional Copyright (c) 2002 by Eric Moore under same license.
+ * Additional Copyright (c) 2002 LSI Logic Corporation
+ *
* $FreeBSD$
*/
@@ -100,12 +107,15 @@ static driver_t amrd_driver = {
DRIVER_MODULE(amrd, amr, amrd_driver, amrd_devclass, 0, 0);
static int
-amrd_open(dev_t dev, int flags, int fmt, struct thread *td)
+amrd_open(dev_t dev, int flags, int fmt, d_thread_t *td)
{
struct amrd_softc *sc = (struct amrd_softc *)dev->si_drv1;
+#if __FreeBSD_version < 500000 /* old buf style */
+ struct disklabel *label;
+#endif
debug_called(1);
-
+
if (sc == NULL)
return (ENXIO);
@@ -113,22 +123,34 @@ amrd_open(dev_t dev, int flags, int fmt, struct thread *td)
if (sc->amrd_controller->amr_state & AMR_STATE_SHUTDOWN)
return(ENXIO);
+#if __FreeBSD_version < 500000 /* old buf style */
+ label = &sc->amrd_disk.d_label;
+ bzero(label, sizeof(*label));
+ label->d_type = DTYPE_SCSI;
+ label->d_secsize = AMR_BLKSIZE;
+ label->d_nsectors = sc->amrd_drive->al_sectors;
+ label->d_ntracks = sc->amrd_drive->al_heads;
+ label->d_ncylinders = sc->amrd_drive->al_cylinders;
+ label->d_secpercyl = sc->amrd_drive->al_sectors * sc->amrd_drive->al_heads;
+ label->d_secperunit = sc->amrd_drive->al_size;
+#else
sc->amrd_disk.d_sectorsize = AMR_BLKSIZE;
sc->amrd_disk.d_mediasize = (off_t)sc->amrd_drive->al_size * AMR_BLKSIZE;
sc->amrd_disk.d_fwsectors = sc->amrd_drive->al_sectors;
sc->amrd_disk.d_fwheads = sc->amrd_drive->al_heads;
+#endif
sc->amrd_flags |= AMRD_OPEN;
return (0);
}
static int
-amrd_close(dev_t dev, int flags, int fmt, struct thread *td)
+amrd_close(dev_t dev, int flags, int fmt, d_thread_t *td)
{
struct amrd_softc *sc = (struct amrd_softc *)dev->si_drv1;
debug_called(1);
-
+
if (sc == NULL)
return (ENXIO);
sc->amrd_flags &= ~AMRD_OPEN;
@@ -136,7 +158,7 @@ amrd_close(dev_t dev, int flags, int fmt, struct thread *td)
}
static int
-amrd_ioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, struct thread *td)
+amrd_ioctl(dev_t dev, u_long cmd, caddr_t addr, int32_t flag, d_thread_t *td)
{
return (ENOTTY);
@@ -189,7 +211,7 @@ amrd_intr(void *data)
bio->bio_resid = 0;
}
- biofinish(bio, &sc->amrd_stats, 0);
+ AMR_BIO_FINISH(bio);
}
static int
@@ -197,8 +219,8 @@ amrd_probe(device_t dev)
{
debug_called(1);
-
- device_set_desc(dev, "MegaRAID logical drive");
+
+ device_set_desc(dev, "LSILogic MegaRAID logical drive");
return (0);
}
diff --git a/sys/dev/amr/amr_pci.c b/sys/dev/amr/amr_pci.c
index e01c10b..8c7995e 100644
--- a/sys/dev/amr/amr_pci.c
+++ b/sys/dev/amr/amr_pci.c
@@ -24,6 +24,13 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
+ * 3. The party using or redistributing the source code and binary forms
+ * agrees to the above disclaimer and the terms and conditions set forth
+ * herein.
+ *
+ * Additional Copyright (c) 2002 by Eric Moore under same license.
+ * Additional Copyright (c) 2002 LSI Logic Corporation
+ *
* $FreeBSD$
*/
@@ -86,7 +93,7 @@ static driver_t amr_pci_driver = {
static devclass_t amr_devclass;
DRIVER_MODULE(amr, pci, amr_pci_driver, amr_devclass, 0, 0);
-static struct
+static struct
{
int vendor;
int device;
@@ -97,11 +104,11 @@ static struct
{0x101e, 0x9060, 0},
{0x8086, 0x1960, PROBE_SIGNATURE},/* generic i960RD, check for signature */
{0x101e, 0x1960, 0},
- {0x1000, 0x1960, 0},
+ {0x1000, 0x1960, PROBE_SIGNATURE},
{0x1000, 0x0407, 0},
{0, 0, 0}
};
-
+
static int
amr_pci_probe(device_t dev)
{
@@ -119,7 +126,7 @@ amr_pci_probe(device_t dev)
if ((sig != AMR_SIGNATURE_1) && (sig != AMR_SIGNATURE_2))
continue;
}
- device_set_desc(dev, "AMI MegaRAID");
+ device_set_desc(dev, "LSILogic MegaRAID");
return(-10); /* allow room to be overridden */
}
}
@@ -149,7 +156,7 @@ amr_pci_attach(device_t dev)
* Determine board type.
*/
command = pci_read_config(dev, PCIR_COMMAND, 1);
- if (pci_get_device(dev) == 0x1960) {
+ if ((pci_get_device(dev) == 0x1960) || (pci_get_device(dev) == 0x0407)){
/*
* Make sure we are going to be able to talk to this board.
*/
diff --git a/sys/dev/amr/amr_tables.h b/sys/dev/amr/amr_tables.h
index d6e9993..f2ce1d3 100644
--- a/sys/dev/amr/amr_tables.h
+++ b/sys/dev/amr/amr_tables.h
@@ -24,6 +24,13 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
+ * 3. The party using or redistributing the source code and binary forms
+ * agrees to the above disclaimer and the terms and conditions set forth
+ * herein.
+ *
+ * Additional Copyright (c) 2002 by Eric Moore under same license.
+ * Additional Copyright (c) 2002 LSI Logic Corporation
+ *
* $FreeBSD$
*/
diff --git a/sys/dev/amr/amrio.h b/sys/dev/amr/amrio.h
index 757e81c..e319573 100644
--- a/sys/dev/amr/amrio.h
+++ b/sys/dev/amr/amrio.h
@@ -23,6 +23,13 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
+ * 3. The party using or redistributing the source code and binary forms
+ * agrees to the above disclaimer and the terms and conditions set forth
+ * herein.
+ *
+ * Additional Copyright (c) 2002 by Eric Moore under same license.
+ * Additional Copyright (c) 2002 LSI Logic Corporation
+ *
* $FreeBSD$
*/
diff --git a/sys/dev/amr/amrreg.h b/sys/dev/amr/amrreg.h
index 61fb501..7abfe0f 100644
--- a/sys/dev/amr/amrreg.h
+++ b/sys/dev/amr/amrreg.h
@@ -24,6 +24,13 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
+ * 3. The party using or redistributing the source code and binary forms
+ * agrees to the above disclaimer and the terms and conditions set forth
+ * herein.
+ *
+ * Additional Copyright (c) 2002 by Eric Moore under same license.
+ * Additional Copyright (c) 2002 LSI Logic Corporation
+ *
* $FreeBSD$
*/
diff --git a/sys/dev/amr/amrvar.h b/sys/dev/amr/amrvar.h
index ad08b67..2c54824 100644
--- a/sys/dev/amr/amrvar.h
+++ b/sys/dev/amr/amrvar.h
@@ -24,6 +24,13 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
+ * 3. The party using or redistributing the source code and binary forms
+ * agrees to the above disclaimer and the terms and conditions set forth
+ * herein.
+ *
+ * Additional Copyright (c) 2002 by Eric Moore under same license.
+ * Additional Copyright (c) 2002 LSI Logic Corporation
+ *
* $FreeBSD$
*/
@@ -103,6 +110,7 @@ struct amr_command
u_int32_t ac_ccb_dataphys;
void (* ac_complete)(struct amr_command *ac);
+ void *ac_private;
};
struct amr_command_cluster
OpenPOWER on IntegriCloud