From a5d4a284cd368acca8e9105dc6a3367720d1a09f Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Wed, 13 Apr 2016 12:04:21 +0000 Subject: provide an scsi_adapter and stub functions for emulation to sit in --- sys/dev/ic/nvme.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'sys') 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 @@ -28,6 +28,7 @@ #include +#include #include #include @@ -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 *)) -- cgit v1.2.3