summaryrefslogtreecommitdiff
path: root/sys/scsi/scsi_base.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2005-06-23 00:31:45 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2005-06-23 00:31:45 +0000
commit9b0080d95ee3988b00d19db3bcff36d96a3d4d10 (patch)
treeacb9939b36ecc360d4ca7f37e0c45ae843bcb086 /sys/scsi/scsi_base.c
parent6c49b94d9c65ac022eac99a6d38f57df9d5a42b4 (diff)
Don't discard the blocksize information provided by the READ CAPACITY
command. Return it in a new parameter to scsi_size.
Diffstat (limited to 'sys/scsi/scsi_base.c')
-rw-r--r--sys/scsi/scsi_base.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c
index 530a23a0be5..051e46d9e74 100644
--- a/sys/scsi/scsi_base.c
+++ b/sys/scsi/scsi_base.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi_base.c,v 1.84 2005/06/18 01:09:03 krw Exp $ */
+/* $OpenBSD: scsi_base.c,v 1.85 2005/06/23 00:31:44 krw Exp $ */
/* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */
/*
@@ -219,9 +219,10 @@ scsi_make_xs(sc_link, scsi_cmd, cmdlen, data_addr, datalen,
* Find out from the device what its capacity is.
*/
u_long
-scsi_size(sc_link, flags)
+scsi_size(sc_link, flags, blksize)
struct scsi_link *sc_link;
int flags;
+ u_int32_t *blksize;
{
struct scsi_read_capacity scsi_cmd;
struct scsi_read_cap_data rdcap;
@@ -247,6 +248,9 @@ scsi_size(sc_link, flags)
}
max_addr = _4btol(rdcap.addr);
+ if (blksize)
+ *blksize = _4btol(rdcap.length);
+
if (max_addr == 0xffffffffUL) {
/*
* The device is reporting it has more than 2^32-1 sectors. The