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 [7/15]  qla2xxx: Firmware options fixes
Date: Thu, 6 May 2004 22:54:00 -0700	[thread overview]
Message-ID: <20040507055400.GA4922@linux.local.home> (raw)

ChangeSet
  1.1928 04/04/30 12:47:27 andrew.vasquez@apc.qlogic.com +1 -0
  Cleanup retrieval and update of firmware options:
  
  	o Update only valid for non-(2[12]00) ISPs.
  	o Instruct firmware to return completed IOCBs without
  	  waiting for an ABTS to complete.

 drivers/scsi/qla2xxx/qla_init.c |   79 +++++++++++++++++++++++++---------------
 1 files changed, 50 insertions(+), 29 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:14:42 2004
+++ b/drivers/scsi/qla2xxx/qla_init.c	Mon May  3 15:14:42 2004
@@ -772,6 +772,54 @@
 }
 
 /**
+ * qla2x00_update_fw_options() - Read and process firmware options.
+ * @ha: HA context
+ *
+ * Returns 0 on success.
+ */
+static void
+qla2x00_update_fw_options(scsi_qla_host_t *ha)
+{
+	/* Setup seriallink options */
+	uint16_t swing, emphasis;
+
+	memset(ha->fw_options, 0, sizeof(ha->fw_options));
+	qla2x00_get_fw_options(ha, ha->fw_options);
+
+	if (IS_QLA2100(ha) || IS_QLA2200(ha))
+		return;
+
+	/* Serial Link options. */
+	DEBUG3(printk("scsi(%ld): Serial link options:\n",
+	    ha->host_no));
+	DEBUG3(qla2x00_dump_buffer((uint8_t *)&ha->fw_seriallink_options,
+	    sizeof(ha->fw_seriallink_options)));
+
+	ha->fw_options[1] &= ~FO1_SET_EMPHASIS_SWING;
+	if (ha->fw_seriallink_options[1] & BIT_2)
+		ha->fw_options[1] |= FO1_SET_EMPHASIS_SWING;
+
+	/*  1G settings */
+	swing = ha->fw_seriallink_options[0] & (BIT_2 | BIT_1 | BIT_0);
+	emphasis = ha->fw_seriallink_options[0] & (BIT_4 | BIT_3);
+	emphasis >>= 3;
+	ha->fw_options[10] = (emphasis << 14) | (swing << 8) | 0x3;
+
+	/*  2G settings */
+	swing = ha->fw_seriallink_options[0] & (BIT_7 | BIT_6 | BIT_5);
+	swing >>= 5;
+	emphasis = ha->fw_seriallink_options[1] & (BIT_1 | BIT_0);
+	ha->fw_options[11] = (emphasis << 14) | (swing << 8) | 0x3;
+
+	/* FCP2 options. */
+	/*  Return command IOCBs without waiting for an ABTS to complete. */
+	ha->fw_options[3] |= BIT_13;
+
+	/* Update Serial Link options. */
+	qla2x00_set_fw_options(ha, ha->fw_options);
+}
+
+/**
  * qla2x00_init_rings() - Initializes firmware.
  * @ha: HA context
  *
@@ -824,35 +872,8 @@
 		DEBUG2_3(printk("scsi(%ld): Init firmware **** FAILED ****.\n",
 		    ha->host_no));
 	} else {
-		/* Setup seriallink options */
-		uint16_t swing, emphasis;
-
-		DEBUG3(printk("scsi(%ld): Serial link options:\n",
-		    ha->host_no));
-		DEBUG3(qla2x00_dump_buffer(
-		    (uint8_t *)&ha->fw_seriallink_options,
-		    sizeof(ha->fw_seriallink_options)));
-
-		memset(ha->fw_options, 0, sizeof(ha->fw_options));
-		qla2x00_get_fw_options(ha, ha->fw_options);
-
-		ha->fw_options[1] &= ~FO1_SET_EMPHASIS_SWING;
-		if (ha->fw_seriallink_options[1] & BIT_2)
-			ha->fw_options[1] |= FO1_SET_EMPHASIS_SWING;
-
-		/* 1G settings */
-		swing = ha->fw_seriallink_options[0] & (BIT_2 | BIT_1 | BIT_0);
-		emphasis = ha->fw_seriallink_options[0] & (BIT_4 | BIT_3);
-		emphasis >>= 3;
-		ha->fw_options[10] = (emphasis << 14) | (swing << 8) | 0x3;
-
-		/* 2G settings */
-		swing = ha->fw_seriallink_options[0] & (BIT_7 | BIT_6 | BIT_5);
-		swing >>= 5;
-		emphasis = ha->fw_seriallink_options[1] & (BIT_1 | BIT_0);
-		ha->fw_options[11] = (emphasis << 14) | (swing << 8) | 0x3;
-
-		qla2x00_set_fw_options(ha, ha->fw_options);
+		/* Update any ISP specific firmware options. */
+		qla2x00_update_fw_options(ha);
 
 		DEBUG3(printk("scsi(%ld): Init firmware -- success.\n",
 		    ha->host_no));

                 reply	other threads:[~2004-05-07  5:52 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=20040507055400.GA4922@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