linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/16]  qla2xxx: update qla2xxx driver to 8.01.02-k.
@ 2005-10-13 23:15 Andrew Vasquez
  2005-10-13 23:15 ` [PATCH 1/12] qla2xxx: Correct issue where fcport is prematurely marked DEAD Andrew Vasquez
                   ` (12 more replies)
  0 siblings, 13 replies; 41+ messages in thread
From: Andrew Vasquez @ 2005-10-13 23:15 UTC (permalink / raw)
  To: James Bottomley, Linux-SCSI Mailing List; +Cc: Andrew Vasquez

James,

Here's a set of patches which add a handful of features to the qla2xxx
driver.  Please queue for post-2.6.14 inclusion.

With the exception of the rather large firmware image updates (direct
pointer to bzip'd patch listed -- noted below with '*'), subsequent
messages will contain inlined patches.

Summary of patches:

  Correct issue where fcport is prematurely marked DEAD.
  Add support to dynamically enable/disable ZIO.
  Collapse ISP2xxx queuecommand implementations.
  Update license.
  Add support for embedded ISP24xx firmware.
* Resync with latest released firmware -- 4.00.12.
  Add hotplug firmware-load support for all ISP types.
* Resync with latest released ISP23xx/63xx firmware -- 3.03.18.
  Use midlayer's int_to_scsilun() function.
  Correct fw-loader module-use referencing.
  Add an 'Issue LIP' device attribute.
  Update version number to 8.01.02-k.

All patches can be found at the following URL:

        ftp://ftp.qlogic.com/outgoing/linux/patches/8.x/8.01.02k/

Regards,
Andrew Vasquez
QLogic Corporation

-- 
Andrew Vasquez

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 1/12]  qla2xxx: Correct issue where fcport is prematurely marked DEAD.
  2005-10-13 23:15 [PATCH 0/16] qla2xxx: update qla2xxx driver to 8.01.02-k Andrew Vasquez
@ 2005-10-13 23:15 ` Andrew Vasquez
  2005-10-13 23:15 ` [PATCH 2/12] qla2xxx: Add support to dynamically enable/disable ZIO Andrew Vasquez
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 41+ messages in thread
From: Andrew Vasquez @ 2005-10-13 23:15 UTC (permalink / raw)
  To: James Bottomley, Linux-SCSI Mailing List; +Cc: Andrew Vasquez

The non-handled failure cases of the Fabric Login mailbox
command handling logic would incorrectly mark the fcport as
dead and not allow the standard port-down-retry-count logic
to manage the transition.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>

---

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

applies-to: b92e43b7cbae6e7128ca6d7831d06e63989f2a31
67f7dd397a973725712a91d3382eba8d8c5bb1da
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 23d095d..7325658 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -2858,7 +2858,7 @@ qla2x00_fabric_login(scsi_qla_host_t *ha
 			    fcport->d_id.b.domain, fcport->d_id.b.area,
 			    fcport->d_id.b.al_pa);
 			fcport->loop_id = FC_NO_LOOP_ID;
-			atomic_set(&fcport->state, FCS_DEVICE_DEAD);
+			fcport->login_retry = 0;
 
 			rval = 3;
 			break;
---
0.99.8.GIT

-- 
Andrew Vasquez

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 2/12]  qla2xxx: Add support to dynamically enable/disable ZIO.
  2005-10-13 23:15 [PATCH 0/16] qla2xxx: update qla2xxx driver to 8.01.02-k Andrew Vasquez
  2005-10-13 23:15 ` [PATCH 1/12] qla2xxx: Correct issue where fcport is prematurely marked DEAD Andrew Vasquez
@ 2005-10-13 23:15 ` Andrew Vasquez
  2005-10-13 23:16 ` [PATCH 3/12] qla2xxx: Collapse ISP2xxx queuecommand implementations Andrew Vasquez
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 41+ messages in thread
From: Andrew Vasquez @ 2005-10-13 23:15 UTC (permalink / raw)
  To: James Bottomley, Linux-SCSI Mailing List; +Cc: Andrew Vasquez

ISP23xx and ISP24xx chips have support for an adaptive
method of posting SCSI command completions for multiple SCSI
commands during a single system interrupt.

SCSI commands are placed on the system response queue
without interrupting the host until 1) a delay timer
expires; or 2) a SCSI command completes with an error.

As long as the host software (qla2xxx) services the response
queue for completions (this polling is done during
queuecommand()) within the 'delay timer' period, the
firmware will not generate system interrupt.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>

---

 drivers/scsi/qla2xxx/qla_attr.c |   83 +++++++++++++++++++++++++++++++++++++++
 drivers/scsi/qla2xxx/qla_def.h  |    8 ++++
 drivers/scsi/qla2xxx/qla_gbl.h  |    3 -
 drivers/scsi/qla2xxx/qla_init.c |   53 +++++++++++++++++++------
 drivers/scsi/qla2xxx/qla_iocb.c |   10 +++++
 drivers/scsi/qla2xxx/qla_isr.c  |    7 ++-
 drivers/scsi/qla2xxx/qla_os.c   |   23 -----------
 7 files changed, 146 insertions(+), 41 deletions(-)

applies-to: 3ba1c677ace2a992c97be174309e1d4ac058d506
1bff7727d9a487fbb3a8370f58c519f5abb17f99
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index fc25cd8..47c9ecf 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -319,6 +319,83 @@ qla2x00_state_show(struct class_device *
 	return len;
 }
 
+static ssize_t
+qla2x00_zio_show(struct class_device *cdev, char *buf)
+{
+	scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev));
+	int len = 0;
+
+	switch (ha->zio_mode) {
+	case QLA_ZIO_MODE_5:
+		len += snprintf(buf + len, PAGE_SIZE-len, "Mode 5\n");
+		break;
+	case QLA_ZIO_MODE_6:
+		len += snprintf(buf + len, PAGE_SIZE-len, "Mode 6\n");
+		break;
+	case QLA_ZIO_DISABLED:
+		len += snprintf(buf + len, PAGE_SIZE-len, "Disabled\n");
+		break;
+	}
+	return len;
+}
+
+static ssize_t
+qla2x00_zio_store(struct class_device *cdev, const char *buf, size_t count)
+{
+	scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev));
+	int val = 0;
+	uint16_t zio_mode;
+
+	if (sscanf(buf, "%d", &val) != 1)
+		return -EINVAL;
+
+	switch (val) {
+	case 1:
+		zio_mode = QLA_ZIO_MODE_5;
+		break;
+	case 2:
+		zio_mode = QLA_ZIO_MODE_6;
+		break;
+	default:
+		zio_mode = QLA_ZIO_DISABLED;
+		break;
+	}
+
+	/* Update per-hba values and queue a reset. */
+	if (zio_mode != QLA_ZIO_DISABLED || ha->zio_mode != QLA_ZIO_DISABLED) {
+		ha->zio_mode = zio_mode;
+		set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
+	}
+	return strlen(buf);
+}
+
+static ssize_t
+qla2x00_zio_timer_show(struct class_device *cdev, char *buf)
+{
+	scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev));
+
+	return snprintf(buf, PAGE_SIZE, "%d us\n", ha->zio_timer * 100);
+}
+
+static ssize_t
+qla2x00_zio_timer_store(struct class_device *cdev, const char *buf,
+    size_t count)
+{
+	scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev));
+	int val = 0;
+	uint16_t zio_timer;
+
+	if (sscanf(buf, "%d", &val) != 1)
+		return -EINVAL;
+	if (val > 25500 || val < 100)
+		return -ERANGE;
+
+	zio_timer = (uint16_t)(val / 100);
+	ha->zio_timer = zio_timer;
+
+	return strlen(buf);
+}
+
 static CLASS_DEVICE_ATTR(driver_version, S_IRUGO, qla2x00_drvr_version_show,
 	NULL);
 static CLASS_DEVICE_ATTR(fw_version, S_IRUGO, qla2x00_fw_version_show, NULL);
@@ -329,6 +406,10 @@ static CLASS_DEVICE_ATTR(model_name, S_I
 static CLASS_DEVICE_ATTR(model_desc, S_IRUGO, qla2x00_model_desc_show, NULL);
 static CLASS_DEVICE_ATTR(pci_info, S_IRUGO, qla2x00_pci_info_show, NULL);
 static CLASS_DEVICE_ATTR(state, S_IRUGO, qla2x00_state_show, NULL);
+static CLASS_DEVICE_ATTR(zio, S_IRUGO | S_IWUSR, qla2x00_zio_show,
+    qla2x00_zio_store);
+static CLASS_DEVICE_ATTR(zio_timer, S_IRUGO | S_IWUSR, qla2x00_zio_timer_show,
+    qla2x00_zio_timer_store);
 
 struct class_device_attribute *qla2x00_host_attrs[] = {
 	&class_device_attr_driver_version,
@@ -340,6 +421,8 @@ struct class_device_attribute *qla2x00_h
 	&class_device_attr_model_desc,
 	&class_device_attr_pci_info,
 	&class_device_attr_state,
+	&class_device_attr_zio,
+	&class_device_attr_zio_timer,
 	NULL,
 };
 
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index b455c31..522bb2d 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -823,6 +823,11 @@ typedef struct {
 #define PD_STATE_WAIT_PORT_LOGOUT_ACK		11
 
 
+#define QLA_ZIO_MODE_5		(BIT_2 | BIT_0)
+#define QLA_ZIO_MODE_6		(BIT_2 | BIT_1)
+#define QLA_ZIO_DISABLED	0
+#define QLA_ZIO_DEFAULT_TIMER	2
+
 /*
  * ISP Initialization Control Block.
  * Little endian except where noted.
@@ -2470,6 +2475,9 @@ typedef struct scsi_qla_host {
 	/* Needed for BEACON */
 	uint16_t	beacon_blink_led;
 	uint16_t	beacon_green_on;
+
+	uint16_t	zio_mode;
+	uint16_t	zio_timer;
 } scsi_qla_host_t;
 
 
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
index 1ed32e7..7680b95 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -76,8 +76,6 @@ extern char qla2x00_version_str[];
 extern int ql2xlogintimeout;
 extern int qlport_down_retry;
 extern int ql2xplogiabsentdevice;
-extern int ql2xenablezio;
-extern int ql2xintrdelaytimer;
 extern int ql2xloginretrycount;
 extern int ql2xfdmienable;
 
@@ -223,6 +221,7 @@ extern irqreturn_t qla2100_intr_handler(
 extern irqreturn_t qla2300_intr_handler(int, void *, struct pt_regs *);
 extern irqreturn_t qla24xx_intr_handler(int, void *, struct pt_regs *);
 extern void qla2x00_process_response_queue(struct scsi_qla_host *);
+extern void qla24xx_process_response_queue(struct scsi_qla_host *);
 
 /*
  * Global Function Prototypes in qla_sup.c source file.
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 7325658..81a2cf1 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -1372,7 +1372,6 @@ qla2x00_nvram_config(scsi_qla_host_t *ha
 	nvram_t         *nv = (nvram_t *)ha->request_ring;
 	uint8_t         *ptr = (uint8_t *)ha->request_ring;
 	struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
-	uint8_t         timer_mode;
 
 	rval = QLA_SUCCESS;
 
@@ -1650,22 +1649,26 @@ qla2x00_nvram_config(scsi_qla_host_t *ha
 
 		ha->flags.process_response_queue = 1;
 	} else {
-		/* Enable ZIO -- Support mode 5 only. */
-		timer_mode = icb->add_firmware_options[0] &
-		    (BIT_3 | BIT_2 | BIT_1 | BIT_0);
+		/* Enable ZIO. */
+		if (!ha->flags.init_done) {
+			ha->zio_mode = icb->add_firmware_options[0] &
+			    (BIT_3 | BIT_2 | BIT_1 | BIT_0);
+			ha->zio_timer = icb->interrupt_delay_timer ?
+			    icb->interrupt_delay_timer: 2;
+		}
 		icb->add_firmware_options[0] &=
 		    ~(BIT_3 | BIT_2 | BIT_1 | BIT_0);
-		if (ql2xenablezio)
-			timer_mode = BIT_2 | BIT_0;
-		if (timer_mode == (BIT_2 | BIT_0)) {
-			DEBUG2(printk("scsi(%ld): ZIO enabled; timer delay "
-			    "(%d).\n", ha->host_no, ql2xintrdelaytimer));
+		ha->flags.process_response_queue = 0;
+		if (ha->zio_mode != QLA_ZIO_DISABLED) {
+			DEBUG2(printk("scsi(%ld): ZIO mode %d enabled; timer "
+			    "delay (%d us).\n", ha->host_no, ha->zio_mode,
+			    ha->zio_timer * 100));
 			qla_printk(KERN_INFO, ha,
-			    "ZIO enabled; timer delay (%d).\n",
-			    ql2xintrdelaytimer);
+			    "ZIO mode %d enabled; timer delay (%d us).\n",
+			    ha->zio_mode, ha->zio_timer * 100);
 
-			icb->add_firmware_options[0] |= timer_mode;
-			icb->interrupt_delay_timer = ql2xintrdelaytimer;
+			icb->add_firmware_options[0] |= (uint8_t)ha->zio_mode;
+			icb->interrupt_delay_timer = (uint8_t)ha->zio_timer;
 			ha->flags.process_response_queue = 1;
 		}
 	}
@@ -3442,6 +3445,30 @@ qla24xx_nvram_config(scsi_qla_host_t *ha
 	if (ql2xloginretrycount)
 		ha->login_retry_count = ql2xloginretrycount;
 
+	/* Enable ZIO. */
+	if (!ha->flags.init_done) {
+		ha->zio_mode = le32_to_cpu(icb->firmware_options_2) &
+		    (BIT_3 | BIT_2 | BIT_1 | BIT_0);
+		ha->zio_timer = le16_to_cpu(icb->interrupt_delay_timer) ?
+		    le16_to_cpu(icb->interrupt_delay_timer): 2;
+	}
+	icb->firmware_options_2 &= __constant_cpu_to_le32(
+	    ~(BIT_3 | BIT_2 | BIT_1 | BIT_0));
+	ha->flags.process_response_queue = 0;
+	if (ha->zio_mode != QLA_ZIO_DISABLED) {
+		DEBUG2(printk("scsi(%ld): ZIO mode %d enabled; timer delay "
+		    "(%d us).\n", ha->host_no, ha->zio_mode,
+		    ha->zio_timer * 100));
+		qla_printk(KERN_INFO, ha,
+		    "ZIO mode %d enabled; timer delay (%d us).\n",
+		    ha->zio_mode, ha->zio_timer * 100);
+
+		icb->firmware_options_2 |= cpu_to_le32(
+		    (uint32_t)ha->zio_mode);
+		icb->interrupt_delay_timer = cpu_to_le16(ha->zio_timer);
+		ha->flags.process_response_queue = 1;
+	}
+
 	if (rval) {
 		DEBUG2_3(printk(KERN_WARNING
 		    "scsi(%ld): NVRAM configuration failed!\n", ha->host_no));
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c
index 37f82e2..d735562 100644
--- a/drivers/scsi/qla2xxx/qla_iocb.c
+++ b/drivers/scsi/qla2xxx/qla_iocb.c
@@ -440,6 +440,11 @@ qla2x00_start_scsi(srb_t *sp)
 	WRT_REG_WORD(ISP_REQ_Q_IN(ha, reg), ha->req_ring_index);
 	RD_REG_WORD_RELAXED(ISP_REQ_Q_IN(ha, reg));	/* PCI Posting. */
 
+	/* Manage unprocessed RIO/ZIO commands in response queue. */
+	if (ha->flags.process_response_queue &&
+	    ha->response_ring_ptr->signature != RESPONSE_PROCESSED)
+		qla2x00_process_response_queue(ha);
+
 	spin_unlock_irqrestore(&ha->hardware_lock, flags);
 	return (QLA_SUCCESS);
 
@@ -877,6 +882,11 @@ qla24xx_start_scsi(srb_t *sp)
 	WRT_REG_DWORD(&reg->req_q_in, ha->req_ring_index);
 	RD_REG_DWORD_RELAXED(&reg->req_q_in);		/* PCI Posting. */
 
+	/* Manage unprocessed RIO/ZIO commands in response queue. */
+	if (ha->flags.process_response_queue &&
+	    ha->response_ring_ptr->signature != RESPONSE_PROCESSED)
+		qla24xx_process_response_queue(ha);
+
 	spin_unlock_irqrestore(&ha->hardware_lock, flags);
 	return QLA_SUCCESS;
 
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index c255bb0..cf6c6ce 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -21,13 +21,11 @@
 static void qla2x00_mbx_completion(scsi_qla_host_t *, uint16_t);
 static void qla2x00_async_event(scsi_qla_host_t *, uint16_t *);
 static void qla2x00_process_completed_request(struct scsi_qla_host *, uint32_t);
-void qla2x00_process_response_queue(struct scsi_qla_host *);
 static void qla2x00_status_entry(scsi_qla_host_t *, void *);
 static void qla2x00_status_cont_entry(scsi_qla_host_t *, sts_cont_entry_t *);
 static void qla2x00_error_entry(scsi_qla_host_t *, sts_entry_t *);
 static void qla2x00_ms_entry(scsi_qla_host_t *, ms_iocb_entry_t *);
 
-void qla24xx_process_response_queue(scsi_qla_host_t *);
 static void qla24xx_ms_entry(scsi_qla_host_t *, struct ct_entry_24xx *);
 
 /**
@@ -651,7 +649,10 @@ qla2x00_async_event(scsi_qla_host_t *ha,
 		    "scsi(%ld): [R|Z]IO update completion.\n",
 		    ha->host_no));
 
-		qla2x00_process_response_queue(ha);
+		if (IS_QLA24XX(ha) || IS_QLA25XX(ha))
+			qla24xx_process_response_queue(ha);
+		else
+			qla2x00_process_response_queue(ha);
 		break;
 
 	case MBA_DISCARD_RND_FRAME:
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 8982978..141ff12 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -61,19 +61,6 @@ MODULE_PARM_DESC(ql2xplogiabsentdevice,
 		"a Fabric scan.  This is needed for several broken switches."
 		"Default is 0 - no PLOGI. 1 - perfom PLOGI.");
 
-int ql2xenablezio = 0;
-module_param(ql2xenablezio, int, S_IRUGO|S_IRUSR);
-MODULE_PARM_DESC(ql2xenablezio,
-		"Option to enable ZIO:If 1 then enable it otherwise"
-		" use the default set in the NVRAM."
-		" Default is 0 : disabled");
-
-int ql2xintrdelaytimer = 10;
-module_param(ql2xintrdelaytimer, int, S_IRUGO|S_IRUSR);
-MODULE_PARM_DESC(ql2xintrdelaytimer,
-		"ZIO: Waiting time for Firmware before it generates an "
-		"interrupt to the host to notify completion of request.");
-
 int ql2xloginretrycount = 0;
 module_param(ql2xloginretrycount, int, S_IRUGO|S_IRUSR);
 MODULE_PARM_DESC(ql2xloginretrycount,
@@ -400,16 +387,6 @@ qla2x00_queuecommand(struct scsi_cmnd *c
 	if (rval != QLA_SUCCESS)
 		goto qc_host_busy_free_sp;
 
-	/* Manage unprocessed RIO/ZIO commands in response queue. */
-	if (ha->flags.online && ha->flags.process_response_queue &&
-	    ha->response_ring_ptr->signature != RESPONSE_PROCESSED) {
-		unsigned long flags;
-
-		spin_lock_irqsave(&ha->hardware_lock, flags);
-		qla2x00_process_response_queue(ha);
-		spin_unlock_irqrestore(&ha->hardware_lock, flags);
-	}
-
 	spin_lock_irq(ha->host->host_lock);
 
 	return 0;
---
0.99.8.GIT

-- 
Andrew Vasquez

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 3/12]  qla2xxx: Collapse ISP2xxx queuecommand implementations.
  2005-10-13 23:15 [PATCH 0/16] qla2xxx: update qla2xxx driver to 8.01.02-k Andrew Vasquez
  2005-10-13 23:15 ` [PATCH 1/12] qla2xxx: Correct issue where fcport is prematurely marked DEAD Andrew Vasquez
  2005-10-13 23:15 ` [PATCH 2/12] qla2xxx: Add support to dynamically enable/disable ZIO Andrew Vasquez
@ 2005-10-13 23:16 ` Andrew Vasquez
  2005-10-14 10:24   ` Christoph Hellwig
  2005-10-13 23:16 ` [PATCH 4/12] qla2xxx: Update license Andrew Vasquez
                   ` (9 subsequent siblings)
  12 siblings, 1 reply; 41+ messages in thread
From: Andrew Vasquez @ 2005-10-13 23:16 UTC (permalink / raw)
  To: James Bottomley, Linux-SCSI Mailing List; +Cc: Andrew Vasquez

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>

---

 drivers/scsi/qla2xxx/qla_os.c |  144 ++++++++++++-----------------------------
 1 files changed, 41 insertions(+), 103 deletions(-)

applies-to: 78d6d6feb3837ff269b56e589bfba93fd55f9d81
6575ef7122e7f3ce8fc8c90412b2ad4dba65e03c
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 141ff12..04d06a3 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -355,111 +355,49 @@ qla2x00_get_new_sp(scsi_qla_host_t *ha, 
 	return sp;
 }
 
-static int
-qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
-{
-	scsi_qla_host_t *ha = to_qla_host(cmd->device->host);
-	fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata;
-	srb_t *sp;
-	int rval;
-
-	if (!fcport) {
-		cmd->result = DID_NO_CONNECT << 16;
-		goto qc_fail_command;
-	}
-
-	if (atomic_read(&fcport->state) != FCS_ONLINE) {
-		if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
-		    atomic_read(&ha->loop_state) == LOOP_DEAD) {
-			cmd->result = DID_NO_CONNECT << 16;
-			goto qc_fail_command;
-		}
-		goto qc_host_busy;
-	}
-
-	spin_unlock_irq(ha->host->host_lock);
-
-	sp = qla2x00_get_new_sp(ha, fcport, cmd, done);
-	if (!sp)
-		goto qc_host_busy_lock;
-
-	rval = qla2x00_start_scsi(sp);
-	if (rval != QLA_SUCCESS)
-		goto qc_host_busy_free_sp;
-
-	spin_lock_irq(ha->host->host_lock);
-
-	return 0;
-
-qc_host_busy_free_sp:
-	qla2x00_sp_free_dma(ha, sp);
-	mempool_free(sp, ha->srb_mempool);
-
-qc_host_busy_lock:
-	spin_lock_irq(ha->host->host_lock);
-
-qc_host_busy:
-	return SCSI_MLQUEUE_HOST_BUSY;
-
-qc_fail_command:
-	done(cmd);
-
-	return 0;
-}
-
-
-static int
-qla24xx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
-{
-	scsi_qla_host_t *ha = to_qla_host(cmd->device->host);
-	fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata;
-	srb_t *sp;
-	int rval;
-
-	if (!fcport) {
-		cmd->result = DID_NO_CONNECT << 16;
-		goto qc24_fail_command;
-	}
-
-	if (atomic_read(&fcport->state) != FCS_ONLINE) {
-		if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
-		    atomic_read(&ha->loop_state) == LOOP_DEAD) {
-			cmd->result = DID_NO_CONNECT << 16;
-			goto qc24_fail_command;
-		}
-		goto qc24_host_busy;
-	}
-
-	spin_unlock_irq(ha->host->host_lock);
-
-	sp = qla2x00_get_new_sp(ha, fcport, cmd, done);
-	if (!sp)
-		goto qc24_host_busy_lock;
-
-	rval = qla24xx_start_scsi(sp);
-	if (rval != QLA_SUCCESS)
-		goto qc24_host_busy_free_sp;
-
-	spin_lock_irq(ha->host->host_lock);
-
-	return 0;
-
-qc24_host_busy_free_sp:
-	qla2x00_sp_free_dma(ha, sp);
-	mempool_free(sp, ha->srb_mempool);
-
-qc24_host_busy_lock:
-	spin_lock_irq(ha->host->host_lock);
-
-qc24_host_busy:
-	return SCSI_MLQUEUE_HOST_BUSY;
-
-qc24_fail_command:
-	done(cmd);
-
-	return 0;
+#define QLA_QUEUE_COMMAND(isp)  \
+static int \
+isp##_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) \
+{ \
+	scsi_qla_host_t *ha = to_qla_host(cmd->device->host); \
+	fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata; \
+	srb_t *sp; \
+	int rval; \
+	if (!fcport) { \
+		cmd->result = DID_NO_CONNECT << 16; \
+		goto fail_command; \
+	} \
+	if (atomic_read(&fcport->state) != FCS_ONLINE) { \
+		if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD || \
+		    atomic_read(&ha->loop_state) == LOOP_DEAD) { \
+			cmd->result = DID_NO_CONNECT << 16; \
+			goto fail_command; \
+		} \
+		goto host_busy; \
+	} \
+	spin_unlock_irq(ha->host->host_lock); \
+	sp = qla2x00_get_new_sp(ha, fcport, cmd, done); \
+	if (!sp) \
+		goto host_busy_lock; \
+	rval = isp##_start_scsi(sp); \
+	if (rval != QLA_SUCCESS) \
+		goto host_busy_free_sp; \
+	spin_lock_irq(ha->host->host_lock); \
+	return 0; \
+host_busy_free_sp: \
+	qla2x00_sp_free_dma(ha, sp); \
+	mempool_free(sp, ha->srb_mempool); \
+host_busy_lock: \
+	spin_lock_irq(ha->host->host_lock); \
+host_busy: \
+	return SCSI_MLQUEUE_HOST_BUSY; \
+fail_command: \
+	done(cmd); \
+	return 0; \
 }
 
+QLA_QUEUE_COMMAND(qla2x00);
+QLA_QUEUE_COMMAND(qla24xx);
 
 /*
  * qla2x00_eh_wait_on_command
---
0.99.8.GIT

-- 
Andrew Vasquez

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 4/12]  qla2xxx: Update license.
  2005-10-13 23:15 [PATCH 0/16] qla2xxx: update qla2xxx driver to 8.01.02-k Andrew Vasquez
                   ` (2 preceding siblings ...)
  2005-10-13 23:16 ` [PATCH 3/12] qla2xxx: Collapse ISP2xxx queuecommand implementations Andrew Vasquez
@ 2005-10-13 23:16 ` Andrew Vasquez
  2005-10-14  7:30   ` Arjan van de Ven
  2005-10-15 11:56   ` Christoph Hellwig
  2005-10-13 23:16 ` [PATCH 5/12] qla2xxx: Add support for embedded ISP24xx firmware Andrew Vasquez
                   ` (8 subsequent siblings)
  12 siblings, 2 replies; 41+ messages in thread
From: Andrew Vasquez @ 2005-10-13 23:16 UTC (permalink / raw)
  To: James Bottomley, Linux-SCSI Mailing List; +Cc: Andrew Vasquez

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>

---

 Documentation/scsi/LICENSE.qla2xxx  |   59 +++++++++++++++++++++++++++++++++++
 drivers/scsi/qla2xxx/ql2100.c       |    9 ++---
 drivers/scsi/qla2xxx/ql2100_fw.c    |   22 +++----------
 drivers/scsi/qla2xxx/ql2200.c       |    9 ++---
 drivers/scsi/qla2xxx/ql2200_fw.c    |   22 +++----------
 drivers/scsi/qla2xxx/ql2300.c       |    9 ++---
 drivers/scsi/qla2xxx/ql2300_fw.c    |   22 +++----------
 drivers/scsi/qla2xxx/ql2322.c       |    7 ++--
 drivers/scsi/qla2xxx/ql2322_fw.c    |   22 +++----------
 drivers/scsi/qla2xxx/ql6312.c       |    7 ++--
 drivers/scsi/qla2xxx/ql6312_fw.c    |   22 +++----------
 drivers/scsi/qla2xxx/qla_attr.c     |   18 ++---------
 drivers/scsi/qla2xxx/qla_dbg.c      |   18 ++---------
 drivers/scsi/qla2xxx/qla_dbg.h      |   23 +++-----------
 drivers/scsi/qla2xxx/qla_def.h      |   25 ++++-----------
 drivers/scsi/qla2xxx/qla_fw.h       |   26 ++++-----------
 drivers/scsi/qla2xxx/qla_gbl.h      |   28 ++++-------------
 drivers/scsi/qla2xxx/qla_gs.c       |   18 ++---------
 drivers/scsi/qla2xxx/qla_init.c     |   18 ++---------
 drivers/scsi/qla2xxx/qla_inline.h   |   19 ++---------
 drivers/scsi/qla2xxx/qla_iocb.c     |   23 +++-----------
 drivers/scsi/qla2xxx/qla_isr.c      |   18 ++---------
 drivers/scsi/qla2xxx/qla_mbx.c      |   18 ++---------
 drivers/scsi/qla2xxx/qla_os.c       |   18 ++---------
 drivers/scsi/qla2xxx/qla_rscn.c     |   18 ++---------
 drivers/scsi/qla2xxx/qla_settings.h |   22 +++----------
 drivers/scsi/qla2xxx/qla_sup.c      |   23 +++-----------
 drivers/scsi/qla2xxx/qla_version.h  |   22 +++----------
 28 files changed, 172 insertions(+), 393 deletions(-)
 create mode 100644 Documentation/scsi/LICENSE.qla2xxx

applies-to: 2a85611f196edcf230196ae7e73d5783255f2be1
f31d3537cd77b14ded8c7eea8c6a1d0ca6a29f3e
diff --git a/Documentation/scsi/LICENSE.qla2xxx b/Documentation/scsi/LICENSE.qla2xxx
new file mode 100644
index 0000000..91d7e38
--- /dev/null
+++ b/Documentation/scsi/LICENSE.qla2xxx
@@ -0,0 +1,59 @@
+Copyright (c)  2003-2005 QLogic Corporation
+QLogic Linux Fibre Channel HBA Driver
+
+This program includes a device driver for Linux 2.6 that may be
+distributed with QLogic hardware specific firmware binary file.
+You may modify and redistribute the device driver code under the
+GNU General Public License as published by the Free Software
+Foundation (version 2 or a later version) and/or under the
+following terms, as applicable:
+
+	1. Redistribution of source code must retain the above
+	   copyright notice, this list of conditions and the
+	   following disclaimer.
+
+	2. Redistribution in binary form must reproduce the above
+	   copyright notice, this list of conditions and the
+	   following disclaimer in the documentation and/or other
+	   materials provided with the distribution.
+
+	3. The name of QLogic Corporation may not be used to
+	   endorse or promote products derived from this software
+	   without specific prior written permission.
+
+You may redistribute the hardware specific firmware binary file
+under the following terms:
+
+	1. Redistribution of source code (only if applicable),
+	   must retain the above copyright notice, this list of
+	   conditions and the following disclaimer.
+
+	2. Redistribution in binary form must reproduce the above
+	   copyright notice, this list of conditions and the
+	   following disclaimer in the documentation and/or other
+	   materials provided with the distribution.
+
+	3. The name of QLogic Corporation may not be used to
+	   endorse or promote products derived from this software
+	   without specific prior written permission
+
+REGARDLESS OF WHAT LICENSING MECHANISM IS USED OR APPLICABLE,
+THIS PROGRAM IS PROVIDED BY QLOGIC CORPORATION "AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+USER ACKNOWLEDGES AND AGREES THAT USE OF THIS PROGRAM WILL NOT
+CREATE OR GIVE GROUNDS FOR A LICENSE BY IMPLICATION, ESTOPPEL, OR
+OTHERWISE IN ANY INTELLECTUAL PROPERTY RIGHTS (PATENT, COPYRIGHT,
+TRADE SECRET, MASK WORK, OR OTHER PROPRIETARY RIGHT) EMBODIED IN
+ANY OTHER QLOGIC HARDWARE OR SOFTWARE EITHER SOLELY OR IN
+COMBINATION WITH THIS PROGRAM.
diff --git a/drivers/scsi/qla2xxx/ql2100.c b/drivers/scsi/qla2xxx/ql2100.c
index 058733d..f5db223 100644
--- a/drivers/scsi/qla2xxx/ql2100.c
+++ b/drivers/scsi/qla2xxx/ql2100.c
@@ -1,11 +1,10 @@
 /*
- * QLogic ISP2100 device driver for Linux 2.6.x
- * Copyright (C) 2003 Christoph Hellwig.
- * Copyright (C) 2003-2005 QLogic Corporation (www.qlogic.com)
+ * QLogic Fibre Channel HBA Driver
+ * Copyright (C)  2003 Christoph Hellwig.
+ * Copyright (c)  2003-2005 QLogic Corporation
  *
- * Released under GPL v2.
+ * See LICENSE.qla2xxx for copyright and licensing details.
  */
-
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/pci.h>
diff --git a/drivers/scsi/qla2xxx/ql2100_fw.c b/drivers/scsi/qla2xxx/ql2100_fw.c
index 18376b8..5600616 100644
--- a/drivers/scsi/qla2xxx/ql2100_fw.c
+++ b/drivers/scsi/qla2xxx/ql2100_fw.c
@@ -1,21 +1,9 @@
-/******************************************************************************
- *                  QLOGIC LINUX SOFTWARE
- *
- * QLogic ISP2x00 device driver for Linux 2.6.x
- * Copyright (C) 2003-2005 QLogic Corporation
- * (www.qlogic.com)
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
+/*
+ * QLogic Fibre Channel HBA Driver
+ * Copyright (c)  2003-2005 QLogic Corporation
  *
- *************************************************************************/
+ * See LICENSE.qla2xxx for copyright and licensing details.
+ */
 
 /*
  *	Firmware Version 1.19.25 (13:12 Dec 10, 2003)
diff --git a/drivers/scsi/qla2xxx/ql2200.c b/drivers/scsi/qla2xxx/ql2200.c
index 5b5ee73..0eef72d 100644
--- a/drivers/scsi/qla2xxx/ql2200.c
+++ b/drivers/scsi/qla2xxx/ql2200.c
@@ -1,11 +1,10 @@
 /*
- * QLogic ISP2200 device driver for Linux 2.6.x
- * Copyright (C) 2003 Christoph Hellwig.
- * Copyright (C) 2003-2005 QLogic Corporation (www.qlogic.com)
+ * QLogic Fibre Channel HBA Driver
+ * Copyright (C)  2003 Christoph Hellwig.
+ * Copyright (c)  2003-2005 QLogic Corporation
  *
- * Released under GPL v2.
+ * See LICENSE.qla2xxx for copyright and licensing details.
  */
-
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/pci.h>
diff --git a/drivers/scsi/qla2xxx/ql2200_fw.c b/drivers/scsi/qla2xxx/ql2200_fw.c
index 6f103fd..ac07e18 100644
--- a/drivers/scsi/qla2xxx/ql2200_fw.c
+++ b/drivers/scsi/qla2xxx/ql2200_fw.c
@@ -1,21 +1,9 @@
-/******************************************************************************
- *                  QLOGIC LINUX SOFTWARE
- *
- * QLogic ISP2x00 device driver for Linux 2.6.x
- * Copyright (C) 2003-2005 QLogic Corporation
- * (www.qlogic.com)
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
+/*
+ * QLogic Fibre Channel HBA Driver
+ * Copyright (c)  2003-2005 QLogic Corporation
  *
- *************************************************************************/
+ * See LICENSE.qla2xxx for copyright and licensing details.
+ */
 
 /*
  *	Firmware Version 2.02.08 (17:06 Mar 22, 2005)
diff --git a/drivers/scsi/qla2xxx/ql2300.c b/drivers/scsi/qla2xxx/ql2300.c
index 22371c8..fd2f4b7 100644
--- a/drivers/scsi/qla2xxx/ql2300.c
+++ b/drivers/scsi/qla2xxx/ql2300.c
@@ -1,11 +1,10 @@
 /*
- * QLogic ISP2300 device driver for Linux 2.6.x
- * Copyright (C) 2003 Christoph Hellwig.
- * Copyright (C) 2003-2005 QLogic Corporation (www.qlogic.com)
+ * QLogic Fibre Channel HBA Driver
+ * Copyright (C)  2003 Christoph Hellwig.
+ * Copyright (c)  2003-2005 QLogic Corporation
  *
- * Released under GPL v2.
+ * See LICENSE.qla2xxx for copyright and licensing details.
  */
-
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/pci.h>
diff --git a/drivers/scsi/qla2xxx/ql2300_fw.c b/drivers/scsi/qla2xxx/ql2300_fw.c
index 4917ec5..1896a0e 100644
--- a/drivers/scsi/qla2xxx/ql2300_fw.c
+++ b/drivers/scsi/qla2xxx/ql2300_fw.c
@@ -1,21 +1,9 @@
-/******************************************************************************
- *                  QLOGIC LINUX SOFTWARE
- *
- * QLogic ISP2x00 device driver for Linux 2.6.x
- * Copyright (C) 2005 QLogic Corporation
- * (www.qlogic.com)
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
+/*
+ * QLogic Fibre Channel HBA Driver
+ * Copyright (c)  2003-2005 QLogic Corporation
  *
- ******************************************************************************/
+ * See LICENSE.qla2xxx for copyright and licensing details.
+ */
 
 /*
  *	Firmware Version 3.03.15 (10:03 May 26, 2005)
diff --git a/drivers/scsi/qla2xxx/ql2322.c b/drivers/scsi/qla2xxx/ql2322.c
index bfe918a..c88a22c 100644
--- a/drivers/scsi/qla2xxx/ql2322.c
+++ b/drivers/scsi/qla2xxx/ql2322.c
@@ -1,10 +1,9 @@
 /*
- * QLogic ISP2322 device driver for Linux 2.6.x
- * Copyright (C) 2003-2005 QLogic Corporation (www.qlogic.com)
+ * QLogic Fibre Channel HBA Driver
+ * Copyright (c)  2003-2005 QLogic Corporation
  *
- * Released under GPL v2.
+ * See LICENSE.qla2xxx for copyright and licensing details.
  */
-
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/pci.h>
diff --git a/drivers/scsi/qla2xxx/ql2322_fw.c b/drivers/scsi/qla2xxx/ql2322_fw.c
index 2645d62..97b5578 100644
--- a/drivers/scsi/qla2xxx/ql2322_fw.c
+++ b/drivers/scsi/qla2xxx/ql2322_fw.c
@@ -1,21 +1,9 @@
-/******************************************************************************
- *                  QLOGIC LINUX SOFTWARE
- *
- * QLogic ISP2x00 device driver for Linux 2.6.x
- * Copyright (C) 2005 QLogic Corporation
- * (www.qlogic.com)
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
+/*
+ * QLogic Fibre Channel HBA Driver
+ * Copyright (c)  2003-2005 QLogic Corporation
  *
- ******************************************************************************/
+ * See LICENSE.qla2xxx for copyright and licensing details.
+ */
 
 /*
  *	Firmware Version 3.03.15 (10:09 May 26, 2005)
diff --git a/drivers/scsi/qla2xxx/ql6312.c b/drivers/scsi/qla2xxx/ql6312.c
index e75882d..de55397 100644
--- a/drivers/scsi/qla2xxx/ql6312.c
+++ b/drivers/scsi/qla2xxx/ql6312.c
@@ -1,10 +1,9 @@
 /*
- * QLogic ISP6312 device driver for Linux 2.6.x
- * Copyright (C) 2003-2005 QLogic Corporation (www.qlogic.com)
+ * QLogic Fibre Channel HBA Driver
+ * Copyright (c)  2003-2005 QLogic Corporation
  *
- * Released under GPL v2.
+ * See LICENSE.qla2xxx for copyright and licensing details.
  */
-
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/pci.h>
diff --git a/drivers/scsi/qla2xxx/ql6312_fw.c b/drivers/scsi/qla2xxx/ql6312_fw.c
index 3579809..1f8744a 100644
--- a/drivers/scsi/qla2xxx/ql6312_fw.c
+++ b/drivers/scsi/qla2xxx/ql6312_fw.c
@@ -1,21 +1,9 @@
-/******************************************************************************
- *                  QLOGIC LINUX SOFTWARE
- *
- * QLogic ISP2x00 device driver for Linux 2.6.x
- * Copyright (C) 2005 QLogic Corporation
- * (www.qlogic.com)
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
+/*
+ * QLogic Fibre Channel HBA Driver
+ * Copyright (c)  2003-2005 QLogic Corporation
  *
- ******************************************************************************/
+ * See LICENSE.qla2xxx for copyright and licensing details.
+ */
 
 /*
  *	Firmware Version 3.03.15 (10:00 May 26, 2005)
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 47c9ecf..49696fa 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -1,20 +1,8 @@
 /*
- *                  QLOGIC LINUX SOFTWARE
- *
- * QLogic ISP2x00 device driver for Linux 2.6.x
- * Copyright (C) 2003-2005 QLogic Corporation
- * (www.qlogic.com)
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
+ * QLogic Fibre Channel HBA Driver
+ * Copyright (c)  2003-2005 QLogic Corporation
  *
+ * See LICENSE.qla2xxx for copyright and licensing details.
  */
 #include "qla_def.h"
 
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c
index 9791496..89793c1 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.c
+++ b/drivers/scsi/qla2xxx/qla_dbg.c
@@ -1,20 +1,8 @@
 /*
- *                  QLOGIC LINUX SOFTWARE
- *
- * QLogic ISP2x00 device driver for Linux 2.6.x
- * Copyright (C) 2003-2005 QLogic Corporation
- * (www.qlogic.com)
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
+ * QLogic Fibre Channel HBA Driver
+ * Copyright (c)  2003-2005 QLogic Corporation
  *
+ * See LICENSE.qla2xxx for copyright and licensing details.
  */
 #include "qla_def.h"
 
diff --git a/drivers/scsi/qla2xxx/qla_dbg.h b/drivers/scsi/qla2xxx/qla_dbg.h
index 9684e7a..935a59a 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.h
+++ b/drivers/scsi/qla2xxx/qla_dbg.h
@@ -1,22 +1,9 @@
-/******************************************************************************
- *                  QLOGIC LINUX SOFTWARE
- *
- * QLogic ISP2x00 device driver for Linux 2.6.x
- * Copyright (C) 2003-2005 QLogic Corporation
- * (www.qlogic.com)
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
+/*
+ * QLogic Fibre Channel HBA Driver
+ * Copyright (c)  2003-2005 QLogic Corporation
  *
- ******************************************************************************/
-
+ * See LICENSE.qla2xxx for copyright and licensing details.
+ */
 /*
  * Driver debug definitions.
  */
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 522bb2d..fc3234c 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -1,22 +1,9 @@
-/********************************************************************************
-*                  QLOGIC LINUX SOFTWARE
-*
-* QLogic ISP2x00 device driver for Linux 2.6.x
-* Copyright (C) 2003-2005 QLogic Corporation
-* (www.qlogic.com)
-*
-* This program is free software; you can redistribute it and/or modify it
-* under the terms of the GNU General Public License as published by the
-* Free Software Foundation; either version 2, or (at your option) any
-* later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-**
-******************************************************************************/
-
+/*
+ * QLogic Fibre Channel HBA Driver
+ * Copyright (c)  2003-2005 QLogic Corporation
+ *
+ * See LICENSE.qla2xxx for copyright and licensing details.
+ */
 #ifndef __QLA_DEF_H
 #define __QLA_DEF_H
 
diff --git a/drivers/scsi/qla2xxx/qla_fw.h b/drivers/scsi/qla2xxx/qla_fw.h
index fd9df16..2c68028 100644
--- a/drivers/scsi/qla2xxx/qla_fw.h
+++ b/drivers/scsi/qla2xxx/qla_fw.h
@@ -1,23 +1,9 @@
-
-/********************************************************************************
-*                  QLOGIC LINUX SOFTWARE
-*
-* QLogic ISP2x00 device driver for Linux 2.6.x
-* Copyright (C) 2003-2005 QLogic Corporation
-* (www.qlogic.com)
-*
-* This program is free software; you can redistribute it and/or modify it
-* under the terms of the GNU General Public License as published by the
-* Free Software Foundation; either version 2, or (at your option) any
-* later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-**
-******************************************************************************/
-
+/*
+ * QLogic Fibre Channel HBA Driver
+ * Copyright (c)  2003-2005 QLogic Corporation
+ *
+ * See LICENSE.qla2xxx for copyright and licensing details.
+ */
 #ifndef __QLA_FW_H
 #define __QLA_FW_H
 
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
index 7680b95..ba44636 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -1,25 +1,9 @@
-/********************************************************************************
-*                  QLOGIC LINUX SOFTWARE
-*
-* QLogic ISP2x00 device driver for Linux 2.6.x
-* Copyright (C) 2003-2005 QLogic Corporation
-* (www.qlogic.com)
-*
-* This program is free software; you can redistribute it and/or modify it
-* under the terms of the GNU General Public License as published by the
-* Free Software Foundation; either version 2, or (at your option) any
-* later version.
-*
-* This program is distributed in the hope that it will be useful, but
-* WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-* General Public License for more details.
-*
-******************************************************************************
-* Global include file.
-******************************************************************************/
-
-
+/*
+ * QLogic Fibre Channel HBA Driver
+ * Copyright (c)  2003-2005 QLogic Corporation
+ *
+ * See LICENSE.qla2xxx for copyright and licensing details.
+ */
 #ifndef __QLA_GBL_H
 #define	__QLA_GBL_H
 
diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c
index e7b138c..cd6f7c3 100644
--- a/drivers/scsi/qla2xxx/qla_gs.c
+++ b/drivers/scsi/qla2xxx/qla_gs.c
@@ -1,20 +1,8 @@
 /*
- *                  QLOGIC LINUX SOFTWARE
- *
- * QLogic ISP2x00 device driver for Linux 2.6.x
- * Copyright (C) 2003-2005 QLogic Corporation
- * (www.qlogic.com)
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
+ * QLogic Fibre Channel HBA Driver
+ * Copyright (c)  2003-2005 QLogic Corporation
  *
+ * See LICENSE.qla2xxx for copyright and licensing details.
  */
 #include "qla_def.h"
 
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 81a2cf1..5ab88e7 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -1,20 +1,8 @@
 /*
- *                  QLOGIC LINUX SOFTWARE
- *
- * QLogic ISP2x00 device driver for Linux 2.6.x
- * Copyright (C) 2003-2005 QLogic Corporation
- * (www.qlogic.com)
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
+ * QLogic Fibre Channel HBA Driver
+ * Copyright (c)  2003-2005 QLogic Corporation
  *
+ * See LICENSE.qla2xxx for copyright and licensing details.
  */
 #include "qla_def.h"
 
diff --git a/drivers/scsi/qla2xxx/qla_inline.h b/drivers/scsi/qla2xxx/qla_inline.h
index b9ff85b..ecc3741 100644
--- a/drivers/scsi/qla2xxx/qla_inline.h
+++ b/drivers/scsi/qla2xxx/qla_inline.h
@@ -1,23 +1,10 @@
 /*
- *                  QLOGIC LINUX SOFTWARE
- *
- * QLogic ISP2x00 device driver for Linux 2.6.x
- * Copyright (C) 2003-2005 QLogic Corporation
- * (www.qlogic.com)
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
+ * QLogic Fibre Channel HBA Driver
+ * Copyright (c)  2003-2005 QLogic Corporation
  *
+ * See LICENSE.qla2xxx for copyright and licensing details.
  */
 
-
 static __inline__ uint16_t qla2x00_debounce_register(volatile uint16_t __iomem *);
 /*
  * qla2x00_debounce_register
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c
index d735562..ae63f8e 100644
--- a/drivers/scsi/qla2xxx/qla_iocb.c
+++ b/drivers/scsi/qla2xxx/qla_iocb.c
@@ -1,22 +1,9 @@
-/******************************************************************************
- *                  QLOGIC LINUX SOFTWARE
+/*
+ * QLogic Fibre Channel HBA Driver
+ * Copyright (c)  2003-2005 QLogic Corporation
  *
- * QLogic ISP2x00 device driver for Linux 2.6.x
- * Copyright (C) 2003-2005 QLogic Corporation
- * (www.qlogic.com)
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- ******************************************************************************/
-
+ * See LICENSE.qla2xxx for copyright and licensing details.
+ */
 #include "qla_def.h"
 
 #include <linux/blkdev.h>
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index cf6c6ce..09afc0f 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -1,20 +1,8 @@
 /*
- *                  QLOGIC LINUX SOFTWARE
- *
- * QLogic ISP2x00 device driver for Linux 2.6.x
- * Copyright (C) 2003-2005 QLogic Corporation
- * (www.qlogic.com)
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
+ * QLogic Fibre Channel HBA Driver
+ * Copyright (c)  2003-2005 QLogic Corporation
  *
+ * See LICENSE.qla2xxx for copyright and licensing details.
  */
 #include "qla_def.h"
 
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index 13e1c90..ad3cacb 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -1,20 +1,8 @@
 /*
- *                  QLOGIC LINUX SOFTWARE
- *
- * QLogic ISP2x00 device driver for Linux 2.6.x
- * Copyright (C) 2003-2005 QLogic Corporation
- * (www.qlogic.com)
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
+ * QLogic Fibre Channel HBA Driver
+ * Copyright (c)  2003-2005 QLogic Corporation
  *
+ * See LICENSE.qla2xxx for copyright and licensing details.
  */
 #include "qla_def.h"
 
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 04d06a3..42c53ea 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -1,20 +1,8 @@
 /*
- *                  QLOGIC LINUX SOFTWARE
- *
- * QLogic ISP2x00 device driver for Linux 2.6.x
- * Copyright (C) 2003-2005 QLogic Corporation
- * (www.qlogic.com)
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
+ * QLogic Fibre Channel HBA Driver
+ * Copyright (c)  2003-2005 QLogic Corporation
  *
+ * See LICENSE.qla2xxx for copyright and licensing details.
  */
 #include "qla_def.h"
 
diff --git a/drivers/scsi/qla2xxx/qla_rscn.c b/drivers/scsi/qla2xxx/qla_rscn.c
index 1eba988..72104c2 100644
--- a/drivers/scsi/qla2xxx/qla_rscn.c
+++ b/drivers/scsi/qla2xxx/qla_rscn.c
@@ -1,20 +1,8 @@
 /*
- *                  QLOGIC LINUX SOFTWARE
- *
- * QLogic ISP2x00 device driver for Linux 2.6.x
- * Copyright (C) 2003-2005 QLogic Corporation
- * (www.qlogic.com)
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
+ * QLogic Fibre Channel HBA Driver
+ * Copyright (c)  2003-2005 QLogic Corporation
  *
+ * See LICENSE.qla2xxx for copyright and licensing details.
  */
 #include "qla_def.h"
 
diff --git a/drivers/scsi/qla2xxx/qla_settings.h b/drivers/scsi/qla2xxx/qla_settings.h
index d85fbbe..363205c 100644
--- a/drivers/scsi/qla2xxx/qla_settings.h
+++ b/drivers/scsi/qla2xxx/qla_settings.h
@@ -1,21 +1,9 @@
-/******************************************************************************
- *                  QLOGIC LINUX SOFTWARE
- *
- * QLogic ISP2x00 device driver for Linux 2.6.x
- * Copyright (C) 2003-2005 QLogic Corporation
- * (www.qlogic.com)
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
+/*
+ * QLogic Fibre Channel HBA Driver
+ * Copyright (c)  2003-2005 QLogic Corporation
  *
- ******************************************************************************/
+ * See LICENSE.qla2xxx for copyright and licensing details.
+ */
 /*
  * Compile time Options:
  *     0 - Disable and 1 - Enable
diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c
index c14abf7..4bec0b4 100644
--- a/drivers/scsi/qla2xxx/qla_sup.c
+++ b/drivers/scsi/qla2xxx/qla_sup.c
@@ -1,22 +1,9 @@
-/******************************************************************************
- *                  QLOGIC LINUX SOFTWARE
- *
- * QLogic ISP2x00 device driver for Linux 2.6.x
- * Copyright (C) 2003-2005 QLogic Corporation
- * (www.qlogic.com)
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
+/*
+ * QLogic Fibre Channel HBA Driver
+ * Copyright (c)  2003-2005 QLogic Corporation
  *
- ******************************************************************************/
-
+ * See LICENSE.qla2xxx for copyright and licensing details.
+ */
 #include "qla_def.h"
 
 #include <linux/delay.h>
diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h
index eae7d6e..0d5472f 100644
--- a/drivers/scsi/qla2xxx/qla_version.h
+++ b/drivers/scsi/qla2xxx/qla_version.h
@@ -1,21 +1,9 @@
-/******************************************************************************
- *                  QLOGIC LINUX SOFTWARE
- *
- * QLogic ISP2x00 device driver for Linux 2.6.x
- * Copyright (C) 2003-2005 QLogic Corporation
- * (www.qlogic.com)
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
+/*
+ * QLogic Fibre Channel HBA Driver
+ * Copyright (c)  2003-2005 QLogic Corporation
  *
- ******************************************************************************/
+ * See LICENSE.qla2xxx for copyright and licensing details.
+ */
 /*
  * Driver version
  */
---
0.99.8.GIT

-- 
Andrew Vasquez

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 5/12]  qla2xxx: Add support for embedded ISP24xx firmware.
  2005-10-13 23:15 [PATCH 0/16] qla2xxx: update qla2xxx driver to 8.01.02-k Andrew Vasquez
                   ` (3 preceding siblings ...)
  2005-10-13 23:16 ` [PATCH 4/12] qla2xxx: Update license Andrew Vasquez
@ 2005-10-13 23:16 ` Andrew Vasquez
  2005-10-14  9:47   ` Christoph Hellwig
  2005-10-13 23:16 ` [PATCH 6/12] qla2xxx: Resync with latest released firmware -- 4.00.12 Andrew Vasquez
                   ` (7 subsequent siblings)
  12 siblings, 1 reply; 41+ messages in thread
From: Andrew Vasquez @ 2005-10-13 23:16 UTC (permalink / raw)
  To: James Bottomley, Linux-SCSI Mailing List; +Cc: Andrew Vasquez

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>

---

 drivers/scsi/qla2xxx/Makefile   |    3 +
 drivers/scsi/qla2xxx/ql2400.c   |  113 +++++++++++++++++++++++++++++++++++++++
 drivers/scsi/qla2xxx/qla_def.h  |    2 -
 drivers/scsi/qla2xxx/qla_gbl.h  |    1 
 drivers/scsi/qla2xxx/qla_init.c |   63 ++++++++++++++++++++++
 drivers/scsi/qla2xxx/qla_os.c   |   85 ++++++-----------------------
 6 files changed, 196 insertions(+), 71 deletions(-)
 create mode 100644 drivers/scsi/qla2xxx/ql2400.c

applies-to: fd35977ee7de3602087def1d4b490e31c9a383d2
84910304aeb3d5db54db9e975309e21791b9baca
diff --git a/drivers/scsi/qla2xxx/Makefile b/drivers/scsi/qla2xxx/Makefile
index b169687..f1c3dfd 100644
--- a/drivers/scsi/qla2xxx/Makefile
+++ b/drivers/scsi/qla2xxx/Makefile
@@ -8,10 +8,11 @@ qla2200-y := ql2200.o ql2200_fw.o
 qla2300-y := ql2300.o ql2300_fw.o
 qla2322-y := ql2322.o ql2322_fw.o
 qla6312-y := ql6312.o ql6312_fw.o
+qla2400-y := ql2400.o ql2400_fw.o
 
 obj-$(CONFIG_SCSI_QLA21XX) += qla2xxx.o qla2100.o
 obj-$(CONFIG_SCSI_QLA22XX) += qla2xxx.o qla2200.o
 obj-$(CONFIG_SCSI_QLA2300) += qla2xxx.o qla2300.o
 obj-$(CONFIG_SCSI_QLA2322) += qla2xxx.o qla2322.o
 obj-$(CONFIG_SCSI_QLA6312) += qla2xxx.o qla6312.o
-obj-$(CONFIG_SCSI_QLA24XX) += qla2xxx.o
+obj-$(CONFIG_SCSI_QLA24XX) += qla2xxx.o qla2400.o
diff --git a/drivers/scsi/qla2xxx/ql2400.c b/drivers/scsi/qla2xxx/ql2400.c
new file mode 100644
index 0000000..76a48ed
--- /dev/null
+++ b/drivers/scsi/qla2xxx/ql2400.c
@@ -0,0 +1,113 @@
+/*
+ * QLogic Fibre Channel HBA Driver
+ * Copyright (c)  2003-2005 QLogic Corporation
+ *
+ * See LICENSE.qla2xxx for copyright and licensing details.
+ */
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+
+#include "qla_def.h"
+
+static char qla_driver_name[] = "qla2400";
+
+extern uint32_t fw2400_version_str[];
+extern uint32_t fw2400_addr01;
+extern uint32_t fw2400_code01[];
+extern uint32_t fw2400_length01;
+extern uint32_t fw2400_addr02;
+extern uint32_t fw2400_code02[];
+extern uint32_t fw2400_length02;
+
+static struct qla_fw_info qla_fw_tbl[] = {
+	{
+		.addressing	= FW_INFO_ADDR_EXTENDED,
+		.fwcode		= (unsigned short *)&fw2400_code01[0],
+		.fwlen		= (unsigned short *)&fw2400_length01,
+		.lfwstart	= (unsigned long *)&fw2400_addr01,
+	},
+	{
+		.addressing	= FW_INFO_ADDR_EXTENDED,
+		.fwcode		= (unsigned short *)&fw2400_code02[0],
+		.fwlen		= (unsigned short *)&fw2400_length02,
+		.lfwstart	= (unsigned long *)&fw2400_addr02,
+	},
+	{ FW_INFO_ADDR_NOMORE, },
+};
+
+static struct qla_board_info qla_board_tbl[] = {
+	{
+		.drv_name	= qla_driver_name,
+		.isp_name	= "ISP2422",
+		.fw_info	= qla_fw_tbl,
+		.fw_fname	= "ql2400_fw.bin",
+		.alternate_sht	= 1,
+	},
+	{
+		.drv_name	= qla_driver_name,
+		.isp_name	= "ISP2432",
+		.fw_info	= qla_fw_tbl,
+		.fw_fname	= "ql2400_fw.bin",
+		.alternate_sht	= 1,
+	},
+};
+
+static struct pci_device_id qla24xx_pci_tbl[] = {
+	{
+		.vendor		= PCI_VENDOR_ID_QLOGIC,
+		.device		= PCI_DEVICE_ID_QLOGIC_ISP2422,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.driver_data	= (unsigned long)&qla_board_tbl[0],
+	},
+	{
+		.vendor		= PCI_VENDOR_ID_QLOGIC,
+		.device		= PCI_DEVICE_ID_QLOGIC_ISP2432,
+		.subvendor	= PCI_ANY_ID,
+		.subdevice	= PCI_ANY_ID,
+		.driver_data	= (unsigned long)&qla_board_tbl[1],
+	},
+	{0, 0},
+};
+MODULE_DEVICE_TABLE(pci, qla24xx_pci_tbl);
+
+static int __devinit
+qla24xx_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
+{
+	return qla2x00_probe_one(pdev,
+	    (struct qla_board_info *)id->driver_data);
+}
+
+static void __devexit
+qla24xx_remove_one(struct pci_dev *pdev)
+{
+	qla2x00_remove_one(pdev);
+}
+
+static struct pci_driver qla24xx_pci_driver = {
+	.name		= "qla2400",
+	.id_table	= qla24xx_pci_tbl,
+	.probe		= qla24xx_probe_one,
+	.remove		= __devexit_p(qla24xx_remove_one),
+};
+
+static int __init
+qla24xx_init(void)
+{
+	return pci_module_init(&qla24xx_pci_driver);
+}
+
+static void __exit
+qla24xx_exit(void)
+{
+	pci_unregister_driver(&qla24xx_pci_driver);
+}
+
+module_init(qla24xx_init);
+module_exit(qla24xx_exit);
+
+MODULE_AUTHOR("QLogic Corporation");
+MODULE_DESCRIPTION("QLogic ISP24xx FC-SCSI Host Bus Adapter driver");
+MODULE_LICENSE("GPL");
+MODULE_VERSION(QLA2XXX_VERSION);
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index fc3234c..73a066c 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -2118,7 +2118,7 @@ struct qla_board_info {
 	char isp_name[8];
 	struct qla_fw_info *fw_info;
 	char *fw_fname;
-	struct scsi_host_template *sht;
+	int alternate_sht;
 };
 
 /* Return data from MBC_GET_ID_LIST call. */
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
index ba44636..ec30ac1 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -35,6 +35,7 @@ extern void qla24xx_update_fw_options(sc
 extern int qla2x00_load_risc(struct scsi_qla_host *, uint32_t *);
 extern int qla24xx_load_risc_flash(scsi_qla_host_t *, uint32_t *);
 extern int qla24xx_load_risc_hotplug(scsi_qla_host_t *, uint32_t *);
+extern int qla24xx_load_risc(scsi_qla_host_t *, uint32_t *);
 
 extern fc_port_t *qla2x00_alloc_fcport(scsi_qla_host_t *, int);
 
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 5ab88e7..7407780 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -3729,3 +3729,66 @@ fail_fw_integrity:
 	return QLA_FUNCTION_FAILED;
 
 }
+
+int
+qla24xx_load_risc(scsi_qla_host_t *ha, uint32_t *srisc_addr)
+{
+	int	rval, num, i;
+	uint32_t cnt;
+	uint32_t *risc_code;
+	uint32_t risc_address;
+	uint32_t risc_code_size;
+	uint32_t *req_ring;
+	struct qla_fw_info *fw_iter;
+
+	rval = QLA_SUCCESS;
+
+	/* Load firmware sequences */
+	fw_iter = ha->brd_info->fw_info;
+	*srisc_addr = *((uint32_t *)fw_iter->lfwstart);
+	while (fw_iter->addressing != FW_INFO_ADDR_NOMORE) {
+		risc_code = (uint32_t *)fw_iter->fwcode;
+		risc_code_size = *((uint32_t *)fw_iter->fwlen);
+		risc_address = *((uint32_t *)fw_iter->lfwstart);
+
+		num = 0;
+		rval = 0;
+		while (risc_code_size > 0 && !rval) {
+			cnt = (uint32_t)(ha->fw_transfer_size >> 2);
+			if (cnt > risc_code_size)
+				cnt = risc_code_size;
+
+			DEBUG7(printk("scsi(%ld): Loading risc segment@ "
+			    "addr %p, number of bytes 0x%x, offset 0x%lx.\n",
+			    ha->host_no, risc_code, cnt, risc_address));
+
+			req_ring = (uint32_t *)ha->request_ring;
+			for (i = 0; i < cnt; i++)
+				req_ring[i] = cpu_to_le32(risc_code[i]);
+
+			rval = qla2x00_load_ram_ext(ha, ha->request_dma,
+			    risc_address, cnt);
+			if (rval) {
+				DEBUG(printk("scsi(%ld): [ERROR] Failed to "
+				    "load segment %d of firmware\n",
+				    ha->host_no, num));
+				qla_printk(KERN_WARNING, ha,
+				    "[ERROR] Failed to load segment %d of "
+				    "firmware\n", num);
+
+				qla2x00_dump_regs(ha);
+				break;
+			}
+
+			risc_code += cnt;
+			risc_address += cnt;
+			risc_code_size -= cnt;
+			num++;
+		}
+
+		/* Next firmware sequence */
+		fw_iter++;
+	}
+
+	return rval;
+}
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 42c53ea..40b124d 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -54,10 +54,15 @@ module_param(ql2xloginretrycount, int, S
 MODULE_PARM_DESC(ql2xloginretrycount,
 		"Specify an alternate value for the NVRAM login retry count.");
 
-int ql2xfwloadbin=1;
+int ql2xfwloadbin;
 module_param(ql2xfwloadbin, int, S_IRUGO|S_IRUSR);
 MODULE_PARM_DESC(ql2xfwloadbin,
-		"Load ISP2xxx firmware image via hotplug.");
+		"Option to specify location in which to load ISP24xx firmware: "
+		" 2 -- load firmware via the request_firmware() (hotplug) "
+		"      interface.  A file, ql2400_fw.bin, (containing the "
+		"      firmware image) should be hotplug accessible."
+		" 1 -- load firmware from flash."
+		" 0 -- load firmware embedded with driver (default).");
 
 static void qla2x00_free_device(scsi_qla_host_t *);
 
@@ -1210,8 +1215,9 @@ int qla2x00_probe_one(struct pci_dev *pd
 	if (pci_enable_device(pdev))
 		goto probe_out;
 
-	host = scsi_host_alloc(brd_info->sht ? brd_info->sht:
-	    &qla2x00_driver_template, sizeof(scsi_qla_host_t));
+	host = scsi_host_alloc(brd_info->alternate_sht ?
+	    &qla24xx_driver_template: &qla2x00_driver_template,
+	    sizeof(scsi_qla_host_t));
 	if (host == NULL) {
 		printk(KERN_WARNING
 		    "qla2xxx: Couldn't allocate host from scsi layer!\n");
@@ -1311,9 +1317,12 @@ int qla2x00_probe_one(struct pci_dev *pd
 		ha->isp_ops.reset_adapter = qla24xx_reset_adapter;
 		ha->isp_ops.nvram_config = qla24xx_nvram_config;
 		ha->isp_ops.update_fw_options = qla24xx_update_fw_options;
-		ha->isp_ops.load_risc = qla24xx_load_risc_flash;
-		if (ql2xfwloadbin)
+		if (ql2xfwloadbin == 2)
 			ha->isp_ops.load_risc = qla24xx_load_risc_hotplug;
+		else if (ql2xfwloadbin == 1)
+			ha->isp_ops.load_risc = qla24xx_load_risc_flash;
+		else
+			ha->isp_ops.load_risc = qla24xx_load_risc;
 		ha->isp_ops.pci_info_str = qla24xx_pci_info_str;
 		ha->isp_ops.fw_version_str = qla24xx_fw_version_str;
 		ha->isp_ops.intr_handler = qla24xx_intr_handler;
@@ -2419,68 +2428,12 @@ qla2x00_down_timeout(struct semaphore *s
 	return -ETIMEDOUT;
 }
 
-static struct qla_board_info qla_board_tbl[] = {
-	{
-		.drv_name	= "qla2400",
-		.isp_name	= "ISP2422",
-		.fw_fname	= "ql2400_fw.bin",
-		.sht		= &qla24xx_driver_template,
-	},
-	{
-		.drv_name	= "qla2400",
-		.isp_name	= "ISP2432",
-		.fw_fname	= "ql2400_fw.bin",
-		.sht		= &qla24xx_driver_template,
-	},
-};
-
-static struct pci_device_id qla2xxx_pci_tbl[] = {
-	{
-		.vendor		= PCI_VENDOR_ID_QLOGIC,
-		.device		= PCI_DEVICE_ID_QLOGIC_ISP2422,
-		.subvendor	= PCI_ANY_ID,
-		.subdevice	= PCI_ANY_ID,
-		.driver_data	= (unsigned long)&qla_board_tbl[0],
-	},
-	{
-		.vendor		= PCI_VENDOR_ID_QLOGIC,
-		.device		= PCI_DEVICE_ID_QLOGIC_ISP2432,
-		.subvendor	= PCI_ANY_ID,
-		.subdevice	= PCI_ANY_ID,
-		.driver_data	= (unsigned long)&qla_board_tbl[1],
-	},
-	{0, 0},
-};
-MODULE_DEVICE_TABLE(pci, qla2xxx_pci_tbl);
-
-static int __devinit
-qla2xxx_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
-{
-	return qla2x00_probe_one(pdev,
-	    (struct qla_board_info *)id->driver_data);
-}
-
-static void __devexit
-qla2xxx_remove_one(struct pci_dev *pdev)
-{
-	qla2x00_remove_one(pdev);
-}
-
-static struct pci_driver qla2xxx_pci_driver = {
-	.name		= "qla2xxx",
-	.id_table	= qla2xxx_pci_tbl,
-	.probe		= qla2xxx_probe_one,
-	.remove		= __devexit_p(qla2xxx_remove_one),
-};
-
 /**
  * qla2x00_module_init - Module initialization.
  **/
 static int __init
 qla2x00_module_init(void)
 {
-	int ret = 0;
-
 	/* Allocate cache for SRBs. */
 	srb_cachep = kmem_cache_create("qla2xxx_srbs", sizeof(srb_t), 0,
 	    SLAB_HWCACHE_ALIGN, NULL, NULL);
@@ -2501,12 +2454,7 @@ qla2x00_module_init(void)
 		return -ENODEV;
 
 	printk(KERN_INFO "QLogic Fibre Channel HBA Driver\n");
-	ret = pci_module_init(&qla2xxx_pci_driver);
-	if (ret) {
-		kmem_cache_destroy(srb_cachep);
-		fc_release_transport(qla2xxx_transport_template);
-	}
-	return ret;
+	return 0;
 }
 
 /**
@@ -2515,7 +2463,6 @@ qla2x00_module_init(void)
 static void __exit
 qla2x00_module_exit(void)
 {
-	pci_unregister_driver(&qla2xxx_pci_driver);
 	kmem_cache_destroy(srb_cachep);
 	fc_release_transport(qla2xxx_transport_template);
 }
---
0.99.8.GIT

-- 
Andrew Vasquez

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 6/12]  qla2xxx: Resync with latest released firmware -- 4.00.12.
  2005-10-13 23:15 [PATCH 0/16] qla2xxx: update qla2xxx driver to 8.01.02-k Andrew Vasquez
                   ` (4 preceding siblings ...)
  2005-10-13 23:16 ` [PATCH 5/12] qla2xxx: Add support for embedded ISP24xx firmware Andrew Vasquez
@ 2005-10-13 23:16 ` Andrew Vasquez
  2005-10-13 23:16 ` [PATCH 7/12] qla2xxx: Add hotplug firmware-load support for all ISP types Andrew Vasquez
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 41+ messages in thread
From: Andrew Vasquez @ 2005-10-13 23:16 UTC (permalink / raw)
  To: James Bottomley, Linux-SCSI Mailing List; +Cc: Andrew Vasquez

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>

---

This patch is too large for an inline patch, please download the
bzip'd patch from:

        ftp://ftp.qlogic.com/outgoing/linux/patches/8.x/8.01.02k/0006-Resync-with-latest-released-firmware-4.00.12.diff.bz2

-- 
Andrew Vasquez

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 7/12]  qla2xxx: Add hotplug firmware-load support for all ISP types.
  2005-10-13 23:15 [PATCH 0/16] qla2xxx: update qla2xxx driver to 8.01.02-k Andrew Vasquez
                   ` (5 preceding siblings ...)
  2005-10-13 23:16 ` [PATCH 6/12] qla2xxx: Resync with latest released firmware -- 4.00.12 Andrew Vasquez
@ 2005-10-13 23:16 ` Andrew Vasquez
  2005-10-13 23:16 ` [PATCH 8/12] qla2xxx: Resync with latest released ISP23xx/63xx firmware -- 3.03.18 Andrew Vasquez
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 41+ messages in thread
From: Andrew Vasquez @ 2005-10-13 23:16 UTC (permalink / raw)
  To: James Bottomley, Linux-SCSI Mailing List; +Cc: Andrew Vasquez

Original implementation only supported ISP24xx types.  The
driver requests a specific file name based on ISP type:

	ISP		Filename
	----------	-------------
	21xx		ql2100_fw.bin
	22xx		ql2200_fw.bin
	2300, 2312	ql2300_fw.bin
	2322		ql2322_fw.bin
	6312, 6322	ql6312_fw.bin
	24xx		ql2400_fw.bin

so the user should insure that the appropriate .bin file is
hotplug accessible.  Upon request, the driver caches the
firmware image until the core qla2xxx driver is unloaded.

Also collapse essentially duplicate code in
qla2x00_load_ram_ext() into a qla2x00_load_ram().

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>

---

 drivers/scsi/qla2xxx/ql2322.c   |   12 +--
 drivers/scsi/qla2xxx/qla_def.h  |    7 ++
 drivers/scsi/qla2xxx/qla_gbl.h  |    8 +-
 drivers/scsi/qla2xxx/qla_init.c |  176 +++++++++++++++++++++++++++++----------
 drivers/scsi/qla2xxx/qla_mbx.c  |  103 ++---------------------
 drivers/scsi/qla2xxx/qla_os.c   |   77 +++++++++++++++++
 6 files changed, 233 insertions(+), 150 deletions(-)

applies-to: 62666c48a7115b6d16b8db7a511f89042b10cc8c
c0f04d85eb3657e1b08c3b5426e4cf56cd2e9e48
diff --git a/drivers/scsi/qla2xxx/ql2322.c b/drivers/scsi/qla2xxx/ql2322.c
index c88a22c..b7affb9 100644
--- a/drivers/scsi/qla2xxx/ql2322.c
+++ b/drivers/scsi/qla2xxx/ql2322.c
@@ -46,12 +46,10 @@ static struct qla_fw_info qla_fw_tbl[] =
 	{ FW_INFO_ADDR_NOMORE, },
 };
 
-static struct qla_board_info qla_board_tbl[] = {
-	{
-		.drv_name	= qla_driver_name,
-		.isp_name	= "ISP2322",
-		.fw_info	= qla_fw_tbl,
-	},
+static struct qla_board_info qla_board_tbl = {
+	.drv_name	= qla_driver_name,
+	.isp_name	= "ISP2322",
+	.fw_info	= qla_fw_tbl,
 };
 
 static struct pci_device_id qla2322_pci_tbl[] = {
@@ -60,7 +58,7 @@ static struct pci_device_id qla2322_pci_
 		.device		= PCI_DEVICE_ID_QLOGIC_ISP2322,
 		.subvendor	= PCI_ANY_ID,
 		.subdevice	= PCI_ANY_ID,
-		.driver_data	= (unsigned long)&qla_board_tbl[0],
+		.driver_data	= (unsigned long)&qla_board_tbl,
 	},
 	{0, 0},
 };
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 73a066c..1dcb69e 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -21,6 +21,7 @@
 #include <linux/spinlock.h>
 #include <linux/completion.h>
 #include <linux/interrupt.h>
+#include <linux/firmware.h>
 #include <asm/semaphore.h>
 
 #include <scsi/scsi.h>
@@ -2121,6 +2122,12 @@ struct qla_board_info {
 	int alternate_sht;
 };
 
+struct fw_blob {
+	char *name;
+	uint32_t segs[4];
+	const struct firmware *fw;
+};
+
 /* Return data from MBC_GET_ID_LIST call. */
 struct gid_list_info {
 	uint8_t	al_pa;
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
index ec30ac1..1f61c38 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -33,6 +33,7 @@ extern int qla24xx_nvram_config(struct s
 extern void qla2x00_update_fw_options(struct scsi_qla_host *);
 extern void qla24xx_update_fw_options(scsi_qla_host_t *);
 extern int qla2x00_load_risc(struct scsi_qla_host *, uint32_t *);
+extern int qla2x00_load_risc_hotplug(scsi_qla_host_t *, uint32_t *);
 extern int qla24xx_load_risc_flash(scsi_qla_host_t *, uint32_t *);
 extern int qla24xx_load_risc_hotplug(scsi_qla_host_t *, uint32_t *);
 extern int qla24xx_load_risc(scsi_qla_host_t *, uint32_t *);
@@ -77,6 +78,8 @@ extern void qla2x00_blink_led(scsi_qla_h
 
 extern int qla2x00_down_timeout(struct semaphore *, unsigned long);
 
+extern struct fw_blob *qla2x00_request_firmware(scsi_qla_host_t *);
+
 /*
  * Global Function Prototypes in qla_iocb.c source file.
  */
@@ -95,10 +98,7 @@ int __qla2x00_marker(scsi_qla_host_t *, 
  * Global Function Prototypes in qla_mbx.c source file.
  */
 extern int
-qla2x00_load_ram(scsi_qla_host_t *, dma_addr_t, uint16_t, uint16_t);
-
-extern int
-qla2x00_load_ram_ext(scsi_qla_host_t *, dma_addr_t, uint32_t, uint32_t);
+qla2x00_load_ram(scsi_qla_host_t *, dma_addr_t, uint32_t, uint32_t);
 
 extern int
 qla2x00_execute_fw(scsi_qla_host_t *, uint32_t);
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 7407780..a2db820 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -8,7 +8,6 @@
 
 #include <linux/delay.h>
 #include <linux/vmalloc.h>
-#include <linux/firmware.h>
 #include <scsi/scsi_transport_fc.h>
 
 #include "qla_devtbl.h"
@@ -3508,13 +3507,8 @@ qla2x00_load_risc(scsi_qla_host_t *ha, u
 			for (i = 0; i < cnt; i++)
 				req_ring[i] = cpu_to_le16(risc_code[i]);
 
-			if (fw_iter->addressing == FW_INFO_ADDR_NORMAL) {
-				rval = qla2x00_load_ram(ha, ha->request_dma,
-				    risc_address, cnt);
-			} else {
-				rval = qla2x00_load_ram_ext(ha,
-				    ha->request_dma, risc_address, cnt);
-			}
+			rval = qla2x00_load_ram(ha, ha->request_dma,
+			    risc_address, cnt);
 			if (rval) {
 				DEBUG(printk("scsi(%ld): [ERROR] Failed to "
 				    "load segment %d of firmware\n",
@@ -3541,15 +3535,112 @@ qla2x00_load_risc(scsi_qla_host_t *ha, u
 }
 
 int
+qla2x00_load_risc_hotplug(scsi_qla_host_t *ha, uint32_t *srisc_addr)
+{
+	int	rval;
+	int	i, fragment;
+	uint16_t *wcode, *fwcode;
+	uint32_t risc_addr, risc_size, fwclen, wlen, *seg;
+	struct fw_blob *blob;
+
+	/* Load firmware blob. */
+	blob = qla2x00_request_firmware(ha);
+	if (!blob) {
+		qla_printk(KERN_ERR, ha, "Firmware image unavailable.\n");
+		return QLA_FUNCTION_FAILED;
+	}
+
+	rval = QLA_SUCCESS;
+
+	wcode = (uint16_t *)ha->request_ring;
+	*srisc_addr = 0;
+	fwcode = (uint16_t *)blob->fw->data;
+	fwclen = 0;
+
+	/* Validate firmware image by checking version. */
+	if (blob->fw->size < 8 * sizeof(uint16_t)) {
+		qla_printk(KERN_WARNING, ha,
+		    "Unable to verify integrity of firmware image (%Zd)!\n",
+		    blob->fw->size);
+		goto fail_fw_integrity;
+	}
+	for (i = 0; i < 4; i++)
+		wcode[i] = be16_to_cpu(fwcode[i + 4]);
+	if ((wcode[0] == 0xffff && wcode[1] == 0xffff && wcode[2] == 0xffff &&
+	    wcode[3] == 0xffff) || (wcode[0] == 0 && wcode[1] == 0 &&
+		wcode[2] == 0 && wcode[3] == 0)) {
+		qla_printk(KERN_WARNING, ha,
+		    "Unable to verify integrity of firmware image!\n");
+		qla_printk(KERN_WARNING, ha,
+		    "Firmware data: %04x %04x %04x %04x!\n", wcode[0],
+		    wcode[1], wcode[2], wcode[3]);
+		goto fail_fw_integrity;
+	}
+
+	seg = blob->segs;
+	while (*seg && rval == QLA_SUCCESS) {
+		risc_addr = *seg;
+		*srisc_addr = *srisc_addr == 0 ? *seg : *srisc_addr;
+		risc_size = be16_to_cpu(fwcode[3]);
+
+		/* Validate firmware image size. */
+		fwclen += risc_size * sizeof(uint16_t);
+		if (blob->fw->size < fwclen) {
+			qla_printk(KERN_WARNING, ha,
+			    "Unable to verify integrity of firmware image "
+			    "(%Zd)!\n", blob->fw->size);
+			goto fail_fw_integrity;
+		}
+
+		fragment = 0;
+		while (risc_size > 0 && rval == QLA_SUCCESS) {
+			wlen = (uint16_t)(ha->fw_transfer_size >> 1);
+			if (wlen > risc_size)
+				wlen = risc_size;
+
+			DEBUG7(printk("scsi(%ld): Loading risc segment@ risc "
+			    "addr %x, number of words 0x%x.\n", ha->host_no,
+			    risc_addr, wlen));
+
+			for (i = 0; i < wlen; i++)
+				wcode[i] = swab16(fwcode[i]);
+
+			rval = qla2x00_load_ram(ha, ha->request_dma, risc_addr,
+			    wlen);
+			if (rval) {
+				DEBUG(printk("scsi(%ld):[ERROR] Failed to load "
+				    "segment %d of firmware\n", ha->host_no,
+				    fragment));
+				qla_printk(KERN_WARNING, ha,
+				    "[ERROR] Failed to load segment %d of "
+				    "firmware\n", fragment);
+				break;
+			}
+
+			fwcode += wlen;
+			risc_addr += wlen;
+			risc_size -= wlen;
+			fragment++;
+		}
+
+		/* Next segment. */
+		seg++;
+	}
+
+	return rval;
+
+fail_fw_integrity:
+	return QLA_FUNCTION_FAILED;
+}
+
+int
 qla24xx_load_risc_flash(scsi_qla_host_t *ha, uint32_t *srisc_addr)
 {
 	int	rval;
-	int	segments, fragment;
+	int	i, segments, fragment;
 	uint32_t faddr;
 	uint32_t *dcode, dlen;
-	uint32_t risc_addr;
-	uint32_t risc_size;
-	uint32_t i;
+	uint32_t risc_addr, risc_size;
 
 	rval = QLA_SUCCESS;
 
@@ -3597,8 +3688,8 @@ qla24xx_load_risc_flash(scsi_qla_host_t 
 			for (i = 0; i < dlen; i++)
 				dcode[i] = swab32(dcode[i]);
 
-			rval = qla2x00_load_ram_ext(ha, ha->request_dma,
-			    risc_addr, dlen);
+			rval = qla2x00_load_ram(ha, ha->request_dma, risc_addr,
+			    dlen);
 			if (rval) {
 				DEBUG(printk("scsi(%ld):[ERROR] Failed to load "
 				    "segment %d of firmware\n", ha->host_no,
@@ -3631,14 +3722,13 @@ qla24xx_load_risc_hotplug(scsi_qla_host_
 	uint32_t risc_addr;
 	uint32_t risc_size;
 	uint32_t i;
-	const struct firmware *fw_entry;
+	struct fw_blob *blob;
 	uint32_t *fwcode, fwclen;
 
-	if (request_firmware(&fw_entry, ha->brd_info->fw_fname,
-	    &ha->pdev->dev)) {
-		qla_printk(KERN_ERR, ha,
-		    "Firmware image file not available: '%s'\n",
-		    ha->brd_info->fw_fname);
+	/* Load firmware blob. */
+	blob = qla2x00_request_firmware(ha);
+	if (!blob) {
+		qla_printk(KERN_ERR, ha, "Firmware image unavailable.\n");
 		return QLA_FUNCTION_FAILED;
 	}
 
@@ -3647,14 +3737,14 @@ qla24xx_load_risc_hotplug(scsi_qla_host_
 	segments = FA_RISC_CODE_SEGMENTS;
 	dcode = (uint32_t *)ha->request_ring;
 	*srisc_addr = 0;
-	fwcode = (uint32_t *)fw_entry->data;
+	fwcode = (uint32_t *)blob->fw->data;
 	fwclen = 0;
 
 	/* Validate firmware image by checking version. */
-	if (fw_entry->size < 8 * sizeof(uint32_t)) {
+	if (blob->fw->size < 8 * sizeof(uint32_t)) {
 		qla_printk(KERN_WARNING, ha,
-		    "Unable to verify integrity of flash firmware image "
-		    "(%Zd)!\n", fw_entry->size);
+		    "Unable to verify integrity of firmware image (%Zd)!\n",
+		    blob->fw->size);
 		goto fail_fw_integrity;
 	}
 	for (i = 0; i < 4; i++)
@@ -3664,7 +3754,7 @@ qla24xx_load_risc_hotplug(scsi_qla_host_
 	    (dcode[0] == 0 && dcode[1] == 0 && dcode[2] == 0 &&
 		dcode[3] == 0)) {
 		qla_printk(KERN_WARNING, ha,
-		    "Unable to verify integrity of flash firmware image!\n");
+		    "Unable to verify integrity of firmware image!\n");
 		qla_printk(KERN_WARNING, ha,
 		    "Firmware data: %08x %08x %08x %08x!\n", dcode[0],
 		    dcode[1], dcode[2], dcode[3]);
@@ -3678,10 +3768,10 @@ qla24xx_load_risc_hotplug(scsi_qla_host_
 
 		/* Validate firmware image size. */
 		fwclen += risc_size * sizeof(uint32_t);
-		if (fw_entry->size < fwclen) {
+		if (blob->fw->size < fwclen) {
 			qla_printk(KERN_WARNING, ha,
-			    "Unable to verify integrity of flash firmware "
-			    "image (%Zd)!\n", fw_entry->size);
+			    "Unable to verify integrity of firmware image "
+			    "(%Zd)!\n", blob->fw->size);
 			goto fail_fw_integrity;
 		}
 
@@ -3698,8 +3788,8 @@ qla24xx_load_risc_hotplug(scsi_qla_host_
 			for (i = 0; i < dlen; i++)
 				dcode[i] = swab32(fwcode[i]);
 
-			rval = qla2x00_load_ram_ext(ha, ha->request_dma,
-			    risc_addr, dlen);
+			rval = qla2x00_load_ram(ha, ha->request_dma, risc_addr,
+			    dlen);
 			if (rval) {
 				DEBUG(printk("scsi(%ld):[ERROR] Failed to load "
 				    "segment %d of firmware\n", ha->host_no,
@@ -3720,12 +3810,9 @@ qla24xx_load_risc_hotplug(scsi_qla_host_
 		segments--;
 	}
 
-	release_firmware(fw_entry);
 	return rval;
 
 fail_fw_integrity:
-
-	release_firmware(fw_entry);
 	return QLA_FUNCTION_FAILED;
 
 }
@@ -3736,8 +3823,7 @@ qla24xx_load_risc(scsi_qla_host_t *ha, u
 	int	rval, num, i;
 	uint32_t cnt;
 	uint32_t *risc_code;
-	uint32_t risc_address;
-	uint32_t risc_code_size;
+	uint32_t risc_addr, risc_size;
 	uint32_t *req_ring;
 	struct qla_fw_info *fw_iter;
 
@@ -3748,26 +3834,26 @@ qla24xx_load_risc(scsi_qla_host_t *ha, u
 	*srisc_addr = *((uint32_t *)fw_iter->lfwstart);
 	while (fw_iter->addressing != FW_INFO_ADDR_NOMORE) {
 		risc_code = (uint32_t *)fw_iter->fwcode;
-		risc_code_size = *((uint32_t *)fw_iter->fwlen);
-		risc_address = *((uint32_t *)fw_iter->lfwstart);
+		risc_size = *((uint32_t *)fw_iter->fwlen);
+		risc_addr = *((uint32_t *)fw_iter->lfwstart);
 
 		num = 0;
 		rval = 0;
-		while (risc_code_size > 0 && !rval) {
+		while (risc_size > 0 && !rval) {
 			cnt = (uint32_t)(ha->fw_transfer_size >> 2);
-			if (cnt > risc_code_size)
-				cnt = risc_code_size;
+			if (cnt > risc_size)
+				cnt = risc_size;
 
 			DEBUG7(printk("scsi(%ld): Loading risc segment@ "
 			    "addr %p, number of bytes 0x%x, offset 0x%lx.\n",
-			    ha->host_no, risc_code, cnt, risc_address));
+			    ha->host_no, risc_code, cnt, risc_addr));
 
 			req_ring = (uint32_t *)ha->request_ring;
 			for (i = 0; i < cnt; i++)
 				req_ring[i] = cpu_to_le32(risc_code[i]);
 
-			rval = qla2x00_load_ram_ext(ha, ha->request_dma,
-			    risc_address, cnt);
+			rval = qla2x00_load_ram(ha, ha->request_dma,
+			    risc_addr, cnt);
 			if (rval) {
 				DEBUG(printk("scsi(%ld): [ERROR] Failed to "
 				    "load segment %d of firmware\n",
@@ -3781,8 +3867,8 @@ qla24xx_load_risc(scsi_qla_host_t *ha, u
 			}
 
 			risc_code += cnt;
-			risc_address += cnt;
-			risc_code_size -= cnt;
+			risc_addr += cnt;
+			risc_size -= cnt;
 			num++;
 		}
 
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index ad3cacb..6b6b3b8 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -325,113 +325,30 @@ qla2x00_mailbox_command(scsi_qla_host_t 
 	return rval;
 }
 
-/*
- * qla2x00_load_ram
- *	Load adapter RAM using DMA.
- *
- * Input:
- *	ha = adapter block pointer.
- *
- * Returns:
- *	qla2x00 local function return status code.
- *
- * Context:
- *	Kernel context.
- */
 int
-qla2x00_load_ram(scsi_qla_host_t *ha, dma_addr_t req_dma, uint16_t risc_addr,
-    uint16_t risc_code_size)
+qla2x00_load_ram(scsi_qla_host_t *ha, dma_addr_t req_dma, uint32_t risc_addr,
+    uint32_t risc_code_size)
 {
 	int rval;
 	mbx_cmd_t mc;
 	mbx_cmd_t *mcp = &mc;
-	uint32_t	req_len;
-	dma_addr_t	nml_dma;
-	uint32_t	nml_len;
-	uint32_t	normalized;
-
-	DEBUG11(printk("qla2x00_load_ram(%ld): entered.\n",
-	    ha->host_no);)
 
-	req_len = risc_code_size;
-	nml_dma = 0;
-	nml_len = 0;
-
-	normalized = qla2x00_normalize_dma_addr(&req_dma, &req_len, &nml_dma,
-	    &nml_len);
-
-	/* Load first segment */
-	mcp->mb[0] = MBC_LOAD_RISC_RAM;
-	mcp->mb[1] = risc_addr;
-	mcp->mb[2] = MSW(req_dma);
-	mcp->mb[3] = LSW(req_dma);
-	mcp->mb[4] = (uint16_t)req_len;
-	mcp->mb[6] = MSW(MSD(req_dma));
-	mcp->mb[7] = LSW(MSD(req_dma));
-	mcp->out_mb = MBX_7|MBX_6|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0;
-	mcp->in_mb = MBX_0;
-	mcp->tov = 30;
-	mcp->flags = 0;
-	rval = qla2x00_mailbox_command(ha, mcp);
-
-	/* Load second segment - if necessary */
-	if (normalized && (rval == QLA_SUCCESS)) {
-		mcp->mb[0] = MBC_LOAD_RISC_RAM;
-		mcp->mb[1] = risc_addr + (uint16_t)req_len;
-		mcp->mb[2] = MSW(nml_dma);
-		mcp->mb[3] = LSW(nml_dma);
-		mcp->mb[4] = (uint16_t)nml_len;
-		mcp->mb[6] = MSW(MSD(nml_dma));
-		mcp->mb[7] = LSW(MSD(nml_dma));
-		mcp->out_mb = MBX_7|MBX_6|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0;
-		mcp->in_mb = MBX_0;
-		mcp->tov = 30;
-		mcp->flags = 0;
-		rval = qla2x00_mailbox_command(ha, mcp);
-	}
+	DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));
 
-	if (rval == QLA_SUCCESS) {
-		/* Empty */
-		DEBUG11(printk("qla2x00_load_ram(%ld): done.\n", ha->host_no);)
+	if (MSW(risc_addr) || IS_QLA24XX(ha) || IS_QLA25XX(ha)) {
+		mcp->mb[0] = MBC_LOAD_RISC_RAM_EXTENDED;
+		mcp->mb[8] = MSW(risc_addr);
+		mcp->out_mb = MBX_8|MBX_0;
 	} else {
-		/* Empty */
-		DEBUG2_3_11(printk("qla2x00_load_ram(%ld): failed. rval=%x "
-		    "mb[0]=%x.\n", ha->host_no, rval, mcp->mb[0]);)
+		mcp->mb[0] = MBC_LOAD_RISC_RAM;
+		mcp->out_mb = MBX_0;
 	}
-	return rval;
-}
-
-/*
- * qla2x00_load_ram_ext
- *	Load adapter extended RAM using DMA.
- *
- * Input:
- *	ha = adapter block pointer.
- *
- * Returns:
- *	qla2x00 local function return status code.
- *
- * Context:
- *	Kernel context.
- */
-int
-qla2x00_load_ram_ext(scsi_qla_host_t *ha, dma_addr_t req_dma,
-    uint32_t risc_addr, uint32_t risc_code_size)
-{
-	int rval;
-	mbx_cmd_t mc;
-	mbx_cmd_t *mcp = &mc;
-
-	DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));
-
-	mcp->mb[0] = MBC_LOAD_RISC_RAM_EXTENDED;
 	mcp->mb[1] = LSW(risc_addr);
 	mcp->mb[2] = MSW(req_dma);
 	mcp->mb[3] = LSW(req_dma);
 	mcp->mb[6] = MSW(MSD(req_dma));
 	mcp->mb[7] = LSW(MSD(req_dma));
-	mcp->mb[8] = MSW(risc_addr);
-	mcp->out_mb = MBX_8|MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0;
+	mcp->out_mb |= MBX_7|MBX_6|MBX_3|MBX_2|MBX_1;
 	if (IS_QLA24XX(ha) || IS_QLA25XX(ha)) {
 		mcp->mb[4] = MSW(risc_code_size);
 		mcp->mb[5] = LSW(risc_code_size);
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 40b124d..2daba58 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -1258,7 +1258,10 @@ int qla2x00_probe_one(struct pci_dev *pd
 	ha->isp_ops.reset_adapter	= qla2x00_reset_adapter;
 	ha->isp_ops.nvram_config	= qla2x00_nvram_config;
 	ha->isp_ops.update_fw_options	= qla2x00_update_fw_options;
-	ha->isp_ops.load_risc		= qla2x00_load_risc;
+	if (ql2xfwloadbin == 1 || ql2xfwloadbin == 2)
+		ha->isp_ops.load_risc = qla2x00_load_risc_hotplug;
+	else
+		ha->isp_ops.load_risc = qla2x00_load_risc;
 	ha->isp_ops.pci_info_str	= qla2x00_pci_info_str;
 	ha->isp_ops.fw_version_str	= qla2x00_fw_version_str;
 	ha->isp_ops.intr_handler	= qla2100_intr_handler;
@@ -2428,6 +2431,77 @@ qla2x00_down_timeout(struct semaphore *s
 	return -ETIMEDOUT;
 }
 
+/* Firmware interface routines. */
+
+#define FW_BLOBS	6
+#define FW_ISP21XX	0
+#define FW_ISP22XX	1
+#define FW_ISP2300	2
+#define FW_ISP2322	3
+#define FW_ISP63XX	4
+#define FW_ISP24XX	5
+
+static DECLARE_MUTEX(qla_fw_lock);
+
+static struct fw_blob qla_fw_blobs[FW_BLOBS] = {
+	{ .name = "ql2100_fw.bin", .segs = { 0x1000, 0 }, },
+	{ .name = "ql2200_fw.bin", .segs = { 0x1000, 0 }, },
+	{ .name = "ql2300_fw.bin", .segs = { 0x800, 0 }, },
+	{ .name = "ql2322_fw.bin", .segs = { 0x800, 0x1c000, 0x1e000, 0 }, },
+	{ .name = "ql6312_fw.bin", .segs = { 0x800, 0 }, },
+	{ .name = "ql2400_fw.bin", },
+};
+
+struct fw_blob *
+qla2x00_request_firmware(scsi_qla_host_t *ha)
+{
+	struct fw_blob *blob;
+
+	blob = NULL;
+	if (IS_QLA2100(ha)) {
+		blob = &qla_fw_blobs[FW_ISP21XX];
+	} else if (IS_QLA2200(ha)) {
+		blob = &qla_fw_blobs[FW_ISP22XX];
+	} else if (IS_QLA2300(ha) || IS_QLA2312(ha)) {
+		blob = &qla_fw_blobs[FW_ISP2300];
+	} else if (IS_QLA2322(ha)) {
+		blob = &qla_fw_blobs[FW_ISP2322];
+	} else if (IS_QLA6312(ha) || IS_QLA6322(ha)) {
+		blob = &qla_fw_blobs[FW_ISP63XX];
+	} else if (IS_QLA24XX(ha)) {
+		blob = &qla_fw_blobs[FW_ISP24XX];
+	}
+
+	down(&qla_fw_lock);
+	if (blob->fw)
+		goto out;
+
+	if (request_firmware(&blob->fw, blob->name, &ha->pdev->dev)) {
+		DEBUG2(printk("scsi(%ld): Failed to load firmware image "
+		    "(%s).\n", ha->host_no, blob->name));
+		blob->fw = NULL;
+		blob = NULL;
+		goto out;
+	}
+
+out:
+	up(&qla_fw_lock);
+	return blob;
+}
+
+static void
+qla2x00_release_firmware(void)
+{
+	int idx;
+
+	down(&qla_fw_lock);
+	for (idx = 0; idx < FW_BLOBS; idx++)
+		if (qla_fw_blobs[idx].fw)
+			release_firmware(qla_fw_blobs[idx].fw);
+	up(&qla_fw_lock);
+}
+
+
 /**
  * qla2x00_module_init - Module initialization.
  **/
@@ -2463,6 +2537,7 @@ qla2x00_module_init(void)
 static void __exit
 qla2x00_module_exit(void)
 {
+	qla2x00_release_firmware();
 	kmem_cache_destroy(srb_cachep);
 	fc_release_transport(qla2xxx_transport_template);
 }
---
0.99.8.GIT

-- 
Andrew Vasquez

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 8/12]  qla2xxx: Resync with latest released ISP23xx/63xx firmware -- 3.03.18.
  2005-10-13 23:15 [PATCH 0/16] qla2xxx: update qla2xxx driver to 8.01.02-k Andrew Vasquez
                   ` (6 preceding siblings ...)
  2005-10-13 23:16 ` [PATCH 7/12] qla2xxx: Add hotplug firmware-load support for all ISP types Andrew Vasquez
@ 2005-10-13 23:16 ` Andrew Vasquez
  2005-10-13 23:17 ` [PATCH 9/12] qla2xxx: Use midlayer's int_to_scsilun() function Andrew Vasquez
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 41+ messages in thread
From: Andrew Vasquez @ 2005-10-13 23:16 UTC (permalink / raw)
  To: James Bottomley, Linux-SCSI Mailing List; +Cc: Andrew Vasquez

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>

---

This patch is too large for an inline patch, please download the
bzip'd patch from:

        ftp://ftp.qlogic.com/outgoing/linux/patches/8.x/8.01.02k/0008-Resync-with-latest-released-ISP23xx-63xx-firmware-3.03.18.diff.bz2

-- 
Andrew Vasquez

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH 9/12]  qla2xxx: Use midlayer's int_to_scsilun() function.
  2005-10-13 23:15 [PATCH 0/16] qla2xxx: update qla2xxx driver to 8.01.02-k Andrew Vasquez
                   ` (7 preceding siblings ...)
  2005-10-13 23:16 ` [PATCH 8/12] qla2xxx: Resync with latest released ISP23xx/63xx firmware -- 3.03.18 Andrew Vasquez
@ 2005-10-13 23:17 ` Andrew Vasquez
  2005-10-15 11:58   ` Christoph Hellwig
  2005-10-13 23:17 ` [PATCH 10/12] qla2xxx: Correct fw-loader module-use referencing Andrew Vasquez
                   ` (3 subsequent siblings)
  12 siblings, 1 reply; 41+ messages in thread
From: Andrew Vasquez @ 2005-10-13 23:17 UTC (permalink / raw)
  To: James Bottomley, Linux-SCSI Mailing List; +Cc: Andrew Vasquez

While populating command type 6 and 7 IOCBs.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>

---

 drivers/scsi/qla2xxx/qla_iocb.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

applies-to: fe8002ebcdf0c4c12e193b17cd64cc67b5a01bf5
95b166d4587c82ed5e261d9e7e8c7675ef808fff
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c
index ae63f8e..f13ddac 100644
--- a/drivers/scsi/qla2xxx/qla_iocb.c
+++ b/drivers/scsi/qla2xxx/qla_iocb.c
@@ -826,8 +826,7 @@ qla24xx_start_scsi(srb_t *sp)
 	cmd_pkt->port_id[1] = sp->fcport->d_id.b.area;
 	cmd_pkt->port_id[2] = sp->fcport->d_id.b.domain;
 
-	cmd_pkt->lun[1] = LSB(sp->cmd->device->lun);
-	cmd_pkt->lun[2] = MSB(sp->cmd->device->lun);
+	int_to_scsilun(sp->cmd->device->lun, (struct scsi_lun *)cmd_pkt->lun);
 
 	/* Update tagged queuing modifier -- default is TSK_SIMPLE (0). */
 	if (scsi_populate_tag_msg(cmd, tag)) {
---
0.99.8.GIT

-- 
Andrew Vasquez

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 10/12] qla2xxx: Correct fw-loader module-use referencing.
  2005-10-13 23:15 [PATCH 0/16] qla2xxx: update qla2xxx driver to 8.01.02-k Andrew Vasquez
                   ` (8 preceding siblings ...)
  2005-10-13 23:17 ` [PATCH 9/12] qla2xxx: Use midlayer's int_to_scsilun() function Andrew Vasquez
@ 2005-10-13 23:17 ` Andrew Vasquez
  2005-10-13 23:17 ` [PATCH 11/12] qla2xxx: Add an 'Issue LIP' device attribute Andrew Vasquez
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 41+ messages in thread
From: Andrew Vasquez @ 2005-10-13 23:17 UTC (permalink / raw)
  To: James Bottomley, Linux-SCSI Mailing List; +Cc: Andrew Vasquez

Subject: Correct fw-loader module-use referencing.

Original implementation would allow a firmware-loader module
to be removed during I/O.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>

---

 drivers/scsi/qla2xxx/ql2100.c  |    5 ++
 drivers/scsi/qla2xxx/ql2200.c  |    5 ++
 drivers/scsi/qla2xxx/ql2300.c  |    6 +++
 drivers/scsi/qla2xxx/ql2322.c  |    5 ++
 drivers/scsi/qla2xxx/ql2400.c  |    8 +++-
 drivers/scsi/qla2xxx/ql6312.c  |    6 +++
 drivers/scsi/qla2xxx/qla_def.h |    2 -
 drivers/scsi/qla2xxx/qla_os.c  |   85 ++++++++++++++--------------------------
 8 files changed, 63 insertions(+), 59 deletions(-)

applies-to: 5b9c41f9a7562c87e6dbaa6a602b0842d9694896
efa63354c35d8eccf0a7a30a0a9902dd9c461843
diff --git a/drivers/scsi/qla2xxx/ql2100.c b/drivers/scsi/qla2xxx/ql2100.c
index f5db223..8050140 100644
--- a/drivers/scsi/qla2xxx/ql2100.c
+++ b/drivers/scsi/qla2xxx/ql2100.c
@@ -30,11 +30,16 @@ static struct qla_fw_info qla_fw_tbl[] =
 	{ FW_INFO_ADDR_NOMORE, },
 };
 
+static struct scsi_host_template qla_driver_template = {
+	.module = THIS_MODULE,
+};
+
 static struct qla_board_info qla_board_tbl = {
 	.drv_name	= qla_driver_name,
 
 	.isp_name	= "ISP2100",
 	.fw_info	= qla_fw_tbl,
+	.sht		= &qla_driver_template,
 };
 
 static struct pci_device_id qla2100_pci_tbl[] = {
diff --git a/drivers/scsi/qla2xxx/ql2200.c b/drivers/scsi/qla2xxx/ql2200.c
index 0eef72d..e8f2af2 100644
--- a/drivers/scsi/qla2xxx/ql2200.c
+++ b/drivers/scsi/qla2xxx/ql2200.c
@@ -30,11 +30,16 @@ static struct qla_fw_info qla_fw_tbl[] =
 	{ FW_INFO_ADDR_NOMORE, },
 };
 
+static struct scsi_host_template qla_driver_template = {
+	.module = THIS_MODULE,
+};
+
 static struct qla_board_info qla_board_tbl = {
 	.drv_name	= qla_driver_name,
 
 	.isp_name	= "ISP2200",
 	.fw_info	= qla_fw_tbl,
+	.sht		= &qla_driver_template,
 };
 
 static struct pci_device_id qla2200_pci_tbl[] = {
diff --git a/drivers/scsi/qla2xxx/ql2300.c b/drivers/scsi/qla2xxx/ql2300.c
index fd2f4b7..22e13f8 100644
--- a/drivers/scsi/qla2xxx/ql2300.c
+++ b/drivers/scsi/qla2xxx/ql2300.c
@@ -29,16 +29,22 @@ static struct qla_fw_info qla_fw_tbl[] =
 	{ FW_INFO_ADDR_NOMORE, },
 };
 
+static struct scsi_host_template qla_driver_template = {
+	.module = THIS_MODULE,
+};
+
 static struct qla_board_info qla_board_tbl[] = {
 	{
 		.drv_name	= qla_driver_name,
 		.isp_name	= "ISP2300",
 		.fw_info	= qla_fw_tbl,
+		.sht		= &qla_driver_template,
 	},
 	{
 		.drv_name	= qla_driver_name,
 		.isp_name	= "ISP2312",
 		.fw_info	= qla_fw_tbl,
+		.sht		= &qla_driver_template,
 	},
 };
 
diff --git a/drivers/scsi/qla2xxx/ql2322.c b/drivers/scsi/qla2xxx/ql2322.c
index b7affb9..f335470 100644
--- a/drivers/scsi/qla2xxx/ql2322.c
+++ b/drivers/scsi/qla2xxx/ql2322.c
@@ -46,10 +46,15 @@ static struct qla_fw_info qla_fw_tbl[] =
 	{ FW_INFO_ADDR_NOMORE, },
 };
 
+static struct scsi_host_template qla_driver_template = {
+	.module = THIS_MODULE,
+};
+
 static struct qla_board_info qla_board_tbl = {
 	.drv_name	= qla_driver_name,
 	.isp_name	= "ISP2322",
 	.fw_info	= qla_fw_tbl,
+	.sht		= &qla_driver_template,
 };
 
 static struct pci_device_id qla2322_pci_tbl[] = {
diff --git a/drivers/scsi/qla2xxx/ql2400.c b/drivers/scsi/qla2xxx/ql2400.c
index 76a48ed..a7ace67 100644
--- a/drivers/scsi/qla2xxx/ql2400.c
+++ b/drivers/scsi/qla2xxx/ql2400.c
@@ -36,20 +36,24 @@ static struct qla_fw_info qla_fw_tbl[] =
 	{ FW_INFO_ADDR_NOMORE, },
 };
 
+static struct scsi_host_template qla_driver_template = {
+	.module = THIS_MODULE,
+};
+
 static struct qla_board_info qla_board_tbl[] = {
 	{
 		.drv_name	= qla_driver_name,
 		.isp_name	= "ISP2422",
 		.fw_info	= qla_fw_tbl,
 		.fw_fname	= "ql2400_fw.bin",
-		.alternate_sht	= 1,
+		.sht		= &qla_driver_template,
 	},
 	{
 		.drv_name	= qla_driver_name,
 		.isp_name	= "ISP2432",
 		.fw_info	= qla_fw_tbl,
 		.fw_fname	= "ql2400_fw.bin",
-		.alternate_sht	= 1,
+		.sht		= &qla_driver_template,
 	},
 };
 
diff --git a/drivers/scsi/qla2xxx/ql6312.c b/drivers/scsi/qla2xxx/ql6312.c
index de55397..274b337 100644
--- a/drivers/scsi/qla2xxx/ql6312.c
+++ b/drivers/scsi/qla2xxx/ql6312.c
@@ -28,16 +28,22 @@ static struct qla_fw_info qla_fw_tbl[] =
 	{ FW_INFO_ADDR_NOMORE, },
 };
 
+static struct scsi_host_template qla_driver_template = {
+	.module = THIS_MODULE,
+};
+
 static struct qla_board_info qla_board_tbl[] = {
 	{
 		.drv_name	= qla_driver_name,
 		.isp_name	= "ISP6312",
 		.fw_info	= qla_fw_tbl,
+		.sht		= &qla_driver_template,
 	},
 	{
 		.drv_name	= qla_driver_name,
 		.isp_name	= "ISP6322",
 		.fw_info	= qla_fw_tbl,
+		.sht		= &qla_driver_template,
 	},
 };
 
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 1dcb69e..1763081 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -2119,7 +2119,7 @@ struct qla_board_info {
 	char isp_name[8];
 	struct qla_fw_info *fw_info;
 	char *fw_fname;
-	int alternate_sht;
+	struct scsi_host_template *sht;
 };
 
 struct fw_blob {
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 2daba58..d73485e 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -94,60 +94,6 @@ static int qla2x00_device_reset(scsi_qla
 static int qla2x00_change_queue_depth(struct scsi_device *, int);
 static int qla2x00_change_queue_type(struct scsi_device *, int);
 
-static struct scsi_host_template qla2x00_driver_template = {
-	.module			= THIS_MODULE,
-	.name			= "qla2xxx",
-	.queuecommand		= qla2x00_queuecommand,
-
-	.eh_abort_handler	= qla2xxx_eh_abort,
-	.eh_device_reset_handler = qla2xxx_eh_device_reset,
-	.eh_bus_reset_handler	= qla2xxx_eh_bus_reset,
-	.eh_host_reset_handler	= qla2xxx_eh_host_reset,
-
-	.slave_configure	= qla2xxx_slave_configure,
-
-	.slave_alloc		= qla2xxx_slave_alloc,
-	.slave_destroy		= qla2xxx_slave_destroy,
-	.change_queue_depth	= qla2x00_change_queue_depth,
-	.change_queue_type	= qla2x00_change_queue_type,
-	.this_id		= -1,
-	.cmd_per_lun		= 3,
-	.use_clustering		= ENABLE_CLUSTERING,
-	.sg_tablesize		= SG_ALL,
-
-	/*
-	 * The RISC allows for each command to transfer (2^32-1) bytes of data,
-	 * which equates to 0x800000 sectors.
-	 */
-	.max_sectors		= 0xFFFF,
-	.shost_attrs		= qla2x00_host_attrs,
-};
-
-static struct scsi_host_template qla24xx_driver_template = {
-	.module			= THIS_MODULE,
-	.name			= "qla2xxx",
-	.queuecommand		= qla24xx_queuecommand,
-
-	.eh_abort_handler	= qla2xxx_eh_abort,
-	.eh_device_reset_handler = qla2xxx_eh_device_reset,
-	.eh_bus_reset_handler	= qla2xxx_eh_bus_reset,
-	.eh_host_reset_handler	= qla2xxx_eh_host_reset,
-
-	.slave_configure	= qla2xxx_slave_configure,
-
-	.slave_alloc		= qla2xxx_slave_alloc,
-	.slave_destroy		= qla2xxx_slave_destroy,
-	.change_queue_depth	= qla2x00_change_queue_depth,
-	.change_queue_type	= qla2x00_change_queue_type,
-	.this_id		= -1,
-	.cmd_per_lun		= 3,
-	.use_clustering		= ENABLE_CLUSTERING,
-	.sg_tablesize		= SG_ALL,
-
-	.max_sectors		= 0xFFFF,
-	.shost_attrs		= qla2x00_host_attrs,
-};
-
 static struct scsi_transport_template *qla2xxx_transport_template = NULL;
 
 /* TODO Convert to inlines
@@ -1197,6 +1143,34 @@ qla24xx_disable_intrs(scsi_qla_host_t *h
 	spin_unlock_irqrestore(&ha->hardware_lock, flags);
 }
 
+static struct scsi_host_template *
+qla2x00_prep_sht(struct pci_dev *pdev, struct scsi_host_template *sht)
+{
+	sht->name		= "qla2xxx";
+	sht->queuecommand	= qla2x00_queuecommand;
+	sht->eh_abort_handler	= qla2xxx_eh_abort;
+	sht->eh_device_reset_handler = qla2xxx_eh_device_reset;
+	sht->eh_bus_reset_handler = qla2xxx_eh_bus_reset;
+	sht->eh_host_reset_handler = qla2xxx_eh_host_reset;
+	sht->slave_configure	= qla2xxx_slave_configure;
+	sht->slave_alloc	= qla2xxx_slave_alloc;
+	sht->slave_destroy	= qla2xxx_slave_destroy;
+	sht->change_queue_depth	= qla2x00_change_queue_depth;
+	sht->change_queue_type	= qla2x00_change_queue_type;
+	sht->this_id		= -1;
+	sht->cmd_per_lun	= 3;
+	sht->use_clustering	= ENABLE_CLUSTERING;
+	sht->sg_tablesize	= SG_ALL;
+	sht->max_sectors	= 0xffff;
+	sht->shost_attrs	= qla2x00_host_attrs;
+
+	if (pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2422 ||
+	    pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2432)
+		sht->queuecommand	= qla24xx_queuecommand;
+
+	return sht;
+}
+
 /*
  * PCI driver interface
  */
@@ -1215,8 +1189,7 @@ int qla2x00_probe_one(struct pci_dev *pd
 	if (pci_enable_device(pdev))
 		goto probe_out;
 
-	host = scsi_host_alloc(brd_info->alternate_sht ?
-	    &qla24xx_driver_template: &qla2x00_driver_template,
+	host = scsi_host_alloc(qla2x00_prep_sht(pdev, brd_info->sht),
 	    sizeof(scsi_qla_host_t));
 	if (host == NULL) {
 		printk(KERN_WARNING
---
0.99.8.GIT

-- 
Andrew Vasquez

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 11/12] qla2xxx: Add an 'Issue LIP' device attribute.
  2005-10-13 23:15 [PATCH 0/16] qla2xxx: update qla2xxx driver to 8.01.02-k Andrew Vasquez
                   ` (9 preceding siblings ...)
  2005-10-13 23:17 ` [PATCH 10/12] qla2xxx: Correct fw-loader module-use referencing Andrew Vasquez
@ 2005-10-13 23:17 ` Andrew Vasquez
  2005-10-14  9:48   ` Christoph Hellwig
  2005-10-13 23:17 ` [PATCH 12/12] qla2xxx: Update version number to 8.01.02-k Andrew Vasquez
  2005-10-19 17:42 ` [PATCH 0/16] qla2xxx: update qla2xxx driver " Andrew Vasquez
  12 siblings, 1 reply; 41+ messages in thread
From: Andrew Vasquez @ 2005-10-13 23:17 UTC (permalink / raw)
  To: James Bottomley, Linux-SCSI Mailing List; +Cc: Andrew Vasquez

Subject: Add an 'Issue LIP' device attribute.

Add a scsi_host device attribute to allow a user to initiate
a LIP.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>

---

 drivers/scsi/qla2xxx/qla_attr.c |   16 ++++++++++++++++
 drivers/scsi/qla2xxx/qla_os.c   |    8 ++++++++
 2 files changed, 24 insertions(+), 0 deletions(-)

applies-to: a66456df428081210a3b7117c57f277e69484bce
e3f47b3b40d29beb69223d2b479d34a5bc76c518
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 49696fa..2c6bf16 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -384,6 +384,20 @@ qla2x00_zio_timer_store(struct class_dev
 	return strlen(buf);
 }
 
+static ssize_t
+qla2x00_issue_lip(struct class_device *cdev, const char *buf, size_t count)
+{
+	scsi_qla_host_t *ha = to_qla_host(class_to_shost(cdev));
+	int val = 0;
+
+	if ((sscanf(buf, "%d", &val) != 1) || val != 1)
+		return -EINVAL;
+
+	set_bit(LOOP_RESET_NEEDED, &ha->dpc_flags);
+
+	return strlen(buf);
+}
+
 static CLASS_DEVICE_ATTR(driver_version, S_IRUGO, qla2x00_drvr_version_show,
 	NULL);
 static CLASS_DEVICE_ATTR(fw_version, S_IRUGO, qla2x00_fw_version_show, NULL);
@@ -398,6 +412,7 @@ static CLASS_DEVICE_ATTR(zio, S_IRUGO | 
     qla2x00_zio_store);
 static CLASS_DEVICE_ATTR(zio_timer, S_IRUGO | S_IWUSR, qla2x00_zio_timer_show,
     qla2x00_zio_timer_store);
+static CLASS_DEVICE_ATTR(issue_lip, S_IWUSR, NULL, qla2x00_issue_lip);
 
 struct class_device_attribute *qla2x00_host_attrs[] = {
 	&class_device_attr_driver_version,
@@ -411,6 +426,7 @@ struct class_device_attribute *qla2x00_h
 	&class_device_attr_state,
 	&class_device_attr_zio,
 	&class_device_attr_zio_timer,
+	&class_device_attr_issue_lip,
 	NULL,
 };
 
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index d73485e..d3181bf 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -2074,6 +2074,13 @@ qla2x00_do_dpc(void *data)
 			    ha->host_no));
 		}
 
+		if (test_and_clear_bit(LOOP_RESET_NEEDED, &ha->dpc_flags)) {
+			DEBUG(printk("scsi(%ld): dpc: sched loop_reset()\n",
+			    ha->host_no));
+
+			qla2x00_loop_reset(ha);
+		}
+
 		if (test_and_clear_bit(RESET_MARKER_NEEDED, &ha->dpc_flags) &&
 		    (!(test_and_set_bit(RESET_ACTIVE, &ha->dpc_flags)))) {
 
@@ -2375,6 +2382,7 @@ qla2x00_timer(scsi_qla_host_t *ha)
 	/* Schedule the DPC routine if needed */
 	if ((test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags) ||
 	    test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags) ||
+	    test_bit(LOOP_RESET_NEEDED, &ha->dpc_flags) ||
 	    start_dpc ||
 	    test_bit(LOGIN_RETRY_NEEDED, &ha->dpc_flags) ||
 	    test_bit(RESET_MARKER_NEEDED, &ha->dpc_flags) ||
---
0.99.8.GIT

-- 
Andrew Vasquez

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH 12/12] qla2xxx: Update version number to 8.01.02-k.
  2005-10-13 23:15 [PATCH 0/16] qla2xxx: update qla2xxx driver to 8.01.02-k Andrew Vasquez
                   ` (10 preceding siblings ...)
  2005-10-13 23:17 ` [PATCH 11/12] qla2xxx: Add an 'Issue LIP' device attribute Andrew Vasquez
@ 2005-10-13 23:17 ` Andrew Vasquez
  2005-10-19 17:42 ` [PATCH 0/16] qla2xxx: update qla2xxx driver " Andrew Vasquez
  12 siblings, 0 replies; 41+ messages in thread
From: Andrew Vasquez @ 2005-10-13 23:17 UTC (permalink / raw)
  To: James Bottomley, Linux-SCSI Mailing List; +Cc: Andrew Vasquez

Subject: Update version number to 8.01.02-k.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>

---

 drivers/scsi/qla2xxx/qla_version.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

applies-to: f44b3c5228b9cfb0393117daae32056473bae8eb
056de35b9be3bd58c4e6760f0629a1a931405e38
diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h
index 0d5472f..13c47ef 100644
--- a/drivers/scsi/qla2xxx/qla_version.h
+++ b/drivers/scsi/qla2xxx/qla_version.h
@@ -7,9 +7,9 @@
 /*
  * Driver version
  */
-#define QLA2XXX_VERSION      "8.01.00-k"
+#define QLA2XXX_VERSION      "8.01.02-k"
 
 #define QLA_DRIVER_MAJOR_VER	8
 #define QLA_DRIVER_MINOR_VER	1
-#define QLA_DRIVER_PATCH_VER	0
+#define QLA_DRIVER_PATCH_VER	2
 #define QLA_DRIVER_BETA_VER	0
---
0.99.8.GIT

-- 
Andrew Vasquez

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* Re: [PATCH 4/12]  qla2xxx: Update license.
  2005-10-13 23:16 ` [PATCH 4/12] qla2xxx: Update license Andrew Vasquez
@ 2005-10-14  7:30   ` Arjan van de Ven
  2005-10-14 13:37     ` Douglas Gilbert
  2005-10-14 16:27     ` Andrew Vasquez
  2005-10-15 11:56   ` Christoph Hellwig
  1 sibling, 2 replies; 41+ messages in thread
From: Arjan van de Ven @ 2005-10-14  7:30 UTC (permalink / raw)
  To: Andrew Vasquez; +Cc: Linux-SCSI Mailing List, James Bottomley

On Thu, 2005-10-13 at 16:16 -0700, Andrew Vasquez wrote:
> Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>

> +++ b/Documentation/scsi/LICENSE.qla2xxx
> @@ -0,0 +1,59 @@
> +Copyright (c)  2003-2005 QLogic Corporation
> +QLogic Linux Fibre Channel HBA Driver
> +
> +This program includes a device driver for Linux 2.6 that may be
> +distributed with QLogic hardware specific firmware binary file.
> +You may modify and redistribute the device driver code under the
> +GNU General Public License as published by the Free Software
> +Foundation (version 2 or a later version) and/or under the
> +following terms, as applicable:
> +
> +	1. Redistribution of source code must retain the above
> +	   copyright notice, this list of conditions and the
> +	   following disclaimer.
> +
> +	2. Redistribution in binary form must reproduce the above
> +	   copyright notice, this list of conditions and the
> +	   following disclaimer in the documentation and/or other
> +	   materials provided with the distribution.
> +
> +	3. The name of QLogic Corporation may not be used to
> +	   endorse or promote products derived from this software
> +	   without specific prior written permission.
> +


as one of the people who made significant changes to the qlogic driver I
object to this license change, especially because it was a one sided
change without consultation beforehand.

James: please do not apply this.

Andrew: you can't do this. You just CANNOT change the license of code
you don't own fully without consent of ALL contributors.



^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH 5/12]  qla2xxx: Add support for embedded ISP24xx firmware.
  2005-10-13 23:16 ` [PATCH 5/12] qla2xxx: Add support for embedded ISP24xx firmware Andrew Vasquez
@ 2005-10-14  9:47   ` Christoph Hellwig
  2005-10-14 16:50     ` Andrew Vasquez
  0 siblings, 1 reply; 41+ messages in thread
From: Christoph Hellwig @ 2005-10-14  9:47 UTC (permalink / raw)
  To: Andrew Vasquez; +Cc: James Bottomley, Linux-SCSI Mailing List

On Thu, Oct 13, 2005 at 04:16:24PM -0700, Andrew Vasquez wrote:
> Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>

NACK.  No more embedded firmware.


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH 11/12] qla2xxx: Add an 'Issue LIP' device attribute.
  2005-10-13 23:17 ` [PATCH 11/12] qla2xxx: Add an 'Issue LIP' device attribute Andrew Vasquez
@ 2005-10-14  9:48   ` Christoph Hellwig
  2005-10-14 22:44     ` Andrew Vasquez
  2005-10-27 23:03     ` Andrew Vasquez
  0 siblings, 2 replies; 41+ messages in thread
From: Christoph Hellwig @ 2005-10-14  9:48 UTC (permalink / raw)
  To: Andrew Vasquez; +Cc: James Bottomley, Linux-SCSI Mailing List

On Thu, Oct 13, 2005 at 04:17:24PM -0700, Andrew Vasquez wrote:
> Subject: Add an 'Issue LIP' device attribute.
> 
> Add a scsi_host device attribute to allow a user to initiate
> a LIP.

This kind of thing belongs into the transport class so that we have
a common API over all HBA drivers.


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH 3/12]  qla2xxx: Collapse ISP2xxx queuecommand implementations.
  2005-10-13 23:16 ` [PATCH 3/12] qla2xxx: Collapse ISP2xxx queuecommand implementations Andrew Vasquez
@ 2005-10-14 10:24   ` Christoph Hellwig
  2005-10-14 22:43     ` Andrew Vasquez
  0 siblings, 1 reply; 41+ messages in thread
From: Christoph Hellwig @ 2005-10-14 10:24 UTC (permalink / raw)
  To: Andrew Vasquez; +Cc: James Bottomley, Linux-SCSI Mailing List

On Thu, Oct 13, 2005 at 04:16:04PM -0700, Andrew Vasquez wrote:
> Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>

I don't like this at all.  Even the first variant with the indirect
function call seems better than this.

> +#define QLA_QUEUE_COMMAND(isp)  \
> +static int \
> +isp##_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) \
> +{ \
> +	scsi_qla_host_t *ha = to_qla_host(cmd->device->host); \
> +	fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata; \
> +	srb_t *sp; \
> +	int rval; \
> +	if (!fcport) { \
> +		cmd->result = DID_NO_CONNECT << 16; \
> +		goto fail_command; \
> +	} \

While we're at it, I don't think cmd->device->hostdata could ever be
NULL.


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH 4/12]  qla2xxx: Update license.
  2005-10-14  7:30   ` Arjan van de Ven
@ 2005-10-14 13:37     ` Douglas Gilbert
  2005-10-14 13:53       ` Arjan van de Ven
  2005-10-14 16:27     ` Andrew Vasquez
  1 sibling, 1 reply; 41+ messages in thread
From: Douglas Gilbert @ 2005-10-14 13:37 UTC (permalink / raw)
  To: Arjan van de Ven; +Cc: Andrew Vasquez, Linux-SCSI Mailing List, James Bottomley

Arjan van de Ven wrote:
> On Thu, 2005-10-13 at 16:16 -0700, Andrew Vasquez wrote:
> 
>>Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
> 
> 
>>+++ b/Documentation/scsi/LICENSE.qla2xxx
>>@@ -0,0 +1,59 @@
>>+Copyright (c)  2003-2005 QLogic Corporation
>>+QLogic Linux Fibre Channel HBA Driver
>>+
>>+This program includes a device driver for Linux 2.6 that may be
>>+distributed with QLogic hardware specific firmware binary file.
>>+You may modify and redistribute the device driver code under the
>>+GNU General Public License as published by the Free Software
>>+Foundation (version 2 or a later version) and/or under the
>>+following terms, as applicable:
>>+
>>+	1. Redistribution of source code must retain the above
>>+	   copyright notice, this list of conditions and the
>>+	   following disclaimer.
>>+
>>+	2. Redistribution in binary form must reproduce the above
>>+	   copyright notice, this list of conditions and the
>>+	   following disclaimer in the documentation and/or other
>>+	   materials provided with the distribution.
>>+
>>+	3. The name of QLogic Corporation may not be used to
>>+	   endorse or promote products derived from this software
>>+	   without specific prior written permission.
>>+
> 
> 
> 
> as one of the people who made significant changes to the qlogic driver I
> object to this license change, especially because it was a one sided
> change without consultation beforehand.

Arjan,
Apart from not being consulted beforehand, what precisely
is objectionable in the above?

> James: please do not apply this.
> 
> Andrew: you can't do this. You just CANNOT change the license of code
> you don't own fully without consent of ALL contributors.

Often wondered about that. Someone sends me a bug fix,
I accept it, credit them and then at some later stage
want to broaden the license on that code from GPL to
BSD (say). Do I need the bug fixer's permission?

Doug Gilbert

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH 4/12]  qla2xxx: Update license.
  2005-10-14 13:37     ` Douglas Gilbert
@ 2005-10-14 13:53       ` Arjan van de Ven
  0 siblings, 0 replies; 41+ messages in thread
From: Arjan van de Ven @ 2005-10-14 13:53 UTC (permalink / raw)
  To: dougg; +Cc: Andrew Vasquez, Linux-SCSI Mailing List, James Bottomley

On Fri, 2005-10-14 at 23:37 +1000, Douglas Gilbert wrote:

> Arjan,
> Apart from not being consulted beforehand, what precisely
> is objectionable in the above?

It allows people to make binary only linux modules (in so far binary
kernel modules are allowed at all, eg not that far, but still, this text
would give people the impression that it would be allowed and even
approved/OK to do so from this driver), or binary only <ANYTHING>
modules from this driver, including the bits I worked on.

 
> > Andrew: you can't do this. You just CANNOT change the license of code
> > you don't own fully without consent of ALL contributors.
> 
> Often wondered about that. Someone sends me a bug fix,
> I accept it, credit them and then at some later stage
> want to broaden the license on that code from GPL to
> BSD (say). Do I need the bug fixer's permission?

I think the lawyers will say "depends on the size of the contribution";
for a single one liner it's "probably not" although politeness certainly
would require it; for anything substantially bigger, you do need that.

(and "substantially" is obviously subject to interpretation, and that's
the bit where you need to talk to lawyers realistically if you want to
know the exact boundary)



^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH 4/12]  qla2xxx: Update license.
  2005-10-14  7:30   ` Arjan van de Ven
  2005-10-14 13:37     ` Douglas Gilbert
@ 2005-10-14 16:27     ` Andrew Vasquez
  2005-10-14 18:47       ` Arjan van de Ven
  1 sibling, 1 reply; 41+ messages in thread
From: Andrew Vasquez @ 2005-10-14 16:27 UTC (permalink / raw)
  To: Arjan van de Ven; +Cc: Linux-SCSI Mailing List, James Bottomley, Arun Mittal

On Fri, 14 Oct 2005, Arjan van de Ven wrote:
> On Thu, 2005-10-13 at 16:16 -0700, Andrew Vasquez wrote:
> > Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
> 
> > +++ b/Documentation/scsi/LICENSE.qla2xxx
> > @@ -0,0 +1,59 @@
> > +Copyright (c)  2003-2005 QLogic Corporation
> > +QLogic Linux Fibre Channel HBA Driver
> > +
> > +This program includes a device driver for Linux 2.6 that may be
> > +distributed with QLogic hardware specific firmware binary file.
> > +You may modify and redistribute the device driver code under the
> > +GNU General Public License as published by the Free Software
> > +Foundation (version 2 or a later version) and/or under the
> > +following terms, as applicable:
> > +
> > +	1. Redistribution of source code must retain the above
> > +	   copyright notice, this list of conditions and the
> > +	   following disclaimer.
> > +
> > +	2. Redistribution in binary form must reproduce the above
> > +	   copyright notice, this list of conditions and the
> > +	   following disclaimer in the documentation and/or other
> > +	   materials provided with the distribution.
> > +
> > +	3. The name of QLogic Corporation may not be used to
> > +	   endorse or promote products derived from this software
> > +	   without specific prior written permission.
> > +
> 
> 
> as one of the people who made significant changes to the qlogic driver I
> object to this license change, especially because it was a one sided
> change without consultation beforehand.
> 
> James: please do not apply this.
> 
> Andrew: you can't do this. You just CANNOT change the license of code
> you don't own fully without consent of ALL contributors.

During my talk at OLS, I had mentioned that QLogic Legal was
investigating solutions to the firmware-blob licensing issue with
respect to the qla2xxx driver.  Several folks after the talk asked for
specific verbaige (which I did not have), I only knew it was going to
be a dual GPL/BSD (type) license. Later in the day I received a
preliminary copy from Legal and forwarded it to inquirying
individuals.

Since then, the license was was working its way through the
slow-moving pipelines of Legal.  During this time, it was my
understanding that the document had been vetted my several OEMs and
major distros.  Granted, I can understand that this would certainly
not get the broad exposure of the linux-kerne|scsi ditributions (which
if I'm reading correctly is one of your major concerns).  For this I
apologize, as it ultimately was my responsibility to insure this
license change proceeded smoothly.

I've since forwarded your email to our engineering VP and would also
like to solicit any others on these mailing lists for their concerns
with the license verbaige.  Given the heritage of the qla2xxx driver,
one concerns is -- at what point does one claim that total
contributors acceptance has been achieved given a proposed licensing
change.

Regards,
Andrew Vasquez


---

Copyright (c)  2003-2005 QLogic Corporation
QLogic Linux Fibre Channel HBA Driver

This program includes a device driver for Linux 2.6 that may be
distributed with QLogic hardware specific firmware binary file.
You may modify and redistribute the device driver code under the
GNU General Public License as published by the Free Software
Foundation (version 2 or a later version) and/or under the
following terms, as applicable:

	1. Redistribution of source code must retain the above
	   copyright notice, this list of conditions and the
	   following disclaimer.

	2. Redistribution in binary form must reproduce the above
	   copyright notice, this list of conditions and the
	   following disclaimer in the documentation and/or other
	   materials provided with the distribution.

	3. The name of QLogic Corporation may not be used to
	   endorse or promote products derived from this software
	   without specific prior written permission.

You may redistribute the hardware specific firmware binary file
under the following terms:

	1. Redistribution of source code (only if applicable),
	   must retain the above copyright notice, this list of
	   conditions and the following disclaimer.

	2. Redistribution in binary form must reproduce the above
	   copyright notice, this list of conditions and the
	   following disclaimer in the documentation and/or other
	   materials provided with the distribution.

	3. The name of QLogic Corporation may not be used to
	   endorse or promote products derived from this software
	   without specific prior written permission

REGARDLESS OF WHAT LICENSING MECHANISM IS USED OR APPLICABLE,
THIS PROGRAM IS PROVIDED BY QLOGIC CORPORATION "AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

USER ACKNOWLEDGES AND AGREES THAT USE OF THIS PROGRAM WILL NOT
CREATE OR GIVE GROUNDS FOR A LICENSE BY IMPLICATION, ESTOPPEL, OR
OTHERWISE IN ANY INTELLECTUAL PROPERTY RIGHTS (PATENT, COPYRIGHT,
TRADE SECRET, MASK WORK, OR OTHER PROPRIETARY RIGHT) EMBODIED IN
ANY OTHER QLOGIC HARDWARE OR SOFTWARE EITHER SOLELY OR IN
COMBINATION WITH THIS PROGRAM.

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH 5/12]  qla2xxx: Add support for embedded ISP24xx firmware.
  2005-10-14  9:47   ` Christoph Hellwig
@ 2005-10-14 16:50     ` Andrew Vasquez
  2005-10-15 11:58       ` Christoph Hellwig
  0 siblings, 1 reply; 41+ messages in thread
From: Andrew Vasquez @ 2005-10-14 16:50 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: James Bottomley, Linux-SCSI Mailing List

On Fri, 14 Oct 2005, Christoph Hellwig wrote:

> On Thu, Oct 13, 2005 at 04:16:24PM -0700, Andrew Vasquez wrote:
> > Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
> 
> NACK.  No more embedded firmware.

Unfortunately, since OLS, it has been decided that for 24xx HBAs,
firmware will *not* be present on the board during manufacturing time
and thus, similarly to all our previous products, firmware will have
to be embedded within the driver.  Yes, this is a complete 180 from my
previous statements before and during OLS.

The additional patch:

[PATCH 7/12]  qla2xxx: Add hotplug firmware-load support for all ISP types.
http://marc.theaimsgroup.com/?l=linux-scsi&m=112924541603555&w=2

as part of this patchset moves us one-step closer to having complete
firmware-blob independence (and hell, perhaps some final resolution
wrt this whole licensing issue) from the driver, but it is certainly
not a panacea.  There is still the major issue of those users who
depend on a root-boot across the SAN.  As it currently stands, I don't
believe distros are currently at a state where the request-firmware
interface is fully supported at boot-time (please correct me if I'm
wrong).

There's also an additional detail I'm trying to work out locally --
distribution of these .bin files, this is entirely within my court,
but as it stands, without an firmware image present, these 24xx users
will have no way of initialising their cards.

I believe we spoke about this during OLS as well, and agreed that
adding the request-firmware interface for all ISP types, waiting a
year or so for distro infrastructure to mature now, then discarding
the embedded blobs was the way to go.  Given that, embedded 24xx
support will need to be present throughout that year.

--
Andrew

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH 4/12]  qla2xxx: Update license.
  2005-10-14 16:27     ` Andrew Vasquez
@ 2005-10-14 18:47       ` Arjan van de Ven
  2005-10-19 17:37         ` Andrew Vasquez
  0 siblings, 1 reply; 41+ messages in thread
From: Arjan van de Ven @ 2005-10-14 18:47 UTC (permalink / raw)
  To: Andrew Vasquez; +Cc: Linux-SCSI Mailing List, James Bottomley, Arun Mittal


> > 
> > as one of the people who made significant changes to the qlogic driver I
> > object to this license change, especially because it was a one sided
> > change without consultation beforehand.
> > 
> > James: please do not apply this.
> > 
> > Andrew: you can't do this. You just CANNOT change the license of code
> > you don't own fully without consent of ALL contributors.
> 
> During my talk at OLS, I had mentioned that QLogic Legal was
> investigating solutions to the firmware-blob licensing issue with
> respect to the qla2xxx driver. 

this is a really odd way to "solve" this, simply because by being part
of the kernel tarbal, the GPL clause is the only one that matters (see
the GPL text for collective works) and the BSD part of it is "dormant"
until someone takes the driver outside the linux kernel context.
So that isn't solving anything with respect to the firmware licensing
issue/non-issue (depending from what angle you look at it)


> Since then, the license was was working its way through the
> slow-moving pipelines of Legal.  During this time, it was my
> understanding that the document had been vetted my several OEMs and
> major distros

this is all irrelevant :)

> .  Granted, I can understand that this would certainly
> not get the broad exposure of the linux-kerne|scsi ditributions (which
> if I'm reading correctly is one of your major concerns). 

no my concern is that you failed to get consent from all people who
contributed to the driver.



>   Given the heritage of the qla2xxx driver,
> one concerns is -- at what point does one claim that total
> contributors acceptance has been achieved given a proposed licensing
> change.

you need 100% of the people who contributed substantial changes. And
even then it's a questionable change, given that the driver clearly is a
derived work of the linux kernel (and that's fine, it's GPL) and is
shipped with the linux kernel (see clause 2 of the GPL). Other licenses
are not relevant as long as the driver is a linux kernel driver like
this.

You need 100% because you are giving 3rd parties more rights the code
than that the contributors have given you. That just can't be done
without consent.



If you want the firmware issue improved, make the *firmware* BSD
licensed. And only the firmware. But leave the driver GPL.
And probably make it optional and allow a request_firmware() interface
as well, so that people/distributions who don't want the built in one
can use the request_firmware() option instead.




^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH 3/12]  qla2xxx: Collapse ISP2xxx queuecommand implementations.
  2005-10-14 10:24   ` Christoph Hellwig
@ 2005-10-14 22:43     ` Andrew Vasquez
  0 siblings, 0 replies; 41+ messages in thread
From: Andrew Vasquez @ 2005-10-14 22:43 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: James Bottomley, Linux-SCSI Mailing List

On Fri, 14 Oct 2005, Christoph Hellwig wrote:

> On Thu, Oct 13, 2005 at 04:16:04PM -0700, Andrew Vasquez wrote:
> > Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
> 
> I don't like this at all.  Even the first variant with the indirect
> function call seems better than this.

The indirect function call is still there -- the resultant code hasn't
changed with this patch.  This patch simply insures that common
queueing code gets updated in one spot rather than two
(qla2x00_queuecommand() qla24xx_queuecommand()).  The *only*
difference between the two was the call to
[qla2x00|qla24xx]_start_scsi().  So, beyond style, are there any other
objections.

> > +#define QLA_QUEUE_COMMAND(isp)  \
> > +static int \
> > +isp##_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) \
> > +{ \
> > +	scsi_qla_host_t *ha = to_qla_host(cmd->device->host); \
> > +	fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata; \
> > +	srb_t *sp; \
> > +	int rval; \
> > +	if (!fcport) { \
> > +		cmd->result = DID_NO_CONNECT << 16; \
> > +		goto fail_command; \
> > +	} \
> 
> While we're at it, I don't think cmd->device->hostdata could ever be
> NULL.

Yes, with the target_parent checks in scsi_alloc_target():

        if (shost->transportt->target_parent) {
                spin_lock_irqsave(shost->host_lock, flags);
                parent = shost->transportt->target_parent(shost, channel, id);
                spin_unlock_irqrestore(shost->host_lock, flags);
                if (!parent)
                        return NULL;
        }

you are correct.  Yet another reason to collapse both -- change the
code in one place.

-- 
Andrew Vasquez

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH 11/12] qla2xxx: Add an 'Issue LIP' device attribute.
  2005-10-14  9:48   ` Christoph Hellwig
@ 2005-10-14 22:44     ` Andrew Vasquez
  2005-10-27 23:03     ` Andrew Vasquez
  1 sibling, 0 replies; 41+ messages in thread
From: Andrew Vasquez @ 2005-10-14 22:44 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: James Bottomley, Linux-SCSI Mailing List

On Fri, 14 Oct 2005, Christoph Hellwig wrote:

> On Thu, Oct 13, 2005 at 04:17:24PM -0700, Andrew Vasquez wrote:
> > Subject: Add an 'Issue LIP' device attribute.
> > 
> > Add a scsi_host device attribute to allow a user to initiate
> > a LIP.
> 
> This kind of thing belongs into the transport class so that we have
> a common API over all HBA drivers.

Makes sense.  I'll get something posted on Monday.

Thanks,
Andrew

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH 4/12]  qla2xxx: Update license.
  2005-10-13 23:16 ` [PATCH 4/12] qla2xxx: Update license Andrew Vasquez
  2005-10-14  7:30   ` Arjan van de Ven
@ 2005-10-15 11:56   ` Christoph Hellwig
  2005-10-16  0:38     ` Douglas Gilbert
  1 sibling, 1 reply; 41+ messages in thread
From: Christoph Hellwig @ 2005-10-15 11:56 UTC (permalink / raw)
  To: Andrew Vasquez; +Cc: James Bottomley, Linux-SCSI Mailing List

On Thu, Oct 13, 2005 at 04:16:14PM -0700, Andrew Vasquez wrote:
> Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>

NACK.  My contributions won't be relicensed under such an odd license.
The real fix is to allow userspace firmware loading for all HBA types
(as done in one of the later patches) and eventually remove the firmware
completely.


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH 5/12]  qla2xxx: Add support for embedded ISP24xx firmware.
  2005-10-14 16:50     ` Andrew Vasquez
@ 2005-10-15 11:58       ` Christoph Hellwig
  2005-10-17 21:34         ` Andrew Vasquez
  0 siblings, 1 reply; 41+ messages in thread
From: Christoph Hellwig @ 2005-10-15 11:58 UTC (permalink / raw)
  To: Andrew Vasquez
  Cc: Christoph Hellwig, James Bottomley, Linux-SCSI Mailing List

On Fri, Oct 14, 2005 at 09:50:35AM -0700, Andrew Vasquez wrote:
> On Fri, 14 Oct 2005, Christoph Hellwig wrote:
> 
> > On Thu, Oct 13, 2005 at 04:16:24PM -0700, Andrew Vasquez wrote:
> > > Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
> > 
> > NACK.  No more embedded firmware.
> 
> Unfortunately, since OLS, it has been decided that for 24xx HBAs,
> firmware will *not* be present on the board during manufacturing time
> and thus, similarly to all our previous products, firmware will have
> to be embedded within the driver.  Yes, this is a complete 180 from my
> previous statements before and during OLS.
> 
> The additional patch:
> 
> [PATCH 7/12]  qla2xxx: Add hotplug firmware-load support for all ISP types.
> http://marc.theaimsgroup.com/?l=linux-scsi&m=112924541603555&w=2
> 
> as part of this patchset moves us one-step closer to having complete
> firmware-blob independence (and hell, perhaps some final resolution
> wrt this whole licensing issue) from the driver, but it is certainly
> not a panacea.  There is still the major issue of those users who
> depend on a root-boot across the SAN.  As it currently stands, I don't
> believe distros are currently at a state where the request-firmware
> interface is fully supported at boot-time (please correct me if I'm
> wrong).
> 
> There's also an additional detail I'm trying to work out locally --
> distribution of these .bin files, this is entirely within my court,
> but as it stands, without an firmware image present, these 24xx users
> will have no way of initialising their cards.
> 
> I believe we spoke about this during OLS as well, and agreed that
> adding the request-firmware interface for all ISP types, waiting a
> year or so for distro infrastructure to mature now, then discarding
> the embedded blobs was the way to go.  Given that, embedded 24xx
> support will need to be present throughout that year.

No, we shouldn't add more firmware.  I think we need to play out you
against the distros here so that they finally fix their infrastructure ;-)

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH 9/12]  qla2xxx: Use midlayer's int_to_scsilun() function.
  2005-10-13 23:17 ` [PATCH 9/12] qla2xxx: Use midlayer's int_to_scsilun() function Andrew Vasquez
@ 2005-10-15 11:58   ` Christoph Hellwig
  0 siblings, 0 replies; 41+ messages in thread
From: Christoph Hellwig @ 2005-10-15 11:58 UTC (permalink / raw)
  To: Andrew Vasquez; +Cc: James Bottomley, Linux-SCSI Mailing List

> -	cmd_pkt->lun[1] = LSB(sp->cmd->device->lun);
> -	cmd_pkt->lun[2] = MSB(sp->cmd->device->lun);
> +	int_to_scsilun(sp->cmd->device->lun, (struct scsi_lun *)cmd_pkt->lun);

Please make the field of type struct scsi_lun instead of the cast.


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH 4/12]  qla2xxx: Update license.
  2005-10-15 11:56   ` Christoph Hellwig
@ 2005-10-16  0:38     ` Douglas Gilbert
  2005-10-16  8:32       ` Arjan van de Ven
  0 siblings, 1 reply; 41+ messages in thread
From: Douglas Gilbert @ 2005-10-16  0:38 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Andrew Vasquez, James Bottomley, Linux-SCSI Mailing List

Christoph Hellwig wrote:
> On Thu, Oct 13, 2005 at 04:16:14PM -0700, Andrew Vasquez wrote:
> 
>>Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
> 
> 
> NACK.  My contributions won't be relicensed under such an odd license.
> The real fix is to allow userspace firmware loading for all HBA types
> (as done in one of the later patches) and eventually remove the firmware
> completely.

Andrew,
Another approach is to separate out changes made
by Christoph and Arjan into a separate file (or
files) and leave the GPL on that file.

Doug Gilbert

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH 4/12]  qla2xxx: Update license.
  2005-10-16  0:38     ` Douglas Gilbert
@ 2005-10-16  8:32       ` Arjan van de Ven
  0 siblings, 0 replies; 41+ messages in thread
From: Arjan van de Ven @ 2005-10-16  8:32 UTC (permalink / raw)
  To: dougg
  Cc: Linux-SCSI Mailing List, James Bottomley, Andrew Vasquez,
	Christoph Hellwig

On Sun, 2005-10-16 at 10:38 +1000, Douglas Gilbert wrote:
> Christoph Hellwig wrote:
> > On Thu, Oct 13, 2005 at 04:16:14PM -0700, Andrew Vasquez wrote:
> > 
> >>Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
> > 
> > 
> > NACK.  My contributions won't be relicensed under such an odd license.
> > The real fix is to allow userspace firmware loading for all HBA types
> > (as done in one of the later patches) and eventually remove the firmware
> > completely.
> 
> Andrew,
> Another approach is to separate out changes made
> by Christoph and Arjan into a separate file (or
> files) and leave the GPL on that file.

..as well as any other contributor that isn't qlogic...

to be honest I suspect there will be nothing left for that though. It
also voids the goal of this license change as far as I can see..
(and also I think that is legally iffy as well; one could argue that
half the driver is a derived work of the other half (as well as probably
a derived work of linux) and as such it needs to be GPL as well)


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH 5/12]  qla2xxx: Add support for embedded ISP24xx firmware.
  2005-10-15 11:58       ` Christoph Hellwig
@ 2005-10-17 21:34         ` Andrew Vasquez
  2005-10-19 16:19           ` Christoph Hellwig
  0 siblings, 1 reply; 41+ messages in thread
From: Andrew Vasquez @ 2005-10-17 21:34 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: James Bottomley, Linux-SCSI Mailing List

On Sat, 15 Oct 2005, Christoph Hellwig wrote:

> On Fri, Oct 14, 2005 at 09:50:35AM -0700, Andrew Vasquez wrote:
> > 
> > I believe we spoke about this during OLS as well, and agreed that
> > adding the request-firmware interface for all ISP types, waiting a
> > year or so for distro infrastructure to mature now, then discarding
> > the embedded blobs was the way to go.  Given that, embedded 24xx
> > support will need to be present throughout that year.
> 
> No, we shouldn't add more firmware.  I think we need to play out you
> against the distros here so that they finally fix their infrastructure ;-)

Ok, so what's going to be the policy regarding firmware updates:

http://marc.theaimsgroup.com/?l=linux-scsi&m=112924541725072&w=2

--
av

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH 5/12]  qla2xxx: Add support for embedded ISP24xx firmware.
  2005-10-17 21:34         ` Andrew Vasquez
@ 2005-10-19 16:19           ` Christoph Hellwig
  0 siblings, 0 replies; 41+ messages in thread
From: Christoph Hellwig @ 2005-10-19 16:19 UTC (permalink / raw)
  To: Andrew Vasquez; +Cc: James Bottomley, Linux-SCSI Mailing List

On Mon, Oct 17, 2005 at 02:34:05PM -0700, Andrew Vasquez wrote:
> Ok, so what's going to be the policy regarding firmware updates:

Updates for existing drivers are fine mid-term, just please avoid adding new
ones.

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH 4/12]  qla2xxx: Update license.
  2005-10-14 18:47       ` Arjan van de Ven
@ 2005-10-19 17:37         ` Andrew Vasquez
  2005-10-19 17:43           ` Christoph Hellwig
  2005-10-19 18:18           ` Arjan van de Ven
  0 siblings, 2 replies; 41+ messages in thread
From: Andrew Vasquez @ 2005-10-19 17:37 UTC (permalink / raw)
  To: Arjan van de Ven; +Cc: Linux-SCSI Mailing List, James Bottomley, Arun Mittal

On Fri, 14 Oct 2005, Arjan van de Ven wrote:

> If you want the firmware issue improved, make the *firmware* BSD
> licensed. And only the firmware. But leave the driver GPL.
> And probably make it optional and allow a request_firmware() interface
> as well, so that people/distributions who don't want the built in one
> can use the request_firmware() option instead.

Here's the updated license we'd like to propose.  Please note the
verbiage regarding the questionable relicensing of the driver codes
has been removed.

On ACK, I'll re-diff my original patch and submit.

Regards,
Andrew Vasquez

---
Copyright (c)  2003-2005 QLogic Corporation
QLogic Linux Fibre Channel HBA Driver

This program includes a device driver for Linux 2.6 that may be
distributed with QLogic hardware specific firmware binary file.
You may modify and redistribute the device driver code under the
GNU General Public License as published by the Free Software
Foundation (version 2 or a later version).

You may redistribute the hardware specific firmware binary file
under the following terms:

	1. Redistribution of source code (only if applicable),
	   must retain the above copyright notice, this list of
	   conditions and the following disclaimer.

	2. Redistribution in binary form must reproduce the above
	   copyright notice, this list of conditions and the
	   following disclaimer in the documentation and/or other
	   materials provided with the distribution.

	3. The name of QLogic Corporation may not be used to
	   endorse or promote products derived from this software
	   without specific prior written permission

REGARDLESS OF WHAT LICENSING MECHANISM IS USED OR APPLICABLE,
THIS PROGRAM IS PROVIDED BY QLOGIC CORPORATION "AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

USER ACKNOWLEDGES AND AGREES THAT USE OF THIS PROGRAM WILL NOT
CREATE OR GIVE GROUNDS FOR A LICENSE BY IMPLICATION, ESTOPPEL, OR
OTHERWISE IN ANY INTELLECTUAL PROPERTY RIGHTS (PATENT, COPYRIGHT,
TRADE SECRET, MASK WORK, OR OTHER PROPRIETARY RIGHT) EMBODIED IN
ANY OTHER QLOGIC HARDWARE OR SOFTWARE EITHER SOLELY OR IN
COMBINATION WITH THIS PROGRAM.

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH 0/16]  qla2xxx: update qla2xxx driver to 8.01.02-k.
  2005-10-13 23:15 [PATCH 0/16] qla2xxx: update qla2xxx driver to 8.01.02-k Andrew Vasquez
                   ` (11 preceding siblings ...)
  2005-10-13 23:17 ` [PATCH 12/12] qla2xxx: Update version number to 8.01.02-k Andrew Vasquez
@ 2005-10-19 17:42 ` Andrew Vasquez
  2005-10-20 23:47   ` James Bottomley
  12 siblings, 1 reply; 41+ messages in thread
From: Andrew Vasquez @ 2005-10-19 17:42 UTC (permalink / raw)
  To: James Bottomley, Linux-SCSI Mailing List

On Thu, 13 Oct 2005, Andrew Vasquez wrote:

> James,
> 
> Here's a set of patches which add a handful of features to the qla2xxx
> driver.  Please queue for post-2.6.14 inclusion.

Given all the activity promted with this patchset, could you provide
some insight on which patches you have queued for inclusion into
scsi-misc?

The scsi-misc-2.6 GIT tree has been dormant for some time and I would
like to have some direction on which patches I should cherrypick and
rebase given a number of updates to linux-2.6.git for the qla2xxx
driver as well as the rport interface updates proposed by James S.

Thanks,
AV

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH 4/12]  qla2xxx: Update license.
  2005-10-19 17:37         ` Andrew Vasquez
@ 2005-10-19 17:43           ` Christoph Hellwig
  2005-10-19 17:50             ` Andrew Vasquez
  2005-10-19 18:18           ` Arjan van de Ven
  1 sibling, 1 reply; 41+ messages in thread
From: Christoph Hellwig @ 2005-10-19 17:43 UTC (permalink / raw)
  To: Andrew Vasquez
  Cc: Arjan van de Ven, Linux-SCSI Mailing List, James Bottomley,
	Arun Mittal

On Wed, Oct 19, 2005 at 10:37:07AM -0700, Andrew Vasquez wrote:
> Here's the updated license we'd like to propose.  Please note the
> verbiage regarding the questionable relicensing of the driver codes
> has been removed.

please don't hard-code qlogic in the license, you're not the only
copytight holder and adding everyone gets to long.  The only license
I'd be willing to dual-license my code under is the extremly simple
mit-style license used by the openbsd project:

 http://www.openbsd.org/cgi-bin/cvsweb/src/share/misc/license.template?rev=1.2&content-type=text/x-cvsweb-markup

I'll also send you a list of the files that have singnificant contributions
from me so you can add me to the copyright lines.  I though that wasn't
nessecary, but who knows what odd ideas legal departments will come up
with next.


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH 4/12]  qla2xxx: Update license.
  2005-10-19 17:43           ` Christoph Hellwig
@ 2005-10-19 17:50             ` Andrew Vasquez
  2005-10-19 18:22               ` Christoph Hellwig
  0 siblings, 1 reply; 41+ messages in thread
From: Andrew Vasquez @ 2005-10-19 17:50 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Arjan van de Ven, Linux-SCSI Mailing List, James Bottomley,
	Arun Mittal

On Wed, 19 Oct 2005, Christoph Hellwig wrote:

> On Wed, Oct 19, 2005 at 10:37:07AM -0700, Andrew Vasquez wrote:
> > Here's the updated license we'd like to propose.  Please note the
> > verbiage regarding the questionable relicensing of the driver codes
> > has been removed.
> 
> please don't hard-code qlogic in the license, you're not the only
> copytight holder and adding everyone gets to long.  The only license
> I'd be willing to dual-license my code under is the extremly simple
> mit-style license used by the openbsd project:
> 
>  http://www.openbsd.org/cgi-bin/cvsweb/src/share/misc/license.template?rev=1.2&content-type=text/x-cvsweb-markup
> 
> I'll also send you a list of the files that have singnificant contributions
> from me so you can add me to the copyright lines.I though that wasn't
> nessecary, but who knows what odd ideas legal departments will come up
> with next.

Sorry, but QLogic is not requesting that the driver codes be
dual-licensed.  The license explcitely states the codes are under the
GPL and the firmware blobs are under the BSD style license.

Where's the disconnect?

-- 
Andrew Vasquez

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH 4/12]  qla2xxx: Update license.
  2005-10-19 17:37         ` Andrew Vasquez
  2005-10-19 17:43           ` Christoph Hellwig
@ 2005-10-19 18:18           ` Arjan van de Ven
  1 sibling, 0 replies; 41+ messages in thread
From: Arjan van de Ven @ 2005-10-19 18:18 UTC (permalink / raw)
  To: Andrew Vasquez; +Cc: Linux-SCSI Mailing List, James Bottomley, Arun Mittal

On Wed, 2005-10-19 at 10:37 -0700, Andrew Vasquez wrote:
> On Fri, 14 Oct 2005, Arjan van de Ven wrote:
> 
> > If you want the firmware issue improved, make the *firmware* BSD
> > licensed. And only the firmware. But leave the driver GPL.
> > And probably make it optional and allow a request_firmware() interface
> > as well, so that people/distributions who don't want the built in one
> > can use the request_firmware() option instead.
> 
> Here's the updated license we'd like to propose.  Please note the
> verbiage regarding the questionable relicensing of the driver codes
> has been removed.


I'm fine with this "license the driver GPL as before, license the
firmware BSD" approach.



^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH 4/12]  qla2xxx: Update license.
  2005-10-19 17:50             ` Andrew Vasquez
@ 2005-10-19 18:22               ` Christoph Hellwig
  0 siblings, 0 replies; 41+ messages in thread
From: Christoph Hellwig @ 2005-10-19 18:22 UTC (permalink / raw)
  To: Andrew Vasquez
  Cc: Christoph Hellwig, Arjan van de Ven, Linux-SCSI Mailing List,
	James Bottomley, Arun Mittal

On Wed, Oct 19, 2005 at 10:50:09AM -0700, Andrew Vasquez wrote:
> Sorry, but QLogic is not requesting that the driver codes be
> dual-licensed.  The license explcitely states the codes are under the
> GPL and the firmware blobs are under the BSD style license.
> 
> Where's the disconnect?

sorry, I mis-read the sentence before the BSD-style license.  This
approach is fine with me, and still required with external firmware
aswell so that the distributions have a chance to ship it.  It would
be nice to just add a the BSD boilerplate to each of the firmware
files directly instead of adding a LICENSE file to avoid confusion
like mine :)


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH 0/16]  qla2xxx: update qla2xxx driver to 8.01.02-k.
  2005-10-19 17:42 ` [PATCH 0/16] qla2xxx: update qla2xxx driver " Andrew Vasquez
@ 2005-10-20 23:47   ` James Bottomley
  2005-10-21 21:07     ` Andrew Vasquez
  0 siblings, 1 reply; 41+ messages in thread
From: James Bottomley @ 2005-10-20 23:47 UTC (permalink / raw)
  To: Andrew Vasquez; +Cc: Linux-SCSI Mailing List

On Wed, 2005-10-19 at 10:42 -0700, Andrew Vasquez wrote:
> Given all the activity promted with this patchset, could you provide
> some insight on which patches you have queued for inclusion into
> scsi-misc?
> 
> The scsi-misc-2.6 GIT tree has been dormant for some time and I would
> like to have some direction on which patches I should cherrypick and
> rebase given a number of updates to linux-2.6.git for the qla2xxx
> driver as well as the rport interface updates proposed by James S.

Actually, none at the moment.  When a patch set comes as a list of
patches, I generally tend to assume that they are all interdependent
(although sometimes if there's objection to only a single component
patch, I will pull that out if possible).

So for the monolithic set, I'll put them in when all the objections are
worked out on the list.  If there are pieces I can apply now which
everyone's happy with, tell me what they are.

James



^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH 0/16]  qla2xxx: update qla2xxx driver to 8.01.02-k.
  2005-10-20 23:47   ` James Bottomley
@ 2005-10-21 21:07     ` Andrew Vasquez
  0 siblings, 0 replies; 41+ messages in thread
From: Andrew Vasquez @ 2005-10-21 21:07 UTC (permalink / raw)
  To: James Bottomley; +Cc: Linux-SCSI Mailing List

On Thu, 20 Oct 2005, James Bottomley wrote:

> On Wed, 2005-10-19 at 10:42 -0700, Andrew Vasquez wrote:
> > Given all the activity promted with this patchset, could you provide
> > some insight on which patches you have queued for inclusion into
> > scsi-misc?
> > 
> > The scsi-misc-2.6 GIT tree has been dormant for some time and I would
> > like to have some direction on which patches I should cherrypick and
> > rebase given a number of updates to linux-2.6.git for the qla2xxx
> > driver as well as the rport interface updates proposed by James S.
> 
> Actually, none at the moment.  When a patch set comes as a list of
> patches, I generally tend to assume that they are all interdependent
> (although sometimes if there's objection to only a single component
> patch, I will pull that out if possible).
> 
> So for the monolithic set, I'll put them in when all the objections are
> worked out on the list.  If there are pieces I can apply now which
> everyone's happy with, tell me what they are.

Ok, how about I rework my patchset based off linux-2.6.git with
scsi-misc-2.6.git merged and the rport interface updates proposed by
James S:

[PATCH - repost] update fc_transport for removal of block/unblock functions
http://marc.theaimsgroup.com/?l=linux-scsi&m=112965152011520&w=2


that would seem like a reasonable base to begin with, no?

--
Andrew Vasquez

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH 11/12] qla2xxx: Add an 'Issue LIP' device attribute.
  2005-10-14  9:48   ` Christoph Hellwig
  2005-10-14 22:44     ` Andrew Vasquez
@ 2005-10-27 23:03     ` Andrew Vasquez
  2005-10-28 22:53       ` Christoph Hellwig
  1 sibling, 1 reply; 41+ messages in thread
From: Andrew Vasquez @ 2005-10-27 23:03 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: James Bottomley, Linux-SCSI Mailing List, James Smart

On Fri, 14 Oct 2005, Christoph Hellwig wrote:

> On Thu, Oct 13, 2005 at 04:17:24PM -0700, Andrew Vasquez wrote:
> > Subject: Add an 'Issue LIP' device attribute.
> > 
> > Add a scsi_host device attribute to allow a user to initiate
> > a LIP.
> 
> This kind of thing belongs into the transport class so that we have
> a common API over all HBA drivers.

Ok, here's a patch to add such a common API for fc transport users.
Relevant LLD changes (lpfc and qla2xxx) also present.

Reasonable?

--
AV

---

diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index 2cab556..0467422 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -222,7 +222,7 @@ static void fc_rport_terminate(struct fc
  */
 #define FC_STARGET_NUM_ATTRS 	3
 #define FC_RPORT_NUM_ATTRS	9
-#define FC_HOST_NUM_ATTRS	15
+#define FC_HOST_NUM_ATTRS	16
 
 struct fc_internal {
 	struct scsi_transport_template t;
@@ -715,9 +715,11 @@ static FC_CLASS_DEVICE_ATTR(host, field,
 	count++
 
 #define SETUP_PRIVATE_HOST_ATTRIBUTE_RW(field)			\
+{									\
 	i->private_host_attrs[count] = class_device_attr_host_##field;	\
 	i->host_attrs[count] = &i->private_host_attrs[count];		\
-	count++
+	count++;							\
+}
 
 
 /* Fixed Host Attributes */
@@ -848,6 +850,26 @@ static FC_CLASS_DEVICE_ATTR(host, tgtid_
 			show_fc_private_host_tgtid_bind_type,
 			store_fc_private_host_tgtid_bind_type);
 
+static ssize_t
+store_fc_private_host_issue_lip(struct class_device *cdev,
+	const char *buf, size_t count)
+{
+	struct Scsi_Host *shost = transport_class_to_shost(cdev);
+	struct fc_internal *i = to_fc_internal(shost->transportt);
+	int ret;
+
+	/* ignore any data value written to the attribute */
+	if (i->f->issue_fc_host_lip) {
+		ret = i->f->issue_fc_host_lip(shost);
+		return ret ? ret: count;
+	}
+
+	return -ENOENT;
+}
+
+static FC_CLASS_DEVICE_ATTR(host, issue_lip, S_IWUSR, NULL,
+			store_fc_private_host_issue_lip);
+
 /*
  * Host Statistics Management
  */
@@ -1114,6 +1136,8 @@ fc_attach_transport(struct fc_function_t
 
 	/* Transport-managed attributes */
 	SETUP_PRIVATE_HOST_ATTRIBUTE_RW(tgtid_bind_type);
+	if (ft->issue_fc_host_lip)
+		SETUP_PRIVATE_HOST_ATTRIBUTE_RW(issue_lip);
 
 	BUG_ON(count > FC_HOST_NUM_ATTRS);
 
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h
index b0d4454..4496b32 100644
--- a/include/scsi/scsi_transport_fc.h
+++ b/include/scsi/scsi_transport_fc.h
@@ -384,6 +384,8 @@ struct fc_function_template {
 	struct fc_host_statistics * (*get_fc_host_stats)(struct Scsi_Host *);
 	void	(*reset_fc_host_stats)(struct Scsi_Host *);
 
+	int	(*issue_fc_host_lip)(struct Scsi_Host *);
+
 	/* allocation lengths for host-specific data */
 	u32	 			dd_fcrport_size;
 
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index acae7c4..445da1d 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -200,19 +200,13 @@ lpfc_num_discovered_ports_show(struct cl
 }
 
 
-static ssize_t
-lpfc_issue_lip (struct class_device *cdev, const char *buf, size_t count)
+static int
+lpfc_issue_lip(struct Scsi_Host *host)
 {
-	struct Scsi_Host *host = class_to_shost(cdev);
 	struct lpfc_hba *phba = (struct lpfc_hba *) host->hostdata[0];
-	int val = 0;
 	LPFC_MBOXQ_t *pmboxq;
 	int mbxstatus = MBXERR_ERROR;
 
-	if ((sscanf(buf, "%d", &val) != 1) ||
-	    (val != 1))
-		return -EINVAL;
-
 	if ((phba->fc_flag & FC_OFFLINE_MODE) ||
 	    (phba->hba_state != LPFC_HBA_READY))
 		return -EPERM;
@@ -234,7 +228,7 @@ lpfc_issue_lip (struct class_device *cde
 	if (mbxstatus == MBXERR_ERROR)
 		return -EIO;
 
-	return strlen(buf);
+	return 0;
 }
 
 static ssize_t
@@ -364,7 +358,6 @@ static CLASS_DEVICE_ATTR(lpfc_drvr_versi
 			 NULL);
 static CLASS_DEVICE_ATTR(management_version, S_IRUGO, management_version_show,
 			 NULL);
-static CLASS_DEVICE_ATTR(issue_lip, S_IWUSR, NULL, lpfc_issue_lip);
 static CLASS_DEVICE_ATTR(board_online, S_IRUGO | S_IWUSR,
 			 lpfc_board_online_show, lpfc_board_online_store);
 
@@ -537,7 +530,6 @@ struct class_device_attribute *lpfc_host
 	&class_device_attr_lpfc_max_luns,
 	&class_device_attr_nport_evt_cnt,
 	&class_device_attr_management_version,
-	&class_device_attr_issue_lip,
 	&class_device_attr_board_online,
 	NULL,
 };
@@ -1234,6 +1226,8 @@ struct fc_function_template lpfc_transpo
 
 	.get_starget_port_name = lpfc_get_starget_port_name,
 	.show_starget_port_name = 1,
+
+	.issue_fc_host_lip = lpfc_issue_lip,
 };
 
 void
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index fc25cd8..d921725 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -432,6 +432,15 @@ qla2x00_set_rport_loss_tmo(struct fc_rpo
 	rport->dev_loss_tmo = ha->port_down_retry_count + 5;
 }
 
+static int
+qla2x00_issue_lip(struct Scsi_Host *shost)
+{
+	scsi_qla_host_t *ha = to_qla_host(shost);
+
+	set_bit(LOOP_RESET_NEEDED, &ha->dpc_flags);
+	return 0;
+}
+
 struct fc_function_template qla2xxx_transport_functions = {
 
 	.show_host_node_name = 1,
@@ -455,6 +464,7 @@ struct fc_function_template qla2xxx_tran
 	.set_rport_dev_loss_tmo = qla2x00_set_rport_loss_tmo,
 	.show_rport_dev_loss_tmo = 1,
 
+	.issue_fc_host_lip = qla2x00_issue_lip,
 };
 
 void
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 8982978..9d90558 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -2186,6 +2186,12 @@ qla2x00_do_dpc(void *data)
 			    ha->host_no));
 		}
 
+		if (test_and_clear_bit(LOOP_RESET_NEEDED, &ha->dpc_flags)) {
+			DEBUG(printk("scsi(%ld): dpc: sched loop_reset()\n",
+			    ha->host_no));
+			qla2x00_loop_reset(ha);
+		}
+
 		if (test_and_clear_bit(RESET_MARKER_NEEDED, &ha->dpc_flags) &&
 		    (!(test_and_set_bit(RESET_ACTIVE, &ha->dpc_flags)))) {
 
@@ -2487,6 +2493,7 @@ qla2x00_timer(scsi_qla_host_t *ha)
 	/* Schedule the DPC routine if needed */
 	if ((test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags) ||
 	    test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags) ||
+	    test_bit(LOOP_RESET_NEEDED, &ha->dpc_flags) ||
 	    start_dpc ||
 	    test_bit(LOGIN_RETRY_NEEDED, &ha->dpc_flags) ||
 	    test_bit(RESET_MARKER_NEEDED, &ha->dpc_flags) ||

^ permalink raw reply related	[flat|nested] 41+ messages in thread

* Re: [PATCH 11/12] qla2xxx: Add an 'Issue LIP' device attribute.
  2005-10-27 23:03     ` Andrew Vasquez
@ 2005-10-28 22:53       ` Christoph Hellwig
  0 siblings, 0 replies; 41+ messages in thread
From: Christoph Hellwig @ 2005-10-28 22:53 UTC (permalink / raw)
  To: Andrew Vasquez
  Cc: Christoph Hellwig, James Bottomley, Linux-SCSI Mailing List,
	James Smart

On Thu, Oct 27, 2005 at 04:03:37PM -0700, Andrew Vasquez wrote:
> Ok, here's a patch to add such a common API for fc transport users.
> Relevant LLD changes (lpfc and qla2xxx) also present.
> 
> Reasonable?

Looks good, thanks.

And sorry for not noticing that lpfc sneaked it in already, otherwise
I would have made Emulex do this :)


^ permalink raw reply	[flat|nested] 41+ messages in thread

end of thread, other threads:[~2005-10-28 22:53 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-13 23:15 [PATCH 0/16] qla2xxx: update qla2xxx driver to 8.01.02-k Andrew Vasquez
2005-10-13 23:15 ` [PATCH 1/12] qla2xxx: Correct issue where fcport is prematurely marked DEAD Andrew Vasquez
2005-10-13 23:15 ` [PATCH 2/12] qla2xxx: Add support to dynamically enable/disable ZIO Andrew Vasquez
2005-10-13 23:16 ` [PATCH 3/12] qla2xxx: Collapse ISP2xxx queuecommand implementations Andrew Vasquez
2005-10-14 10:24   ` Christoph Hellwig
2005-10-14 22:43     ` Andrew Vasquez
2005-10-13 23:16 ` [PATCH 4/12] qla2xxx: Update license Andrew Vasquez
2005-10-14  7:30   ` Arjan van de Ven
2005-10-14 13:37     ` Douglas Gilbert
2005-10-14 13:53       ` Arjan van de Ven
2005-10-14 16:27     ` Andrew Vasquez
2005-10-14 18:47       ` Arjan van de Ven
2005-10-19 17:37         ` Andrew Vasquez
2005-10-19 17:43           ` Christoph Hellwig
2005-10-19 17:50             ` Andrew Vasquez
2005-10-19 18:22               ` Christoph Hellwig
2005-10-19 18:18           ` Arjan van de Ven
2005-10-15 11:56   ` Christoph Hellwig
2005-10-16  0:38     ` Douglas Gilbert
2005-10-16  8:32       ` Arjan van de Ven
2005-10-13 23:16 ` [PATCH 5/12] qla2xxx: Add support for embedded ISP24xx firmware Andrew Vasquez
2005-10-14  9:47   ` Christoph Hellwig
2005-10-14 16:50     ` Andrew Vasquez
2005-10-15 11:58       ` Christoph Hellwig
2005-10-17 21:34         ` Andrew Vasquez
2005-10-19 16:19           ` Christoph Hellwig
2005-10-13 23:16 ` [PATCH 6/12] qla2xxx: Resync with latest released firmware -- 4.00.12 Andrew Vasquez
2005-10-13 23:16 ` [PATCH 7/12] qla2xxx: Add hotplug firmware-load support for all ISP types Andrew Vasquez
2005-10-13 23:16 ` [PATCH 8/12] qla2xxx: Resync with latest released ISP23xx/63xx firmware -- 3.03.18 Andrew Vasquez
2005-10-13 23:17 ` [PATCH 9/12] qla2xxx: Use midlayer's int_to_scsilun() function Andrew Vasquez
2005-10-15 11:58   ` Christoph Hellwig
2005-10-13 23:17 ` [PATCH 10/12] qla2xxx: Correct fw-loader module-use referencing Andrew Vasquez
2005-10-13 23:17 ` [PATCH 11/12] qla2xxx: Add an 'Issue LIP' device attribute Andrew Vasquez
2005-10-14  9:48   ` Christoph Hellwig
2005-10-14 22:44     ` Andrew Vasquez
2005-10-27 23:03     ` Andrew Vasquez
2005-10-28 22:53       ` Christoph Hellwig
2005-10-13 23:17 ` [PATCH 12/12] qla2xxx: Update version number to 8.01.02-k Andrew Vasquez
2005-10-19 17:42 ` [PATCH 0/16] qla2xxx: update qla2xxx driver " Andrew Vasquez
2005-10-20 23:47   ` James Bottomley
2005-10-21 21:07     ` Andrew Vasquez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).