From: Andrew Vasquez <andrew.vasquez@qlogic.com>
To: James Bottomley <James.Bottomley@SteelEye.com>,
Linux-SCSI Mailing List <linux-scsi@vger.kernel.org>
Cc: Andrew Vasquez <andrew.vasquez@qlogic.com>
Subject: [PATCH 10/12] qla2xxx: Correct fw-loader module-use referencing.
Date: Thu, 13 Oct 2005 16:17:14 -0700 (PDT) [thread overview]
Message-ID: <20051013231714.27191.14514.sendpatchset@plap.qlogic.com> (raw)
In-Reply-To: <20051013231534.27191.19815.sendpatchset@plap.qlogic.com>
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
next prev parent reply other threads:[~2005-10-13 23:17 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Andrew Vasquez [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20051013231714.27191.14514.sendpatchset@plap.qlogic.com \
--to=andrew.vasquez@qlogic.com \
--cc=James.Bottomley@SteelEye.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).