summaryrefslogtreecommitdiff
path: root/sys/dev/ata/atascsi.c
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2010-04-05 00:59:32 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2010-04-05 00:59:32 +0000
commit9c42caaca1457e6dd40d046a3bfea2a14078b071 (patch)
tree64f6b33a226dc433fadca8b3aa0c7a282138807c /sys/dev/ata/atascsi.c
parent24a96c44edc3ea37cd0ecf750531374e75939aab (diff)
add support for READ_CAPACITY_16.
Diffstat (limited to 'sys/dev/ata/atascsi.c')
-rw-r--r--sys/dev/ata/atascsi.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/sys/dev/ata/atascsi.c b/sys/dev/ata/atascsi.c
index f8195337176..cddf1e4eaf2 100644
--- a/sys/dev/ata/atascsi.c
+++ b/sys/dev/ata/atascsi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atascsi.c,v 1.76 2010/04/05 00:55:03 dlg Exp $ */
+/* $OpenBSD: atascsi.c,v 1.77 2010/04/05 00:59:31 dlg Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
@@ -78,6 +78,7 @@ void atascsi_disk_vpd_ident(struct scsi_xfer *);
void atascsi_disk_vpd_limits(struct scsi_xfer *);
void atascsi_disk_vpd_info(struct scsi_xfer *);
void atascsi_disk_capacity(struct scsi_xfer *);
+void atascsi_disk_capacity16(struct scsi_xfer *);
void atascsi_disk_sync(struct scsi_xfer *);
void atascsi_disk_sync_done(struct ata_xfer *);
void atascsi_disk_sense(struct scsi_xfer *);
@@ -372,6 +373,9 @@ atascsi_disk_cmd(struct scsi_xfer *xs)
case READ_CAPACITY:
atascsi_disk_capacity(xs);
return;
+ case READ_CAPACITY_16:
+ atascsi_disk_capacity16(xs);
+ return;
case TEST_UNIT_READY:
case START_STOP:
@@ -831,6 +835,24 @@ atascsi_disk_capacity(struct scsi_xfer *xs)
}
void
+atascsi_disk_capacity16(struct scsi_xfer *xs)
+{
+ struct scsi_link *link = xs->sc_link;
+ struct atascsi *as = link->adapter_softc;
+ struct ata_port *ap = as->as_ports[link->target];
+ struct scsi_read_cap_data_16 rcd;
+
+ bzero(&rcd, sizeof(rcd));
+
+ _lto4b(ata_identify_blocks(&ap->ap_identify), rcd.addr);
+ _lto4b(ata_identify_blocksize(&ap->ap_identify), rcd.length);
+
+ bcopy(&rcd, xs->data, MIN(sizeof(rcd), xs->datalen));
+
+ atascsi_done(xs, XS_NOERROR);
+}
+
+void
atascsi_disk_sense(struct scsi_xfer *xs)
{
struct scsi_sense_data *sd = (struct scsi_sense_data *)xs->data;