summaryrefslogtreecommitdiff
path: root/sys/scsi
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2005-05-22 21:11:32 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2005-05-22 21:11:32 +0000
commit2578a7b7dcf8045b630a7d68496b717b8a4b6b39 (patch)
tree1705d614ce4f77d252083c4e6e4435363ac9e939 /sys/scsi
parentddc3e4f32fb65df6d4537382d0a34081092947b4 (diff)
Remove some superfluous structures, etc. No functional change.
Diffstat (limited to 'sys/scsi')
-rw-r--r--sys/scsi/atapi_cd.h3
-rw-r--r--sys/scsi/atapi_disk.h24
-rw-r--r--sys/scsi/sd_atapi.c6
3 files changed, 6 insertions, 27 deletions
diff --git a/sys/scsi/atapi_cd.h b/sys/scsi/atapi_cd.h
index f521d17324a..bedaa1cf5c6 100644
--- a/sys/scsi/atapi_cd.h
+++ b/sys/scsi/atapi_cd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: atapi_cd.h,v 1.2 2005/04/16 16:41:46 krw Exp $ */
+/* $OpenBSD: atapi_cd.h,v 1.3 2005/05/22 21:11:31 krw Exp $ */
/* $NetBSD: atapi_cd.h,v 1.9 1998/07/13 16:50:56 thorpej Exp $ */
/*
@@ -103,7 +103,6 @@ struct atapi_cap_page {
#define ATAPI_CAP_PAGE 0x2a
union atapi_cd_pages {
- u_int8_t page_code;
struct atapi_cdrom_page cdrom;
struct atapi_cap_page cap;
struct cd_audio_page audio;
diff --git a/sys/scsi/atapi_disk.h b/sys/scsi/atapi_disk.h
index fa13aad166c..40750e5630b 100644
--- a/sys/scsi/atapi_disk.h
+++ b/sys/scsi/atapi_disk.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: atapi_disk.h,v 1.2 2005/04/16 16:41:46 krw Exp $ */
+/* $OpenBSD: atapi_disk.h,v 1.3 2005/05/22 21:11:31 krw Exp $ */
/* $NetBSD: atapi_disk.h,v 1.3 1998/02/13 08:28:21 enami Exp $ */
/*
@@ -73,29 +73,9 @@ struct atapi_capacity_descriptor {
#define ATAPI_CAP_DESC_OFFSET_HEADER 0
#define ATAPI_CAP_DESC_OFFSET_DESC(n) ATAPI_CAP_DESC_SIZE(n)
-struct atapi_flex_geometry_page {
- u_int8_t pg_code; /* page code */
- u_int8_t pg_length; /* page length */
- u_int8_t xfr_rate[2]; /* transfer rate, Kb/sec */
- u_int8_t nheads; /* number of heads */
- u_int8_t ph_sec_tr; /* physical sectors per track */
- u_int8_t blklen[2]; /* block length (bytes per sector) */
- u_int8_t ncyl[2]; /* number of cylinders */
- u_int8_t reserved1[18];
- u_int8_t rot_rate[2]; /* medium rotation rate (RPM) */
-};
-
#define ATAPI_FLEX_GEOMETRY_PAGE 0x05
-union atapi_sd_pages {
- u_int8_t page_code;
- struct atapi_flex_geometry_page flex_geometry;
-};
-
struct atapi_sd_mode_data {
struct scsi_mode_header_big header;
- union atapi_sd_pages pages;
+ union scsi_disk_pages pages;
};
-
-#define FLEXGEOMETRYPAGESIZE \
- (sizeof(struct scsi_mode_header_big) + sizeof(struct atapi_flex_geometry_page))
diff --git a/sys/scsi/sd_atapi.c b/sys/scsi/sd_atapi.c
index 731d100b258..294f410ad75 100644
--- a/sys/scsi/sd_atapi.c
+++ b/sys/scsi/sd_atapi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sd_atapi.c,v 1.6 2005/05/14 00:20:43 krw Exp $ */
+/* $OpenBSD: sd_atapi.c,v 1.7 2005/05/22 21:11:31 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)
bzero(&sense_data, sizeof(sense_data));
error = scsi_mode_sense_big(sd->sc_link, 0, ATAPI_FLEX_GEOMETRY_PAGE,
- (struct scsi_mode_header_big *)&sense_data, FLEXGEOMETRYPAGESIZE,
+ (struct scsi_mode_header_big *)&sense_data, sizeof(sense_data),
flags, 20000);
SC_DEBUG(sd->sc_link, SDEV_DB2,
("sd_atapibus_get_parms: mode sense (flex) error=%d\n", error));
@@ -136,7 +136,7 @@ sd_atapibus_get_parms(sd, dp, flags)
dp->heads = sense_data.pages.flex_geometry.nheads;
dp->sectors = sense_data.pages.flex_geometry.ph_sec_tr;
dp->cyls = _2btol(sense_data.pages.flex_geometry.ncyl);
- rpm = _2btol(sense_data.pages.flex_geometry.rot_rate);
+ rpm = _2btol(sense_data.pages.flex_geometry.rpm);
if (rpm)
dp->rot_rate = rpm;
} else {