summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2020-06-21 16:46:35 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2020-06-21 16:46:35 +0000
commit04272a8ecdf5e65db8f021970b04126fb124d722 (patch)
treea96251e628bcc69a491b482813faed73e97a8881
parent3d37a6b15e62b0fc9a2130e93bd2928682bd56f6 (diff)
Nuke pointless vioblk_dev_probe() and vioblk_dev_free() functions and
tweak adapter_target and adapter_buswidth values to provide desired semantic of providing only target 0/lun 0 device per vioblk(4) device. Tested by sf@
-rw-r--r--sys/dev/pv/vioblk.c26
1 files changed, 5 insertions, 21 deletions
diff --git a/sys/dev/pv/vioblk.c b/sys/dev/pv/vioblk.c
index c01b8355531..f2bb518e95f 100644
--- a/sys/dev/pv/vioblk.c
+++ b/sys/dev/pv/vioblk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vioblk.c,v 1.17 2020/02/14 15:56:47 krw Exp $ */
+/* $OpenBSD: vioblk.c,v 1.18 2020/06/21 16:46:34 krw Exp $ */
/*
* Copyright (c) 2012 Stefan Fritsch.
@@ -129,8 +129,6 @@ void vioblk_vq_done1(struct vioblk_softc *, struct virtio_softc *,
void vioblk_reset(struct vioblk_softc *);
void vioblk_scsi_cmd(struct scsi_xfer *);
-int vioblk_dev_probe(struct scsi_link *);
-void vioblk_dev_free(struct scsi_link *);
void *vioblk_req_get(void *);
void vioblk_req_put(void *, void *);
@@ -152,7 +150,7 @@ struct cfdriver vioblk_cd = {
};
struct scsi_adapter vioblk_switch = {
- vioblk_scsi_cmd, NULL, vioblk_dev_probe, vioblk_dev_free, NULL
+ vioblk_scsi_cmd, NULL, NULL, NULL, NULL
};
int vioblk_match(struct device *parent, void *match, void *aux)
@@ -240,9 +238,10 @@ vioblk_attach(struct device *parent, struct device *self, void *aux)
sc->sc_link.adapter = &vioblk_switch;
sc->sc_link.pool = &sc->sc_iopool;
sc->sc_link.adapter_softc = self;
- sc->sc_link.adapter_buswidth = 2;
+ /* Only valid target/lun is 0/0. */
+ sc->sc_link.adapter_buswidth = 1;
sc->sc_link.luns = 1;
- sc->sc_link.adapter_target = 2;
+ sc->sc_link.adapter_target = sc->sc_link.adapter_buswidth;;
DNPRINTF(1, "%s: qsize: %d\n", __func__, qsize);
if (virtio_has_feature(vsc, VIRTIO_BLK_F_RO))
sc->sc_link.flags |= SDEV_READONLY;
@@ -626,21 +625,6 @@ vioblk_scsi_done(struct scsi_xfer *xs, int error)
}
int
-vioblk_dev_probe(struct scsi_link *link)
-{
- KASSERT(link->lun == 0);
- if (link->target == 0)
- return (0);
- return (ENODEV);
-}
-
-void
-vioblk_dev_free(struct scsi_link *link)
-{
- printf("%s\n", __func__);
-}
-
-int
vioblk_alloc_reqs(struct vioblk_softc *sc, int qsize)
{
struct virtqueue *vq = &sc->sc_vq[0];