public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Vasquez <andrew.vasquez@qlogic.com>
To: SCSI Mailing List <linux-scsi@vger.kernel.org>,
	James Bottomley <James.Bottomley@steeleye.com>
Subject: PATCH [4/15]  qla2xxx: PortID binding fixes
Date: Thu, 6 May 2004 22:51:45 -0700	[thread overview]
Message-ID: <20040507055145.GA4901@linux.local.home> (raw)

ChangeSet
  1.1925 04/04/30 10:48:48 andrew.vasquez@apc.qlogic.com +1 -0
  Fix problem where port ID binding would not be honoured when
  a device was moved within the fabric.

 drivers/scsi/qla2xxx/qla_init.c |   33 ++++++++++++++++++++++++---------
 1 files changed, 24 insertions(+), 9 deletions(-)

diff -Nru a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
--- a/drivers/scsi/qla2xxx/qla_init.c	Mon May  3 15:13:47 2004
+++ b/drivers/scsi/qla2xxx/qla_init.c	Mon May  3 15:13:47 2004
@@ -3290,6 +3290,7 @@
 static uint16_t
 qla2x00_fcport_bind(scsi_qla_host_t *ha, fc_port_t *fcport) 
 {
+	int		found;
 	uint16_t	tgt;
 	os_tgt_t	*tq;
 
@@ -3298,18 +3299,32 @@
 		if ((tq = TGT_Q(ha, tgt)) == NULL)
 			continue;
 
-		if (ha->binding_type == BIND_BY_PORT_ID &&
-		    fcport->d_id.b24 == tq->d_id.b24) {
-			memcpy(tq->node_name, fcport->node_name, WWN_SIZE);
-			memcpy(tq->port_name, fcport->port_name, WWN_SIZE);
+		found = 0;
+		switch (ha->binding_type) {
+		case BIND_BY_PORT_ID:
+			if (fcport->d_id.b24 == tq->d_id.b24) {
+				memcpy(tq->node_name, fcport->node_name,
+				    WWN_SIZE);
+				memcpy(tq->port_name, fcport->port_name,
+				    WWN_SIZE);
+				found++;
+			}
 			break;
-		}
-
-		if (memcmp(fcport->port_name, tq->port_name, WWN_SIZE) == 0) {
-			/* In case of persistent binding, update the WWNN */
-			memcpy(tq->node_name, fcport->node_name, WWN_SIZE);
+		case BIND_BY_PORT_NAME:    
+			if (memcmp(fcport->port_name, tq->port_name,
+			    WWN_SIZE) == 0) {
+				/*
+				 * In case of persistent binding, update the
+				 * WWNN.
+				 */
+				memcpy(tq->node_name, fcport->node_name,
+				    WWN_SIZE);
+				found++;
+			}
 			break;
 		}
+		if (found)
+		    break;	
 	}
 
 	/* TODO: honor the ConfigRequired flag */

                 reply	other threads:[~2004-05-07  5:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040507055145.GA4901@linux.local.home \
    --to=andrew.vasquez@qlogic.com \
    --cc=James.Bottomley@steeleye.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox