summaryrefslogtreecommitdiff
path: root/sys/dev/ata/atascsi.c
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2007-04-10 23:37:07 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2007-04-10 23:37:07 +0000
commit79334dc9d3d29b94d14061f326d00878afca233d (patch)
tree7fd8c19af2cd71f112a3c7b7be73d9105a8bb250 /sys/dev/ata/atascsi.c
parentbbfd9c202c1429ac6639fd26a1e4712d509d6813 (diff)
endian fixes for the read capacity handling.
Diffstat (limited to 'sys/dev/ata/atascsi.c')
-rw-r--r--sys/dev/ata/atascsi.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/dev/ata/atascsi.c b/sys/dev/ata/atascsi.c
index f6e2723ff9a..265e71cfc36 100644
--- a/sys/dev/ata/atascsi.c
+++ b/sys/dev/ata/atascsi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atascsi.c,v 1.38 2007/03/24 22:03:18 pascoe Exp $ */
+/* $OpenBSD: atascsi.c,v 1.39 2007/04/10 23:37:06 dlg Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
@@ -595,15 +595,16 @@ atascsi_disk_capacity_done(struct ata_xfer *xa)
ata_complete_identify(xa, &id);
bzero(&rcd, sizeof(rcd));
- if (id.cmdset83 & 0x0400) { /* LBA48 feature set supported */
+ if (letoh16(id.cmdset83) & 0x0400) {
+ /* LBA48 feature set supported */
for (i = 3; i >= 0; --i) {
capacity <<= 16;
- capacity += id.addrsecxt[i];
+ capacity += letoh16(id.addrsecxt[i]);
}
} else {
- capacity = id.addrsec[1];
+ capacity = letoh16(id.addrsec[1]);
capacity <<= 16;
- capacity += id.addrsec[0];
+ capacity += letoh16(id.addrsec[0]);
}
/* XXX SCSI layer can't handle a device this big yet */