summaryrefslogtreecommitdiff
path: root/sys/dev/pci/isp_pci.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2008-06-01 15:49:26 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2008-06-01 15:49:26 +0000
commite36e9b532a339d0c6ec3ad4de0ce9f8b080d240c (patch)
tree39fa2dd6d7f107d6d9571f55bdda5557d86b012e /sys/dev/pci/isp_pci.c
parentea2b13562c5d2ee5ccf734f7ce9336d4bf9a5bd1 (diff)
Make SCSI isp(4) use the same SCSI initiator ID as the prom on sparc/sparc64.
ok marco@, krw@, deraadt@
Diffstat (limited to 'sys/dev/pci/isp_pci.c')
-rw-r--r--sys/dev/pci/isp_pci.c24
1 files changed, 23 insertions, 1 deletions
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;