aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_dbf.c
diff options
context:
space:
mode:
authorChristof Schmitt <christof.schmitt@de.ibm.com>2009-11-24 10:54:08 -0500
committerJames Bottomley <James.Bottomley@suse.de>2009-12-04 13:02:10 -0500
commit4318e08c84e4916ac463002ffb7f9901ddb3c385 (patch)
treeebce82e85a0d2010c98d0585a5b94113981ee357 /drivers/s390/scsi/zfcp_dbf.c
parent8830271c4819d86d8e87202a1fe8da0bb58912a2 (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_dbf.c')
-rw-r--r--drivers/s390/scsi/zfcp_dbf.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c
index fe818cd29dc..21e5316e500 100644
--- a/drivers/s390/scsi/zfcp_dbf.c
+++ b/drivers/s390/scsi/zfcp_dbf.c
@@ -870,8 +870,9 @@ void _zfcp_dbf_scsi(const char *tag, const char *tag2, int level,
870 struct zfcp_dbf_scsi_record *rec = &dbf->scsi_buf; 870 struct zfcp_dbf_scsi_record *rec = &dbf->scsi_buf;
871 struct zfcp_dbf_dump *dump = (struct zfcp_dbf_dump *)rec; 871 struct zfcp_dbf_dump *dump = (struct zfcp_dbf_dump *)rec;
872 unsigned long flags; 872 unsigned long flags;
873 struct fcp_rsp_iu *fcp_rsp; 873 struct fcp_resp_with_ext *fcp_rsp;
874 char *fcp_rsp_info = NULL, *fcp_sns_info = NULL; 874 struct fcp_resp_rsp_info *fcp_rsp_info = NULL;
875 char *fcp_sns_info = NULL;
875 int offset = 0, buflen = 0; 876 int offset = 0, buflen = 0;
876 877
877 spin_lock_irqsave(&dbf->scsi_lock, flags); 878 spin_lock_irqsave(&dbf->scsi_lock, flags);
@@ -895,20 +896,22 @@ void _zfcp_dbf_scsi(const char *tag, const char *tag2, int level,
895 rec->scsi_allowed = scsi_cmnd->allowed; 896 rec->scsi_allowed = scsi_cmnd->allowed;
896 } 897 }
897 if (fsf_req != NULL) { 898 if (fsf_req != NULL) {
898 fcp_rsp = (struct fcp_rsp_iu *) 899 fcp_rsp = (struct fcp_resp_with_ext *)
899 &(fsf_req->qtcb->bottom.io.fcp_rsp); 900 &(fsf_req->qtcb->bottom.io.fcp_rsp);
900 fcp_rsp_info = (unsigned char *) &fcp_rsp[1]; 901 fcp_rsp_info = (struct fcp_resp_rsp_info *)
901 fcp_sns_info = 902 &fcp_rsp[1];
902 zfcp_get_fcp_sns_info_ptr(fcp_rsp); 903 fcp_sns_info = (char *) &fcp_rsp[1];
903 904 if (fcp_rsp->resp.fr_flags & FCP_RSP_LEN_VAL)
904 rec->rsp_validity = fcp_rsp->validity.value; 905 fcp_sns_info += fcp_rsp->ext.fr_sns_len;
905 rec->rsp_scsi_status = fcp_rsp->scsi_status; 906
906 rec->rsp_resid = fcp_rsp->fcp_resid; 907 rec->rsp_validity = fcp_rsp->resp.fr_flags;
907 if (fcp_rsp->validity.bits.fcp_rsp_len_valid) 908 rec->rsp_scsi_status = fcp_rsp->resp.fr_status;
908 rec->rsp_code = *(fcp_rsp_info + 3); 909 rec->rsp_resid = fcp_rsp->ext.fr_resid;
909 if (fcp_rsp->validity.bits.fcp_sns_len_valid) { 910 if (fcp_rsp->resp.fr_flags & FCP_RSP_LEN_VAL)
910 buflen = min((int)fcp_rsp->fcp_sns_len, 911 rec->rsp_code = fcp_rsp_info->rsp_code;
911 ZFCP_DBF_SCSI_MAX_FCP_SNS_INFO); 912 if (fcp_rsp->resp.fr_flags & FCP_SNS_LEN_VAL) {
913 buflen = min(fcp_rsp->ext.fr_sns_len,
914 (u32)ZFCP_DBF_SCSI_MAX_FCP_SNS_INFO);
912 rec->sns_info_len = buflen; 915 rec->sns_info_len = buflen;
913 memcpy(rec->sns_info, fcp_sns_info, 916 memcpy(rec->sns_info, fcp_sns_info,
914 min(buflen, 917 min(buflen,