summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJonathan Matthew <jmatthew@cvs.openbsd.org>2014-04-05 12:49:28 +0000
committerJonathan Matthew <jmatthew@cvs.openbsd.org>2014-04-05 12:49:28 +0000
commitcf4b8395a00739a2c8782e98bf1af6d22dd9c577 (patch)
tree15d07ed84e629d0719db29c03ce1a9ed462883d3 /sys/dev
parente2eacf6422f30ef36f016c77815f1b9f9e9f3cb0 (diff)
set adapter buswidth according to the number of loop ids supported by the
firmware (2048 for 2k login firmware, 256 otherwise) pointed out by deraadt@, ok dlg@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/qla.c12
-rw-r--r--sys/dev/ic/qlareg.h4
-rw-r--r--sys/dev/ic/qlavar.h7
3 files changed, 13 insertions, 10 deletions
diff --git a/sys/dev/ic/qla.c b/sys/dev/ic/qla.c
index 620e5879984..6b7be1bd351 100644
--- a/sys/dev/ic/qla.c
+++ b/sys/dev/ic/qla.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: qla.c,v 1.32 2014/04/04 11:27:41 jmatthew Exp $ */
+/* $OpenBSD: qla.c,v 1.33 2014/04/05 12:49:27 jmatthew Exp $ */
/*
* Copyright (c) 2011 David Gwynne <dlg@openbsd.org>
@@ -566,9 +566,13 @@ qla_attach(struct qla_softc *sc)
/* we should be good to go now, attach scsibus */
sc->sc_link.adapter = &qla_switch;
sc->sc_link.adapter_softc = sc;
- sc->sc_link.adapter_target = QLA_MAX_TARGETS;
- sc->sc_link.adapter_buswidth = QLA_MAX_TARGETS;
- sc->sc_link.openings = sc->sc_maxcmds; /* / sc->sc_buswidth? */
+ if (sc->sc_2k_logins) {
+ sc->sc_link.adapter_buswidth = QLA_2KL_BUSWIDTH;
+ } else {
+ sc->sc_link.adapter_buswidth = QLA_BUSWIDTH;
+ }
+ sc->sc_link.adapter_target = sc->sc_link.adapter_buswidth;
+ sc->sc_link.openings = sc->sc_maxcmds;
sc->sc_link.pool = &sc->sc_iopool;
sc->sc_link.port_wwn = sc->sc_port_name;
sc->sc_link.node_wwn = sc->sc_node_name;
diff --git a/sys/dev/ic/qlareg.h b/sys/dev/ic/qlareg.h
index 3078bd61f28..16bc3bccb57 100644
--- a/sys/dev/ic/qlareg.h
+++ b/sys/dev/ic/qlareg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: qlareg.h,v 1.5 2014/03/31 11:25:45 jmatthew Exp $ */
+/* $OpenBSD: qlareg.h,v 1.6 2014/04/05 12:49:27 jmatthew Exp $ */
/*
* Copyright (c) 2013, 2014 Jonathan Matthew <jmatthew@openbsd.org>
@@ -491,9 +491,11 @@ struct qla_sns_gid_ft {
/* available handle ranges */
#define QLA_2KL_MIN_HANDLE 0x81
#define QLA_2KL_MAX_HANDLE 0x7EF
+#define QLA_2KL_BUSWIDTH 0x800
#define QLA_MIN_HANDLE 0x81
#define QLA_MAX_HANDLE 0xFE
+#define QLA_BUSWIDTH 0x100
#define QLA_F_PORT_HANDLE 0x7E
#define QLA_FABRIC_CTRL_HANDLE 0x7F
diff --git a/sys/dev/ic/qlavar.h b/sys/dev/ic/qlavar.h
index 82e793a8805..3539e926202 100644
--- a/sys/dev/ic/qlavar.h
+++ b/sys/dev/ic/qlavar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: qlavar.h,v 1.6 2014/03/31 11:25:45 jmatthew Exp $ */
+/* $OpenBSD: qlavar.h,v 1.7 2014/04/05 12:49:27 jmatthew Exp $ */
/*
* Copyright (c) 2013, 2014 Jonathan Matthew <jmatthew@openbsd.org>
@@ -21,9 +21,6 @@
#define QLA_WAIT_FOR_LOOP 10
-/* rounded up range of assignable handles for 2k login firmware */
-#define QLA_MAX_TARGETS 2048
-
/* maximum number of segments allowed for in a single io */
#define QLA_MAX_SEGS 16
@@ -161,7 +158,7 @@ struct qla_softc {
TAILQ_HEAD(, qla_fc_port) sc_ports_new;
TAILQ_HEAD(, qla_fc_port) sc_ports_gone;
TAILQ_HEAD(, qla_fc_port) sc_ports_found;
- struct qla_fc_port *sc_targets[QLA_MAX_TARGETS];
+ struct qla_fc_port *sc_targets[QLA_2KL_BUSWIDTH];
struct taskq *sc_scan_taskq;
int sc_maxcmds;