瀏覽代碼

[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>
James Bottomley 17 年之前
父節點
當前提交
b30c2fc111
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      include/scsi/scsi_device.h

+ 4 - 0
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) "*")