diff options
author | 2020-07-19 18:57:57 +0000 | |
---|---|---|
committer | 2020-07-19 18:57:57 +0000 | |
commit | ead808c42040dde55a8ea2938802849f628f2859 (patch) | |
tree | eaa6027c39fae179c81fd6469d744349804e203a /sys/dev/pci | |
parent | Should use ufs_args here after all. (diff) | |
download | wireguard-openbsd-ead808c42040dde55a8ea2938802849f628f2859.tar.xz wireguard-openbsd-ead808c42040dde55a8ea2938802849f628f2859.zip |
Move the adapter related items (luns, adapter, adapter_target,
adapter_buswidth, adapter_softc) from struct scsi_link to struct
scsibus_attach_args.
Additional compile tests by jmatthew@ (sparc64) and aoyam@ (luna88k).
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/arc.c | 11 | ||||
-rw-r--r-- | sys/dev/pci/iha_pci.c | 11 | ||||
-rw-r--r-- | sys/dev/pci/ips.c | 21 | ||||
-rw-r--r-- | sys/dev/pci/mfii.c | 20 | ||||
-rw-r--r-- | sys/dev/pci/mpii.c | 12 | ||||
-rw-r--r-- | sys/dev/pci/qle.c | 11 | ||||
-rw-r--r-- | sys/dev/pci/trm_pci.c | 13 | ||||
-rw-r--r-- | sys/dev/pci/vmwpvs.c | 11 |
8 files changed, 60 insertions, 50 deletions
diff --git a/sys/dev/pci/arc.c b/sys/dev/pci/arc.c index bbc787bc669..b62e906d7bf 100644 --- a/sys/dev/pci/arc.c +++ b/sys/dev/pci/arc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arc.c,v 1.115 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: arc.c,v 1.116 2020/07/19 18:57:58 krw Exp $ */ /* * Copyright (c) 2006 David Gwynne <dlg@openbsd.org> @@ -801,14 +801,15 @@ arc_attach(struct device *parent, struct device *self, void *aux) goto unmap_pci; } - sc->sc_link.adapter = &arc_switch; - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter_target = SDEV_NO_ADAPTER_TARGET; - sc->sc_link.adapter_buswidth = ARC_MAX_TARGET; sc->sc_link.openings = sc->sc_req_count; sc->sc_link.pool = &sc->sc_iopool; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter = &arc_switch; + saa.saa_adapter_softc = sc; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; + saa.saa_adapter_buswidth = ARC_MAX_TARGET; + saa.saa_luns = 8; sc->sc_scsibus = (struct scsibus_softc *)config_found(self, &saa, scsiprint); diff --git a/sys/dev/pci/iha_pci.c b/sys/dev/pci/iha_pci.c index a1c8a8f69d3..f01a374cdf4 100644 --- a/sys/dev/pci/iha_pci.c +++ b/sys/dev/pci/iha_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: iha_pci.c,v 1.16 2020/07/11 13:34:06 krw Exp $ */ +/* $OpenBSD: iha_pci.c,v 1.17 2020/07/19 18:57:58 krw Exp $ */ /*------------------------------------------------------------------------- * * Device driver for the INI-9XXXU/UW or INIC-940/950 PCI SCSI Controller. @@ -134,14 +134,15 @@ iha_pci_attach(parent, self, aux) printf(": %s\n", intrstr); if (iha_init_tulip(sc) == 0) { - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter = &iha_switch; sc->sc_link.openings = 4; /* # xs's allowed per device */ - sc->sc_link.adapter_target = sc->sc_id; - sc->sc_link.adapter_buswidth = sc->sc_maxtargets; sc->sc_link.pool = &sc->sc_iopool; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter_softc = sc; + saa.saa_adapter = &iha_switch; + saa.saa_adapter_target = sc->sc_id; + saa.saa_adapter_buswidth = sc->sc_maxtargets; + saa.saa_luns = 8; config_found(&sc->sc_dev, &saa, scsiprint); } diff --git a/sys/dev/pci/ips.c b/sys/dev/pci/ips.c index 57e88973543..7fcf00d96c4 100644 --- a/sys/dev/pci/ips.c +++ b/sys/dev/pci/ips.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ips.c,v 1.123 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: ips.c,v 1.124 2020/07/19 18:57:58 krw Exp $ */ /* * Copyright (c) 2006, 2007, 2009 Alexander Yurchenko <grange@openbsd.org> @@ -720,13 +720,15 @@ ips_attach(struct device *parent, struct device *self, void *aux) if (sc->sc_nunits > 0) sc->sc_scsi_link.openings = sc->sc_nccbs / sc->sc_nunits; - sc->sc_scsi_link.adapter_target = SDEV_NO_ADAPTER_TARGET; - sc->sc_scsi_link.adapter_buswidth = sc->sc_nunits; - sc->sc_scsi_link.adapter = &ips_switch; - sc->sc_scsi_link.adapter_softc = sc; sc->sc_scsi_link.pool = &sc->sc_iopool; saa.saa_sc_link = &sc->sc_scsi_link; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; + saa.saa_adapter_buswidth = sc->sc_nunits; + saa.saa_adapter = &ips_switch; + saa.saa_adapter_softc = sc; + saa.saa_luns = 8; + sc->sc_scsibus = (struct scsibus_softc *)config_found(self, &saa, scsiprint); @@ -762,13 +764,14 @@ ips_attach(struct device *parent, struct device *self, void *aux) link = &pt->pt_link; link->openings = 1; - link->adapter_target = IPS_MAXTARGETS; - link->adapter_buswidth = lastarget + 1; - link->adapter = &ips_pt_switch; - link->adapter_softc = pt; link->pool = &sc->sc_iopool; saa.saa_sc_link = link; + saa.saa_adapter = &ips_pt_switch; + saa.saa_adapter_softc = pt; + saa.saa_adapter_buswidth = lastarget + 1; + saa.saa_adapter_target = IPS_MAXTARGETS; + saa.saa_luns = 8; config_found(self, &saa, scsiprint); } diff --git a/sys/dev/pci/mfii.c b/sys/dev/pci/mfii.c index c88c2463fec..054edaf6c41 100644 --- a/sys/dev/pci/mfii.c +++ b/sys/dev/pci/mfii.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mfii.c,v 1.77 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: mfii.c,v 1.78 2020/07/19 18:57:58 krw Exp $ */ /* * Copyright (c) 2012 David Gwynne <dlg@openbsd.org> @@ -782,13 +782,14 @@ mfii_attach(struct device *parent, struct device *self, void *aux) goto free_sgl; sc->sc_link.openings = sc->sc_max_cmds; - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter = &mfii_switch; - sc->sc_link.adapter_target = SDEV_NO_ADAPTER_TARGET; - sc->sc_link.adapter_buswidth = sc->sc_info.mci_max_lds; sc->sc_link.pool = &sc->sc_iopool; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter_softc = sc; + saa.saa_adapter = &mfii_switch; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; + saa.saa_adapter_buswidth = sc->sc_info.mci_max_lds; + saa.saa_luns = 8; sc->sc_scsibus = (struct scsibus_softc *)config_found(&sc->sc_dev, &saa, scsiprint); @@ -917,14 +918,15 @@ mfii_syspd(struct mfii_softc *sc) goto free_pdsc; link = &sc->sc_pd->pd_link; - link->adapter = &mfii_pd_switch; - link->adapter_softc = sc; - link->adapter_buswidth = MFI_MAX_PD; - link->adapter_target = SDEV_NO_ADAPTER_TARGET; link->openings = sc->sc_max_cmds - 1; link->pool = &sc->sc_iopool; saa.saa_sc_link = link; + saa.saa_adapter = &mfii_pd_switch; + saa.saa_adapter_softc = sc; + saa.saa_adapter_buswidth = MFI_MAX_PD; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; + saa.saa_luns = 8; sc->sc_pd->pd_scsibus = (struct scsibus_softc *) config_found(&sc->sc_dev, &saa, scsiprint); diff --git a/sys/dev/pci/mpii.c b/sys/dev/pci/mpii.c index adfcaf75a8a..714cc2436b7 100644 --- a/sys/dev/pci/mpii.c +++ b/sys/dev/pci/mpii.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpii.c,v 1.135 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: mpii.c,v 1.136 2020/07/19 18:57:58 krw Exp $ */ /* * Copyright (c) 2010, 2012 Mike Belopuhov * Copyright (c) 2009 James Giannoules @@ -590,15 +590,15 @@ mpii_attach(struct device *parent, struct device *self, void *aux) sc->sc_pending = 1; config_pending_incr(); - sc->sc_link.adapter = &mpii_switch; - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter_target = SDEV_NO_ADAPTER_TARGET; - sc->sc_link.adapter_buswidth = sc->sc_max_devices; - sc->sc_link.luns = 1; sc->sc_link.openings = sc->sc_max_cmds - 1; sc->sc_link.pool = &sc->sc_iopool; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter = &mpii_switch; + saa.saa_adapter_softc = sc; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; + saa.saa_adapter_buswidth = sc->sc_max_devices; + saa.saa_luns = 1; sc->sc_scsibus = (struct scsibus_softc *) config_found(&sc->sc_dev, &saa, scsiprint); diff --git a/sys/dev/pci/qle.c b/sys/dev/pci/qle.c index 8a259b89664..65669ecd537 100644 --- a/sys/dev/pci/qle.c +++ b/sys/dev/pci/qle.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qle.c,v 1.57 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: qle.c,v 1.58 2020/07/19 18:57:58 krw Exp $ */ /* * Copyright (c) 2013, 2014 Jonathan Matthew <jmatthew@openbsd.org> @@ -654,10 +654,6 @@ qle_attach(struct device *parent, struct device *self, void *aux) DEVNAME(sc)); } - sc->sc_link.adapter = &qle_switch; - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter_target = SDEV_NO_ADAPTER_TARGET; - sc->sc_link.adapter_buswidth = QLE_MAX_TARGETS; sc->sc_link.openings = sc->sc_maxcmds; sc->sc_link.pool = &sc->sc_iopool; if (sc->sc_nvram_valid) { @@ -677,6 +673,11 @@ qle_attach(struct device *parent, struct device *self, void *aux) } saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter = &qle_switch; + saa.saa_adapter_softc = sc; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; + saa.saa_adapter_buswidth = QLE_MAX_TARGETS; + saa.saa_luns = 8; sc->sc_scsibus = (struct scsibus_softc *)config_found(&sc->sc_dev, &saa, scsiprint); diff --git a/sys/dev/pci/trm_pci.c b/sys/dev/pci/trm_pci.c index b1bafecea67..fbb991a759e 100644 --- a/sys/dev/pci/trm_pci.c +++ b/sys/dev/pci/trm_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trm_pci.c,v 1.8 2020/07/11 13:34:06 krw Exp $ +/* $OpenBSD: trm_pci.c,v 1.9 2020/07/19 18:57:58 krw Exp $ * ------------------------------------------------------------ * O.S : OpenBSD * FILE NAME : trm_pci.c @@ -161,14 +161,15 @@ trm_pci_attach(struct device *parent, struct device *self, void *aux) if (intrstr != NULL) printf(": %s\n", intrstr); - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter_target = sc->sc_AdaptSCSIID; sc->sc_link.openings = 30; /* So TagMask (32 bit integer) always has space */ - sc->sc_link.adapter = &trm_switch; - sc->sc_link.adapter_buswidth = ((sc->sc_config & HCC_WIDE_CARD) == 0) ? 8:16; sc->sc_link.pool = &sc->sc_iopool; - saa.saa_sc_link = &sc->sc_link; + saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter_softc = sc; + saa.saa_adapter_target = sc->sc_AdaptSCSIID; + saa.saa_adapter = &trm_switch; + saa.saa_adapter_buswidth = ((sc->sc_config & HCC_WIDE_CARD) == 0) ? 8:16; + saa.saa_luns = 8; config_found(&sc->sc_device, &saa, scsiprint); } diff --git a/sys/dev/pci/vmwpvs.c b/sys/dev/pci/vmwpvs.c index 94d13b83e02..5f9ad29a67d 100644 --- a/sys/dev/pci/vmwpvs.c +++ b/sys/dev/pci/vmwpvs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmwpvs.c,v 1.20 2020/07/16 21:18:30 krw Exp $ */ +/* $OpenBSD: vmwpvs.c,v 1.21 2020/07/19 18:57:58 krw Exp $ */ /* * Copyright (c) 2013 David Gwynne <dlg@openbsd.org> @@ -558,14 +558,15 @@ vmwpvs_attach(struct device *parent, struct device *self, void *aux) scsi_iopool_init(&sc->sc_iopool, sc, vmwpvs_ccb_get, vmwpvs_ccb_put); - sc->sc_link.adapter = &vmwpvs_switch; - sc->sc_link.adapter_softc = sc; - sc->sc_link.adapter_target = SDEV_NO_ADAPTER_TARGET; - sc->sc_link.adapter_buswidth = sc->sc_bus_width; sc->sc_link.openings = VMWPVS_OPENINGS; sc->sc_link.pool = &sc->sc_iopool; saa.saa_sc_link = &sc->sc_link; + saa.saa_adapter = &vmwpvs_switch; + saa.saa_adapter_softc = sc; + saa.saa_adapter_target = SDEV_NO_ADAPTER_TARGET; + saa.saa_adapter_buswidth = sc->sc_bus_width; + saa.saa_luns = 8; sc->sc_scsibus = (struct scsibus_softc *)config_found(&sc->sc_dev, &saa, scsiprint); |