Merge tag 'xtensa-next-20121008' of git://github.com/czankel/xtensa-linux
[firefly-linux-kernel-4.4.55.git] / include / scsi / scsi_device.h
index 9895f69294fc4a65113f3368155f087e86d42807..88fae8d2015471885972da8407d0077106b527cc 100644 (file)
@@ -156,6 +156,7 @@ struct scsi_device {
        unsigned is_visible:1;  /* is the device visible in sysfs */
        unsigned can_power_off:1; /* Device supports runtime power off */
        unsigned wce_default_on:1;      /* Cache is ON by default */
+       unsigned no_dif:1;      /* T10 PI (DIF) should be disabled */
 
        DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */
        struct list_head event_list;    /* asserted events */
@@ -476,6 +477,9 @@ static inline int scsi_device_enclosure(struct scsi_device *sdev)
 
 static inline int scsi_device_protection(struct scsi_device *sdev)
 {
+       if (sdev->no_dif)
+               return 0;
+
        return sdev->scsi_level > SCSI_2 && sdev->inquiry[5] & (1<<0);
 }