diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2005-06-19 20:41:29 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2005-06-19 20:41:29 +0000 |
commit | 47adb4253e32a37f97b1b4a936ecc670f80c74f1 (patch) | |
tree | 12f9048def52945617d7f76b334a26c5a91608db /sys/scsi | |
parent | c852b2c50dabb159ccf9a6dec103e0f5798ecc0f (diff) |
Eradicate unused struct atapi_sd_mode_data. Eradicate struct
atapi_capacity_descriptor in favour of equivalent struct
scsi_direct_blk_desc. No code change. One verbiage adjustment.
Diffstat (limited to 'sys/scsi')
-rw-r--r-- | sys/scsi/atapi_disk.h | 15 | ||||
-rw-r--r-- | sys/scsi/sd_atapi.c | 14 |
2 files changed, 9 insertions, 20 deletions
diff --git a/sys/scsi/atapi_disk.h b/sys/scsi/atapi_disk.h index 40750e5630b..5f7606effad 100644 --- a/sys/scsi/atapi_disk.h +++ b/sys/scsi/atapi_disk.h @@ -1,4 +1,4 @@ -/* $OpenBSD: atapi_disk.h,v 1.3 2005/05/22 21:11:31 krw Exp $ */ +/* $OpenBSD: atapi_disk.h,v 1.4 2005/06/19 20:41:28 krw Exp $ */ /* $NetBSD: atapi_disk.h,v 1.3 1998/02/13 08:28:21 enami Exp $ */ /* @@ -54,12 +54,6 @@ struct atapi_capacity_list_header { u_int8_t length; }; -struct atapi_capacity_descriptor { - u_int8_t nblks[4]; - u_int8_t byte5; - u_int8_t blklen[3]; -}; - /* codes only valid in the current/maximum capacity descriptor */ #define ATAPI_CAP_DESC_CODE_MASK 0x3 /* reserved 0x0 */ @@ -69,13 +63,8 @@ struct atapi_capacity_descriptor { #define ATAPI_CAP_DESC_SIZE(n) \ (sizeof(struct atapi_capacity_list_header) + \ - (n) * sizeof(struct atapi_capacity_descriptor)) + (n) * sizeof(struct scsi_direct_blk_desc)) #define ATAPI_CAP_DESC_OFFSET_HEADER 0 #define ATAPI_CAP_DESC_OFFSET_DESC(n) ATAPI_CAP_DESC_SIZE(n) #define ATAPI_FLEX_GEOMETRY_PAGE 0x05 - -struct atapi_sd_mode_data { - struct scsi_mode_header_big header; - union scsi_disk_pages pages; -}; diff --git a/sys/scsi/sd_atapi.c b/sys/scsi/sd_atapi.c index cdbca3dfd15..ff8726a7463 100644 --- a/sys/scsi/sd_atapi.c +++ b/sys/scsi/sd_atapi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sd_atapi.c,v 1.9 2005/06/03 15:50:10 krw Exp $ */ +/* $OpenBSD: sd_atapi.c,v 1.10 2005/06/19 20:41:28 krw Exp $ */ /* $NetBSD: sd_atapi.c,v 1.3 1998/08/31 22:28:07 cgd Exp $ */ /* @@ -71,7 +71,7 @@ sd_atapibus_get_parms(sd, dp, flags) int flags; { struct atapi_read_format_capacities scsi_cmd; - struct atapi_capacity_descriptor *descp; + struct scsi_direct_blk_desc *descp; struct scsi_mode_sense_buf sense_data; union scsi_disk_pages *sense_pages = NULL; char capacity_data[ATAPI_CAP_DESC_SIZE(1)]; @@ -92,10 +92,10 @@ sd_atapibus_get_parms(sd, dp, flags) if (error != 0) return (SDGP_RESULT_OFFLINE); - descp = (struct atapi_capacity_descriptor *) + descp = (struct scsi_direct_blk_desc *) &capacity_data[ATAPI_CAP_DESC_OFFSET_DESC(0)]; - switch (descp->byte5 & ATAPI_CAP_DESC_CODE_MASK) { + switch (descp->density & ATAPI_CAP_DESC_CODE_MASK) { case ATAPI_CAP_DESC_CODE_UNFORMATTED: return SDGP_RESULT_UNFORMATTED; @@ -107,13 +107,13 @@ sd_atapibus_get_parms(sd, dp, flags) default: #ifdef DIAGNOSTIC - printf("%s: strange capacity descriptor byte5 0x%x\n", - sd->sc_dev.dv_xname, (u_int)descp->byte5); + printf("%s: strange capacity descriptor density 0x%x\n", + sd->sc_dev.dv_xname, (u_int)descp->density); #endif break; } - dp->disksize = _4btol(descp->nblks); + dp->disksize = _4btol(descp->nblocks); if (dp->disksize == 0) return (SDGP_RESULT_OFFLINE); |