Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6: [SCSI] bfa: declare MODULE_FIRMWARE [SCSI] gdth: Prevent negative offsets in ioctl CVE-2009-3080 [SCSI] libsas: do not set res = 0 in sas_ex_discover_dev() [SCSI] Fix incorrect reporting of host protection capabilities [SCSI] pmcraid: Fix ppc64 driver build for using cpu_to_le32 on U8 data type [SCSI] ipr: add workaround for MSI interrupts on P7 [SCSI] scsi_transport_fc: Fix WARN message for FC passthru failure paths [SCSI] bfa: fix test in bfad_os_fc_host_init()
This commit is contained in:
@@ -797,30 +797,23 @@ static inline unsigned int scsi_host_get_prot(struct Scsi_Host *shost)
|
||||
|
||||
static inline unsigned int scsi_host_dif_capable(struct Scsi_Host *shost, unsigned int target_type)
|
||||
{
|
||||
switch (target_type) {
|
||||
case 1:
|
||||
if (shost->prot_capabilities & SHOST_DIF_TYPE1_PROTECTION)
|
||||
return target_type;
|
||||
case 2:
|
||||
if (shost->prot_capabilities & SHOST_DIF_TYPE2_PROTECTION)
|
||||
return target_type;
|
||||
case 3:
|
||||
if (shost->prot_capabilities & SHOST_DIF_TYPE3_PROTECTION)
|
||||
return target_type;
|
||||
}
|
||||
static unsigned char cap[] = { 0,
|
||||
SHOST_DIF_TYPE1_PROTECTION,
|
||||
SHOST_DIF_TYPE2_PROTECTION,
|
||||
SHOST_DIF_TYPE3_PROTECTION };
|
||||
|
||||
return 0;
|
||||
return shost->prot_capabilities & cap[target_type] ? target_type : 0;
|
||||
}
|
||||
|
||||
static inline unsigned int scsi_host_dix_capable(struct Scsi_Host *shost, unsigned int target_type)
|
||||
{
|
||||
#if defined(CONFIG_BLK_DEV_INTEGRITY)
|
||||
switch (target_type) {
|
||||
case 0: return shost->prot_capabilities & SHOST_DIX_TYPE0_PROTECTION;
|
||||
case 1: return shost->prot_capabilities & SHOST_DIX_TYPE1_PROTECTION;
|
||||
case 2: return shost->prot_capabilities & SHOST_DIX_TYPE2_PROTECTION;
|
||||
case 3: return shost->prot_capabilities & SHOST_DIX_TYPE3_PROTECTION;
|
||||
}
|
||||
static unsigned char cap[] = { SHOST_DIX_TYPE0_PROTECTION,
|
||||
SHOST_DIX_TYPE1_PROTECTION,
|
||||
SHOST_DIX_TYPE2_PROTECTION,
|
||||
SHOST_DIX_TYPE3_PROTECTION };
|
||||
|
||||
return shost->prot_capabilities & cap[target_type];
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user