public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Vasquez <andrew.vasquez@qlogic.com>
To: James Bottomley <James.Bottomley@steeleye.com>
Cc: SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: PATCH [10/15] qla2xxx: Use fcports list for targets
Date: Sun, 14 Mar 2004 00:25:35 -0800	[thread overview]
Message-ID: <20040314082535.GA3451@linux.local.home> (raw)

ChangeSet
  1.1666 04/03/01 15:37:16 andrew.vasquez@apc.qlogic.com +1 -0
  Consistently use the fcports list of an HA to iterate through the
  known target devices.

 drivers/scsi/qla2xxx/qla_os.c |   47 ++++++++++++++++++++++--------------------
 1 files changed, 25 insertions(+), 22 deletions(-)

ftp://ftp.qlogic.com/outgoing/linux/patches/8.x/8.00.00b11k/19_use_fcport_list.patch

diff -Nru a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
--- a/drivers/scsi/qla2xxx/qla_os.c	Fri Mar 12 17:08:49 2004
+++ b/drivers/scsi/qla2xxx/qla_os.c	Fri Mar 12 17:08:49 2004
@@ -2270,10 +2270,10 @@
     char **start, off_t offset, int length, int inout)
 {
 	struct info_str	info;
-	int             i;
+	int		i;
 	int             retval = -EINVAL;
 	os_lun_t	*up;
-	os_tgt_t	*tq;
+	fc_port_t	*fcport;
 	unsigned int	t, l;
 	uint32_t        tmp_sn;
 	unsigned long   *flags;
@@ -2459,20 +2459,23 @@
 	    ha->init_cb->port_name[7]);
 
 	/* Print out device port names */
-	for (i = 0; i < MAX_TARGETS; i++) {
-		if ((tq = TGT_Q(ha, i)) == NULL)
+	i = 0;
+ 	list_for_each_entry(fcport, &ha->fcports, list) {
+		if (fcport->port_type != FCT_TARGET)
 			continue;
 
 		copy_info(&info,
 		    "scsi-qla%d-target-%d="
-		    "%02x%02x%02x%02x%02x%02x%02x%02x;\n",
+		    "%02x%02x%02x%02x%02x%02x%02x%02x:%02x%02x%02x;\n",
 		    (int)ha->instance, i,
-		    tq->port_name[0], tq->port_name[1],
-		    tq->port_name[2], tq->port_name[3],
-		    tq->port_name[4], tq->port_name[5],
-		    tq->port_name[6], tq->port_name[7]);
-
-	} /* 2.25 node/port display to proc */
+		    fcport->port_name[0], fcport->port_name[1],
+		    fcport->port_name[2], fcport->port_name[3],
+		    fcport->port_name[4], fcport->port_name[5],
+		    fcport->port_name[6], fcport->port_name[7],
+		    fcport->d_id.b.domain, fcport->d_id.b.area,
+		    fcport->d_id.b.al_pa);
+		i++;
+	}
 
 	copy_info(&info, "\nSCSI LUN Information:\n");
 	copy_info(&info,
@@ -2776,11 +2779,11 @@
 void
 qla2x00_mark_all_devices_lost(scsi_qla_host_t *ha) 
 {
-	struct list_head	*fcpl;
-	fc_port_t		*fcport;
+	fc_port_t *fcport;
 
-	list_for_each(fcpl, &ha->fcports) {
-		fcport = list_entry(fcpl, fc_port_t, list);
+	list_for_each_entry(fcport, &ha->fcports, list) {
+		if (fcport->port_type != FCT_TARGET)
+			continue;
 
 		/*
 		 * No point in marking the device as lost, if the device is
@@ -3140,7 +3143,6 @@
 {
 	DECLARE_MUTEX_LOCKED(sem);
 	scsi_qla_host_t *ha;
-	struct list_head *fcpl;
 	fc_port_t	*fcport;
 	os_lun_t        *q;
 	srb_t           *sp;
@@ -3339,9 +3341,10 @@
 			    ha->host_no));
 
 			next_loopid = 0;
-			list_for_each(fcpl, &ha->fcports) {
-				fcport = list_entry(fcpl, fc_port_t, list);
-				
+			list_for_each_entry(fcport, &ha->fcports, list) {
+				if (fcport->port_type != FCT_TARGET)
+					continue;
+
 				/*
 				 * If the port is not ONLINE then try to login
 				 * to it if we haven't run out of retries.
@@ -3643,7 +3646,6 @@
 {
 	int		t,l;
 	unsigned long	cpu_flags = 0;
-	struct list_head	*fcpl;
 	fc_port_t	*fcport;
 	os_lun_t *lq;
 	os_tgt_t *tq;
@@ -3678,8 +3680,9 @@
 	 * the port it marked DEAD. 
 	 */
 	t = 0;
-	list_for_each(fcpl, &ha->fcports) {
-		fcport = list_entry(fcpl, fc_port_t, list);
+	list_for_each_entry(fcport, &ha->fcports, list) {
+		if (fcport->port_type != FCT_TARGET)
+			continue;
 
 		if (atomic_read(&fcport->state) == FCS_DEVICE_LOST) {
 

                 reply	other threads:[~2004-03-14  8:23 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=20040314082535.GA3451@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