summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2016-04-13 12:04:21 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2016-04-13 12:04:21 +0000
commita5d4a284cd368acca8e9105dc6a3367720d1a09f (patch)
tree74cbd65c734f3a5d00b0581eec4c9751ac348637
parentb35af2fdee8153c263c56162d0e48964606609c2 (diff)
provide an scsi_adapter and stub functions for emulation to sit in
-rw-r--r--sys/dev/ic/nvme.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/sys/dev/ic/nvme.c b/sys/dev/ic/nvme.c
index ba64e73b0a6..d54c8254fa8 100644
--- a/sys/dev/ic/nvme.c
+++ b/sys/dev/ic/nvme.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nvme.c,v 1.21 2016/04/13 11:56:50 dlg Exp $ */
+/* $OpenBSD: nvme.c,v 1.22 2016/04/13 12:04:20 dlg Exp $ */
/*
* Copyright (c) 2014 David Gwynne <dlg@openbsd.org>
@@ -29,6 +29,7 @@
#include <machine/bus.h>
#include <scsi/scsi_all.h>
+#include <scsi/scsi_all.h>
#include <scsi/scsiconf.h>
#include <dev/ic/nvmereg.h>
@@ -77,6 +78,18 @@ struct nvme_dmamem *
void nvme_dmamem_free(struct nvme_softc *, struct nvme_dmamem *);
void nvme_dmamem_sync(struct nvme_softc *, struct nvme_dmamem *, int);
+void nvme_scsi_cmd(struct scsi_xfer *);
+int nvme_scsi_probe(struct scsi_link *);
+void nvme_scsi_free(struct scsi_link *);
+
+struct scsi_adapter nvme_switch = {
+ nvme_scsi_cmd, /* cmd */
+ scsi_minphys, /* minphys */
+ nvme_scsi_probe, /* dev probe */
+ nvme_scsi_free, /* dev free */
+ NULL, /* ioctl */
+};
+
#define nvme_read4(_s, _r) \
bus_space_read_4((_s)->sc_iot, (_s)->sc_ioh, (_r))
#define nvme_write4(_s, _r, _v) \
@@ -325,6 +338,25 @@ free_admin_q:
return (1);
}
+int
+nvme_scsi_probe(struct scsi_link *link)
+{
+ return (ENXIO);
+}
+
+void
+nvme_scsi_cmd(struct scsi_xfer *xs)
+{
+ xs->error = XS_DRIVER_STUFFUP;
+ scsi_done(xs);
+}
+
+void
+nvme_scsi_free(struct scsi_link *link)
+{
+
+}
+
void
nvme_q_submit(struct nvme_softc *sc, struct nvme_queue *q, struct nvme_ccb *ccb,
void (*fill)(struct nvme_softc *, struct nvme_ccb *, void *))