summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sparc/dev/isp_sbus.c5
-rw-r--r--sys/dev/ic/isp_openbsd.h5
-rw-r--r--sys/dev/pci/isp_pci.c24
-rw-r--r--sys/dev/sbus/isp_sbus.c5
4 files changed, 33 insertions, 6 deletions
diff --git a/sys/arch/sparc/dev/isp_sbus.c b/sys/arch/sparc/dev/isp_sbus.c
index f13bb7b37b0..5b70de874bf 100644
--- a/sys/arch/sparc/dev/isp_sbus.c
+++ b/sys/arch/sparc/dev/isp_sbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isp_sbus.c,v 1.24 2004/09/29 07:35:11 miod Exp $ */
+/* $OpenBSD: isp_sbus.c,v 1.25 2008/06/01 15:49:25 kettenis Exp $ */
/*
* SBus specific probe and attach routines for Qlogic ISP SCSI adapters.
*
@@ -176,6 +176,9 @@ isp_sbus_attach(struct device *parent, struct device *self, void *aux)
}
sbc->sbus_mdvec.dv_clock = freq;
+ DEFAULT_IID(isp) =
+ getpropint(ca->ca_ra.ra_node, "scsi-initiator-id", 7);
+
if ((bp = ca->ca_ra.ra_bp) != NULL) {
if (bp->val[0] == ca->ca_slot &&
bp->val[1] == ca->ca_offset) {
diff --git a/sys/dev/ic/isp_openbsd.h b/sys/dev/ic/isp_openbsd.h
index f08f1a95968..719f1ca600c 100644
--- a/sys/dev/ic/isp_openbsd.h
+++ b/sys/dev/ic/isp_openbsd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: isp_openbsd.h,v 1.27 2008/01/21 20:00:33 sobrado Exp $ */
+/* $OpenBSD: isp_openbsd.h,v 1.28 2008/06/01 15:49:25 kettenis Exp $ */
/*
* OpenBSD Specific definitions for the QLogic ISP Host Adapter
*/
@@ -89,6 +89,7 @@ struct isposinfo {
rtpend : 1,
no_mbox_ints : 1,
blocked : 2;
+ int _iid;
union {
u_int64_t _wwn;
u_int16_t _discovered[2];
@@ -246,7 +247,7 @@ default: \
#define XS_SET_STATE_STAT(a, b, c)
-#define DEFAULT_IID(x) 7
+#define DEFAULT_IID(isp) (isp)->isp_osinfo._iid
#define DEFAULT_LOOPID(x) 107
#define DEFAULT_NODEWWN(isp) (isp)->isp_osinfo.un._wwn
#define DEFAULT_PORTWWN(isp) (isp)->isp_osinfo.un._wwn
diff --git a/sys/dev/pci/isp_pci.c b/sys/dev/pci/isp_pci.c
index 4524d4c3ef5..5c74cddab84 100644
--- a/sys/dev/pci/isp_pci.c
+++ b/sys/dev/pci/isp_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isp_pci.c,v 1.43 2008/05/28 18:46:56 kettenis Exp $ */
+/* $OpenBSD: isp_pci.c,v 1.44 2008/06/01 15:49:25 kettenis Exp $ */
/*
* PCI specific probe and attach routines for QLogic ISP SCSI adapters.
*
@@ -404,6 +404,28 @@ isp_pci_attach(struct device *parent, struct device *self, void *aux)
int ioh_valid, memh_valid;
bus_size_t iosize, msize;
u_int32_t confopts = 0;
+#ifdef __sparc64__
+ int node, iid;
+#endif
+
+ DEFAULT_IID(isp) = 7;
+#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",
+ &iid, sizeof(iid)) == sizeof(iid)) {
+ DEFAULT_IID(isp) = iid;
+ confopts |= ISP_CFG_OWNLOOPID;
+ break;
+ }
+
+ node = OF_parent(node);
+ }
+#endif
ioh_valid = memh_valid = 0;
diff --git a/sys/dev/sbus/isp_sbus.c b/sys/dev/sbus/isp_sbus.c
index 0abb1879d31..1d5007770cd 100644
--- a/sys/dev/sbus/isp_sbus.c
+++ b/sys/dev/sbus/isp_sbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isp_sbus.c,v 1.11 2008/01/21 20:00:33 sobrado Exp $ */
+/* $OpenBSD: isp_sbus.c,v 1.12 2008/06/01 15:49:25 kettenis Exp $ */
/* $NetBSD: isp_sbus.c,v 1.46 2001/09/26 20:53:14 eeh Exp $ */
/*
@@ -76,7 +76,6 @@
#include <dev/microcode/isp/asm_sbus.h>
#endif
#include <dev/sbus/sbusvar.h>
-#include <sys/reboot.h>
static int isp_sbus_intr(void *);
static int
@@ -197,6 +196,8 @@ isp_sbus_attach(struct device *parent, struct device *self, void *aux)
}
sbc->sbus_mdvec.dv_clock = freq;
+ DEFAULT_IID(isp) = getpropint(sa->sa_node, "scsi-initiator-id", 7);
+
/*
* Now figure out what the proper burst sizes, etc., to use.
* Unfortunately, there is no ddi_dma_burstsizes here which