summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2014-03-07 22:39:09 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2014-03-07 22:39:09 +0000
commitb549fc52d1799de74aa633aca4ef272480a95356 (patch)
treeb2865a17154e35a0315dc99776570b0a19e3d931 /sys/dev/ic
parent4c26d533db46fd9ce60c0565529995ec30c8165c (diff)
Make sure a SCSI initiator ID provided by Open Firmware overrides the value
read from nvram, just like we did for isp(4).
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/qlw.c10
-rw-r--r--sys/dev/ic/qlwvar.h5
2 files changed, 11 insertions, 4 deletions
diff --git a/sys/dev/ic/qlw.c b/sys/dev/ic/qlw.c
index ddf602a839f..ed76ab3895f 100644
--- a/sys/dev/ic/qlw.c
+++ b/sys/dev/ic/qlw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: qlw.c,v 1.3 2014/03/07 22:17:02 kettenis Exp $ */
+/* $OpenBSD: qlw.c,v 1.4 2014/03/07 22:39:07 kettenis Exp $ */
/*
* Copyright (c) 2011 David Gwynne <dlg@openbsd.org>
@@ -1432,7 +1432,9 @@ qlw_parse_nvram_1040(struct qlw_softc *sc, int bus)
KASSERT(bus == 0);
- sc->sc_initiator[0] = (nv->config1 >> 4);
+ if (!ISSET(sc->sc_flags, QLW_FLAG_INITIATOR))
+ sc->sc_initiator[0] = (nv->config1 >> 4);
+
sc->sc_retry_count[0] = nv->retry_count;
sc->sc_retry_delay[0] = nv->retry_delay;
sc->sc_reset_delay[0] = nv->reset_delay;
@@ -1459,7 +1461,9 @@ qlw_parse_nvram_1080(struct qlw_softc *sc, int bus)
struct qlw_nvram_bus *nv = &nvram->bus[bus];
int target;
- sc->sc_initiator[bus] = (nv->config1 & 0x0f);
+ if (!ISSET(sc->sc_flags, QLW_FLAG_INITIATOR))
+ sc->sc_initiator[bus] = (nv->config1 & 0x0f);
+
sc->sc_retry_count[bus] = nv->retry_count;
sc->sc_retry_delay[bus] = nv->retry_delay;
sc->sc_reset_delay[bus] = nv->reset_delay;
diff --git a/sys/dev/ic/qlwvar.h b/sys/dev/ic/qlwvar.h
index 1a306a64100..5a616f8cfe0 100644
--- a/sys/dev/ic/qlwvar.h
+++ b/sys/dev/ic/qlwvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: qlwvar.h,v 1.4 2014/03/07 22:17:03 kettenis Exp $ */
+/* $OpenBSD: qlwvar.h,v 1.5 2014/03/07 22:39:07 kettenis Exp $ */
/*
* Copyright (c) 2013, 2014 Jonathan Matthew <jmatthew@openbsd.org>
@@ -77,6 +77,9 @@ struct qlw_target {
struct qlw_softc {
struct device sc_dev;
+ int sc_flags;
+#define QLW_FLAG_INITIATOR 0x0001
+
bus_space_tag_t sc_iot;
bus_space_handle_t sc_ioh;
bus_size_t sc_ios;