diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-05-15 14:34:28 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-05-22 06:47:51 -0400 |
commit | 2d70c103fd2a066f904712b14239a5ce141f8236 (patch) | |
tree | ab803dc02ea9be7c45bf1b506880031ad87ac1f9 /drivers/scsi/qla2xxx/qla_iocb.c | |
parent | 2c1391d395ef7ba9261b7dd590c5a195315631d6 (diff) |
[SCSI] qla2xxx: Add LLD target-mode infrastructure for >= 24xx series
Add LLD target mode for >= 24xx series HW. This code was originally based on
external qla2x00t module based on 8.02.01-k4, and has been refactored to
push the bulk of code into mainline qla2xxx.ko LLD -> qla_target.c.
The implementation uses internal workqueues for I/O context submission
into tcm_qla2xxx code, and includes the struct qla_tgt_func_tmpl API for
external interaction to allow qla2xxx LDD to function without direct
target-core dependencies:
It also enables qla_target.c usage within existing qla2xxx LLD code.
This includes:
*) Addition of target mode specific members to existing data
structures in qla_def.h and struct qla_hw_data->tgt_ops using
qla_target.h:struct qla_tgt_func_tmpl
*) Addition of struct qla_tgt_func_tmpl and direct calls into
qla_target.c logic w/ qlt_* prefixed functions.
*) Addition of qla_iocb.c:qla2x00_req_pkt() for ring processing, and
qla2x00_issue_marker() for handling request/response queue processing
for target mode operation
*) Addition of various qla_tgt_mode_enabled() logic checks in
qla24xx_nvram_config(), qla2x00_initialize_adapter(), qla2x00_rff_id(),
qla2x00_abort_isp(), qla24xx_modify_vp_config(), and
qla2x00_vp_abort_isp().
By default the new qlini_mode module parameter is setting initiator-mode
to 'enabled' in order for 'modprobe qla2xxx' to continue to function as
expected in initiator only mode. Enabling target-mode operation will
currently require a:
modprobe qla2xxx qlini_mode="disabled"
in order to explictly disabled initiator mode and allow target-mode
to be enabled via tcm_qla2xxx configfs fabric callers.
(nab: Convert to qlini_mode='enabled' by default in qla_target.c)
(joern: Remove loop_id from qla_tgt_make_local_sess() arguments +
Remove unused s_id + fix s_id endianness bug +
simplify qla_tgt_abort_work)
(gerard: fix section __exit mismatch in qla_tgt_exit)
(arun: Capture ATIO queue during firmware dump + Send SCR in target mode +
Target mode review comments)
(roland: Don't create duplicate target sessions to address tearing down
ACLs with IO in flight + Add missing call to qlt_fc_port_deleted
call during qla2x00_schedule_rport_del timeout)
Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_iocb.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_iocb.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index 6bf6c08650e8..73cc96da9421 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c | |||
@@ -5,6 +5,7 @@ | |||
5 | * See LICENSE.qla2xxx for copyright and licensing details. | 5 | * See LICENSE.qla2xxx for copyright and licensing details. |
6 | */ | 6 | */ |
7 | #include "qla_def.h" | 7 | #include "qla_def.h" |
8 | #include "qla_target.h" | ||
8 | 9 | ||
9 | #include <linux/blkdev.h> | 10 | #include <linux/blkdev.h> |
10 | #include <linux/delay.h> | 11 | #include <linux/delay.h> |
@@ -470,7 +471,7 @@ queuing_error: | |||
470 | /** | 471 | /** |
471 | * qla2x00_start_iocbs() - Execute the IOCB command | 472 | * qla2x00_start_iocbs() - Execute the IOCB command |
472 | */ | 473 | */ |
473 | static void | 474 | void |
474 | qla2x00_start_iocbs(struct scsi_qla_host *vha, struct req_que *req) | 475 | qla2x00_start_iocbs(struct scsi_qla_host *vha, struct req_que *req) |
475 | { | 476 | { |
476 | struct qla_hw_data *ha = vha->hw; | 477 | struct qla_hw_data *ha = vha->hw; |
@@ -571,6 +572,29 @@ qla2x00_marker(struct scsi_qla_host *vha, struct req_que *req, | |||
571 | return (ret); | 572 | return (ret); |
572 | } | 573 | } |
573 | 574 | ||
575 | /* | ||
576 | * qla2x00_issue_marker | ||
577 | * | ||
578 | * Issue marker | ||
579 | * Caller CAN have hardware lock held as specified by ha_locked parameter. | ||
580 | * Might release it, then reaquire. | ||
581 | */ | ||
582 | int qla2x00_issue_marker(scsi_qla_host_t *vha, int ha_locked) | ||
583 | { | ||
584 | if (ha_locked) { | ||
585 | if (__qla2x00_marker(vha, vha->req, vha->req->rsp, 0, 0, | ||
586 | MK_SYNC_ALL) != QLA_SUCCESS) | ||
587 | return QLA_FUNCTION_FAILED; | ||
588 | } else { | ||
589 | if (qla2x00_marker(vha, vha->req, vha->req->rsp, 0, 0, | ||
590 | MK_SYNC_ALL) != QLA_SUCCESS) | ||
591 | return QLA_FUNCTION_FAILED; | ||
592 | } | ||
593 | vha->marker_needed = 0; | ||
594 | |||
595 | return QLA_SUCCESS; | ||
596 | } | ||
597 | |||
574 | /** | 598 | /** |
575 | * qla24xx_calc_iocbs() - Determine number of Command Type 3 and | 599 | * qla24xx_calc_iocbs() - Determine number of Command Type 3 and |
576 | * Continuation Type 1 IOCBs to allocate. | 600 | * Continuation Type 1 IOCBs to allocate. |