diff options
author | Martin K. Petersen <martin.petersen@oracle.com> | 2009-09-18 17:33:00 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-10-02 10:46:39 -0400 |
commit | 35e1a5d90b66487d754ef2f2dcbf1007f806d921 (patch) | |
tree | 964511498993ed8fe0c1604ab74ac7a3db9361ba /include/scsi | |
parent | c6af404215bab0d333accbb497f835d10cb0050c (diff) |
[SCSI] sd: Detach DIF from block integrity infrastructure
So far we have only issued DIF commands if CONFIG_BLK_DEV_INTEGRITY is
enabled. However, communication between initiator and target should be
independent of protection information DMA. There are DIF-only host
adapters coming out that will be able to take advantage of this.
Move the relevant DIF bits to sd.c.
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'include/scsi')
-rw-r--r-- | include/scsi/scsi_host.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index b62a097b3ecb..6e728b176904 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
@@ -798,9 +798,15 @@ static inline unsigned int scsi_host_get_prot(struct Scsi_Host *shost) | |||
798 | static inline unsigned int scsi_host_dif_capable(struct Scsi_Host *shost, unsigned int target_type) | 798 | static inline unsigned int scsi_host_dif_capable(struct Scsi_Host *shost, unsigned int target_type) |
799 | { | 799 | { |
800 | switch (target_type) { | 800 | switch (target_type) { |
801 | case 1: return shost->prot_capabilities & SHOST_DIF_TYPE1_PROTECTION; | 801 | case 1: |
802 | case 2: return shost->prot_capabilities & SHOST_DIF_TYPE2_PROTECTION; | 802 | if (shost->prot_capabilities & SHOST_DIF_TYPE1_PROTECTION) |
803 | case 3: return shost->prot_capabilities & SHOST_DIF_TYPE3_PROTECTION; | 803 | return target_type; |
804 | case 2: | ||
805 | if (shost->prot_capabilities & SHOST_DIF_TYPE2_PROTECTION) | ||
806 | return target_type; | ||
807 | case 3: | ||
808 | if (shost->prot_capabilities & SHOST_DIF_TYPE3_PROTECTION) | ||
809 | return target_type; | ||
804 | } | 810 | } |
805 | 811 | ||
806 | return 0; | 812 | return 0; |
@@ -808,13 +814,14 @@ static inline unsigned int scsi_host_dif_capable(struct Scsi_Host *shost, unsign | |||
808 | 814 | ||
809 | static inline unsigned int scsi_host_dix_capable(struct Scsi_Host *shost, unsigned int target_type) | 815 | static inline unsigned int scsi_host_dix_capable(struct Scsi_Host *shost, unsigned int target_type) |
810 | { | 816 | { |
817 | #if defined(CONFIG_BLK_DEV_INTEGRITY) | ||
811 | switch (target_type) { | 818 | switch (target_type) { |
812 | case 0: return shost->prot_capabilities & SHOST_DIX_TYPE0_PROTECTION; | 819 | case 0: return shost->prot_capabilities & SHOST_DIX_TYPE0_PROTECTION; |
813 | case 1: return shost->prot_capabilities & SHOST_DIX_TYPE1_PROTECTION; | 820 | case 1: return shost->prot_capabilities & SHOST_DIX_TYPE1_PROTECTION; |
814 | case 2: return shost->prot_capabilities & SHOST_DIX_TYPE2_PROTECTION; | 821 | case 2: return shost->prot_capabilities & SHOST_DIX_TYPE2_PROTECTION; |
815 | case 3: return shost->prot_capabilities & SHOST_DIX_TYPE3_PROTECTION; | 822 | case 3: return shost->prot_capabilities & SHOST_DIX_TYPE3_PROTECTION; |
816 | } | 823 | } |
817 | 824 | #endif | |
818 | return 0; | 825 | return 0; |
819 | } | 826 | } |
820 | 827 | ||