diff options
author | Eric Moore <eric.moore@lsi.com> | 2010-04-22 12:47:40 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-27 13:00:59 -0400 |
commit | d334aa79786a878e90af5b5c1b14109c1df85820 (patch) | |
tree | b957a6e52da6fbb9acf2637932cd856b79cb95f9 /drivers/scsi/mpt2sas/mpt2sas_scsih.c | |
parent | 8f83d7688026729c9d356d865f65a8996f090048 (diff) |
[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: Martin Petersen <martin.petersen@oracle.com>
Signed-off-by: Eric Moore <eric.moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/mpt2sas/mpt2sas_scsih.c')
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_scsih.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c index c5ff26a2a51d..456ea7c3b099 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c +++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c | |||
@@ -2858,9 +2858,7 @@ _scsih_setup_eedp(struct scsi_cmnd *scmd, Mpi2SCSIIORequest_t *mpi_request) | |||
2858 | unsigned char prot_op = scsi_get_prot_op(scmd); | 2858 | unsigned char prot_op = scsi_get_prot_op(scmd); |
2859 | unsigned char prot_type = scsi_get_prot_type(scmd); | 2859 | unsigned char prot_type = scsi_get_prot_type(scmd); |
2860 | 2860 | ||
2861 | if (prot_type == SCSI_PROT_DIF_TYPE0 || | 2861 | if (prot_type == SCSI_PROT_DIF_TYPE0 || prot_op == SCSI_PROT_NORMAL) |
2862 | prot_type == SCSI_PROT_DIF_TYPE2 || | ||
2863 | prot_op == SCSI_PROT_NORMAL) | ||
2864 | return; | 2862 | return; |
2865 | 2863 | ||
2866 | if (prot_op == SCSI_PROT_READ_STRIP) | 2864 | if (prot_op == SCSI_PROT_READ_STRIP) |
@@ -2882,7 +2880,13 @@ _scsih_setup_eedp(struct scsi_cmnd *scmd, Mpi2SCSIIORequest_t *mpi_request) | |||
2882 | MPI2_SCSIIO_EEDPFLAGS_CHECK_GUARD; | 2880 | MPI2_SCSIIO_EEDPFLAGS_CHECK_GUARD; |
2883 | mpi_request->CDB.EEDP32.PrimaryReferenceTag = | 2881 | mpi_request->CDB.EEDP32.PrimaryReferenceTag = |
2884 | cpu_to_be32(scsi_get_lba(scmd)); | 2882 | cpu_to_be32(scsi_get_lba(scmd)); |
2883 | break; | ||
2884 | |||
2885 | case SCSI_PROT_DIF_TYPE2: | ||
2885 | 2886 | ||
2887 | eedp_flags |= MPI2_SCSIIO_EEDPFLAGS_INC_PRI_REFTAG | | ||
2888 | MPI2_SCSIIO_EEDPFLAGS_CHECK_REFTAG | | ||
2889 | MPI2_SCSIIO_EEDPFLAGS_CHECK_GUARD; | ||
2886 | break; | 2890 | break; |
2887 | 2891 | ||
2888 | case SCSI_PROT_DIF_TYPE3: | 2892 | case SCSI_PROT_DIF_TYPE3: |
@@ -3013,7 +3017,7 @@ _scsih_qcmd(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *)) | |||
3013 | mpi_control |= MPI2_SCSIIO_CONTROL_SIMPLEQ; | 3017 | mpi_control |= MPI2_SCSIIO_CONTROL_SIMPLEQ; |
3014 | /* Make sure Device is not raid volume */ | 3018 | /* Make sure Device is not raid volume */ |
3015 | if (!_scsih_is_raid(&scmd->device->sdev_gendev) && | 3019 | if (!_scsih_is_raid(&scmd->device->sdev_gendev) && |
3016 | sas_is_tlr_enabled(scmd->device)) | 3020 | sas_is_tlr_enabled(scmd->device) && scmd->cmd_len != 32) |
3017 | mpi_control |= MPI2_SCSIIO_CONTROL_TLR_ON; | 3021 | mpi_control |= MPI2_SCSIIO_CONTROL_TLR_ON; |
3018 | 3022 | ||
3019 | smid = mpt2sas_base_get_smid_scsiio(ioc, ioc->scsi_io_cb_idx, scmd); | 3023 | 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 | mpi_request = mpt2sas_base_get_msg_frame(ioc, smid); | 3029 | mpi_request = mpt2sas_base_get_msg_frame(ioc, smid); |
3026 | memset(mpi_request, 0, sizeof(Mpi2SCSIIORequest_t)); | 3030 | memset(mpi_request, 0, sizeof(Mpi2SCSIIORequest_t)); |
3027 | _scsih_setup_eedp(scmd, mpi_request); | 3031 | _scsih_setup_eedp(scmd, mpi_request); |
3032 | if (scmd->cmd_len == 32) | ||
3033 | mpi_control |= 4 << MPI2_SCSIIO_CONTROL_ADDCDBLEN_SHIFT; | ||
3028 | mpi_request->Function = MPI2_FUNCTION_SCSI_IO_REQUEST; | 3034 | mpi_request->Function = MPI2_FUNCTION_SCSI_IO_REQUEST; |
3029 | if (sas_device_priv_data->sas_target->flags & | 3035 | if (sas_device_priv_data->sas_target->flags & |
3030 | MPT_TARGET_FLAGS_RAID_COMPONENT) | 3036 | MPT_TARGET_FLAGS_RAID_COMPONENT) |
@@ -6567,7 +6573,7 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
6567 | INIT_LIST_HEAD(&ioc->delayed_tr_list); | 6573 | INIT_LIST_HEAD(&ioc->delayed_tr_list); |
6568 | 6574 | ||
6569 | /* init shost parameters */ | 6575 | /* init shost parameters */ |
6570 | shost->max_cmd_len = 16; | 6576 | shost->max_cmd_len = 32; |
6571 | shost->max_lun = max_lun; | 6577 | shost->max_lun = max_lun; |
6572 | shost->transportt = mpt2sas_transport_template; | 6578 | shost->transportt = mpt2sas_transport_template; |
6573 | shost->unique_id = ioc->id; | 6579 | shost->unique_id = ioc->id; |
@@ -6580,7 +6586,7 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
6580 | } | 6586 | } |
6581 | 6587 | ||
6582 | scsi_host_set_prot(shost, SHOST_DIF_TYPE1_PROTECTION | 6588 | scsi_host_set_prot(shost, SHOST_DIF_TYPE1_PROTECTION |
6583 | | SHOST_DIF_TYPE3_PROTECTION); | 6589 | | SHOST_DIF_TYPE2_PROTECTION | SHOST_DIF_TYPE3_PROTECTION); |
6584 | scsi_host_set_guard(shost, SHOST_DIX_GUARD_CRC); | 6590 | scsi_host_set_guard(shost, SHOST_DIX_GUARD_CRC); |
6585 | 6591 | ||
6586 | /* event thread */ | 6592 | /* event thread */ |