提交 d334aa79 编写于 作者: E Eric Moore 提交者: James Bottomley

[SCSI] mpt2sas: DIF Type 2 Protection Support

Adding DIF Type 2 protection support, as well as turning on 32 byte cdb's,
and setting the cdb length for > 16 byte in the SCSI_IO->control parameter.
Signed-off-by: NMartin Petersen <martin.petersen@oracle.com>
Signed-off-by: NEric Moore <eric.moore@lsi.com>
Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
上级 8f83d768
...@@ -69,11 +69,11 @@ ...@@ -69,11 +69,11 @@
#define MPT2SAS_DRIVER_NAME "mpt2sas" #define MPT2SAS_DRIVER_NAME "mpt2sas"
#define MPT2SAS_AUTHOR "LSI Corporation <DL-MPTFusionLinux@lsi.com>" #define MPT2SAS_AUTHOR "LSI Corporation <DL-MPTFusionLinux@lsi.com>"
#define MPT2SAS_DESCRIPTION "LSI MPT Fusion SAS 2.0 Device Driver" #define MPT2SAS_DESCRIPTION "LSI MPT Fusion SAS 2.0 Device Driver"
#define MPT2SAS_DRIVER_VERSION "05.100.00.02" #define MPT2SAS_DRIVER_VERSION "05.100.00.03"
#define MPT2SAS_MAJOR_VERSION 05 #define MPT2SAS_MAJOR_VERSION 05
#define MPT2SAS_MINOR_VERSION 100 #define MPT2SAS_MINOR_VERSION 100
#define MPT2SAS_BUILD_VERSION 00 #define MPT2SAS_BUILD_VERSION 00
#define MPT2SAS_RELEASE_VERSION 02 #define MPT2SAS_RELEASE_VERSION 03
/* /*
* Set MPT2SAS_SG_DEPTH value based on user input. * Set MPT2SAS_SG_DEPTH value based on user input.
......
...@@ -2858,9 +2858,7 @@ _scsih_setup_eedp(struct scsi_cmnd *scmd, Mpi2SCSIIORequest_t *mpi_request) ...@@ -2858,9 +2858,7 @@ _scsih_setup_eedp(struct scsi_cmnd *scmd, Mpi2SCSIIORequest_t *mpi_request)
unsigned char prot_op = scsi_get_prot_op(scmd); unsigned char prot_op = scsi_get_prot_op(scmd);
unsigned char prot_type = scsi_get_prot_type(scmd); unsigned char prot_type = scsi_get_prot_type(scmd);
if (prot_type == SCSI_PROT_DIF_TYPE0 || if (prot_type == SCSI_PROT_DIF_TYPE0 || prot_op == SCSI_PROT_NORMAL)
prot_type == SCSI_PROT_DIF_TYPE2 ||
prot_op == SCSI_PROT_NORMAL)
return; return;
if (prot_op == SCSI_PROT_READ_STRIP) if (prot_op == SCSI_PROT_READ_STRIP)
...@@ -2882,7 +2880,13 @@ _scsih_setup_eedp(struct scsi_cmnd *scmd, Mpi2SCSIIORequest_t *mpi_request) ...@@ -2882,7 +2880,13 @@ _scsih_setup_eedp(struct scsi_cmnd *scmd, Mpi2SCSIIORequest_t *mpi_request)
MPI2_SCSIIO_EEDPFLAGS_CHECK_GUARD; MPI2_SCSIIO_EEDPFLAGS_CHECK_GUARD;
mpi_request->CDB.EEDP32.PrimaryReferenceTag = mpi_request->CDB.EEDP32.PrimaryReferenceTag =
cpu_to_be32(scsi_get_lba(scmd)); cpu_to_be32(scsi_get_lba(scmd));
break;
case SCSI_PROT_DIF_TYPE2:
eedp_flags |= MPI2_SCSIIO_EEDPFLAGS_INC_PRI_REFTAG |
MPI2_SCSIIO_EEDPFLAGS_CHECK_REFTAG |
MPI2_SCSIIO_EEDPFLAGS_CHECK_GUARD;
break; break;
case SCSI_PROT_DIF_TYPE3: case SCSI_PROT_DIF_TYPE3:
...@@ -3013,7 +3017,7 @@ _scsih_qcmd(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *)) ...@@ -3013,7 +3017,7 @@ _scsih_qcmd(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *))
mpi_control |= MPI2_SCSIIO_CONTROL_SIMPLEQ; mpi_control |= MPI2_SCSIIO_CONTROL_SIMPLEQ;
/* Make sure Device is not raid volume */ /* Make sure Device is not raid volume */
if (!_scsih_is_raid(&scmd->device->sdev_gendev) && if (!_scsih_is_raid(&scmd->device->sdev_gendev) &&
sas_is_tlr_enabled(scmd->device)) sas_is_tlr_enabled(scmd->device) && scmd->cmd_len != 32)
mpi_control |= MPI2_SCSIIO_CONTROL_TLR_ON; mpi_control |= MPI2_SCSIIO_CONTROL_TLR_ON;
smid = mpt2sas_base_get_smid_scsiio(ioc, ioc->scsi_io_cb_idx, scmd); smid = mpt2sas_base_get_smid_scsiio(ioc, ioc->scsi_io_cb_idx, scmd);
...@@ -3025,6 +3029,8 @@ _scsih_qcmd(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *)) ...@@ -3025,6 +3029,8 @@ _scsih_qcmd(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *))
mpi_request = mpt2sas_base_get_msg_frame(ioc, smid); mpi_request = mpt2sas_base_get_msg_frame(ioc, smid);
memset(mpi_request, 0, sizeof(Mpi2SCSIIORequest_t)); memset(mpi_request, 0, sizeof(Mpi2SCSIIORequest_t));
_scsih_setup_eedp(scmd, mpi_request); _scsih_setup_eedp(scmd, mpi_request);
if (scmd->cmd_len == 32)
mpi_control |= 4 << MPI2_SCSIIO_CONTROL_ADDCDBLEN_SHIFT;
mpi_request->Function = MPI2_FUNCTION_SCSI_IO_REQUEST; mpi_request->Function = MPI2_FUNCTION_SCSI_IO_REQUEST;
if (sas_device_priv_data->sas_target->flags & if (sas_device_priv_data->sas_target->flags &
MPT_TARGET_FLAGS_RAID_COMPONENT) MPT_TARGET_FLAGS_RAID_COMPONENT)
...@@ -6567,7 +6573,7 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -6567,7 +6573,7 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
INIT_LIST_HEAD(&ioc->delayed_tr_list); INIT_LIST_HEAD(&ioc->delayed_tr_list);
/* init shost parameters */ /* init shost parameters */
shost->max_cmd_len = 16; shost->max_cmd_len = 32;
shost->max_lun = max_lun; shost->max_lun = max_lun;
shost->transportt = mpt2sas_transport_template; shost->transportt = mpt2sas_transport_template;
shost->unique_id = ioc->id; shost->unique_id = ioc->id;
...@@ -6580,7 +6586,7 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -6580,7 +6586,7 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id)
} }
scsi_host_set_prot(shost, SHOST_DIF_TYPE1_PROTECTION scsi_host_set_prot(shost, SHOST_DIF_TYPE1_PROTECTION
| SHOST_DIF_TYPE3_PROTECTION); | SHOST_DIF_TYPE2_PROTECTION | SHOST_DIF_TYPE3_PROTECTION);
scsi_host_set_guard(shost, SHOST_DIX_GUARD_CRC); scsi_host_set_guard(shost, SHOST_DIX_GUARD_CRC);
/* event thread */ /* event thread */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册