summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2001-06-22 14:35:44 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2001-06-22 14:35:44 +0000
commita232614599face9788bb78b9f15995dc01f7568b (patch)
treebf91b5a0335164b1244f1cca835834825f53ee0a
parentf42d8b99248945a02177adb0c2d42667133940d2 (diff)
KNF
-rw-r--r--sys/scsi/cd.c156
-rw-r--r--sys/scsi/cd_scsi.c4
-rw-r--r--sys/scsi/cdvar.h4
-rw-r--r--sys/scsi/ch.c8
-rw-r--r--sys/scsi/scsi_all.h38
-rw-r--r--sys/scsi/scsi_base.c42
-rw-r--r--sys/scsi/scsi_cd.h64
-rw-r--r--sys/scsi/scsi_disk.h22
-rw-r--r--sys/scsi/scsi_ioctl.c4
-rw-r--r--sys/scsi/scsi_scanner.h12
-rw-r--r--sys/scsi/scsiconf.c34
-rw-r--r--sys/scsi/scsiconf.h74
-rw-r--r--sys/scsi/sd.c22
-rw-r--r--sys/scsi/sdvar.h12
-rw-r--r--sys/scsi/ses.c18
-rw-r--r--sys/scsi/ss.c14
-rw-r--r--sys/scsi/ss_scanjet.c23
-rw-r--r--sys/scsi/ssvar.h6
-rw-r--r--sys/scsi/st.c14
19 files changed, 277 insertions, 294 deletions
diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c
index 6ca2d2abaa2..5b96b226336 100644
--- a/sys/scsi/cd.c
+++ b/sys/scsi/cd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd.c,v 1.55 2000/07/18 06:09:00 csapuntz Exp $ */
+/* $OpenBSD: cd.c,v 1.56 2001/06/22 14:35:42 deraadt Exp $ */
/* $NetBSD: cd.c,v 1.100 1997/04/02 02:29:30 mycroft Exp $ */
/*
@@ -82,7 +82,7 @@
#define CDOUTSTANDING 4
#define CDUNIT(z) DISKUNIT(z)
-#define CDMINOR(unit, part) DISKMINOR(unit, part)
+#define CDMINOR(unit, part) DISKMINOR(unit, part)
#define CDPART(z) DISKPART(z)
#define MAKECDDEV(maj, unit, part) MAKEDISKDEV(maj, unit, part)
@@ -112,8 +112,8 @@ struct cd_toc {
int cdmatch __P((struct device *, void *, void *));
void cdattach __P((struct device *, struct device *, void *));
-int cdactivate __P((struct device *, enum devact));
-int cddetach __P((struct device *, int));
+int cdactivate __P((struct device *, enum devact));
+int cddetach __P((struct device *, int));
void cdzeroref __P((struct device *));
void cdstart __P((void *));
@@ -130,7 +130,7 @@ int cd_play_msf __P((struct cd_softc *, int, int, int, int, int, int));
int cd_pause __P((struct cd_softc *, int));
int cd_reset __P((struct cd_softc *));
int cd_read_subchannel __P((struct cd_softc *, int, int, int,
- struct cd_sub_channel_info *, int ));
+ struct cd_sub_channel_info *, int ));
int cd_read_toc __P((struct cd_softc *, int, int, void *,
int, int ));
int cd_get_parms __P((struct cd_softc *, int));
@@ -248,33 +248,33 @@ cdattach(parent, self, aux)
int
cdactivate(self, act)
- struct device *self;
- enum devact act;
+ struct device *self;
+ enum devact act;
{
- int rv = 0;
-
- switch (act) {
- case DVACT_ACTIVATE:
- break;
-
- case DVACT_DEACTIVATE:
- /*
- * Nothing to do; we key off the device's DVF_ACTIVATE.
- */
- break;
- }
- return (rv);
+ int rv = 0;
+
+ switch (act) {
+ case DVACT_ACTIVATE:
+ break;
+
+ case DVACT_DEACTIVATE:
+ /*
+ * Nothing to do; we key off the device's DVF_ACTIVATE.
+ */
+ break;
+ }
+ return (rv);
}
int
cddetach(self, flags)
- struct device *self;
- int flags;
+ struct device *self;
+ int flags;
{
- struct cd_softc *sc = (struct cd_softc *)self;
- struct buf *dp, *bp;
- int s, bmaj, cmaj, mn;
+ struct cd_softc *sc = (struct cd_softc *)self;
+ struct buf *dp, *bp;
+ int s, bmaj, cmaj, mn;
/* Remove unprocessed buffers from queue */
s = splbio();
@@ -287,26 +287,26 @@ cddetach(self, flags)
}
splx(s);
- /* locate the major number */
- mn = CDMINOR(self->dv_unit, 0);
+ /* locate the major number */
+ mn = CDMINOR(self->dv_unit, 0);
- for (bmaj = 0; bmaj < nblkdev; bmaj++)
- if (bdevsw[bmaj].d_open == cdopen)
+ for (bmaj = 0; bmaj < nblkdev; bmaj++)
+ if (bdevsw[bmaj].d_open == cdopen)
vdevgone(bmaj, mn, mn + MAXPARTITIONS - 1, VBLK);
- for (cmaj = 0; cmaj < nchrdev; cmaj++)
- if (cdevsw[cmaj].d_open == cdopen)
+ for (cmaj = 0; cmaj < nchrdev; cmaj++)
+ if (cdevsw[cmaj].d_open == cdopen)
vdevgone(cmaj, mn, mn + MAXPARTITIONS - 1, VCHR);
- return (0);
+ return (0);
}
void
cdzeroref(self)
- struct device *self;
+ struct device *self;
{
- struct cd_softc *cd = (struct cd_softc *)self;
+ struct cd_softc *cd = (struct cd_softc *)self;
- /* Detach disk. */
- disk_detach(&cd->sc_dk);
+ /* Detach disk. */
+ disk_detach(&cd->sc_dk);
}
@@ -352,16 +352,15 @@ cdopen(dev, flag, fmt, p)
} else {
/* Check that it is still responding and ok. */
error = scsi_test_unit_ready(sc_link,
- SCSI_IGNORE_ILLEGAL_REQUEST |
- SCSI_IGNORE_MEDIA_CHANGE |
- SCSI_IGNORE_NOT_READY);
+ SCSI_IGNORE_ILLEGAL_REQUEST |
+ SCSI_IGNORE_MEDIA_CHANGE | SCSI_IGNORE_NOT_READY);
if (error)
goto bad3;
/* Start the pack spinning if necessary. */
error = scsi_start(sc_link, SSS_START,
- SCSI_IGNORE_ILLEGAL_REQUEST |
- SCSI_IGNORE_MEDIA_CHANGE | SCSI_SILENT);
+ SCSI_IGNORE_ILLEGAL_REQUEST |
+ SCSI_IGNORE_MEDIA_CHANGE | SCSI_SILENT);
if (error)
goto bad3;
@@ -369,8 +368,7 @@ cdopen(dev, flag, fmt, p)
/* Lock the pack in. */
error = scsi_prevent(sc_link, PR_PREVENT,
- SCSI_IGNORE_ILLEGAL_REQUEST |
- SCSI_IGNORE_MEDIA_CHANGE);
+ SCSI_IGNORE_ILLEGAL_REQUEST | SCSI_IGNORE_MEDIA_CHANGE);
if (error)
goto bad;
@@ -396,7 +394,7 @@ cdopen(dev, flag, fmt, p)
/* Check that the partition exists. */
if (part != RAW_PART &&
(part >= cd->sc_dk.dk_label->d_npartitions ||
- cd->sc_dk.dk_label->d_partitions[part].p_fstype == FS_UNUSED)) {
+ cd->sc_dk.dk_label->d_partitions[part].p_fstype == FS_UNUSED)) {
error = ENXIO;
goto bad;
}
@@ -642,8 +640,8 @@ cdstart(v)
blkno =
bp->b_blkno / (cd->sc_dk.dk_label->d_secsize / DEV_BSIZE);
if (CDPART(bp->b_dev) != RAW_PART) {
- p = &cd->sc_dk.dk_label->d_partitions[CDPART(bp->b_dev)];
- blkno += p->p_offset;
+ p = &cd->sc_dk.dk_label->d_partitions[CDPART(bp->b_dev)];
+ blkno += p->p_offset;
}
nblks = howmany(bp->b_bcount, cd->sc_dk.dk_label->d_secsize);
@@ -959,7 +957,7 @@ cdioctl(dev, cmd, addr, flag, p)
MALLOC (toc, struct cd_toc *, sizeof (struct cd_toc),
M_DEVBUF, M_WAITOK);
-
+
th = &toc->header;
if (len > sizeof(toc->entries) ||
@@ -983,7 +981,7 @@ cdioctl(dev, cmd, addr, flag, p)
if (cd->sc_link->quirks & ADEV_LITTLETOC) {
#if BYTE_ORDER == BIG_ENDIAN
swap16_multi((u_int16_t *)&cte->addr,
- sizeof(cte->addr) / 2);
+ sizeof(cte->addr) / 2);
#endif
} else
cte->addr.lba = ntohl(cte->addr.lba);
@@ -1025,7 +1023,7 @@ cdioctl(dev, cmd, addr, flag, p)
if (cd->sc_link->quirks & ADEV_LITTLETOC) {
#if BYTE_ORDER == BIG_ENDIAN
swap16_multi((u_int16_t *)&cte->addr,
- sizeof(cte->addr) / 2);
+ sizeof(cte->addr) / 2);
#endif
} else
cte->addr.lba = ntohl(cte->addr.lba);
@@ -1247,7 +1245,7 @@ cdgetdisklabel(dev, cd, lp, clp, spoofonly)
goto done;
/* Create the partition table. */
- /* Probably should sanity-check the drive's values */
+ /* Probably should sanity-check the drive's values */
toc_valid = 1;
ent = toc + TOC_HEADER_SZ;
lba = ((cd->sc_link->quirks & ADEV_LITTLETOC) ?
@@ -1602,7 +1600,7 @@ dvd_auth(cd, a)
cmd.bytes[8] = 8;
cmd.bytes[9] = 0 | (0 << 6);
error = scsi_scsi_cmd(cd->sc_link, &cmd, sizeof(cmd), buf, 8,
- CDRETRIES, 30000, NULL, SCSI_DATA_IN);
+ CDRETRIES, 30000, NULL, SCSI_DATA_IN);
if (error)
return (error);
a->lsa.agid = buf[7] >> 6;
@@ -1613,7 +1611,7 @@ dvd_auth(cd, a)
cmd.bytes[8] = 16;
cmd.bytes[9] = 1 | (a->lsc.agid << 6);
error = scsi_scsi_cmd(cd->sc_link, &cmd, sizeof(cmd), buf, 16,
- CDRETRIES, 30000, NULL, SCSI_DATA_IN);
+ CDRETRIES, 30000, NULL, SCSI_DATA_IN);
if (error)
return (error);
dvd_copy_challenge(a->lsc.chal, &buf[4]);
@@ -1624,7 +1622,7 @@ dvd_auth(cd, a)
cmd.bytes[8] = 12;
cmd.bytes[9] = 2 | (a->lsk.agid << 6);
error = scsi_scsi_cmd(cd->sc_link, &cmd, sizeof(cmd), buf, 12,
- CDRETRIES, 30000, NULL, SCSI_DATA_IN);
+ CDRETRIES, 30000, NULL, SCSI_DATA_IN);
if (error)
return (error);
dvd_copy_key(a->lsk.key, &buf[4]);
@@ -1636,7 +1634,7 @@ dvd_auth(cd, a)
cmd.bytes[8] = 12;
cmd.bytes[9] = 4 | (a->lstk.agid << 6);
error = scsi_scsi_cmd(cd->sc_link, &cmd, sizeof(cmd), buf, 12,
- CDRETRIES, 30000, NULL, SCSI_DATA_IN);
+ CDRETRIES, 30000, NULL, SCSI_DATA_IN);
if (error)
return (error);
a->lstk.cpm = (buf[4] >> 7) & 1;
@@ -1650,7 +1648,7 @@ dvd_auth(cd, a)
cmd.bytes[8] = 8;
cmd.bytes[9] = 5 | (a->lsasf.agid << 6);
error = scsi_scsi_cmd(cd->sc_link, &cmd, sizeof(cmd), buf, 8,
- CDRETRIES, 30000, NULL, SCSI_DATA_IN);
+ CDRETRIES, 30000, NULL, SCSI_DATA_IN);
if (error)
return (error);
a->lsasf.asf = buf[7] & 1;
@@ -1663,8 +1661,7 @@ dvd_auth(cd, a)
buf[1] = 14;
dvd_copy_challenge(&buf[4], a->hsc.chal);
error = scsi_scsi_cmd(cd->sc_link, &cmd, sizeof(cmd), buf, 16,
- CDRETRIES, 30000, NULL,
- SCSI_DATA_OUT);
+ CDRETRIES, 30000, NULL, SCSI_DATA_OUT);
if (error)
return (error);
a->type = DVD_LU_SEND_KEY1;
@@ -1677,8 +1674,7 @@ dvd_auth(cd, a)
buf[1] = 10;
dvd_copy_key(&buf[4], a->hsk.key);
error = scsi_scsi_cmd(cd->sc_link, &cmd, sizeof(cmd), buf, 12,
- CDRETRIES, 30000, NULL,
- SCSI_DATA_OUT);
+ CDRETRIES, 30000, NULL, SCSI_DATA_OUT);
if (error) {
a->type = DVD_AUTH_FAILURE;
return (error);
@@ -1690,7 +1686,7 @@ dvd_auth(cd, a)
cmd.opcode = GPCMD_REPORT_KEY;
cmd.bytes[9] = 0x3f | (a->lsa.agid << 6);
error = scsi_scsi_cmd(cd->sc_link, &cmd, sizeof(cmd), buf, 16,
- CDRETRIES, 30000, NULL, 0);
+ CDRETRIES, 30000, NULL, 0);
if (error)
return (error);
return (0);
@@ -1719,25 +1715,25 @@ dvd_read_physical(cd, s)
cmd.bytes[5] = s->physical.layer_num;
error = scsi_scsi_cmd(cd->sc_link, &cmd, sizeof(cmd), buf, sizeof(buf),
- CDRETRIES, 30000, NULL, SCSI_DATA_IN);
+ CDRETRIES, 30000, NULL, SCSI_DATA_IN);
if (error)
return (error);
for (i = 0, bufp = &buf[4], layer = &s->physical.layer[0]; i < 4;
- i++, bufp += 20, layer++) {
- bzero(layer, sizeof(*layer));
- layer->book_version = bufp[0] & 0xf;
- layer->book_type = bufp[0] >> 4;
- layer->min_rate = bufp[1] & 0xf;
- layer->disc_size = bufp[1] >> 4;
- layer->layer_type = bufp[2] & 0xf;
- layer->track_path = (bufp[2] >> 4) & 1;
- layer->nlayers = (bufp[2] >> 5) & 3;
- layer->track_density = bufp[3] & 0xf;
- layer->linear_density = bufp[3] >> 4;
- layer->start_sector = _4btol(&bufp[4]);
- layer->end_sector = _4btol(&bufp[8]);
- layer->end_sector_l0 = _4btol(&bufp[12]);
- layer->bca = bufp[16] >> 7;
+ i++, bufp += 20, layer++) {
+ bzero(layer, sizeof(*layer));
+ layer->book_version = bufp[0] & 0xf;
+ layer->book_type = bufp[0] >> 4;
+ layer->min_rate = bufp[1] & 0xf;
+ layer->disc_size = bufp[1] >> 4;
+ layer->layer_type = bufp[2] & 0xf;
+ layer->track_path = (bufp[2] >> 4) & 1;
+ layer->nlayers = (bufp[2] >> 5) & 3;
+ layer->track_density = bufp[3] & 0xf;
+ layer->linear_density = bufp[3] >> 4;
+ layer->start_sector = _4btol(&bufp[4]);
+ layer->end_sector = _4btol(&bufp[8]);
+ layer->end_sector_l0 = _4btol(&bufp[12]);
+ layer->bca = bufp[16] >> 7;
}
return (0);
}
@@ -1759,7 +1755,7 @@ dvd_read_copyright(cd, s)
cmd.bytes[5] = s->copyright.layer_num;
error = scsi_scsi_cmd(cd->sc_link, &cmd, sizeof(cmd), buf, sizeof(buf),
- CDRETRIES, 30000, NULL, SCSI_DATA_IN);
+ CDRETRIES, 30000, NULL, SCSI_DATA_IN);
if (error)
return (error);
s->copyright.cpst = buf[4];
@@ -1784,7 +1780,7 @@ dvd_read_disckey(cd, s)
cmd.bytes[9] = s->disckey.agid << 6;
error = scsi_scsi_cmd(cd->sc_link, &cmd, sizeof(cmd), buf, sizeof(buf),
- CDRETRIES, 30000, NULL, SCSI_DATA_IN);
+ CDRETRIES, 30000, NULL, SCSI_DATA_IN);
if (error)
return (error);
bcopy(&buf[4], s->disckey.value, 2048);
@@ -1807,7 +1803,7 @@ dvd_read_bca(cd, s)
_lto2b(sizeof(buf), &cmd.bytes[7]);
error = scsi_scsi_cmd(cd->sc_link, &cmd, sizeof(cmd), buf, sizeof(buf),
- CDRETRIES, 30000, NULL, SCSI_DATA_IN);
+ CDRETRIES, 30000, NULL, SCSI_DATA_IN);
if (error)
return (error);
s->bca.len = _2btol(&buf[0]);
@@ -1833,7 +1829,7 @@ dvd_read_manufact(cd, s)
_lto2b(sizeof(buf), &cmd.bytes[7]);
error = scsi_scsi_cmd(cd->sc_link, &cmd, sizeof(cmd), buf, sizeof(buf),
- CDRETRIES, 30000, NULL, SCSI_DATA_IN);
+ CDRETRIES, 30000, NULL, SCSI_DATA_IN);
if (error)
return (error);
s->manufact.len = _2btol(&buf[0]);
diff --git a/sys/scsi/cd_scsi.c b/sys/scsi/cd_scsi.c
index 1458049ea57..9f57e80327f 100644
--- a/sys/scsi/cd_scsi.c
+++ b/sys/scsi/cd_scsi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd_scsi.c,v 1.2 2000/07/18 06:26:29 csapuntz Exp $ */
+/* $OpenBSD: cd_scsi.c,v 1.3 2001/06/22 14:35:42 deraadt Exp $ */
/* $NetBSD: cd_scsi.c,v 1.14 1998/08/31 22:28:06 cgd Exp $ */
/*-
@@ -110,7 +110,7 @@ cd_scsibus_get_mode(cd, data, page, len, flags)
{
struct scsi_mode_sense scsi_cmd;
-#ifdef DIAGNOSTIC
+#ifdef DIAGNOSTIC
if (len == 0 || len > 256) {
printf ("cd_scsibus_get_mode: Mode page %02x request "
"bad size: %d bytes\n", page, len);
diff --git a/sys/scsi/cdvar.h b/sys/scsi/cdvar.h
index e2e075d887a..3e5331558be 100644
--- a/sys/scsi/cdvar.h
+++ b/sys/scsi/cdvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cdvar.h,v 1.1 1999/07/20 06:21:59 csapuntz Exp $ */
+/* $OpenBSD: cdvar.h,v 1.2 2001/06/22 14:35:42 deraadt Exp $ */
/* $NetBSD: cdvar.h,v 1.10 1999/02/02 13:02:49 bouyer Exp $ */
/*
@@ -45,7 +45,7 @@ struct cd_softc {
#define CDF_LABELLING 0x08 /* writing label */
#define CDF_ANCIENT 0x10 /* disk is ancient; for minphys */
#ifdef CDDA
-#define CDF_CDDA 0x20
+#define CDF_CDDA 0x20
#endif
struct scsi_link *sc_link; /* contains our targ, lun, etc. */
struct cd_parms {
diff --git a/sys/scsi/ch.c b/sys/scsi/ch.c
index f4f0ea2b590..8bb033d664b 100644
--- a/sys/scsi/ch.c
+++ b/sys/scsi/ch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ch.c,v 1.10 2001/03/15 20:08:43 mjacob Exp $ */
+/* $OpenBSD: ch.c,v 1.11 2001/06/22 14:35:42 deraadt Exp $ */
/* $NetBSD: ch.c,v 1.26 1997/02/21 22:06:52 thorpej Exp $ */
/*
@@ -86,7 +86,7 @@ struct ch_softc {
/*
* Quirks; see below.
*/
- int sc_settledelay; /* delay for settle */
+ int sc_settledelay; /* delay for settle */
};
@@ -419,9 +419,9 @@ ch_exchange(sc, ce)
* Check the request against the changer's capabilities.
*/
if (((sc->sc_exchangemask[ce->ce_srctype] &
- (1 << ce->ce_fdsttype)) == 0) ||
+ (1 << ce->ce_fdsttype)) == 0) ||
((sc->sc_exchangemask[ce->ce_fdsttype] &
- (1 << ce->ce_sdsttype)) == 0))
+ (1 << ce->ce_sdsttype)) == 0))
return (EINVAL);
/*
diff --git a/sys/scsi/scsi_all.h b/sys/scsi/scsi_all.h
index 5211bac8923..e7eed34422b 100644
--- a/sys/scsi/scsi_all.h
+++ b/sys/scsi/scsi_all.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi_all.h,v 1.10 2001/04/08 03:16:10 krw Exp $ */
+/* $OpenBSD: scsi_all.h,v 1.11 2001/06/22 14:35:42 deraadt Exp $ */
/* $NetBSD: scsi_all.h,v 1.10 1996/09/12 01:57:17 thorpej Exp $ */
/*
@@ -175,8 +175,8 @@ struct scsi_changedef {
#define MODE_SELECT 0x15
#define MODE_SENSE 0x1a
#define START_STOP 0x1b
-#define RESERVE 0x16
-#define RELEASE 0x17
+#define RESERVE 0x16
+#define RELEASE 0x17
#define PREVENT_ALLOW 0x1e
#define POSITION_TO_ELEMENT 0x2b
#define CHANGE_DEFINITION 0x40
@@ -273,22 +273,22 @@ struct scsi_sense_data {
/*32*/ u_int8_t extra_bytes[14];
};
-#define SKEY_NO_SENSE 0x00
-#define SKEY_RECOVERED_ERROR 0x01
-#define SKEY_NOT_READY 0x02
-#define SKEY_MEDIUM_ERROR 0x03
-#define SKEY_HARDWARE_ERROR 0x04
-#define SKEY_ILLEGAL_REQUEST 0x05
-#define SKEY_UNIT_ATTENTION 0x06
-#define SKEY_WRITE_PROTECT 0x07
-#define SKEY_BLANK_CHECK 0x08
-#define SKEY_VENDOR_UNIQUE 0x09
-#define SKEY_COPY_ABORTED 0x0A
-#define SKEY_ABORTED_COMMAND 0x0B
-#define SKEY_EQUAL 0x0C
-#define SKEY_VOLUME_OVERFLOW 0x0D
-#define SKEY_MISCOMPARE 0x0E
-#define SKEY_RESERVED 0x0F
+#define SKEY_NO_SENSE 0x00
+#define SKEY_RECOVERED_ERROR 0x01
+#define SKEY_NOT_READY 0x02
+#define SKEY_MEDIUM_ERROR 0x03
+#define SKEY_HARDWARE_ERROR 0x04
+#define SKEY_ILLEGAL_REQUEST 0x05
+#define SKEY_UNIT_ATTENTION 0x06
+#define SKEY_WRITE_PROTECT 0x07
+#define SKEY_BLANK_CHECK 0x08
+#define SKEY_VENDOR_UNIQUE 0x09
+#define SKEY_COPY_ABORTED 0x0A
+#define SKEY_ABORTED_COMMAND 0x0B
+#define SKEY_EQUAL 0x0C
+#define SKEY_VOLUME_OVERFLOW 0x0D
+#define SKEY_MISCOMPARE 0x0E
+#define SKEY_RESERVED 0x0F
struct scsi_blk_desc {
u_int8_t density;
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c
index 7606b015d85..b83822f1375 100644
--- a/sys/scsi/scsi_base.c
+++ b/sys/scsi/scsi_base.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi_base.c,v 1.28 2001/02/18 22:38:44 fgsch Exp $ */
+/* $OpenBSD: scsi_base.c,v 1.29 2001/06/22 14:35:42 deraadt Exp $ */
/* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */
/*
@@ -145,7 +145,7 @@ scsi_free_xs(xs, flags)
*/
static __inline struct scsi_xfer *
scsi_make_xs(sc_link, scsi_cmd, cmdlen, data_addr, datalen,
- retries, timeout, bp, flags)
+ retries, timeout, bp, flags)
struct scsi_link *sc_link;
struct scsi_generic *scsi_cmd;
int cmdlen;
@@ -239,7 +239,7 @@ scsi_test_unit_ready(sc_link, flags)
scsi_cmd.opcode = TEST_UNIT_READY;
return scsi_scsi_cmd(sc_link, (struct scsi_generic *) &scsi_cmd,
- sizeof(scsi_cmd), 0, 0, 5, 10000, NULL, flags);
+ sizeof(scsi_cmd), 0, 0, 5, 10000, NULL, flags);
}
/*
@@ -257,7 +257,7 @@ scsi_change_def(sc_link, flags)
scsi_cmd.how = SC_SCSI_2;
return scsi_scsi_cmd(sc_link, (struct scsi_generic *) &scsi_cmd,
- sizeof(scsi_cmd), 0, 0, 2, 100000, NULL, flags);
+ sizeof(scsi_cmd), 0, 0, 2, 100000, NULL, flags);
}
/*
@@ -277,9 +277,9 @@ scsi_inquire(sc_link, inqbuf, flags)
scsi_cmd.length = sizeof(struct scsi_inquiry_data);
return scsi_scsi_cmd(sc_link, (struct scsi_generic *) &scsi_cmd,
- sizeof(scsi_cmd), (u_char *) inqbuf,
- sizeof(struct scsi_inquiry_data), 2, 10000, NULL,
- SCSI_DATA_IN | flags);
+ sizeof(scsi_cmd), (u_char *) inqbuf,
+ sizeof(struct scsi_inquiry_data), 2, 10000, NULL,
+ SCSI_DATA_IN | flags);
}
/*
@@ -296,7 +296,7 @@ scsi_prevent(sc_link, type, flags)
scsi_cmd.opcode = PREVENT_ALLOW;
scsi_cmd.how = type;
return scsi_scsi_cmd(sc_link, (struct scsi_generic *) &scsi_cmd,
- sizeof(scsi_cmd), 0, 0, 2, 5000, NULL, flags);
+ sizeof(scsi_cmd), 0, 0, 2, 5000, NULL, flags);
}
/*
@@ -317,8 +317,8 @@ scsi_start(sc_link, type, flags)
scsi_cmd.byte2 = 0x00;
scsi_cmd.how = type;
return scsi_scsi_cmd(sc_link, (struct scsi_generic *) &scsi_cmd,
- sizeof(scsi_cmd), 0, 0, 2,
- type == SSS_START ? 30000 : 10000, NULL, flags);
+ sizeof(scsi_cmd), 0, 0, 2,
+ type == SSS_START ? 30000 : 10000, NULL, flags);
}
/*
@@ -578,14 +578,14 @@ sc_err1(xs, async)
error = EIO;
break;
- case XS_RESET:
- if (xs->retries) {
- SC_DEBUG(xs->sc_link, SDEV_DB3,
- ("restarting command destroyed by reset\n"));
- goto retry;
- }
- error = EIO;
- break;
+ case XS_RESET:
+ if (xs->retries) {
+ SC_DEBUG(xs->sc_link, SDEV_DB3,
+ ("restarting command destroyed by reset\n"));
+ goto retry;
+ }
+ error = EIO;
+ break;
default:
sc_print_addr(xs->sc_link);
@@ -701,8 +701,8 @@ scsi_interpret_sense(xs)
break;
case SKEY_UNIT_ATTENTION:
if (sense->add_sense_code == 0x29 &&
- sense->add_sense_code_qual == 0x00)
- return (ERESTART); /* device or bus reset */
+ sense->add_sense_code_qual == 0x00)
+ return (ERESTART); /* device or bus reset */
if ((sc_link->flags & SDEV_REMOVABLE) != 0)
sc_link->flags &= ~SDEV_MEDIA_LOADED;
if ((xs->flags & SCSI_IGNORE_MEDIA_CHANGE) != 0 ||
@@ -1235,7 +1235,7 @@ show_scsi_cmd(xs)
struct scsi_xfer *xs;
{
u_char *b = (u_char *) xs->cmd;
- int i = 0;
+ int i = 0;
sc_print_addr(xs->sc_link);
printf("command: ");
diff --git a/sys/scsi/scsi_cd.h b/sys/scsi/scsi_cd.h
index 0821f8b8c6a..fa45c6981d1 100644
--- a/sys/scsi/scsi_cd.h
+++ b/sys/scsi/scsi_cd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi_cd.h,v 1.5 1999/07/20 06:21:59 csapuntz Exp $ */
+/* $OpenBSD: scsi_cd.h,v 1.6 2001/06/22 14:35:42 deraadt Exp $ */
/* $NetBSD: scsi_cd.h,v 1.6 1996/03/19 03:06:39 mycroft Exp $ */
/*
@@ -21,33 +21,33 @@
#define _SCSI_SCSI_CD_H 1
struct scsi_cd_write_params_page {
- u_int8_t page_code;
- u_int8_t page_len;
- u_int8_t write_type;
-#define WRITE_TYPE_DUMMY 0x10 /* do not actually write blocks */
-#define WRITE_TYPE_MASK 0x0f /* session write type */
- u_int8_t track_mode;
-#define TRACK_MODE_MULTI_SESS 0xc0 /* multisession write type */
-#define TRACK_MODE_FP 0x20 /* fixed packet (if in packet mode) */
-#define TRACK_MODE_COPY 0x10 /* 1st higher gen of copy prot track */
-#define TRACK_MODE_PREEPMPASIS 0x01 /* audio w/ preemphasis (audio) */
-#define TRACK_MODE_INCREMENTAL 0x01 /* incremental data track (data) */
-#define TRACK_MODE_ALLOW_COPY 0x02 /* digital copy is permitted */
-#define TRACK_MODE_DATA 0x04 /* this is a data track */
-#define TRACK_MODE_4CHAN 0x08 /* four channel audio */
- u_int8_t dbtype;
-#define DBTYPE_MASK 0x0f /* data block type */
- u_int8_t reserved1[2];
- u_int8_t host_appl_code;
-#define HOST_APPL_CODE_MASK 0x3f /* host application code of disk */
- u_int8_t session_format;
- u_int8_t reserved2;
- u_int8_t packet_size[4];
- u_int8_t audio_pause_len[2];
- u_int8_t media_cat_number[16];
- u_int8_t isrc[14];
- u_int8_t sub_header[4];
- u_int8_t vendir_unique[4];
+ u_int8_t page_code;
+ u_int8_t page_len;
+ u_int8_t write_type;
+#define WRITE_TYPE_DUMMY 0x10 /* do not actually write blocks */
+#define WRITE_TYPE_MASK 0x0f /* session write type */
+ u_int8_t track_mode;
+#define TRACK_MODE_MULTI_SESS 0xc0 /* multisession write type */
+#define TRACK_MODE_FP 0x20 /* fixed packet (if in packet mode) */
+#define TRACK_MODE_COPY 0x10 /* 1st higher gen of copy prot track */
+#define TRACK_MODE_PREEPMPASIS 0x01 /* audio w/ preemphasis (audio) */
+#define TRACK_MODE_INCREMENTAL 0x01 /* incremental data track (data) */
+#define TRACK_MODE_ALLOW_COPY 0x02 /* digital copy is permitted */
+#define TRACK_MODE_DATA 0x04 /* this is a data track */
+#define TRACK_MODE_4CHAN 0x08 /* four channel audio */
+ u_int8_t dbtype;
+#define DBTYPE_MASK 0x0f /* data block type */
+ u_int8_t reserved1[2];
+ u_int8_t host_appl_code;
+#define HOST_APPL_CODE_MASK 0x3f /* host application code of disk */
+ u_int8_t session_format;
+ u_int8_t reserved2;
+ u_int8_t packet_size[4];
+ u_int8_t audio_pause_len[2];
+ u_int8_t media_cat_number[16];
+ u_int8_t isrc[14];
+ u_int8_t sub_header[4];
+ u_int8_t vendir_unique[4];
};
#ifdef CDDA
@@ -68,8 +68,8 @@ struct scsi_cd_write_params_page {
#endif /* CDDA */
union scsi_cd_pages {
- struct scsi_cd_write_params_page write_params;
- struct cd_audio_page audio;
+ struct scsi_cd_write_params_page write_params;
+ struct cd_audio_page audio;
};
struct scsi_cd_mode_data {
@@ -79,8 +79,8 @@ struct scsi_cd_mode_data {
};
#define AUDIOPAGESIZE \
- (sizeof(struct scsi_mode_header) + sizeof(struct scsi_blk_desc) \
- + sizeof(struct cd_audio_page))
+ (sizeof(struct scsi_mode_header) + sizeof(struct scsi_blk_desc) \
+ + sizeof(struct cd_audio_page))
#endif /*_SCSI_SCSI_CD_H*/
diff --git a/sys/scsi/scsi_disk.h b/sys/scsi/scsi_disk.h
index 25de75a7992..33d8cfbbc29 100644
--- a/sys/scsi/scsi_disk.h
+++ b/sys/scsi/scsi_disk.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi_disk.h,v 1.10 2001/01/29 02:33:17 csapuntz Exp $ */
+/* $OpenBSD: scsi_disk.h,v 1.11 2001/06/22 14:35:43 deraadt Exp $ */
/* $NetBSD: scsi_disk.h,v 1.10 1996/07/05 16:19:05 christos Exp $ */
/*
@@ -149,7 +149,7 @@ struct scsi_reassign_blocks {
* XXX Is this also used by ATAPI?
*/
#define REZERO_UNIT 0x01
-#define SCSI_REZERO_UNIT 0x01
+#define SCSI_REZERO_UNIT 0x01
struct scsi_rezero_unit {
u_int8_t opcode;
u_int8_t byte2;
@@ -217,20 +217,20 @@ struct scsi_synchronize_cache {
*/
#define REASSIGN_BLOCKS 0x07
#define READ_COMMAND 0x08
-#define SCSI_READ_COMMAND 0x08
-#define WRITE_COMMAND 0x0a
-#define SCSI_WRITE_COMMAND 0x0a
-#define MODE_SELECT 0x15
-#define SCSI_MODE_SELECT 0x15
+#define SCSI_READ_COMMAND 0x08
+#define WRITE_COMMAND 0x0a
+#define SCSI_WRITE_COMMAND 0x0a
+#define MODE_SELECT 0x15
+#define SCSI_MODE_SELECT 0x15
#define MODE_SENSE 0x1a
#define START_STOP 0x1b
-#define PREVENT_ALLOW 0x1e
-#define READ_CAPACITY 0x25
+#define PREVENT_ALLOW 0x1e
+#define READ_CAPACITY 0x25
#define READ_BIG 0x28
#define WRITE_BIG 0x2a
#define SYNCHRONIZE_CACHE 0x35
-#define SCSI_MODE_SELECT_BIG 0x55
-#define SCSI_MODE_SENSE_BIG 0x5a
+#define SCSI_MODE_SELECT_BIG 0x55
+#define SCSI_MODE_SENSE_BIG 0x5a
struct scsi_read_cap_data {
diff --git a/sys/scsi/scsi_ioctl.c b/sys/scsi/scsi_ioctl.c
index 4c464645dee..eb4c1918f27 100644
--- a/sys/scsi/scsi_ioctl.c
+++ b/sys/scsi/scsi_ioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi_ioctl.c,v 1.12 2001/04/30 21:21:54 csapuntz Exp $ */
+/* $OpenBSD: scsi_ioctl.c,v 1.13 2001/06/22 14:35:43 deraadt Exp $ */
/* $NetBSD: scsi_ioctl.c,v 1.23 1996/10/12 23:23:17 christos Exp $ */
/*
@@ -364,7 +364,7 @@ scsi_do_ioctl(sc_link, dev, cmd, addr, flag, p)
if ((flag & FWRITE) == 0)
return EBADF;
scsi_scsi_cmd(sc_link, 0, 0, 0, 0, GENRETRY, 2000, NULL,
- SCSI_RESET);
+ SCSI_RESET);
return 0;
}
default:
diff --git a/sys/scsi/scsi_scanner.h b/sys/scsi/scsi_scanner.h
index c25f2289a33..853adc38c8c 100644
--- a/sys/scsi/scsi_scanner.h
+++ b/sys/scsi/scsi_scanner.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi_scanner.h,v 1.8 1999/05/11 23:25:43 kstailey Exp $ */
+/* $OpenBSD: scsi_scanner.h,v 1.9 2001/06/22 14:35:43 deraadt Exp $ */
/*
* Copyright (c) 1995 Kenneth Stailey. All rights reserved.
@@ -100,9 +100,9 @@ struct scsi_set_window {
};
struct scsi_window_data {
- u_int8_t reserved[6]; /* window header */
- u_int8_t window_desc_len[2]; /* ditto */
- u_int8_t window_id; /* must be zero */
+ u_int8_t reserved[6]; /* window header */
+ u_int8_t window_desc_len[2]; /* ditto */
+ u_int8_t window_id; /* must be zero */
u_int8_t res1:7;
u_int8_t auto_bit:1;
u_int8_t x_res[2];
@@ -114,10 +114,10 @@ struct scsi_window_data {
u_int8_t brightness;
u_int8_t threshold;
u_int8_t contrast;
- u_int8_t image_comp; /* image composition (data type) */
+ u_int8_t image_comp; /* image composition (data type) */
u_int8_t bits_per_pixel;
u_int8_t halftone_pattern[2];
- u_int8_t rif:1; /* reverse image format (mono negative) */
+ u_int8_t rif:1; /* reverse image format (mono negative) */
u_int8_t res2:4;
u_int8_t pad_type:3;
u_int8_t bit_ordering[2];
diff --git a/sys/scsi/scsiconf.c b/sys/scsi/scsiconf.c
index 2aa63670e2a..523d94521c9 100644
--- a/sys/scsi/scsiconf.c
+++ b/sys/scsi/scsiconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsiconf.c,v 1.56 2001/05/24 04:13:16 angelos Exp $ */
+/* $OpenBSD: scsiconf.c,v 1.57 2001/06/22 14:35:43 deraadt Exp $ */
/* $NetBSD: scsiconf.c,v 1.57 1996/05/02 01:09:01 neil Exp $ */
/*
@@ -134,8 +134,8 @@ scsiprint(aux, pnp)
int
scsibusmatch(parent, match, aux)
- struct device *parent;
- void *match, *aux;
+ struct device *parent;
+ void *match, *aux;
{
return 1;
@@ -147,8 +147,8 @@ scsibusmatch(parent, match, aux)
*/
void
scsibusattach(parent, self, aux)
- struct device *parent, *self;
- void *aux;
+ struct device *parent, *self;
+ void *aux;
{
struct scsibus_softc *sb = (struct scsibus_softc *)self;
struct scsi_link *sc_link_proto = aux;
@@ -619,7 +619,7 @@ struct scsi_quirk_inquiry_pattern scsi_quirk_patterns[] = {
*/
int
scsibusprint(aux, pnp)
- void *aux;
+ void *aux;
const char *pnp;
{
struct scsibus_attach_args *sa = aux;
@@ -635,11 +635,11 @@ scsibusprint(aux, pnp)
inqbuf = sa->sa_inqbuf;
- target = sa->sa_sc_link->target;
- lun = sa->sa_sc_link->lun;
+ target = sa->sa_sc_link->target;
+ lun = sa->sa_sc_link->lun;
- type = inqbuf->device & SID_TYPE;
- removable = inqbuf->dev_qual2 & SID_REMOVABLE ? 1 : 0;
+ type = inqbuf->device & SID_TYPE;
+ removable = inqbuf->dev_qual2 & SID_REMOVABLE ? 1 : 0;
/*
* Figure out basic device type and qualifier.
@@ -706,14 +706,14 @@ scsibusprint(aux, pnp)
}
}
- scsi_strvis(vendor, inqbuf->vendor, 8);
- scsi_strvis(product, inqbuf->product, 16);
- scsi_strvis(revision, inqbuf->revision, 4);
+ scsi_strvis(vendor, inqbuf->vendor, 8);
+ scsi_strvis(product, inqbuf->product, 16);
+ scsi_strvis(revision, inqbuf->revision, 4);
- printf(" targ %d lun %d: <%s, %s, %s> SCSI%d %d/%s %s%s",
- target, lun, vendor, product, revision,
- inqbuf->version & SID_ANSII, type, dtype,
- removable ? "removable" : "fixed", qtype);
+ printf(" targ %d lun %d: <%s, %s, %s> SCSI%d %d/%s %s%s",
+ target, lun, vendor, product, revision,
+ inqbuf->version & SID_ANSII, type, dtype,
+ removable ? "removable" : "fixed", qtype);
return (UNCONF);
}
diff --git a/sys/scsi/scsiconf.h b/sys/scsi/scsiconf.h
index d5779e26558..34976bea001 100644
--- a/sys/scsi/scsiconf.h
+++ b/sys/scsi/scsiconf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsiconf.h,v 1.26 2001/04/30 21:21:54 csapuntz Exp $ */
+/* $OpenBSD: scsiconf.h,v 1.27 2001/06/22 14:35:43 deraadt Exp $ */
/* $NetBSD: scsiconf.h,v 1.35 1997/04/02 02:29:38 mycroft Exp $ */
/*
@@ -105,8 +105,8 @@ struct scsi_adapter {
void (*scsi_minphys) __P((struct buf *));
int (*open_target_lu) __P((void));
int (*close_target_lu) __P((void));
- int (*ioctl) __P((struct scsi_link *, u_long cmd,
- caddr_t addrp, int flag));
+ int (*ioctl) __P((struct scsi_link *, u_long cmd,
+ caddr_t addrp, int flag));
};
/*
@@ -122,9 +122,9 @@ struct scsi_adapter {
* or one of these three items.
*/
-#define SCSIRET_NOERROR 0 /* No Error */
-#define SCSIRET_RETRY -1 /* Retry the command that got this sense */
-#define SCSIRET_CONTINUE -2 /* Continue with standard sense processing */
+#define SCSIRET_NOERROR 0 /* No Error */
+#define SCSIRET_RETRY -1 /* Retry the command that got this sense */
+#define SCSIRET_CONTINUE -2 /* Continue with standard sense processing */
/*
* These entry points are called by the low-end drivers to get services from
@@ -168,23 +168,23 @@ struct scsi_link {
#define SDEV_OPEN 0x0008 /* at least 1 open session */
#define SDEV_DBX 0x00f0 /* debuging flags (scsi_debug.h) */
#define SDEV_EJECTING 0x0100 /* eject on device close */
-#define SDEV_ATAPI 0x0200 /* device is ATAPI */
+#define SDEV_ATAPI 0x0200 /* device is ATAPI */
#define SDEV_2NDBUS 0x0400 /* device is a 'second' bus device */
u_int16_t quirks; /* per-device oddities */
-#define SDEV_AUTOSAVE 0x0001 /* do implicit SAVEDATAPOINTER on disconnect */
-#define SDEV_NOSYNC 0x0002 /* does not grok SDTR */
-#define SDEV_NOWIDE 0x0004 /* does not grok WDTR */
-#define SDEV_NOTAGS 0x0008 /* lies about having tagged queueing */
-#define SDEV_NOLUNS 0x0010 /* does not grok LUNs */
-#define SDEV_FORCELUNS 0x0020 /* prehistoric drive/ctlr groks LUNs */
-#define SDEV_NOMODESENSE 0x0040 /* removable media/optical drives */
-#define SDEV_NOSTARTUNIT 0x0080 /* do not issue start unit requests in sd.c */
-#define SDEV_NOSYNCCACHE 0x0100 /* no SYNCHRONIZE_CACHE */
-#define ADEV_NOSENSE 0x0200 /* No request sense - ATAPI */
-#define ADEV_LITTLETOC 0x0400 /* little-endian TOC - ATAPI */
-#define ADEV_NOCAPACITY 0x0800
-#define ADEV_NOTUR 0x1000
-#define ADEV_NODOORLOCK 0x2000
+#define SDEV_AUTOSAVE 0x0001 /* do implicit SAVEDATAPOINTER on disconnect */
+#define SDEV_NOSYNC 0x0002 /* does not grok SDTR */
+#define SDEV_NOWIDE 0x0004 /* does not grok WDTR */
+#define SDEV_NOTAGS 0x0008 /* lies about having tagged queueing */
+#define SDEV_NOLUNS 0x0010 /* does not grok LUNs */
+#define SDEV_FORCELUNS 0x0020 /* prehistoric drive/ctlr groks LUNs */
+#define SDEV_NOMODESENSE 0x0040 /* removable media/optical drives */
+#define SDEV_NOSTARTUNIT 0x0080 /* do not issue start unit requests in sd.c */
+#define SDEV_NOSYNCCACHE 0x0100 /* no SYNCHRONIZE_CACHE */
+#define ADEV_NOSENSE 0x0200 /* No request sense - ATAPI */
+#define ADEV_LITTLETOC 0x0400 /* little-endian TOC - ATAPI */
+#define ADEV_NOCAPACITY 0x0800
+#define ADEV_NOTUR 0x1000
+#define ADEV_NODOORLOCK 0x2000
u_int8_t inquiry_flags; /* copy of flags from probe INQUIRY */
struct scsi_device *device; /* device entry points etc. */
void *device_softc; /* needed for call to foo_start */
@@ -284,7 +284,7 @@ struct scsi_xfer {
#define SCSI_DATA_OUT 0x01000 /* expect data to flow OUT of memory */
#define SCSI_TARGET 0x02000 /* This defines a TARGET mode op. */
#define SCSI_ESCAPE 0x04000 /* Escape operation */
-#define SCSI_URGENT 0x08000 /* Urgent operation (e.g., HTAG) */
+#define SCSI_URGENT 0x08000 /* Urgent operation (e.g., HTAG) */
#define SCSI_PRIVATE 0xf0000 /* private to each HBA flags */
/*
@@ -305,8 +305,8 @@ struct scsi_xfer {
#define XS_SELTIMEOUT 3 /* The device timed out.. turned off? */
#define XS_TIMEOUT 4 /* The Timeout reported was caught by SW */
#define XS_BUSY 5 /* The device busy, try again later? */
-#define XS_SHORTSENSE 6 /* Check the ATAPI sense for the error */
-#define XS_RESET 8 /* bus was reset; possible retry command */
+#define XS_SHORTSENSE 6 /* Check the ATAPI sense for the error */
+#define XS_RESET 8 /* bus was reset; possible retry command */
caddr_t scsi_inqmatch __P((struct scsi_inquiry_data *, caddr_t, int,
int, int *));
@@ -391,8 +391,7 @@ _2btol(bytes)
{
register u_int32_t rv;
- rv = (bytes[0] << 8) |
- bytes[1];
+ rv = (bytes[0] << 8) | bytes[1];
return (rv);
}
@@ -402,9 +401,7 @@ _3btol(bytes)
{
register u_int32_t rv;
- rv = (bytes[0] << 16) |
- (bytes[1] << 8) |
- bytes[2];
+ rv = (bytes[0] << 16) | (bytes[1] << 8) | bytes[2];
return (rv);
}
@@ -414,10 +411,8 @@ _4btol(bytes)
{
register u_int32_t rv;
- rv = (bytes[0] << 24) |
- (bytes[1] << 16) |
- (bytes[2] << 8) |
- bytes[3];
+ rv = (bytes[0] << 24) | (bytes[1] << 16) |
+ (bytes[2] << 8) | bytes[3];
return (rv);
}
@@ -460,8 +455,7 @@ _2ltol(bytes)
{
register u_int32_t rv;
- rv = bytes[0] |
- (bytes[1] << 8);
+ rv = bytes[0] | (bytes[1] << 8);
return (rv);
}
@@ -471,9 +465,7 @@ _3ltol(bytes)
{
register u_int32_t rv;
- rv = bytes[0] |
- (bytes[1] << 8) |
- (bytes[2] << 16);
+ rv = bytes[0] | (bytes[1] << 8) | (bytes[2] << 16);
return (rv);
}
@@ -483,10 +475,8 @@ _4ltol(bytes)
{
register u_int32_t rv;
- rv = bytes[0] |
- (bytes[1] << 8) |
- (bytes[2] << 16) |
- (bytes[3] << 24);
+ rv = bytes[0] | (bytes[1] << 8) |
+ (bytes[2] << 16) | (bytes[3] << 24);
return (rv);
}
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index 49b59a83136..756ea472e6a 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sd.c,v 1.47 2000/12/13 15:33:24 mickey Exp $ */
+/* $OpenBSD: sd.c,v 1.48 2001/06/22 14:35:43 deraadt Exp $ */
/* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */
/*-
@@ -382,18 +382,17 @@ sdopen(dev, flag, fmt, p)
} else {
/* Check that it is still responding and ok. */
error = scsi_test_unit_ready(sc_link,
- SCSI_IGNORE_ILLEGAL_REQUEST |
- SCSI_IGNORE_MEDIA_CHANGE |
- SCSI_IGNORE_NOT_READY);
+ SCSI_IGNORE_ILLEGAL_REQUEST |
+ SCSI_IGNORE_MEDIA_CHANGE |
+ SCSI_IGNORE_NOT_READY);
if (error)
goto bad3;
/* Start the pack spinning if necessary. */
if ((sc_link->quirks & SDEV_NOSTARTUNIT) == 0) {
error = scsi_start(sc_link, SSS_START,
- SCSI_IGNORE_ILLEGAL_REQUEST |
- SCSI_IGNORE_MEDIA_CHANGE |
- SCSI_SILENT);
+ SCSI_IGNORE_ILLEGAL_REQUEST |
+ SCSI_IGNORE_MEDIA_CHANGE | SCSI_SILENT);
if (error)
goto bad3;
}
@@ -402,8 +401,7 @@ sdopen(dev, flag, fmt, p)
/* Lock the pack in. */
error = scsi_prevent(sc_link, PR_PREVENT,
- SCSI_IGNORE_ILLEGAL_REQUEST |
- SCSI_IGNORE_MEDIA_CHANGE);
+ SCSI_IGNORE_ILLEGAL_REQUEST | SCSI_IGNORE_MEDIA_CHANGE);
if (error)
goto bad;
@@ -430,7 +428,7 @@ sdopen(dev, flag, fmt, p)
/* Check that the partition exists. */
if (part != RAW_PART &&
(part >= sd->sc_dk.dk_label->d_npartitions ||
- sd->sc_dk.dk_label->d_partitions[part].p_fstype == FS_UNUSED)) {
+ sd->sc_dk.dk_label->d_partitions[part].p_fstype == FS_UNUSED)) {
error = ENXIO;
goto bad;
}
@@ -680,8 +678,8 @@ sdstart(v)
blkno =
bp->b_blkno / (sd->sc_dk.dk_label->d_secsize / DEV_BSIZE);
if (SDPART(bp->b_dev) != RAW_PART) {
- p = &sd->sc_dk.dk_label->d_partitions[SDPART(bp->b_dev)];
- blkno += p->p_offset;
+ p = &sd->sc_dk.dk_label->d_partitions[SDPART(bp->b_dev)];
+ blkno += p->p_offset;
}
nblks = howmany(bp->b_bcount, sd->sc_dk.dk_label->d_secsize);
diff --git a/sys/scsi/sdvar.h b/sys/scsi/sdvar.h
index 5cecac31811..f4ca0297e0d 100644
--- a/sys/scsi/sdvar.h
+++ b/sys/scsi/sdvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdvar.h,v 1.1 1999/07/25 07:09:20 csapuntz Exp $ */
+/* $OpenBSD: sdvar.h,v 1.2 2001/06/22 14:35:43 deraadt Exp $ */
/* $NetBSD: sdvar.h,v 1.7 1998/08/17 00:49:03 mycroft Exp $ */
/*-
@@ -81,11 +81,11 @@ struct sd_softc {
} params;
struct buf buf_queue;
u_int8_t type;
- struct disk_name {
- char vendor[9]; /* disk vendor/manufacturer */
- char product[17]; /* disk product model */
- char revision[5]; /* drive/firmware revision */
- } name;
+ struct disk_name {
+ char vendor[9]; /* disk vendor/manufacturer */
+ char product[17]; /* disk product model */
+ char revision[5]; /* drive/firmware revision */
+ } name;
const struct sd_ops *sc_ops; /* our bus-dependent ops vector */
void *sc_sdhook; /* our shutdown hook */
diff --git a/sys/scsi/ses.c b/sys/scsi/ses.c
index 03656019f52..fe9934e42e6 100644
--- a/sys/scsi/ses.c
+++ b/sys/scsi/ses.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ses.c,v 1.1 2000/02/21 08:23:30 mjacob Exp $ */
+/* $OpenBSD: ses.c,v 1.2 2001/06/22 14:35:43 deraadt Exp $ */
/* $NetBSD: ses.c,v 1.3 2000/01/21 21:19:57 mjacob Exp $ */
/*
* Copyright (C) 2000 National Aeronautics & Space Administration
@@ -272,7 +272,7 @@ ses_attach(parent, self, aux)
switch (softc->ses_type) {
case SES_SES:
case SES_SES_SCSI2:
- case SES_SES_PASSTHROUGH:
+ case SES_SES_PASSTHROUGH:
softc->ses_vec.softc_init = ses_softc_init;
softc->ses_vec.init_enc = ses_init_enc;
softc->ses_vec.get_encstat = ses_get_encstat;
@@ -280,7 +280,7 @@ ses_attach(parent, self, aux)
softc->ses_vec.get_objstat = ses_get_objstat;
softc->ses_vec.set_objstat = ses_set_objstat;
break;
- case SES_SAFT:
+ case SES_SAFT:
softc->ses_vec.softc_init = safte_softc_init;
softc->ses_vec.init_enc = safte_init_enc;
softc->ses_vec.get_encstat = safte_get_encstat;
@@ -288,7 +288,7 @@ ses_attach(parent, self, aux)
softc->ses_vec.get_objstat = safte_get_objstat;
softc->ses_vec.set_objstat = safte_set_objstat;
break;
- case SES_SEN:
+ case SES_SEN:
break;
case SES_NONE:
default:
@@ -306,13 +306,13 @@ ses_attach(parent, self, aux)
case SES_SES:
tname = "SCSI-3 SES Device";
break;
- case SES_SES_PASSTHROUGH:
+ case SES_SES_PASSTHROUGH:
tname = "SES Passthrough Device";
break;
- case SES_SEN:
+ case SES_SEN:
tname = "UNISYS SEN Device (NOT HANDLED YET)";
break;
- case SES_SAFT:
+ case SES_SAFT:
tname = "SAF-TE Compliant Device";
break;
}
@@ -392,7 +392,7 @@ sesopen(dev, flags, fmt, p)
}
error = scsipi_adapter_addref(softc->sc_link);
if (error != 0)
- goto out;
+ goto out;
softc->ses_flags |= SES_FLAG_OPEN;
@@ -436,7 +436,7 @@ sesioctl(dev, cmd, arg_addr, flag, p)
dev_t dev;
u_long cmd;
caddr_t arg_addr;
- int flag;
+ int flag;
struct proc *p;
{
ses_encstat tmp;
diff --git a/sys/scsi/ss.c b/sys/scsi/ss.c
index e1e2dbb425e..4862230a038 100644
--- a/sys/scsi/ss.c
+++ b/sys/scsi/ss.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ss.c,v 1.42 2001/03/25 04:23:45 fgsch Exp $ */
+/* $OpenBSD: ss.c,v 1.43 2001/06/22 14:35:43 deraadt Exp $ */
/* $NetBSD: ss.c,v 1.10 1996/05/05 19:52:55 christos Exp $ */
/*
@@ -767,7 +767,7 @@ ss_set_window(ss, sio)
bzero(&window_data, sizeof(window_data));
if (ss->quirkdata->quirks & SS_Q_WINDOW_DESC_LEN)
_lto2l(ss->quirkdata->window_descriptor_length,
- window_data.window_desc_len);
+ window_data.window_desc_len);
else
_lto2l(40L, window_data.window_desc_len);
@@ -857,11 +857,11 @@ ss_set_window(ss, sio)
else
/* send the command to the scanner */
return (scsi_scsi_cmd(sc_link,
- (struct scsi_generic *)&window_cmd,
- sizeof(window_cmd), (u_char *) &wd.window_data,
- (ss->quirkdata->quirks & SS_Q_WINDOW_DESC_LEN) ?
- ss->quirkdata->window_descriptor_length : 40,
- 4, 5000, NULL, SCSI_DATA_OUT));
+ (struct scsi_generic *)&window_cmd,
+ sizeof(window_cmd), (u_char *) &wd.window_data,
+ (ss->quirkdata->quirks & SS_Q_WINDOW_DESC_LEN) ?
+ ss->quirkdata->window_descriptor_length : 40,
+ 4, 5000, NULL, SCSI_DATA_OUT));
}
int
diff --git a/sys/scsi/ss_scanjet.c b/sys/scsi/ss_scanjet.c
index 6697faaa2e3..828da1203b5 100644
--- a/sys/scsi/ss_scanjet.c
+++ b/sys/scsi/ss_scanjet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ss_scanjet.c,v 1.22 2001/03/25 04:23:46 fgsch Exp $ */
+/* $OpenBSD: ss_scanjet.c,v 1.23 2001/06/22 14:35:43 deraadt Exp $ */
/* $NetBSD: ss_scanjet.c,v 1.6 1996/05/18 22:58:01 christos Exp $ */
/*
@@ -363,15 +363,16 @@ scanjet_ctl_read(ss, buf, size, flags)
#ifdef SCANJETDEBUG
static void show_es(char *es)
{
- char *p = es;
- while (*p) {
- if (*p == '\033')
- printf("[Esc]");
- else
- printf("%c", *p);
- ++p;
- }
- printf("\n");
+ char *p = es;
+
+ while (*p) {
+ if (*p == '\033')
+ printf("[Esc]");
+ else
+ printf("%c", *p);
+ ++p;
+ }
+ printf("\n");
}
#endif
@@ -393,7 +394,7 @@ scanjet_set_window(ss, flags)
p += sprintf(p, "\033*f%ldY", ss->sio.scan_y_origin / 4);
p += sprintf(p, "\033*a%dR", ss->sio.scan_x_resolution);
p += sprintf(p, "\033*a%dS", ss->sio.scan_y_resolution);
-
+
switch (ss->sio.scan_image_mode) {
case SIM_BINARY_MONOCHROME:
ss->sio.scan_bits_per_pixel = 1;
diff --git a/sys/scsi/ssvar.h b/sys/scsi/ssvar.h
index df6b050821a..c626a463b69 100644
--- a/sys/scsi/ssvar.h
+++ b/sys/scsi/ssvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssvar.h,v 1.7 1997/03/10 02:29:41 kstailey Exp $ */
+/* $OpenBSD: ssvar.h,v 1.8 2001/06/22 14:35:43 deraadt Exp $ */
/* $NetBSD: ssvar.h,v 1.2 1996/03/30 21:47:11 christos Exp $ */
/*
@@ -65,10 +65,10 @@ struct ss_softc {
int flags;
#define SSF_TRIGGERED 0x01 /* read operation has been primed */
#define SSF_LOADED 0x02 /* parameters loaded */
- struct scsi_link *sc_link; /* contains our targ, lun, etc. */
+ struct scsi_link *sc_link; /* contains our targ, lun, etc. */
struct scan_io sio;
struct buf buf_queue; /* the queue of pending IO operations */
- struct quirkdata *quirkdata; /* if we have a rogue entry */
+ struct quirkdata *quirkdata; /* if we have a rogue entry */
struct ss_special special; /* special handlers for spec. devices */
};
diff --git a/sys/scsi/st.c b/sys/scsi/st.c
index 6db850ccf26..1c514da3bef 100644
--- a/sys/scsi/st.c
+++ b/sys/scsi/st.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: st.c,v 1.28 2000/04/08 19:19:33 csapuntz Exp $ */
+/* $OpenBSD: st.c,v 1.29 2001/06/22 14:35:43 deraadt Exp $ */
/* $NetBSD: st.c,v 1.71 1997/02/21 23:03:49 thorpej Exp $ */
/*
@@ -76,7 +76,7 @@
#define DEF_FIXED_BSIZE 512
#define ST_RETRIES 4 /* only on non IO commands */
-#define STMODE(z) ( minor(z) & 0x03)
+#define STMODE(z) ( minor(z) & 0x03)
#define STDSTY(z) ((minor(z) >> 2) & 0x03)
#define STUNIT(z) ((minor(z) >> 4) )
#define CTLMODE 3
@@ -530,10 +530,8 @@ stopen(dev, flags, mode, p)
/*
* Catch any unit attention errors.
*/
- error = scsi_test_unit_ready(sc_link,
- SCSI_IGNORE_MEDIA_CHANGE |
- (stmode == CTLMODE ?
- SCSI_IGNORE_NOT_READY : 0));
+ error = scsi_test_unit_ready(sc_link, SCSI_IGNORE_MEDIA_CHANGE |
+ (stmode == CTLMODE ? SCSI_IGNORE_NOT_READY : 0));
if (error)
goto bad;
@@ -1087,7 +1085,7 @@ stread(dev, uio, iomode)
struct st_softc *st = st_cd.cd_devs[STUNIT(dev)];
return (physio(ststrategy, NULL, dev, B_READ,
- st->sc_link->adapter->scsi_minphys, uio));
+ st->sc_link->adapter->scsi_minphys, uio));
}
int
@@ -1099,7 +1097,7 @@ stwrite(dev, uio, iomode)
struct st_softc *st = st_cd.cd_devs[STUNIT(dev)];
return (physio(ststrategy, NULL, dev, B_WRITE,
- st->sc_link->adapter->scsi_minphys, uio));
+ st->sc_link->adapter->scsi_minphys, uio));
}
/*