diff options
author | dufault <dufault@FreeBSD.org> | 1995-04-14 15:10:44 +0000 |
---|---|---|
committer | dufault <dufault@FreeBSD.org> | 1995-04-14 15:10:44 +0000 |
commit | a644aba5017dfc9956e335d54cbdc4f68b763576 (patch) | |
tree | 3a69b37cbf049735d0cbf7b77ca3da8ae11c9866 /sys/scsi/ch.c | |
parent | 3ce68508565a04b191a7642e35ddbfeaef1c0c67 (diff) | |
download | FreeBSD-src-a644aba5017dfc9956e335d54cbdc4f68b763576.zip FreeBSD-src-a644aba5017dfc9956e335d54cbdc4f68b763576.tar.gz |
Added "scsi target" device that can act as a target for scsi transfers
from an initiator
Added Julian's support for residuals.
Added Julian's fixes to the tape driver
Made compile cleanly with -Wall
Reduce boot up output
Diffstat (limited to 'sys/scsi/ch.c')
-rw-r--r-- | sys/scsi/ch.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/sys/scsi/ch.c b/sys/scsi/ch.c index a4cd115e..ae71850 100644 --- a/sys/scsi/ch.c +++ b/sys/scsi/ch.c @@ -2,7 +2,7 @@ * Written by grefen@????? * Based on scsi drivers by Julian Elischer (julian@tfs.com) * - * $Id: ch.c,v 1.16 1995/03/15 14:22:04 dufault Exp $ + * $Id: ch.c,v 1.17 1995/03/28 07:57:22 bde Exp $ */ #include <sys/types.h> @@ -128,8 +128,7 @@ ch_registerdev(int unit) errval chattach(struct scsi_link *sc_link) { - u_int32 unit, i; - unsigned char *tbl; + u_int32 unit; struct scsi_data *ch = sc_link->sd; @@ -170,7 +169,7 @@ struct scsi_link *sc_link) * Only allow one at a time */ if (cd->flags & CH_OPEN) { - printf("ch%d: already open\n", unit); + printf("ch%ld: already open\n", unit); return EBUSY; } /* @@ -182,15 +181,15 @@ struct scsi_link *sc_link) /* * Check that it is still responding and ok. */ - if (errcode = (scsi_test_unit_ready(sc_link, 0))) { - printf("ch%d: not ready\n", unit); + if ( (errcode = (scsi_test_unit_ready(sc_link, 0))) ) { + printf("ch%ld: not ready\n", unit); sc_link->flags &= ~SDEV_OPEN; return errcode; } /* * Make sure data is loaded */ - if (errcode = (ch_mode_sense(unit, SCSI_NOSLEEP | SCSI_NOMASK))) { + if ( (errcode = (ch_mode_sense(unit, SCSI_NOSLEEP | SCSI_NOMASK))) ) { printf("ch%d: scsi changer :- offline\n", unit); sc_link->flags &= ~SDEV_OPEN; return (errcode); @@ -221,12 +220,8 @@ ch_ioctl(dev_t dev, int cmd, caddr_t arg, int mode, struct proc *p, struct scsi_link *sc_link) { /* struct ch_cmd_buf *args; */ - union scsi_cmd *scsi_cmd; - register i, j; - u_int32 opri; - errval errcode = 0; unsigned char unit; - u_int32 number, flags; + u_int32 flags; errval ret; struct scsi_data *cd; @@ -438,7 +433,7 @@ ch_mode_sense(unit, flags) /* * Read in the pages */ - if (errcode = scsi_scsi_cmd(sc_link, + if ( (errcode = scsi_scsi_cmd(sc_link, (struct scsi_generic *) &scsi_cmd, sizeof(struct scsi_mode_sense), (u_char *) & scsi_sense, @@ -446,9 +441,9 @@ ch_mode_sense(unit, flags) CHRETRIES, 5000, NULL, - flags | SCSI_DATA_IN) != 0) { + flags | SCSI_DATA_IN) != 0) ) { if (!(flags & SCSI_SILENT)) - printf("ch%d: could not mode sense\n", unit); + printf("ch%ld: could not mode sense\n", unit); return (errcode); } sc_link->flags |= SDEV_MEDIA_LOADED; |