Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 168695
b: refs/heads/master
c: b2b465e
h: refs/heads/master
i:
  168693: fa49f6b
  168691: 4a04988
  168687: d33f1fa
v: v3
  • Loading branch information
Martin K. Petersen authored and James Bottomley committed Nov 6, 2009
1 parent 24f7199 commit d1876c2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 88197966e1eeee6547764fa49bfce7e57549acd2
refs/heads/master: b2b465e9280b739a528435d2916c0a5c1b4eb100
29 changes: 11 additions & 18 deletions trunk/include/scsi/scsi_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit d1876c2

Please sign in to comment.