diff options
author | 2020-02-18 17:20:12 +0000 | |
---|---|---|
committer | 2020-02-18 17:20:12 +0000 | |
commit | 4c952a9b023e921140aa1bfff1b51d446c9e0583 (patch) | |
tree | bc9444c8bfdbd31b09ef354178d0dc1c9393bb09 | |
parent | Trailing whitespace is icky. Some KNF whitespace tweaks (diff) | |
download | wireguard-openbsd-4c952a9b023e921140aa1bfff1b51d446c9e0583.tar.xz wireguard-openbsd-4c952a9b023e921140aa1bfff1b51d446c9e0583.zip |
Flip vdsk to 'normal' scsi_adapter idiom.
Compile testing by kurt@ and jca@.
-rw-r--r-- | sys/arch/sparc64/dev/vdsk.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/sys/arch/sparc64/dev/vdsk.c b/sys/arch/sparc64/dev/vdsk.c index b3262729d30..02e36d7e51e 100644 --- a/sys/arch/sparc64/dev/vdsk.c +++ b/sys/arch/sparc64/dev/vdsk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vdsk.c,v 1.52 2020/02/05 16:29:29 krw Exp $ */ +/* $OpenBSD: vdsk.c,v 1.53 2020/02/18 17:20:12 krw Exp $ */ /* * Copyright (c) 2009, 2011 Mark Kettenis * @@ -160,7 +160,6 @@ struct vdsk_softc { struct vdsk_soft_desc *sc_vsd; struct scsi_iopool sc_iopool; - struct scsi_adapter sc_switch; struct scsi_link sc_link; uint32_t sc_vdisk_block_size; @@ -179,6 +178,14 @@ struct cfdriver vdsk_cd = { NULL, "vdsk", DV_DULL }; +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 +}; + int vdsk_tx_intr(void *); int vdsk_rx_intr(void *); @@ -203,11 +210,8 @@ void vdsk_send_rdx(struct vdsk_softc *); void *vdsk_io_get(void *); void vdsk_io_put(void *, void *); -void vdsk_scsi_cmd(struct scsi_xfer *); int vdsk_submit_cmd(struct scsi_xfer *); void vdsk_complete_cmd(struct scsi_xfer *, int); -int vdsk_dev_probe(struct scsi_link *); -void vdsk_dev_free(struct scsi_link *); void vdsk_scsi_inq(struct scsi_xfer *); void vdsk_scsi_inquiry(struct scsi_xfer *); @@ -343,12 +347,7 @@ vdsk_attach(struct device *parent, struct device *self, void *aux) scsi_iopool_init(&sc->sc_iopool, sc, vdsk_io_get, vdsk_io_put); - sc->sc_switch.scsi_cmd = vdsk_scsi_cmd; - sc->sc_switch.dev_minphys = NULL; - sc->sc_switch.dev_probe = vdsk_dev_probe; - sc->sc_switch.dev_free = vdsk_dev_free; - - sc->sc_link.adapter = &sc->sc_switch; + 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? */ |