aboutsummaryrefslogtreecommitdiff
path: root/drivers/scsi/scsi_scan.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2006-02-09 15:26:18 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-02-27 23:24:09 -0600
commit1bfc5d9d5eb8e1a2efacc306bc55c248ed259a8e (patch)
tree503f6cd4f481e16db7c3b00326e07b0dca8942e8 /drivers/scsi/scsi_scan.c
parent8cac814501677e9f6a824cf4d423122ac8d67fcb (diff)
[SCSI] Recognize missing LUNs for non-standard devices
Some non-standard SCSI targets or protocols, such as USB UFI, report "no LUN present" by setting the Peripheral Device Type to 0x1f and the Peripheral Qualifier to 0 (not 3 as the standard requires) in the INQUIRY response. This patch (as650b) adds a new target flag and code to accomodate such targets. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/scsi_scan.c')
-rw-r--r--drivers/scsi/scsi_scan.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 803c7b9690c..94b86d5b146 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -853,6 +853,19 @@ static int scsi_probe_and_add_lun(struct scsi_target *starget,
goto out_free_result;
}
+ /*
+ * Non-standard SCSI targets may set the PDT to 0x1f (unknown or
+ * no device type) instead of using the Peripheral Qualifier to
+ * indicate that no LUN is present. For example, USB UFI does this.
+ */
+ if (starget->pdt_1f_for_no_lun && (result[0] & 0x1f) == 0x1f) {
+ SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO
+ "scsi scan: peripheral device type"
+ " of 31, no device added\n"));
+ res = SCSI_SCAN_TARGET_PRESENT;
+ goto out_free_result;
+ }
+
res = scsi_add_lun(sdev, result, &bflags);
if (res == SCSI_SCAN_LUN_PRESENT) {
if (bflags & BLIST_KEY) {