diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2002-12-15 20:53:34 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2002-12-15 20:53:34 +0000 |
commit | 05c6914f948d872b58f2369690f4e708e4ce4a23 (patch) | |
tree | 3252d3a5807ffa07c426f30d85b92496233eae14 /sys | |
parent | 6814abb2d34fe50ae1e7419ea7cb2fe6c678a963 (diff) |
Fix/Cleanup some SCSI #defines.
1) Correctly define MODE_SENSE_BIG as 0x5a, not 0x54.
2) Delete duplicate #define's of some opcodes in scsi_disk.h.
3) Delete multiple #define's for same opcode in scsi_disk.h.
4) Replace uses of deleted opcodes in umass.c with remaining ones.
ok millert@ tdeval@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/usb/umass.c | 20 | ||||
-rw-r--r-- | sys/scsi/scsi_all.h | 6 | ||||
-rw-r--r-- | sys/scsi/scsi_disk.h | 14 |
3 files changed, 15 insertions, 25 deletions
diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c index 30f49585d2c..121417ccd9c 100644 --- a/sys/dev/usb/umass.c +++ b/sys/dev/usb/umass.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umass.c,v 1.19 2002/10/12 01:09:44 krw Exp $ */ +/* $OpenBSD: umass.c,v 1.20 2002/12/15 20:53:32 krw Exp $ */ /* $NetBSD: umass.c,v 1.49 2001/01/21 18:56:38 augustss Exp $ */ /*- * Copyright (c) 1999 MAEKAWA Masahide <bishop@rr.iij4u.or.jp>, @@ -3195,9 +3195,9 @@ umass_scsipi_cmd(xs) cmd = xs->cmd; - if (xs->cmd->opcode == SCSI_MODE_SENSE && + if (xs->cmd->opcode == MODE_SENSE && (sc_link->quirks & SDEV_NOMODESENSE)) { - /*printf("%s: SCSI_MODE_SENSE\n", USBDEVNAME(sc->sc_dev));*/ + /*printf("%s: MODE_SENSE\n", USBDEVNAME(sc->sc_dev));*/ xs->error = XS_TIMEOUT; goto done; } @@ -3494,7 +3494,7 @@ umass_ufi_transform(struct umass_softc *sc, struct scsipi_generic *cmd, switch (cmd->opcode) { /* Commands of which the format has been verified. They should work. */ case TEST_UNIT_READY: - case SCSI_REZERO_UNIT: + case REZERO_UNIT: case REQUEST_SENSE: case INQUIRY: case START_STOP: @@ -3504,8 +3504,8 @@ umass_ufi_transform(struct umass_softc *sc, struct scsipi_generic *cmd, case READ_BIG: case WRITE_BIG: case POSITION_TO_ELEMENT: /* SEEK_10 */ - case SCSI_MODE_SELECT_BIG: - case SCSI_MODE_SENSE_BIG: + case MODE_SELECT_BIG: + case MODE_SENSE_BIG: default: /* Copy the command into the (zeroed out) destination buffer */ memcpy(rcmd, cmd, cmdlen); @@ -3518,10 +3518,10 @@ umass_ufi_transform(struct umass_softc *sc, struct scsipi_generic *cmd, */ /* These commands are known _not_ to work. They should be converted. */ - case SCSI_READ_COMMAND: - case SCSI_WRITE_COMMAND: - case SCSI_MODE_SENSE: - case SCSI_MODE_SELECT: + case READ_COMMAND: + case WRITE_COMMAND: + case MODE_SENSE: + case MODE_SELECT: printf("%s: Unsupported UFI command 0x%02x", USBDEVNAME(sc->sc_dev), cmd->opcode); if (cmdlen == 6) diff --git a/sys/scsi/scsi_all.h b/sys/scsi/scsi_all.h index 2517d7ee289..4b560754379 100644 --- a/sys/scsi/scsi_all.h +++ b/sys/scsi/scsi_all.h @@ -1,4 +1,4 @@ -/* $OpenBSD: scsi_all.h,v 1.13 2002/09/04 23:07:28 tdeval Exp $ */ +/* $OpenBSD: scsi_all.h,v 1.14 2002/12/15 20:53:33 krw Exp $ */ /* $NetBSD: scsi_all.h,v 1.10 1996/09/12 01:57:17 thorpej Exp $ */ /* @@ -180,8 +180,8 @@ struct scsi_changedef { #define PREVENT_ALLOW 0x1e #define POSITION_TO_ELEMENT 0x2b #define CHANGE_DEFINITION 0x40 -#define MODE_SENSE_BIG 0x54 #define MODE_SELECT_BIG 0x55 +#define MODE_SENSE_BIG 0x5a /* * Sort of an extra one, for SCSI_RESET. @@ -299,7 +299,7 @@ struct scsi_blk_desc { }; struct scsi_mode_header { - u_int8_t data_length; /* Sense data length */ + u_int8_t data_length; /* Sense data length */ u_int8_t medium_type; u_int8_t dev_spec; u_int8_t blk_desc_len; diff --git a/sys/scsi/scsi_disk.h b/sys/scsi/scsi_disk.h index 347ba8bf4f0..00b137c15b0 100644 --- a/sys/scsi/scsi_disk.h +++ b/sys/scsi/scsi_disk.h @@ -1,4 +1,4 @@ -/* $OpenBSD: scsi_disk.h,v 1.12 2002/09/04 23:07:28 tdeval Exp $ */ +/* $OpenBSD: scsi_disk.h,v 1.13 2002/12/15 20:53:33 krw Exp $ */ /* $NetBSD: scsi_disk.h,v 1.10 1996/07/05 16:19:05 christos Exp $ */ /* @@ -149,7 +149,6 @@ struct scsi_reassign_blocks { * XXX Is this also used by ATAPI? */ #define REZERO_UNIT 0x01 -#define SCSI_REZERO_UNIT 0x01 struct scsi_rezero_unit { u_int8_t opcode; u_int8_t byte2; @@ -213,24 +212,15 @@ struct scsi_synchronize_cache { /* - * Opcodes + * Disk specific opcodes */ #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 MODE_SENSE 0x1a -#define START_STOP 0x1b -#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 struct scsi_read_cap_data { |