summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2014-03-08 16:56:30 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2014-03-08 16:56:30 +0000
commitdddf2f63b3ee186ee2e733ce4f4c9696b3b08182 (patch)
tree2e196eadc3f976b36d2c1b339ef8df4a51cc2599 /sys
parentcb579514b65a47fde187b0771b39fbde11485721 (diff)
A bit of spring cleaning.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/qlw.c43
-rw-r--r--sys/dev/ic/qlwreg.h7
-rw-r--r--sys/dev/ic/qlwvar.h4
3 files changed, 18 insertions, 36 deletions
diff --git a/sys/dev/ic/qlw.c b/sys/dev/ic/qlw.c
index 3c956925003..c2f2217d218 100644
--- a/sys/dev/ic/qlw.c
+++ b/sys/dev/ic/qlw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: qlw.c,v 1.7 2014/03/08 16:34:29 kettenis Exp $ */
+/* $OpenBSD: qlw.c,v 1.8 2014/03/08 16:56:29 kettenis Exp $ */
/*
* Copyright (c) 2011 David Gwynne <dlg@openbsd.org>
@@ -234,28 +234,10 @@ qlw_attach(struct qlw_softc *sc)
if (sc->sc_isp_config & QLW_BURST_ENABLE)
qlw_dma_burst_enable(sc);
-#if 0
- /* set SCSI termination */
- qlw_write(sc, QLW_GPIO_ENABLE, 0x8f);
- qlw_write(sc, QLW_GPIO_DATA, sc->sc_nvram.termination);
-#endif
-
-#if 0
- sc->sc_mbox[0] = QLW_MBOX_SET_SYSTEM_PARAMETER;
- sc->sc_mbox[1] = sc->sc_nvram.isp_parameter;
- if (qlw_mbox(sc, 0x0003, 0x0001)) {
- printf("couldn't set system parameter: %x\n", sc->sc_mbox[0]);
- return (ENXIO);
- }
-#endif
-
sc->sc_mbox[0] = QLW_MBOX_SET_FIRMWARE_FEATURES;
-#if 0
- sc->sc_mbox[1] = letoh16(sc->sc_nvram.fw_options);
-#else
- sc->sc_mbox[1] = 0x000a;
- sc->sc_mbox[1] = 0x0002;
-#endif
+ sc->sc_mbox[1] = 0;
+ if (sc->sc_fw_features & QLW_FW_FEATURE_LVD_NOTIFY)
+ sc->sc_mbox[1] |= QLW_FW_FEATURE_LVD_NOTIFY;
if (qlw_mbox(sc, 0x0003, 0x0001)) {
printf("couldn't set firmware features: %x\n", sc->sc_mbox[0]);
return (ENXIO);
@@ -296,18 +278,9 @@ qlw_attach(struct qlw_softc *sc)
return (ENXIO);
}
-#if 0
- sc->sc_mbox[0] = QLW_MBOX_SET_DATA_OVERRUN_RECOVERY;
- sc->sc_mbox[1] = 2;
- if (qlw_mbox(sc, 0x0003, 0x0001)) {
- printf("couldn't set data overrun recovery: %x\n", sc->sc_mbox[0]);
- return (ENXIO);
- }
-#endif
-
sc->sc_mbox[0] = QLW_MBOX_SET_TAG_AGE_LIMIT;
- sc->sc_mbox[1] = 8;
- sc->sc_mbox[2] = 8;
+ sc->sc_mbox[1] = sc->sc_tag_age_limit[0];
+ sc->sc_mbox[2] = sc->sc_tag_age_limit[1];
if (qlw_mbox(sc, 0x0007, 0x0001)) {
printf("couldn't set tag age limit: %x\n", sc->sc_mbox[0]);
return (ENXIO);
@@ -1454,6 +1427,7 @@ qlw_parse_nvram_1040(struct qlw_softc *sc, int bus)
sc->sc_retry_count[0] = nv->retry_count;
sc->sc_retry_delay[0] = nv->retry_delay;
sc->sc_reset_delay[0] = nv->reset_delay;
+ sc->sc_tag_age_limit[0] = nv->tag_age_limit;
sc->sc_selection_timeout[0] = letoh16(nv->selection_timeout);
sc->sc_max_queue_depth[0] = letoh16(nv->max_queue_depth);
sc->sc_async_data_setup[0] = (nv->config2 & 0x0f);
@@ -1478,6 +1452,7 @@ qlw_parse_nvram_1080(struct qlw_softc *sc, int bus)
int target;
sc->sc_isp_config = nvram->isp_config;
+ sc->sc_fw_features = nvram->fw_features;
if (!ISSET(sc->sc_flags, QLW_FLAG_INITIATOR))
sc->sc_initiator[bus] = (nv->config1 & 0x0f);
@@ -1516,12 +1491,14 @@ qlw_init_defaults(struct qlw_softc *sc, int bus)
case QLW_GEN_ISP1080:
case QLW_GEN_ISP12160:
sc->sc_isp_config = QLW_BURST_ENABLE | QLW_PCI_FIFO_128;
+ sc->sc_fw_features = QLW_FW_FEATURE_LVD_NOTIFY;
break;
}
sc->sc_retry_count[bus] = 0;
sc->sc_retry_delay[bus] = 0;
sc->sc_reset_delay[bus] = 3;
+ sc->sc_tag_age_limit[bus] = 8;
sc->sc_selection_timeout[bus] = 250;
sc->sc_max_queue_depth[bus] = 32;
if (sc->sc_clock > 40)
diff --git a/sys/dev/ic/qlwreg.h b/sys/dev/ic/qlwreg.h
index a84b54c11b2..33b00711144 100644
--- a/sys/dev/ic/qlwreg.h
+++ b/sys/dev/ic/qlwreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: qlwreg.h,v 1.2 2014/03/08 15:13:12 kettenis Exp $ */
+/* $OpenBSD: qlwreg.h,v 1.3 2014/03/08 16:56:29 kettenis Exp $ */
/*
* Copyright (c) 2013, 2014 Jonathan Matthew <jmatthew@openbsd.org>
@@ -141,6 +141,9 @@
#define QLW_MBOX_ABOUT_FIRMWARE_OUT 0x004f
#define QLW_MBOX_INIT_FIRMWARE_IN 0x00fd
+#define QLW_FW_FEATURE_FAST_POSTING 0x0001
+#define QLW_FW_FEATURE_LVD_NOTIFY 0x0002
+
/* nvram layout */
struct qlw_nvram_target {
u_int8_t parameter;
@@ -193,7 +196,7 @@ struct qlw_nvram_1080 {
u_int8_t isp_config;
u_int8_t termination;
u_int16_t isp_parameter;
- u_int16_t fw_options;
+ u_int16_t fw_features;
u_int16_t reserved_1;
struct qlw_nvram_bus bus[2];
u_int8_t reserved_2[2];
diff --git a/sys/dev/ic/qlwvar.h b/sys/dev/ic/qlwvar.h
index 7ce708d6229..882e5df32ff 100644
--- a/sys/dev/ic/qlwvar.h
+++ b/sys/dev/ic/qlwvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: qlwvar.h,v 1.6 2014/03/08 15:13:12 kettenis Exp $ */
+/* $OpenBSD: qlwvar.h,v 1.7 2014/03/08 16:56:29 kettenis Exp $ */
/*
* Copyright (c) 2013, 2014 Jonathan Matthew <jmatthew@openbsd.org>
@@ -121,11 +121,13 @@ struct qlw_softc {
int sc_nvram_minversion;
u_int16_t sc_isp_config;
+ u_int16_t sc_fw_features;
u_int8_t sc_initiator[2];
u_int8_t sc_retry_count[2];
u_int8_t sc_retry_delay[2];
u_int8_t sc_reset_delay[2];
+ u_int8_t sc_tag_age_limit[2];
u_int16_t sc_selection_timeout[2];
u_int16_t sc_max_queue_depth[2];
u_int8_t sc_async_data_setup[2];