diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2006-02-09 15:26:18 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-02-28 00:24:09 -0500 |
commit | 1bfc5d9d5eb8e1a2efacc306bc55c248ed259a8e (patch) | |
tree | 503f6cd4f481e16db7c3b00326e07b0dca8942e8 | |
parent | 8cac814501677e9f6a824cf4d423122ac8d67fcb (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>
-rw-r--r-- | drivers/scsi/scsi_scan.c | 13 | ||||
-rw-r--r-- | include/scsi/scsi_device.h | 5 |
2 files changed, 17 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 803c7b9690c5..94b86d5b1469 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, | |||
853 | goto out_free_result; | 853 | goto out_free_result; |
854 | } | 854 | } |
855 | 855 | ||
856 | /* | ||
857 | * Non-standard SCSI targets may set the PDT to 0x1f (unknown or | ||
858 | * no device type) instead of using the Peripheral Qualifier to | ||
859 | * indicate that no LUN is present. For example, USB UFI does this. | ||
860 | */ | ||
861 | if (starget->pdt_1f_for_no_lun && (result[0] & 0x1f) == 0x1f) { | ||
862 | SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO | ||
863 | "scsi scan: peripheral device type" | ||
864 | " of 31, no device added\n")); | ||
865 | res = SCSI_SCAN_TARGET_PRESENT; | ||
866 | goto out_free_result; | ||
867 | } | ||
868 | |||
856 | res = scsi_add_lun(sdev, result, &bflags); | 869 | res = scsi_add_lun(sdev, result, &bflags); |
857 | if (res == SCSI_SCAN_LUN_PRESENT) { | 870 | if (res == SCSI_SCAN_LUN_PRESENT) { |
858 | if (bflags & BLIST_KEY) { | 871 | if (bflags & BLIST_KEY) { |
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index cde84b39bb65..8d77da932d2c 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -167,7 +167,10 @@ struct scsi_target { | |||
167 | unsigned int channel; | 167 | unsigned int channel; |
168 | unsigned int id; /* target id ... replace | 168 | unsigned int id; /* target id ... replace |
169 | * scsi_device.id eventually */ | 169 | * scsi_device.id eventually */ |
170 | unsigned long create:1; /* signal that it needs to be added */ | 170 | unsigned int create:1; /* signal that it needs to be added */ |
171 | unsigned int pdt_1f_for_no_lun; /* PDT = 0x1f */ | ||
172 | /* means no lun present */ | ||
173 | |||
171 | char scsi_level; | 174 | char scsi_level; |
172 | void *hostdata; /* available to low-level driver */ | 175 | void *hostdata; /* available to low-level driver */ |
173 | unsigned long starget_data[0]; /* for the transport */ | 176 | unsigned long starget_data[0]; /* for the transport */ |