diff --git a/qla2x00t/qla2x00-target/qla2x00t.c b/qla2x00t/qla2x00-target/qla2x00t.c index a4a627f8e..9cff3aad9 100644 --- a/qla2x00t/qla2x00-target/qla2x00t.c +++ b/qla2x00t/qla2x00-target/qla2x00t.c @@ -73,10 +73,10 @@ static void q2t_send_term_exchange(scsi_qla_host_t *ha, struct q2t_cmd *cmd, #if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) #define trace_flag q2t_trace_flag -unsigned long q2t_trace_flag = Q2T_DEFAULT_LOG_FLAGS; +static unsigned long q2t_trace_flag = Q2T_DEFAULT_LOG_FLAGS; #endif -struct scst_tgt_template tgt_template = { +static struct scst_tgt_template tgt_template = { .name = "qla2x00tgt", .sg_tablesize = 0, .use_clustering = 1, @@ -95,7 +95,7 @@ struct scst_tgt_template tgt_template = { .task_mgmt_fn_done = q2t_task_mgmt_fn_done, }; -struct kmem_cache *q2t_cmd_cachep; +static struct kmem_cache *q2t_cmd_cachep; static struct qla2x_tgt_target tgt_data; /* diff --git a/qla2x00t/qla_def.h b/qla2x00t/qla_def.h index 8eadc48db..7bea425ad 100644 --- a/qla2x00t/qla_def.h +++ b/qla2x00t/qla_def.h @@ -2621,13 +2621,6 @@ typedef struct scsi_qla_host { struct qla_statistics qla_stats; } scsi_qla_host_t; -/* Wait type for qla2x00_eh_wait_for_pending_commands() */ -enum nexus_wait_type { - WAIT_HOST = 0, - WAIT_TARGET, - WAIT_LUN, -}; - /* * Macros to help code, maintain, etc. */ diff --git a/qla2x00t/qla_gbl.h b/qla2x00t/qla_gbl.h index f2fb20361..cd70f3965 100644 --- a/qla2x00t/qla_gbl.h +++ b/qla2x00t/qla_gbl.h @@ -374,13 +374,4 @@ extern void qla2x00_free_sysfs_attr(scsi_qla_host_t *); extern int qla2x00_dfs_setup(scsi_qla_host_t *); extern int qla2x00_dfs_remove(scsi_qla_host_t *); -/* from qla_os.c for __qla2x00_host_reset in qla_init.c */ -int -qla2x00_wait_for_loop_ready(scsi_qla_host_t *ha); -int -qla2x00_wait_for_hba_online(scsi_qla_host_t *ha); -int -qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *ha, unsigned int t, - unsigned int l, enum nexus_wait_type type); - #endif /* _QLA_GBL_H */ diff --git a/qla2x00t/qla_init.c b/qla2x00t/qla_init.c index b1a6693f2..439213ba9 100644 --- a/qla2x00t/qla_init.c +++ b/qla2x00t/qla_init.c @@ -4135,51 +4135,12 @@ qla24xx_configure_vhba(scsi_qla_host_t *ha) #ifdef CONFIG_SCSI_QLA2XXX_TARGET -/* - * __qla2x00_host_reset - NO LOCKS HELD - * - * Reset host adapter. - * taken directly from qla2xxx_eh_host_reset() {ver 8.01.03-k} - */ -void -__qla2x00_host_reset(scsi_qla_host_t *ha) -{ - int ret = FAILED; - - qla_printk(KERN_INFO, ha, "scsi(%ld): ADAPTER RESET ISSUED.\n", - ha->host_no); - - if (qla2x00_wait_for_hba_online(ha) != QLA_SUCCESS) - goto out; - - qla2x00_wait_for_loop_ready(ha); - set_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags); - if (qla2x00_abort_isp(ha)) { - clear_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags); - /* failed. schedule dpc to try */ - set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); - - if (qla2x00_wait_for_hba_online(ha) != QLA_SUCCESS) - goto out; - } - clear_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags); - - /* Waiting for our command in done_queue to be returned to OS.*/ - if (qla2x00_eh_wait_for_pending_commands(ha, 0, 0, WAIT_HOST)) - ret = SUCCESS; - -out: - qla_printk(KERN_INFO, ha, "%s: reset %s\n", __func__, - (ret == FAILED) ? "failed" : "succeded"); - return; -} - /* * __qla2x00_enable_lun - NO LOCK HELD * * host_reset, bring up w/ Target Mode Enabled */ -void +static void __qla2x00_enable_lun(scsi_qla_host_t *ha) { unsigned long flags = 0; @@ -4188,7 +4149,6 @@ __qla2x00_enable_lun(scsi_qla_host_t *ha) ha->flags.enable_target_mode = 1; spin_unlock_irqrestore(&ha->hardware_lock, flags); - /* __qla2x00_host_reset(ha); */ set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); } @@ -4197,7 +4157,7 @@ __qla2x00_enable_lun(scsi_qla_host_t *ha) * * Disable Target Mode and reset the adapter */ -void +static void __qla2x00_disable_lun(scsi_qla_host_t *ha) { unsigned long flags = 0; @@ -4206,7 +4166,6 @@ __qla2x00_disable_lun(scsi_qla_host_t *ha) ha->flags.enable_target_mode = 0; spin_unlock_irqrestore(&ha->hardware_lock, flags); - /* __qla2x00_host_reset(ha); */ set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); } @@ -4216,7 +4175,7 @@ __qla2x00_disable_lun(scsi_qla_host_t *ha) * Caller MUST have hardware lock held */ -int +static int __qla2x00_issue_marker(scsi_qla_host_t *ha) { /* Send marker if required */ @@ -4228,7 +4187,7 @@ __qla2x00_issue_marker(scsi_qla_host_t *ha) return QLA_SUCCESS; } -int +static int qla2x00_get_resource_counts(scsi_qla_host_t *ha, uint8_t *cmd, uint8_t *imm) { mbx_cmd_t mc; @@ -4254,7 +4213,7 @@ qla2x00_get_resource_counts(scsi_qla_host_t *ha, uint8_t *cmd, uint8_t *imm) * Retrieve a continue packet from request que * Caller MUST have hardware lock held */ -cont_entry_t * +static cont_entry_t * qla2x00_req_cont_pkt(scsi_qla_host_t *ha) { /* Adjust ring index. */ diff --git a/qla2x00t/qla_os.c b/qla2x00t/qla_os.c index 31091f1c8..4bff7f867 100644 --- a/qla2x00t/qla_os.c +++ b/qla2x00t/qla_os.c @@ -601,7 +601,7 @@ qla2x00_wait_for_hba_online(scsi_qla_host_t *ha) * Success (LOOP_READY) : 0 * Failed (LOOP_NOT_READY) : 1 */ -int +static int qla2x00_wait_for_loop_ready(scsi_qla_host_t *ha) { int return_status = QLA_SUCCESS; @@ -762,7 +762,13 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd) return ret; } -int +enum nexus_wait_type { + WAIT_HOST = 0, + WAIT_TARGET, + WAIT_LUN, +}; + +static int qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *ha, unsigned int t, unsigned int l, enum nexus_wait_type type) {