summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2008-05-27 21:52:29 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2008-05-27 21:52:29 +0000
commitac3499f62e5e9e7f283e032c046e02e5c3dbbf0f (patch)
tree9e1df288112fced2c3eaad326491e65d906f3eef /sys
parented91ded49608f5f73508c8134d0305176baf4ac2 (diff)
only look up the initiator-id for SPI (aka "real scsi") controllers on
sparc64. this prevents us from setting the initiator id on sas and fc hbas. the scsi midlayer doesnt probe for targets at the initiator id address, so if we set this on fc and sas hbas (which dont really have a real scsi address on the bus), then we're preventing them from finding potential targets at that address. ok kettenis@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/mpi_pci.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/sys/dev/pci/mpi_pci.c b/sys/dev/pci/mpi_pci.c
index d6639b8ec64..b7573eb6878 100644
--- a/sys/dev/pci/mpi_pci.c
+++ b/sys/dev/pci/mpi_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpi_pci.c,v 1.19 2008/05/26 12:48:28 kettenis Exp $ */
+/* $OpenBSD: mpi_pci.c,v 1.20 2008/05/27 21:52:28 dlg Exp $ */
/*
* Copyright (c) 2005 David Gwynne <dlg@openbsd.org>
@@ -113,21 +113,6 @@ mpi_pci_attach(struct device *parent, struct device *self, void *aux)
sc->sc_ios = 0;
sc->sc_target = -1;
-#ifdef __sparc64__
- /*
- * Walk up the Open Firmware device tree until we find a
- * "scsi-initiator-id" property.
- */
- node = PCITAG_NODE(pa->pa_tag);
- while (node) {
- if (OF_getprop(node, "scsi-initiator-id", &sc->sc_target,
- sizeof(sc->sc_target)) == sizeof(sc->sc_target))
- break;
-
- node = OF_parent(node);
- }
-#endif
-
/* find the appropriate memory base */
for (r = PCI_MAPREG_START; r < PCI_MAPREG_END; r += sizeof(memtype)) {
memtype = pci_mapreg_type(psc->psc_pc, psc->psc_tag, r);
@@ -165,8 +150,23 @@ mpi_pci_attach(struct device *parent, struct device *self, void *aux)
printf(": %s", intrstr);
if (pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_ID_REG) ==
- PCI_ID_CODE(PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_1030))
+ PCI_ID_CODE(PCI_VENDOR_SYMBIOS, PCI_PRODUCT_SYMBIOS_1030)) {
sc->sc_flags |= MPI_F_SPI;
+#ifdef __sparc64__
+ /*
+ * Walk up the Open Firmware device tree until we find a
+ * "scsi-initiator-id" property.
+ */
+ node = PCITAG_NODE(pa->pa_tag);
+ while (node) {
+ if (OF_getprop(node, "scsi-initiator-id",
+ &sc->sc_target, sizeof(sc->sc_target)) ==
+ sizeof(sc->sc_target))
+ break;
+ node = OF_parent(node);
+ }
+#endif
+ }
if (mpi_attach(sc) != 0) {
/* error printed by mpi_attach */