summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorkn <kn@cvs.openbsd.org>2020-01-03 08:39:32 +0000
committerkn <kn@cvs.openbsd.org>2020-01-03 08:39:32 +0000
commit78f833cd7d632f5101c9396e42802f383ac1eff0 (patch)
tree0574c4c859bb452d5b0457a84368b25074767dc3 /sys/dev/pci
parent0c1734879c0f73c5b87510652a9b7b7ccb7980d9 (diff)
Fix RAID volume WWIDs for LSI controllers on sparc64
Some controllers generate 128 bit WWIDs for RAID volumes but only has a 64-bit field to report it to the host, so it only puts the vendor-specified part here (last half of ID string printed when sd* attaches matches sl->port_wwn in reverse). As such IDs are not IEEE NAA compliant, OpenBoot PROM -at least on SPARC- sets the highest nibble to three by convention to mark such volumes as RAID volumes so that the OS (Solaris) may identify it as such. This is the last missing piece to make booting off hardware RAID on sparc64 just work; autoconf(9) is now able to match the port WWN against the bootpath to eventually identify the volume as the root device. Feedback jmatthew deraadt OK jmatthew
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/mpii.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/dev/pci/mpii.c b/sys/dev/pci/mpii.c
index 52777f6c326..051ca5e511c 100644
--- a/sys/dev/pci/mpii.c
+++ b/sys/dev/pci/mpii.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpii.c,v 1.124 2019/12/31 10:05:33 mpi Exp $ */
+/* $OpenBSD: mpii.c,v 1.125 2020/01/03 08:39:31 kn Exp $ */
/*
* Copyright (c) 2010, 2012 Mike Belopuhov
* Copyright (c) 2009 James Giannoules
@@ -930,6 +930,15 @@ mpii_scsi_probe(struct scsi_link *link)
return (EINVAL);
link->port_wwn = letoh64(vpg.wwid);
+#ifdef __sparc64__
+ /*
+ * WWIDs generated by LSI firmware are not IEEE NAA compliant
+ * so historical practise in OBP is to set the top nibble to 3
+ * to indicate that this is a RAID volume.
+ */
+ link->port_wwn &= 0x0fffffffffffffff;
+ link->port_wwn |= 0x3000000000000000;
+#endif
return (0);
}