summaryrefslogtreecommitdiff
path: root/sys/scsi
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2005-04-16 16:41:47 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2005-04-16 16:41:47 +0000
commitc50888b316d7f238d6c028d418de423beea121b8 (patch)
tree38e0450dbf2818d253a3761c5c5ab7a7430c889d /sys/scsi
parent0bc20d81be6fac17b2075d34e248707198ef9605 (diff)
Nuke unused/duplicate structures and defines in favour of scsi ones.
ok miod@
Diffstat (limited to 'sys/scsi')
-rw-r--r--sys/scsi/atapi_all.h45
-rw-r--r--sys/scsi/atapi_base.c18
-rw-r--r--sys/scsi/atapi_cd.h10
-rw-r--r--sys/scsi/atapi_disk.h6
-rw-r--r--sys/scsi/cd_atapi.c14
-rw-r--r--sys/scsi/sd_atapi.c4
6 files changed, 29 insertions, 68 deletions
diff --git a/sys/scsi/atapi_all.h b/sys/scsi/atapi_all.h
index 71f61be7103..9cccc3ea398 100644
--- a/sys/scsi/atapi_all.h
+++ b/sys/scsi/atapi_all.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: atapi_all.h,v 1.2 2002/03/14 01:27:13 millert Exp $ */
+/* $OpenBSD: atapi_all.h,v 1.3 2005/04/16 16:41:46 krw Exp $ */
/* $NetBSD: atapi_all.h,v 1.3 1998/02/13 08:28:16 enami Exp $ */
/*
@@ -32,46 +32,7 @@
struct scsi_link;
-#define ATAPI_MODE_SELECT 0x55
-struct atapi_mode_select {
- u_int8_t opcode;
- u_int8_t byte2;
-#define AMS_SP 0x01 /* save pages */
-#define AMS_PF 0x10 /* must be set in byte2 */
- u_int8_t reserved1[5];
- u_int8_t length[2];
- u_int8_t reserved2[3];
-};
-
-#define ATAPI_MODE_SENSE 0x5a
-struct atapi_mode_sense {
- u_int8_t opcode;
- u_int8_t byte2;
- u_int8_t page;
- u_int8_t reserved1[4];
- u_int8_t length[2];
- u_int8_t reserved2[3];
-};
-
-struct atapi_mode_header {
- u_int8_t length[2];
- u_int8_t medium;
-#define MDT_UNKNOWN 0x00
-#define MDT_DATA_120 0x01
-#define MDT_AUDIO_120 0x02
-#define MDT_COMB_120 0x03
-#define MDT_PHOTO_120 0x04
-#define MDT_DATA_80 0x05
-#define MDT_AUDIO_80 0x06
-#define MDT_COMB_80 0x07
-#define MDT_PHOTO_80 0x08
-#define MDT_NO_DISC 0x70
-#define MDT_DOOR_OPEN 0x71
-#define MDT_FMT_ERROR 0x72
- u_int8_t reserved[5];
-};
-
int atapi_mode_select(struct scsi_link *,
- struct atapi_mode_header *, int, int, int, int);
+ struct scsi_mode_header_big *, int, int, int, int);
int atapi_mode_sense(struct scsi_link *, int,
- struct atapi_mode_header *, int, int, int, int);
+ struct scsi_mode_header_big *, int, int, int, int);
diff --git a/sys/scsi/atapi_base.c b/sys/scsi/atapi_base.c
index 9adc4f0e46a..b7cd9deb952 100644
--- a/sys/scsi/atapi_base.c
+++ b/sys/scsi/atapi_base.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atapi_base.c,v 1.2 2004/05/09 14:08:11 krw Exp $ */
+/* $OpenBSD: atapi_base.c,v 1.3 2005/04/16 16:41:46 krw Exp $ */
/* $NetBSD: atapi_base.c,v 1.12 1999/06/25 18:58:54 thorpej Exp $ */
/*-
@@ -55,19 +55,19 @@
int
atapi_mode_select(l, data, len, flags, retries, timeout)
struct scsi_link *l;
- struct atapi_mode_header *data;
+ struct scsi_mode_header_big *data;
int len, flags, retries, timeout;
{
- struct atapi_mode_select scsi_cmd;
+ struct scsi_mode_select_big scsi_cmd;
int error;
bzero(&scsi_cmd, sizeof(scsi_cmd));
- scsi_cmd.opcode = ATAPI_MODE_SELECT;
- scsi_cmd.byte2 = AMS_PF;
+ scsi_cmd.opcode = MODE_SELECT_BIG;
+ scsi_cmd.byte2 = SMS_PF;
_lto2b(len, scsi_cmd.length);
/* length is reserved when doing mode select; zero it */
- _lto2l(0, data->length);
+ _lto2l(0, data->data_length);
error = scsi_scsi_cmd(l, (struct scsi_generic *)&scsi_cmd,
sizeof(scsi_cmd), (void *)data, len, retries, timeout, NULL,
@@ -80,13 +80,13 @@ int
atapi_mode_sense(l, page, data, len, flags, retries, timeout)
struct scsi_link *l;
int page, len, flags, retries, timeout;
- struct atapi_mode_header *data;
+ struct scsi_mode_header_big *data;
{
- struct atapi_mode_sense scsi_cmd;
+ struct scsi_mode_sense_big scsi_cmd;
int error;
bzero(&scsi_cmd, sizeof(scsi_cmd));
- scsi_cmd.opcode = ATAPI_MODE_SENSE;
+ scsi_cmd.opcode = MODE_SENSE_BIG;
scsi_cmd.page = page;
_lto2b(len, scsi_cmd.length);
diff --git a/sys/scsi/atapi_cd.h b/sys/scsi/atapi_cd.h
index 3c5ebd839bb..f521d17324a 100644
--- a/sys/scsi/atapi_cd.h
+++ b/sys/scsi/atapi_cd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: atapi_cd.h,v 1.1 1999/07/20 06:21:59 csapuntz Exp $ */
+/* $OpenBSD: atapi_cd.h,v 1.2 2005/04/16 16:41:46 krw Exp $ */
/* $NetBSD: atapi_cd.h,v 1.9 1998/07/13 16:50:56 thorpej Exp $ */
/*
@@ -110,13 +110,13 @@ union atapi_cd_pages {
};
struct atapi_cd_mode_data {
- struct atapi_mode_header header;
+ struct scsi_mode_header_big header;
union atapi_cd_pages pages;
};
#define AUDIOPAGESIZE \
- (sizeof(struct atapi_mode_header) + sizeof(struct cd_audio_page))
+ (sizeof(struct scsi_mode_header_big) + sizeof(struct cd_audio_page))
#define CDROMPAGESIZE \
- (sizeof(struct atapi_mode_header) + sizeof(struct atapi_cdrom_page))
+ (sizeof(struct scsi_mode_header_big) + sizeof(struct atapi_cdrom_page))
#define CAPPAGESIZE \
- (sizeof(struct atapi_mode_header) + sizeof(struct atapi_cap_page))
+ (sizeof(struct scsi_mode_header_big) + sizeof(struct atapi_cap_page))
diff --git a/sys/scsi/atapi_disk.h b/sys/scsi/atapi_disk.h
index 36b545a1c21..fa13aad166c 100644
--- a/sys/scsi/atapi_disk.h
+++ b/sys/scsi/atapi_disk.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: atapi_disk.h,v 1.1 1999/07/25 07:09:19 csapuntz Exp $ */
+/* $OpenBSD: atapi_disk.h,v 1.2 2005/04/16 16:41:46 krw Exp $ */
/* $NetBSD: atapi_disk.h,v 1.3 1998/02/13 08:28:21 enami Exp $ */
/*
@@ -93,9 +93,9 @@ union atapi_sd_pages {
};
struct atapi_sd_mode_data {
- struct atapi_mode_header header;
+ struct scsi_mode_header_big header;
union atapi_sd_pages pages;
};
#define FLEXGEOMETRYPAGESIZE \
- (sizeof(struct atapi_mode_header) + sizeof(struct atapi_flex_geometry_page))
+ (sizeof(struct scsi_mode_header_big) + sizeof(struct atapi_flex_geometry_page))
diff --git a/sys/scsi/cd_atapi.c b/sys/scsi/cd_atapi.c
index f1158b367c1..22fb4995f5d 100644
--- a/sys/scsi/cd_atapi.c
+++ b/sys/scsi/cd_atapi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd_atapi.c,v 1.3 2004/05/09 14:08:11 krw Exp $ */
+/* $OpenBSD: cd_atapi.c,v 1.4 2005/04/16 16:41:46 krw Exp $ */
/* $NetBSD: cd_atapi.c,v 1.10 1998/08/31 22:28:06 cgd Exp $ */
/*
@@ -94,7 +94,7 @@ cd_atapibus_setchan(cd, p0, p1, p2, p3, flags)
int error;
if ((error = atapi_mode_sense(cd->sc_link, ATAPI_AUDIO_PAGE,
- (struct atapi_mode_header *)&data, AUDIOPAGESIZE, flags,
+ (struct scsi_mode_header_big *)&data, AUDIOPAGESIZE, flags,
CDRETRIES, 20000)) != 0)
return (error);
data.pages.audio.port[LEFT_PORT].channels = p0;
@@ -102,7 +102,7 @@ cd_atapibus_setchan(cd, p0, p1, p2, p3, flags)
data.pages.audio.port[2].channels = p2;
data.pages.audio.port[3].channels = p3;
return (atapi_mode_select(cd->sc_link,
- (struct atapi_mode_header *)&data, AUDIOPAGESIZE, flags,
+ (struct scsi_mode_header_big *)&data, AUDIOPAGESIZE, flags,
CDRETRIES, 20000));
}
@@ -116,7 +116,7 @@ cd_atapibus_getvol(cd, arg, flags)
int error;
if ((error = atapi_mode_sense(cd->sc_link, ATAPI_AUDIO_PAGE,
- (struct atapi_mode_header *)&data, AUDIOPAGESIZE, flags,
+ (struct scsi_mode_header_big *)&data, AUDIOPAGESIZE, flags,
CDRETRIES, 20000)) != 0)
return (error);
arg->vol[0] = data.pages.audio.port[0].volume;
@@ -136,11 +136,11 @@ cd_atapibus_setvol(cd, arg, flags)
int error;
if ((error = atapi_mode_sense(cd->sc_link, ATAPI_AUDIO_PAGE,
- (struct atapi_mode_header *)&data, AUDIOPAGESIZE, flags,
+ (struct scsi_mode_header_big *)&data, AUDIOPAGESIZE, flags,
CDRETRIES, 20000)) != 0)
return (error);
if ((error = atapi_mode_sense(cd->sc_link, ATAPI_AUDIO_PAGE_MASK,
- (struct atapi_mode_header *)&mask, AUDIOPAGESIZE, flags,
+ (struct scsi_mode_header_big *)&mask, AUDIOPAGESIZE, flags,
CDRETRIES, 20000)) != 0)
return (error);
@@ -154,7 +154,7 @@ cd_atapibus_setvol(cd, arg, flags)
mask.pages.audio.port[3].volume;
return (atapi_mode_select(cd->sc_link,
- (struct atapi_mode_header *)&data, AUDIOPAGESIZE,
+ (struct scsi_mode_header_big *)&data, AUDIOPAGESIZE,
flags, CDRETRIES, 20000));
}
diff --git a/sys/scsi/sd_atapi.c b/sys/scsi/sd_atapi.c
index 46d399f07dc..52d3827c514 100644
--- a/sys/scsi/sd_atapi.c
+++ b/sys/scsi/sd_atapi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sd_atapi.c,v 1.4 2003/06/25 02:18:35 krw Exp $ */
+/* $OpenBSD: sd_atapi.c,v 1.5 2005/04/16 16:41:46 krw Exp $ */
/* $NetBSD: sd_atapi.c,v 1.3 1998/08/31 22:28:07 cgd Exp $ */
/*
@@ -128,7 +128,7 @@ sd_atapibus_get_parms(sd, dp, flags)
return (SDGP_RESULT_OFFLINE);
error = atapi_mode_sense(sd->sc_link, ATAPI_FLEX_GEOMETRY_PAGE,
- (struct atapi_mode_header *)&sense_data, FLEXGEOMETRYPAGESIZE,
+ (struct scsi_mode_header_big *)&sense_data, FLEXGEOMETRYPAGESIZE,
flags, SDRETRIES, 20000);
SC_DEBUG(sd->sc_link, SDEV_DB2,
("sd_atapibus_get_parms: mode sense (flex) error=%d\n", error));