summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkn <kn@openbsd.org>2020-01-03 08:39:31 +0000
committerkn <kn@openbsd.org>2020-01-03 08:39:31 +0000
commitde8bbe4ae3ee4976f21d80c85bfcba02ecd4019b (patch)
treef00258e569ad7a2eb91c32553217938a30429453
parentthe download resident keys option is -K (upper) not -k (lower); (diff)
downloadwireguard-openbsd-de8bbe4ae3ee4976f21d80c85bfcba02ecd4019b.tar.xz
wireguard-openbsd-de8bbe4ae3ee4976f21d80c85bfcba02ecd4019b.zip
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
-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);
}