summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/scsi/scsi_base.c27
-rw-r--r--sys/scsi/scsiconf.h3
2 files changed, 28 insertions, 2 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c
index bcde4fb7d9e..37222fea959 100644
--- a/sys/scsi/scsi_base.c
+++ b/sys/scsi/scsi_base.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi_base.c,v 1.118 2007/04/03 04:15:50 dlg Exp $ */
+/* $OpenBSD: scsi_base.c,v 1.119 2007/04/03 04:47:59 dlg Exp $ */
/* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */
/*
@@ -405,6 +405,31 @@ scsi_inquire(struct scsi_link *sc_link, struct scsi_inquiry_data *inqbuf,
}
/*
+ * Query a VPD inquiry page
+ */
+int
+scsi_inquire_vpd(struct scsi_link *sc_link, void *buf, u_int buflen,
+ u_int8_t page, int flags)
+{
+ struct scsi_inquiry scsi_cmd;
+ int error;
+
+ bzero(&scsi_cmd, sizeof(scsi_cmd));
+ scsi_cmd.opcode = INQUIRY;
+ scsi_cmd.flags = SI_EVPD;
+ scsi_cmd.pagecode = page;
+ _lto2b(buflen, scsi_cmd.length);
+
+ bzero(buf, buflen);
+
+ error = scsi_scsi_cmd(sc_link, (struct scsi_generic *)&scsi_cmd,
+ sizeof(scsi_cmd), buf, buflen, 2, 10000, NULL,
+ SCSI_DATA_IN | flags);
+
+ return (error);
+}
+
+/*
* Prevent or allow the user to remove the media
*/
int
diff --git a/sys/scsi/scsiconf.h b/sys/scsi/scsiconf.h
index d937dad2b1e..fe0555a5f0a 100644
--- a/sys/scsi/scsiconf.h
+++ b/sys/scsi/scsiconf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsiconf.h,v 1.82 2006/12/12 02:44:36 krw Exp $ */
+/* $OpenBSD: scsiconf.h,v 1.83 2007/04/03 04:47:59 dlg Exp $ */
/* $NetBSD: scsiconf.h,v 1.35 1997/04/02 02:29:38 mycroft Exp $ */
/*
@@ -312,6 +312,7 @@ int scsi_execute_xs(struct scsi_xfer *);
u_long scsi_size(struct scsi_link *, int, u_int32_t *);
int scsi_test_unit_ready(struct scsi_link *, int, int);
int scsi_inquire(struct scsi_link *, struct scsi_inquiry_data *, int);
+int scsi_inquire_vpd(struct scsi_link *, void *, u_int, u_int8_t, int);
int scsi_prevent(struct scsi_link *, int, int);
int scsi_start(struct scsi_link *, int, int);
int scsi_mode_sense(struct scsi_link *, int, int, struct scsi_mode_header *,