From 86f828d7145037fd40e80a41623e2caf5196ccd5 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 6 May 2019 00:42:19 +0000 Subject: [PATCH 1/2] qla2x00t-32gbit: Rework key encoding in qlt_find_host_by_d_id() Use the same approach for encoding the destination ID as the approach used by qlt_update_vp_map(). git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8350 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t-32gbit/qla_target.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/qla2x00t-32gbit/qla_target.c b/qla2x00t-32gbit/qla_target.c index 637692568..cdcfd1871 100644 --- a/qla2x00t-32gbit/qla_target.c +++ b/qla2x00t-32gbit/qla_target.c @@ -213,16 +213,14 @@ struct scsi_qla_host *qlt_find_host_by_d_id(struct scsi_qla_host *vha, be_id_t d_id) { struct scsi_qla_host *host; - uint32_t key = 0; + uint32_t key; if (vha->d_id.b.area == d_id.area && vha->d_id.b.domain == d_id.domain && vha->d_id.b.al_pa == d_id.al_pa) return vha; - key = d_id.domain << 16; - key |= d_id.area << 8; - key |= d_id.al_pa; + key = be_to_port_id(d_id).b24; host = btree_lookup32(&vha->hw->tgt.host_map, key); if (!host) From 0ed0d353959530888766a3c20c44807dde624205 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 6 May 2019 01:47:21 +0000 Subject: [PATCH 2/2] qla2x00t-32gbit: Fix PRLI and PLOGI handling git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8351 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t-32gbit/qla_init.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qla2x00t-32gbit/qla_init.c b/qla2x00t-32gbit/qla_init.c index ef4c3abcc..1f10663ee 100644 --- a/qla2x00t-32gbit/qla_init.c +++ b/qla2x00t-32gbit/qla_init.c @@ -465,7 +465,7 @@ void qla24xx_handle_adisc_event(scsi_qla_host_t *vha, struct event_arg *ea) fcport->fw_login_state, ea->rc, fcport->login_gen, ea->sp->gen2, fcport->rscn_gen, ea->sp->gen1, fcport->loop_id); - if (ea->data[0] != MBS_COMMAND_COMPLETE) { + if (ea->rc != (MBS_COMMAND_COMPLETE & MBS_MASK)) { ql_dbg(ql_dbg_disc, vha, 0x2066, "%s %s: adisc fail: post delete\n", __func__, wwn_to_str(ea->fcport->port_name)); @@ -1884,7 +1884,7 @@ qla24xx_async_abort_command(srb_t *sp) static void qla24xx_handle_prli_done_event(struct scsi_qla_host *vha, struct event_arg *ea) { - switch (ea->data[0]) { + switch (ea->rc | MBS_COMMAND_COMPLETE) { case MBS_COMMAND_COMPLETE: ql_dbg(ql_dbg_disc, vha, 0x2118, "%s %d %s post gpdb\n", __func__, __LINE__, wwn_to_str(ea->fcport->port_name)); @@ -1965,7 +1965,7 @@ qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea) return; } - switch (ea->data[0]) { + switch (ea->rc | MBS_COMMAND_COMPLETE) { case MBS_COMMAND_COMPLETE: /* * Driver must validate login state - If PRLI not complete,