summaryrefslogtreecommitdiffstats
path: root/include/scsi/scsi_device.h
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@HansenPartnership.com>2008-01-20 16:09:40 +0100
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-01-23 18:29:35 +0100
commitb30c2fc1113edfb2371427c10503ff942b0a0370 (patch)
tree1eb6f1c83f44bcd12e254a544eff20b3da9dc996 /include/scsi/scsi_device.h
parent[SCSI] sd: add fix for devices with last sector access problems (diff)
downloadlinux-b30c2fc1113edfb2371427c10503ff942b0a0370.tar.xz
linux-b30c2fc1113edfb2371427c10503ff942b0a0370.zip
[SCSI] scsi.h: add macro for enclosure bit of inquiry data
The macro tells us whether the device is (or contains) an enclosure device. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'include/scsi/scsi_device.h')
-rw-r--r--include/scsi/scsi_device.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 3c8f898b160e..ab7acbe80960 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -387,6 +387,10 @@ static inline int scsi_device_qas(struct scsi_device *sdev)
return 0;
return sdev->inquiry[56] & 0x02;
}
+static inline int scsi_device_enclosure(struct scsi_device *sdev)
+{
+ return sdev->inquiry[6] & (1<<6);
+}
#define MODULE_ALIAS_SCSI_DEVICE(type) \
MODULE_ALIAS("scsi:t-" __stringify(type) "*")