Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/thorpej_scsipi]: src/sys/dev Make compile again.
details: https://anonhg.NetBSD.org/src/rev/9e3dd6a9b1f1
branches: thorpej_scsipi
changeset: 477403:9e3dd6a9b1f1
user: bouyer <bouyer%NetBSD.org@localhost>
date: Fri Mar 23 11:32:16 2001 +0000
description:
Make compile again.
diffstat:
sys/dev/ic/adw.c | 7 +-
sys/dev/ic/dpt.c | 6 +-
sys/dev/usb/umass.c | 10 +--
sys/dev/usb/usscanner.c | 167 +++++++++++++++++++++++++----------------------
4 files changed, 95 insertions(+), 95 deletions(-)
diffs (truncated from 318 to 300 lines):
diff -r 0a12481751ea -r 9e3dd6a9b1f1 sys/dev/ic/adw.c
--- a/sys/dev/ic/adw.c Fri Mar 23 11:31:42 2001 +0000
+++ b/sys/dev/ic/adw.c Fri Mar 23 11:32:16 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: adw.c,v 1.12.2.7 2001/03/12 13:30:12 bouyer Exp $ */
+/* $NetBSD: adw.c,v 1.12.2.8 2001/03/23 11:32:16 bouyer Exp $ */
/*
* Generic driver for the Advanced Systems Inc. SCSI controllers
@@ -707,8 +707,9 @@
{
error = bus_dmamap_load(dmat,
ccb->dmamap_xfer, xs->data, xs->datalen, NULL,
- ((flags & XS_CTL_NOSLEEP) ? BUS_DMA_NOWAIT :
- BUS_DMA_WAITOK) | BUS_DMA_STREAMING);
+ ((xs->xs_control & XS_CTL_NOSLEEP) ?
+ BUS_DMA_NOWAIT : BUS_DMA_WAITOK) |
+ BUS_DMA_STREAMING);
}
switch (error) {
diff -r 0a12481751ea -r 9e3dd6a9b1f1 sys/dev/ic/dpt.c
--- a/sys/dev/ic/dpt.c Fri Mar 23 11:31:42 2001 +0000
+++ b/sys/dev/ic/dpt.c Fri Mar 23 11:32:16 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dpt.c,v 1.8.2.12 2001/03/12 13:30:17 bouyer Exp $ */
+/* $NetBSD: dpt.c,v 1.8.2.13 2001/03/23 11:32:16 bouyer Exp $ */
/*-
* Copyright (c) 1997, 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dpt.c,v 1.8.2.12 2001/03/12 13:30:17 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dpt.c,v 1.8.2.13 2001/03/23 11:32:16 bouyer Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -875,7 +875,7 @@
DPT_SG_SIZE);
else
printf("error %d loading DMA map\n",
- sc->sc_dv.dv_xname, error);
+ error);
out_bad:
dpt_free_ccb(sc, ccb);
scsipi_done(xs);
diff -r 0a12481751ea -r 9e3dd6a9b1f1 sys/dev/usb/umass.c
--- a/sys/dev/usb/umass.c Fri Mar 23 11:31:42 2001 +0000
+++ b/sys/dev/usb/umass.c Fri Mar 23 11:32:16 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: umass.c,v 1.21.2.11 2001/03/12 13:31:28 bouyer Exp $ */
+/* $NetBSD: umass.c,v 1.21.2.12 2001/03/23 11:32:16 bouyer Exp $ */
/*-
* Copyright (c) 1999 MAEKAWA Masahide <bishop%rr.iij4u.or.jp@localhost>,
* Nick Hibma <n_hibma%freebsd.org@localhost>
@@ -594,14 +594,6 @@
#define UMASS_MAX_TRANSFER_SIZE MAXBSIZE
-struct scsipi_periphsw umass_probe_periphsw =
-{
- NULL,
- NULL,
- NULL,
- NULL,
-};
-
Static void umass_scsipi_request(struct scsipi_channel *,
scsipi_adapter_req_t, void *);
Static void umass_scsipi_minphys(struct buf *bp);
diff -r 0a12481751ea -r 9e3dd6a9b1f1 sys/dev/usb/usscanner.c
--- a/sys/dev/usb/usscanner.c Fri Mar 23 11:31:42 2001 +0000
+++ b/sys/dev/usb/usscanner.c Fri Mar 23 11:32:16 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: usscanner.c,v 1.4.2.3 2001/02/11 19:16:35 bouyer Exp $ */
+/* $NetBSD: usscanner.c,v 1.4.2.4 2001/03/23 11:32:17 bouyer Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -93,14 +93,6 @@
#define USSCANNER_TIMEOUT 2000
-Static struct scsipi_device usscanner_dev =
-{
- NULL, /* Use default error handler */
- NULL, /* have a queue, served by this */
- NULL, /* have no async handler */
- NULL, /* Use default 'done' routine */
-};
-
struct usscanner_softc {
USBBASEDEVICE sc_dev;
usbd_device_handle sc_udev;
@@ -134,9 +126,8 @@
device_ptr_t sc_child; /* child device, for detach */
- struct scsipi_link sc_link;
- struct atapi_adapter sc_atapi_adapter;
-#define sc_adapter sc_atapi_adapter._generic
+ struct scsipi_adapter sc_adapter;
+ struct scsipi_channel sc_channel;
int sc_refcnt;
char sc_dying;
@@ -144,7 +135,8 @@
Static void usscanner_cleanup(struct usscanner_softc *sc);
-Static int usscanner_scsipi_cmd(struct scsipi_xfer *xs);
+Static void usscanner_scsipi_request(struct scsipi_channel *chan,
+ scsipi_adapter_req_t req, void *arg);
Static void usscanner_scsipi_minphys(struct buf *bp);
Static void usscanner_done(struct usscanner_softc *sc);
Static void usscanner_sense(struct usscanner_softc *sc);
@@ -309,26 +301,27 @@
/*
* Fill in the adapter.
*/
- sc->sc_adapter.scsipi_cmd = usscanner_scsipi_cmd;
- sc->sc_adapter.scsipi_minphys = usscanner_scsipi_minphys;
+ sc->sc_adapter.adapt_request = usscanner_scsipi_request;
+ sc->sc_adapter.adapt_dev = &sc->sc_dev;
+ sc->sc_adapter.adapt_nchannels = 1;
+ sc->sc_adapter.adapt_openings = 1;
+ sc->sc_adapter.adapt_max_periph = 1;
+ sc->sc_adapter.adapt_minphys = usscanner_scsipi_minphys;
/*
- * fill in the prototype scsipi_link.
+ * fill in the scsipi_channel.
*/
- sc->sc_link.type = BUS_SCSI;
- sc->sc_link.scsipi_scsi.channel = SCSI_CHANNEL_ONLY_ONE;
- sc->sc_link.adapter_softc = sc;
- sc->sc_link.scsipi_scsi.adapter_target = USSCANNER_SCSIID_HOST;
- sc->sc_link.adapter = &sc->sc_adapter;
- sc->sc_link.device = &usscanner_dev;
- sc->sc_link.openings = 1;
- sc->sc_link.scsipi_scsi.max_target = USSCANNER_SCSIID_DEVICE;
- sc->sc_link.scsipi_scsi.max_lun = 0;
-
+ sc->sc_channel.chan_adapter = &sc->sc_adapter;
+ sc->sc_channel.chan_bustype = &scsi_bustype;
+ sc->sc_channel.chan_channel = 0;
+ sc->sc_channel.chan_ntargets = USSCANNER_SCSIID_DEVICE + 1;
+ sc->sc_channel.chan_nluns = 1;
+ sc->sc_channel.chan_id = USSCANNER_SCSIID_HOST;
+
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
USBDEV(sc->sc_dev));
- sc->sc_child = config_found(&sc->sc_dev, &sc->sc_link, scsiprint);
+ sc->sc_child = config_found(&sc->sc_dev, &sc->sc_channel, scsiprint);
DPRINTFN(10, ("usscanner_attach: %p\n", sc->sc_udev));
@@ -423,14 +416,14 @@
usscanner_sense(struct usscanner_softc *sc)
{
struct scsipi_xfer *xs = sc->sc_xs;
- struct scsipi_link *sc_link = xs->sc_link;
+ struct scsipi_periph *periph = xs->xs_periph;
struct scsipi_sense sense_cmd;
usbd_status err;
/* fetch sense data */
memset(&sense_cmd, 0, sizeof(sense_cmd));
sense_cmd.opcode = REQUEST_SENSE;
- sense_cmd.byte2 = sc_link->scsipi_scsi.lun << SCSI_CMD_LUN_SHIFT;
+ sense_cmd.byte2 = periph->periph_lun << SCSI_CMD_LUN_SHIFT;
sense_cmd.length = sizeof xs->sense;
sc->sc_state = UAS_SENSECMD;
@@ -467,7 +460,6 @@
sc->sc_state = UAS_IDLE;
- sc->sc_xs->xs_status |= XS_STS_DONE;
s = splbio();
scsipi_done(sc->sc_xs);
splx(s);
@@ -679,67 +671,82 @@
usscanner_done(sc);
}
-Static int
-usscanner_scsipi_cmd(struct scsipi_xfer *xs)
+Static void
+usscanner_scsipi_request(chan, req, arg)
+ struct scsipi_channel *chan;
+ scsipi_adapter_req_t req;
+ void *arg;
{
- struct scsipi_link *sc_link = xs->sc_link;
- struct usscanner_softc *sc = sc_link->adapter_softc;
+ struct scsipi_xfer *xs;
+ struct scsipi_periph *periph;
+ struct usscanner_softc *sc = (void *)chan->chan_adapter->adapt_dev;
usbd_status err;
- DPRINTFN(8, ("%s: usscanner_scsi_cmd: %d:%d "
- "xs=%p cmd=0x%02x datalen=%d (quirks=0x%x, poll=%d)\n",
- USBDEVNAME(sc->sc_dev),
- sc_link->scsipi_scsi.target, sc_link->scsipi_scsi.lun,
- xs, xs->cmd->opcode, xs->datalen,
- sc_link->quirks, xs->xs_control & XS_CTL_POLL));
+ switch (req) {
+ case ADAPTER_REQ_RUN_XFER:
+ xs = arg;
+ periph = xs->xs_periph;
- if (sc->sc_dying) {
- xs->error = XS_DRIVER_STUFFUP;
- goto done;
- }
+ DPRINTFN(8, ("%s: usscanner_scsi_request: %d:%d "
+ "xs=%p cmd=0x%02x datalen=%d (quirks=0x%x, poll=%d)\n",
+ USBDEVNAME(sc->sc_dev),
+ periph->periph_target, periph->periph_lun,
+ xs, xs->cmd->opcode, xs->datalen,
+ periph->periph_quirks, xs->xs_control & XS_CTL_POLL));
+
+ if (sc->sc_dying) {
+ xs->error = XS_DRIVER_STUFFUP;
+ goto done;
+ }
#ifdef USSCANNER_DEBUG
- if (sc_link->scsipi_scsi.target != USSCANNER_SCSIID_DEVICE) {
- DPRINTF(("%s: wrong SCSI ID %d\n", USBDEVNAME(sc->sc_dev),
- sc_link->scsipi_scsi.target));
- xs->error = XS_DRIVER_STUFFUP;
- goto done;
- }
- if (sc->sc_state != UAS_IDLE) {
- printf("%s: !UAS_IDLE\n", USBDEVNAME(sc->sc_dev));
- xs->error = XS_DRIVER_STUFFUP;
- goto done;
- }
+ if (sc_link->scsipi_scsi.target != USSCANNER_SCSIID_DEVICE) {
+ DPRINTF(("%s: wrong SCSI ID %d\n",
+ USBDEVNAME(sc->sc_dev), periph->periph_target));
+ xs->error = XS_DRIVER_STUFFUP;
+ goto done;
+ }
+ if (sc->sc_state != UAS_IDLE) {
+ printf("%s: !UAS_IDLE\n", USBDEVNAME(sc->sc_dev));
+ xs->error = XS_DRIVER_STUFFUP;
+ goto done;
+ }
#endif
- if (xs->datalen > USSCANNER_MAX_TRANSFER_SIZE) {
- printf("umass_cmd: large datalen, %d\n", xs->datalen);
- xs->error = XS_DRIVER_STUFFUP;
- goto done;
- }
+ if (xs->datalen > USSCANNER_MAX_TRANSFER_SIZE) {
+ printf("umass_cmd: large datalen, %d\n", xs->datalen);
+ xs->error = XS_DRIVER_STUFFUP;
+ goto done;
+ }
- DPRINTFN(4, ("usscanner_scsi_cmd: async cmdlen=%d datalen=%d\n",
- xs->cmdlen, xs->datalen));
- sc->sc_state = UAS_CMD;
- sc->sc_xs = xs;
- memcpy(sc->sc_cmd_buffer, xs->cmd, xs->cmdlen);
- usbd_setup_xfer(sc->sc_cmd_xfer, sc->sc_out_pipe, sc, sc->sc_cmd_buffer,
- xs->cmdlen, USBD_NO_COPY, USSCANNER_TIMEOUT, usscanner_cmd_cb);
- err = usbd_transfer(sc->sc_cmd_xfer);
- if (err != USBD_IN_PROGRESS) {
- xs->error = XS_DRIVER_STUFFUP;
- goto done;
- }
+ DPRINTFN(4, ("usscanner_scsi_cmd: async cmdlen=%d datalen=%d\n",
+ xs->cmdlen, xs->datalen));
+ sc->sc_state = UAS_CMD;
+ sc->sc_xs = xs;
+ memcpy(sc->sc_cmd_buffer, xs->cmd, xs->cmdlen);
+ usbd_setup_xfer(sc->sc_cmd_xfer, sc->sc_out_pipe, sc,
+ sc->sc_cmd_buffer, xs->cmdlen, USBD_NO_COPY,
+ USSCANNER_TIMEOUT, usscanner_cmd_cb);
+ err = usbd_transfer(sc->sc_cmd_xfer);
+ if (err != USBD_IN_PROGRESS) {
+ xs->error = XS_DRIVER_STUFFUP;
+ goto done;
+ }
- return (SUCCESSFULLY_QUEUED);
+ return;
done:
- sc->sc_state = UAS_IDLE;
- xs->xs_status |= XS_STS_DONE;
Home |
Main Index |
Thread Index |
Old Index