diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2020-06-24 01:36:19 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2020-06-24 01:36:19 +0000 |
commit | d285b14710728ee6dc2102ca9564157f01bf9ca2 (patch) | |
tree | f970ccd23888537ba5c2e97ac5fef14fc19db353 | |
parent | 22013c7690c45d0c592fa9612211bd4d1264d394 (diff) |
Nuke some pointless *_dev_probe() and *_dev_free() functions and
set/trust the scsiconf.c probing limits. Same as was done to
vioblk(4).
ok dlg@
-rw-r--r-- | sys/arch/sparc64/dev/vdsk.c | 29 | ||||
-rw-r--r-- | sys/dev/ic/qlw.c | 15 | ||||
-rw-r--r-- | sys/dev/pv/xbf.c | 19 |
3 files changed, 14 insertions, 49 deletions
diff --git a/sys/arch/sparc64/dev/vdsk.c b/sys/arch/sparc64/dev/vdsk.c index 02e36d7e51e..7ff85292b99 100644 --- a/sys/arch/sparc64/dev/vdsk.c +++ b/sys/arch/sparc64/dev/vdsk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vdsk.c,v 1.53 2020/02/18 17:20:12 krw Exp $ */ +/* $OpenBSD: vdsk.c,v 1.54 2020/06/24 01:36:18 krw Exp $ */ /* * Copyright (c) 2009, 2011 Mark Kettenis * @@ -179,11 +179,9 @@ struct cfdriver vdsk_cd = { }; void vdsk_scsi_cmd(struct scsi_xfer *); -int vdsk_dev_probe(struct scsi_link *); -void vdsk_dev_free(struct scsi_link *); struct scsi_adapter vdsk_switch = { - vdsk_scsi_cmd, NULL, vdsk_dev_probe, vdsk_dev_free, NULL + vdsk_scsi_cmd, NULL, NULL, NULL, NULL }; int vdsk_tx_intr(void *); @@ -349,9 +347,10 @@ vdsk_attach(struct device *parent, struct device *self, void *aux) sc->sc_link.adapter = &vdsk_switch; sc->sc_link.adapter_softc = self; - sc->sc_link.adapter_buswidth = 2; - sc->sc_link.luns = 1; /* XXX slices should be presented as luns? */ - sc->sc_link.adapter_target = 2; + /* Only valid target/lun is 0/0. */ + sc->sc_link.adapter_buswidth = 1; + sc->sc_link.luns = 1; + sc->sc_link.adapter_target = sc->sc_link.adapter_buswidth; sc->sc_link.openings = sc->sc_vd->vd_nentries - 1; sc->sc_link.pool = &sc->sc_iopool; @@ -1230,19 +1229,3 @@ vdsk_scsi_done(struct scsi_xfer *xs, int error) scsi_done(xs); } -int -vdsk_dev_probe(struct scsi_link *link) -{ - KASSERT(link->lun == 0); - - if (link->target == 0) - return (0); - - return (ENODEV); -} - -void -vdsk_dev_free(struct scsi_link *link) -{ - printf("%s\n", __func__); -} diff --git a/sys/dev/ic/qlw.c b/sys/dev/ic/qlw.c index 8c1304f5acd..8ba910ff959 100644 --- a/sys/dev/ic/qlw.c +++ b/sys/dev/ic/qlw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qlw.c,v 1.34 2020/02/05 16:29:30 krw Exp $ */ +/* $OpenBSD: qlw.c,v 1.35 2020/06/24 01:35:29 krw Exp $ */ /* * Copyright (c) 2011 David Gwynne <dlg@openbsd.org> @@ -62,7 +62,6 @@ struct cfdriver qlw_cd = { }; void qlw_scsi_cmd(struct scsi_xfer *); -int qlw_scsi_probe(struct scsi_link *); u_int16_t qlw_read(struct qlw_softc *, bus_size_t); void qlw_write(struct qlw_softc *, bus_size_t, u_int16_t); @@ -164,7 +163,7 @@ qlw_queue_write(struct qlw_softc *sc, bus_size_t offset, u_int16_t value) } struct scsi_adapter qlw_switch = { - qlw_scsi_cmd, NULL, qlw_scsi_probe, NULL, NULL + qlw_scsi_cmd, NULL, NULL, NULL, NULL }; int @@ -400,6 +399,7 @@ qlw_attach(struct qlw_softc *sc) sc->sc_link[bus].adapter_softc = sc; sc->sc_link[bus].adapter_target = sc->sc_initiator[bus]; sc->sc_link[bus].adapter_buswidth = QLW_MAX_TARGETS; + sc->sc_link[bus].luns = QLW_MAX_LUNS; sc->sc_link[bus].openings = sc->sc_max_queue_depth[bus]; sc->sc_link[bus].pool = &sc->sc_iopool; @@ -787,15 +787,6 @@ qlw_intr(void *xsc) return (1); } -int -qlw_scsi_probe(struct scsi_link *link) -{ - if (link->lun >= QLW_MAX_LUNS) - return (EINVAL); - - return (0); -} - void qlw_scsi_cmd(struct scsi_xfer *xs) { diff --git a/sys/dev/pv/xbf.c b/sys/dev/pv/xbf.c index 5ccf2023ca2..34965f404fa 100644 --- a/sys/dev/pv/xbf.c +++ b/sys/dev/pv/xbf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xbf.c,v 1.36 2020/02/12 14:08:56 krw Exp $ */ +/* $OpenBSD: xbf.c,v 1.37 2020/06/24 01:35:29 krw Exp $ */ /* * Copyright (c) 2016, 2017 Mike Belopuhov @@ -227,10 +227,9 @@ void xbf_scsi_cmd(struct scsi_xfer *); int xbf_submit_cmd(struct scsi_xfer *); int xbf_poll_cmd(struct scsi_xfer *); void xbf_complete_cmd(struct xbf_softc *, struct xbf_ccb_queue *, int); -int xbf_dev_probe(struct scsi_link *); struct scsi_adapter xbf_switch = { - xbf_scsi_cmd, NULL, xbf_dev_probe, NULL, NULL + xbf_scsi_cmd, NULL, NULL, NULL, NULL }; void xbf_scsi_inq(struct scsi_xfer *); @@ -303,9 +302,10 @@ xbf_attach(struct device *parent, struct device *self, void *aux) sc->sc_link.adapter = &xbf_switch; 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; sc->sc_link.openings = sc->sc_nccb; sc->sc_link.pool = &sc->sc_iopool; @@ -900,15 +900,6 @@ xbf_scsi_done(struct scsi_xfer *xs, int error) } int -xbf_dev_probe(struct scsi_link *link) -{ - if (link->target == 0) - return (0); - - return (ENODEV); -} - -int xbf_get_type(struct xbf_softc *sc) { unsigned long long res; |