summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2007-12-28 16:38:24 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2007-12-28 16:38:24 +0000
commit6f3b6397427423d12b99c79d668ea70e43d4748c (patch)
treebb35cf7bfb0af57aab327a397aed501e202d268d /sys
parent291ca5cd2af937611f37e394e8cd97fd9ebbd919 (diff)
provide vpd page 0, which lists which vpd pages we provide.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ata/atascsi.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/sys/dev/ata/atascsi.c b/sys/dev/ata/atascsi.c
index 2dbd9f06425..8baf2511793 100644
--- a/sys/dev/ata/atascsi.c
+++ b/sys/dev/ata/atascsi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atascsi.c,v 1.57 2007/12/28 16:30:08 dlg Exp $ */
+/* $OpenBSD: atascsi.c,v 1.58 2007/12/28 16:38:23 dlg Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
@@ -74,6 +74,7 @@ int atascsi_disk_cmd(struct scsi_xfer *);
void atascsi_disk_cmd_done(struct ata_xfer *);
int atascsi_disk_inq(struct scsi_xfer *);
int atascsi_disk_inquiry(struct scsi_xfer *);
+int atascsi_disk_vpd_supported(struct scsi_xfer *);
int atascsi_disk_vpd_serial(struct scsi_xfer *);
int atascsi_disk_vpd_ident(struct scsi_xfer *);
int atascsi_disk_capacity(struct scsi_xfer *);
@@ -475,6 +476,8 @@ atascsi_disk_inq(struct scsi_xfer *xs)
if (ISSET(inq->flags, SI_EVPD)) {
switch (inq->pagecode) {
+ case SI_PG_SUPPORTED:
+ return (atascsi_disk_vpd_supported(xs));
case SI_PG_SERIAL:
return (atascsi_disk_vpd_serial(xs));
case SI_PG_DEVID:
@@ -551,6 +554,28 @@ atascsi_disk_inquiry(struct scsi_xfer *xs)
}
int
+atascsi_disk_vpd_supported(struct scsi_xfer *xs)
+{
+ struct {
+ struct scsi_vpd_hdr hdr;
+ u_int8_t list[3];
+ } pg;
+
+ bzero(&pg, sizeof(pg));
+
+ pg.hdr.device = T_DIRECT;
+ pg.hdr.page_code = SI_PG_SUPPORTED;
+ pg.hdr.page_length = sizeof(pg.list);
+ pg.list[0] = SI_PG_SUPPORTED;
+ pg.list[1] = SI_PG_SERIAL;
+ pg.list[2] = SI_PG_DEVID;
+
+ bcopy(&pg, xs->data, MIN(sizeof(pg), xs->datalen));
+
+ return (atascsi_done(xs, XS_NOERROR));
+}
+
+int
atascsi_disk_vpd_serial(struct scsi_xfer *xs)
{
struct scsi_link *link = xs->sc_link;