Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/thorpej_scsipi]: src/sys/dev req_sense_length is dead.
details: https://anonhg.NetBSD.org/src/rev/4d96bb999834
branches: thorpej_scsipi
changeset: 477364:4d96bb999834
user: bouyer <bouyer%NetBSD.org@localhost>
date: Mon Jan 15 09:27:42 2001 +0000
description:
req_sense_length is dead.
diffstat:
sys/dev/i2o/iopsp.c | 8 ++------
sys/dev/ic/adv.c | 3 +--
sys/dev/ic/ncr5380sbc.c | 3 +--
sys/dev/pci/ncr.c | 11 ++++-------
sys/dev/pci/pciide.c | 17 +++++++++++++++--
sys/dev/pci/pciidevar.h | 9 +++++----
sys/dev/usb/umass.c | 8 +-------
7 files changed, 29 insertions(+), 30 deletions(-)
diffs (210 lines):
diff -r 86e51e4b2ea2 -r 4d96bb999834 sys/dev/i2o/iopsp.c
--- a/sys/dev/i2o/iopsp.c Mon Jan 15 09:26:26 2001 +0000
+++ b/sys/dev/i2o/iopsp.c Mon Jan 15 09:27:42 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: iopsp.c,v 1.2.2.3 2000/12/08 09:12:19 bouyer Exp $ */
+/* $NetBSD: iopsp.c,v 1.2.2.4 2001/01/15 09:27:42 bouyer Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -629,11 +629,8 @@
case SCSI_CHECK:
xs->error = XS_SENSE;
sl = le32toh(rb->senselen);
- if (xs->req_sense_length != 0 &&
- xs->req_sense_length < sl)
- sl = xs->req_sense_length;
if (sl > sizeof(xs->sense.scsi_sense))
- sl = le32toh(rb->senselen);
+ sl = sizeof(xs->sense.scsi_sense);
memcpy(&xs->sense.scsi_sense, rb->sense, sl);
break;
case SCSI_BUSY:
@@ -653,7 +650,6 @@
/* Free the message wrapper and pass the news to scsipi. */
iop_msg_unmap(iop, im);
iop_msg_free(iop, &sc->sc_ii, im);
- xs->xs_status |= XS_STS_DONE;
scsipi_done(xs);
}
diff -r 86e51e4b2ea2 -r 4d96bb999834 sys/dev/ic/adv.c
--- a/sys/dev/ic/adv.c Mon Jan 15 09:26:26 2001 +0000
+++ b/sys/dev/ic/adv.c Mon Jan 15 09:27:42 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: adv.c,v 1.14.2.6 2000/11/22 16:03:09 bouyer Exp $ */
+/* $NetBSD: adv.c,v 1.14.2.7 2001/01/15 09:27:42 bouyer Exp $ */
/*
* Generic driver for the Advanced Systems Inc. Narrow SCSI controllers
@@ -937,6 +937,5 @@
adv_free_ccb(sc, ccb);
- xs->xs_status |= XS_STS_DONE;
scsipi_done(xs);
}
diff -r 86e51e4b2ea2 -r 4d96bb999834 sys/dev/ic/ncr5380sbc.c
--- a/sys/dev/ic/ncr5380sbc.c Mon Jan 15 09:26:26 2001 +0000
+++ b/sys/dev/ic/ncr5380sbc.c Mon Jan 15 09:27:42 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ncr5380sbc.c,v 1.31.2.4 2000/11/20 11:40:45 bouyer Exp $ */
+/* $NetBSD: ncr5380sbc.c,v 1.31.2.5 2001/01/15 09:27:42 bouyer Exp $ */
/*
* Copyright (c) 1995 David Jones, Gordon W. Ross
@@ -832,7 +832,6 @@
sc->sc_ncmds--;
/* Tell common SCSI code it is done. */
- xs->xs_status |= XS_STS_DONE;
scsipi_done(xs);
sc->sc_state = NCR_IDLE;
diff -r 86e51e4b2ea2 -r 4d96bb999834 sys/dev/pci/ncr.c
--- a/sys/dev/pci/ncr.c Mon Jan 15 09:26:26 2001 +0000
+++ b/sys/dev/pci/ncr.c Mon Jan 15 09:27:42 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ncr.c,v 1.87.2.5 2001/01/05 17:36:10 bouyer Exp $ */
+/* $NetBSD: ncr.c,v 1.87.2.6 2001/01/15 09:27:43 bouyer Exp $ */
/**************************************************************************
**
@@ -1538,7 +1538,7 @@
#if 0
static char ident[] =
- "\n$NetBSD: ncr.c,v 1.87.2.5 2001/01/05 17:36:10 bouyer Exp $\n";
+ "\n$NetBSD: ncr.c,v 1.87.2.6 2001/01/15 09:27:43 bouyer Exp $\n";
#endif
static const u_long ncr_version = NCR_VERSION * 11
@@ -4947,8 +4947,6 @@
cp->sensecmd[0] = 0x03;
cp->sensecmd[1] = xp->sc_link->scsipi_scsi.lun << 5;
cp->sensecmd[4] = sizeof(struct scsipi_sense_data);
- if (xp->req_sense_length)
- cp->sensecmd[4] = xp->req_sense_length;
/*
** sense data
*/
@@ -5307,8 +5305,6 @@
xp->error = XS_TIMEOUT;
}
- xp->xs_status |= XS_STS_DONE;
-
/*
** trace output
*/
@@ -5329,7 +5325,8 @@
case S_CHECK_COND:
printf (" SENSE:");
p = (u_char*) &xp->sense.scsi_sense;
- for (i=0; i<xp->req_sense_length; i++)
+ for (i=0; i<sizeof(struct scsipi_sense_data);
+ i++)
printf (" %x", *p++);
break;
default:
diff -r 86e51e4b2ea2 -r 4d96bb999834 sys/dev/pci/pciide.c
--- a/sys/dev/pci/pciide.c Mon Jan 15 09:26:26 2001 +0000
+++ b/sys/dev/pci/pciide.c Mon Jan 15 09:27:42 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pciide.c,v 1.44.2.4 2001/01/05 17:36:16 bouyer Exp $ */
+/* $NetBSD: pciide.c,v 1.44.2.5 2001/01/15 09:27:44 bouyer Exp $ */
/*
@@ -671,12 +671,25 @@
if (pci_mapreg_map(pa, PCIIDE_REG_CTL_BASE(wdc_cp->channel),
PCI_MAPREG_TYPE_IO, 0,
- &wdc_cp->ctl_iot, &wdc_cp->ctl_ioh, NULL, ctlsizep) != 0) {
+ &wdc_cp->ctl_iot, &cp->ctl_baseioh, NULL, ctlsizep) != 0) {
printf("%s: couldn't map %s channel ctl regs\n",
sc->sc_wdcdev.sc_dev.dv_xname, cp->name);
bus_space_unmap(wdc_cp->cmd_iot, wdc_cp->cmd_ioh, *cmdsizep);
return 0;
}
+ /*
+ * In native mode, 4 bytes of I/O space are mapped for the control
+ * register, the control register is at offset 2. Pass the generic
+ * code a handle for only one byte at the rigth offset.
+ */
+ if (bus_space_subregion(wdc_cp->ctl_iot, cp->ctl_baseioh, 2, 1,
+ &wdc_cp->ctl_ioh) != 0) {
+ printf("%s: unable to subregion %s channel ctl regs\n",
+ sc->sc_wdcdev.sc_dev.dv_xname, cp->name);
+ bus_space_unmap(wdc_cp->cmd_iot, wdc_cp->cmd_ioh, *cmdsizep);
+ bus_space_unmap(wdc_cp->cmd_iot, cp->ctl_baseioh, *ctlsizep);
+ return 0;
+ }
return (1);
}
diff -r 86e51e4b2ea2 -r 4d96bb999834 sys/dev/pci/pciidevar.h
--- a/sys/dev/pci/pciidevar.h Mon Jan 15 09:26:26 2001 +0000
+++ b/sys/dev/pci/pciidevar.h Mon Jan 15 09:27:42 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pciidevar.h,v 1.2.12.1 2000/11/20 11:42:35 bouyer Exp $ */
+/* $NetBSD: pciidevar.h,v 1.2.12.2 2001/01/15 09:27:44 bouyer Exp $ */
/*
* Copyright (c) 1998 Christopher G. Demetriou. All rights reserved.
@@ -64,9 +64,10 @@
struct pciide_channel { /* per-channel data */
struct channel_softc wdc_channel; /* generic part */
char *name;
- int hw_ok; /* hardware mapped & OK? */
- int compat; /* is it compat? */
- void *ih; /* compat or pci handle */
+ int hw_ok; /* hardware mapped & OK? */
+ int compat; /* is it compat? */
+ void *ih; /* compat or pci handle */
+ bus_space_handle_t ctl_baseioh; /* ctrl regs blk, native mode */
/* DMA tables and DMA map for xfer, for each drive */
struct pciide_dma_maps {
bus_dmamap_t dmamap_table;
diff -r 86e51e4b2ea2 -r 4d96bb999834 sys/dev/usb/umass.c
--- a/sys/dev/usb/umass.c Mon Jan 15 09:26:26 2001 +0000
+++ b/sys/dev/usb/umass.c Mon Jan 15 09:27:42 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: umass.c,v 1.21.2.6 2001/01/05 17:36:32 bouyer Exp $ */
+/* $NetBSD: umass.c,v 1.21.2.7 2001/01/15 09:27:45 bouyer Exp $ */
/*-
* Copyright (c) 1999 MAEKAWA Masahide <bishop%rr.iij4u.or.jp@localhost>,
* Nick Hibma <n_hibma%freebsd.org@localhost>
@@ -3251,7 +3251,6 @@
/* Return if command finishes early. */
done:
- xs->xs_status |= XS_STS_DONE;
scsipi_done(xs);
return;
default:
@@ -3327,7 +3326,6 @@
struct scsipi_xfer *xs = priv;
struct scsipi_periph *periph = xs->xs_periph;
int cmdlen;
- int s;
#ifdef UMASS_DEBUG
struct timeval tv;
u_int delta;
@@ -3372,16 +3370,12 @@
USBDEVNAME(sc->sc_dev), status);
}
- xs->xs_status |= XS_STS_DONE;
-
DPRINTF(UDMASS_CMD,("umass_scsipi_cb: at %lu.%06lu: return xs->error="
"%d, xs->xs_status=0x%x xs->resid=%d\n",
tv.tv_sec, tv.tv_usec,
xs->error, xs->xs_status, xs->resid));
- s = splbio();
scsipi_done(xs);
- splx(s);
}
/*
Home |
Main Index |
Thread Index |
Old Index