aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_scsi.c
diff options
context:
space:
mode:
authorChristof Schmitt <christof.schmitt@de.ibm.com>2009-11-24 10:54:13 -0500
committerJames Bottomley <James.Bottomley@suse.de>2009-12-04 13:02:15 -0500
commit7c7dc196814b9e1d5cc254dc579a5fa78ae524f7 (patch)
treeefe4800a456fa97e1f10876840fbde0983264b18 /drivers/s390/scsi/zfcp_scsi.c
parent800c0cad962dcf630cabf3efdc5983619e73d4c9 (diff)
[SCSI] zfcp: Simplify handling of ct and els requests
Remove some redundancies in FC related code and trace: - drop redundant data from SAN trace (local s_id that only changes during link down, ls_code that is already part of payload, d_id in ct response trace that is always the same as in ct request trace) - use one common fsf struct to hold zfcp data for ct and els requests - leverage common fsf struct for FC passthrough job data, allocate it with dd_bsg_data for passthrough requests and unify common code for ct and els passthrough request - simplify callback handling in zfcp_fc Reviewed-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/s390/scsi/zfcp_scsi.c')
-rw-r--r--drivers/s390/scsi/zfcp_scsi.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
index 3d168410036b..535f36cf2819 100644
--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -14,6 +14,7 @@
14#include <asm/atomic.h> 14#include <asm/atomic.h>
15#include "zfcp_ext.h" 15#include "zfcp_ext.h"
16#include "zfcp_dbf.h" 16#include "zfcp_dbf.h"
17#include "zfcp_fc.h"
17 18
18static unsigned int default_depth = 32; 19static unsigned int default_depth = 32;
19module_param_named(queue_depth, default_depth, uint, 0600); 20module_param_named(queue_depth, default_depth, uint, 0600);
@@ -628,20 +629,6 @@ void zfcp_scsi_scan(struct work_struct *work)
628 put_device(&unit->sysfs_device); 629 put_device(&unit->sysfs_device);
629} 630}
630 631
631static int zfcp_execute_fc_job(struct fc_bsg_job *job)
632{
633 switch (job->request->msgcode) {
634 case FC_BSG_RPT_ELS:
635 case FC_BSG_HST_ELS_NOLOGIN:
636 return zfcp_fc_execute_els_fc_job(job);
637 case FC_BSG_RPT_CT:
638 case FC_BSG_HST_CT:
639 return zfcp_fc_execute_ct_fc_job(job);
640 default:
641 return -EINVAL;
642 }
643}
644
645struct fc_function_template zfcp_transport_functions = { 632struct fc_function_template zfcp_transport_functions = {
646 .show_starget_port_id = 1, 633 .show_starget_port_id = 1,
647 .show_starget_port_name = 1, 634 .show_starget_port_name = 1,
@@ -662,13 +649,14 @@ struct fc_function_template zfcp_transport_functions = {
662 .get_host_port_state = zfcp_get_host_port_state, 649 .get_host_port_state = zfcp_get_host_port_state,
663 .terminate_rport_io = zfcp_scsi_terminate_rport_io, 650 .terminate_rport_io = zfcp_scsi_terminate_rport_io,
664 .show_host_port_state = 1, 651 .show_host_port_state = 1,
665 .bsg_request = zfcp_execute_fc_job, 652 .bsg_request = zfcp_fc_exec_bsg_job,
666 /* no functions registered for following dynamic attributes but 653 /* no functions registered for following dynamic attributes but
667 directly set by LLDD */ 654 directly set by LLDD */
668 .show_host_port_type = 1, 655 .show_host_port_type = 1,
669 .show_host_speed = 1, 656 .show_host_speed = 1,
670 .show_host_port_id = 1, 657 .show_host_port_id = 1,
671 .disable_target_scan = 1, 658 .disable_target_scan = 1,
659 .dd_bsg_size = sizeof(struct zfcp_fsf_ct_els),
672}; 660};
673 661
674struct zfcp_data zfcp_data = { 662struct zfcp_data zfcp_data = {