diff options
author | Christof Schmitt <christof.schmitt@de.ibm.com> | 2009-11-24 10:54:08 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-12-04 13:02:10 -0500 |
commit | 4318e08c84e4916ac463002ffb7f9901ddb3c385 (patch) | |
tree | ebce82e85a0d2010c98d0585a5b94113981ee357 /drivers/s390/scsi/zfcp_scsi.c | |
parent | 8830271c4819d86d8e87202a1fe8da0bb58912a2 (diff) |
[SCSI] zfcp: Update FCP protocol related code
Use common data structures for FCP CMND, FCP RSP and related
definitions and remove zfcp private definitions. Split the FCP CMND
setup and FCP RSP evaluation code in seperate functions. Use inline
functions to not negatively impact the I/O path.
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.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index 0ecec9c1b490..3d168410036b 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c | |||
@@ -9,6 +9,8 @@ | |||
9 | #define KMSG_COMPONENT "zfcp" | 9 | #define KMSG_COMPONENT "zfcp" |
10 | #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt | 10 | #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt |
11 | 11 | ||
12 | #include <linux/types.h> | ||
13 | #include <scsi/fc/fc_fcp.h> | ||
12 | #include <asm/atomic.h> | 14 | #include <asm/atomic.h> |
13 | #include "zfcp_ext.h" | 15 | #include "zfcp_ext.h" |
14 | #include "zfcp_dbf.h" | 16 | #include "zfcp_dbf.h" |
@@ -17,18 +19,6 @@ static unsigned int default_depth = 32; | |||
17 | module_param_named(queue_depth, default_depth, uint, 0600); | 19 | module_param_named(queue_depth, default_depth, uint, 0600); |
18 | MODULE_PARM_DESC(queue_depth, "Default queue depth for new SCSI devices"); | 20 | MODULE_PARM_DESC(queue_depth, "Default queue depth for new SCSI devices"); |
19 | 21 | ||
20 | /* Find start of Sense Information in FCP response unit*/ | ||
21 | char *zfcp_get_fcp_sns_info_ptr(struct fcp_rsp_iu *fcp_rsp_iu) | ||
22 | { | ||
23 | char *fcp_sns_info_ptr; | ||
24 | |||
25 | fcp_sns_info_ptr = (unsigned char *) &fcp_rsp_iu[1]; | ||
26 | if (fcp_rsp_iu->validity.bits.fcp_rsp_len_valid) | ||
27 | fcp_sns_info_ptr += fcp_rsp_iu->fcp_rsp_len; | ||
28 | |||
29 | return fcp_sns_info_ptr; | ||
30 | } | ||
31 | |||
32 | static int zfcp_scsi_change_queue_depth(struct scsi_device *sdev, int depth, | 22 | static int zfcp_scsi_change_queue_depth(struct scsi_device *sdev, int depth, |
33 | int reason) | 23 | int reason) |
34 | { | 24 | { |
@@ -283,12 +273,12 @@ static int zfcp_task_mgmt_function(struct scsi_cmnd *scpnt, u8 tm_flags) | |||
283 | 273 | ||
284 | static int zfcp_scsi_eh_device_reset_handler(struct scsi_cmnd *scpnt) | 274 | static int zfcp_scsi_eh_device_reset_handler(struct scsi_cmnd *scpnt) |
285 | { | 275 | { |
286 | return zfcp_task_mgmt_function(scpnt, FCP_LOGICAL_UNIT_RESET); | 276 | return zfcp_task_mgmt_function(scpnt, FCP_TMF_LUN_RESET); |
287 | } | 277 | } |
288 | 278 | ||
289 | static int zfcp_scsi_eh_target_reset_handler(struct scsi_cmnd *scpnt) | 279 | static int zfcp_scsi_eh_target_reset_handler(struct scsi_cmnd *scpnt) |
290 | { | 280 | { |
291 | return zfcp_task_mgmt_function(scpnt, FCP_TARGET_RESET); | 281 | return zfcp_task_mgmt_function(scpnt, FCP_TMF_TGT_RESET); |
292 | } | 282 | } |
293 | 283 | ||
294 | static int zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *scpnt) | 284 | static int zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *scpnt) |
@@ -325,7 +315,7 @@ int zfcp_adapter_scsi_register(struct zfcp_adapter *adapter) | |||
325 | adapter->scsi_host->max_lun = 1; | 315 | adapter->scsi_host->max_lun = 1; |
326 | adapter->scsi_host->max_channel = 0; | 316 | adapter->scsi_host->max_channel = 0; |
327 | adapter->scsi_host->unique_id = dev_id.devno; | 317 | adapter->scsi_host->unique_id = dev_id.devno; |
328 | adapter->scsi_host->max_cmd_len = 255; | 318 | adapter->scsi_host->max_cmd_len = 16; /* in struct fcp_cmnd */ |
329 | adapter->scsi_host->transportt = zfcp_data.scsi_transport_template; | 319 | adapter->scsi_host->transportt = zfcp_data.scsi_transport_template; |
330 | 320 | ||
331 | adapter->scsi_host->hostdata[0] = (unsigned long) adapter; | 321 | adapter->scsi_host->hostdata[0] = (unsigned long) adapter; |