linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Recognize missing LUNs for non-standard devices
@ 2006-02-06 21:59 Alan Stern
  2006-02-06 22:55 ` Brian King
  0 siblings, 1 reply; 9+ messages in thread
From: Alan Stern @ 2006-02-06 21:59 UTC (permalink / raw)
  To: James Bottomley; +Cc: SCSI development list

Some protocols (like USB UFI) or devices that don't adhere to the SCSI
standard may indicate a nonexistent LUN by returning INQUIRY information
with Peripheral Device Type set to 0x1f (unknown or none) and Peripheral
Qualifier set to 0 instead of 3 as the spec requires.  This patch (as650)
causes PDT = 0x1f to be recognized as no LUN present regardless of the
qualifier value, if the SCSI level is equal to 0.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>

---
James:

Since nobody objected when I proposed this last week, I'm now submitting 
it as a real patch.

Alan Stern


Index: usb-2.6/drivers/scsi/scsi_scan.c
===================================================================
--- usb-2.6.orig/drivers/scsi/scsi_scan.c
+++ usb-2.6/drivers/scsi/scsi_scan.c
@@ -873,6 +873,19 @@ static int scsi_probe_and_add_lun(struct
 		goto out_free_result;
 	}
 
+	/*
+	 * Non-standard SCSI devices 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 (sdev->scsi_level == 0 && (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) {


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2006-02-09 20:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-06 21:59 [PATCH] Recognize missing LUNs for non-standard devices Alan Stern
2006-02-06 22:55 ` Brian King
2006-02-07 14:53   ` Alan Stern
2006-02-07 15:16     ` Brian King
2006-02-07 15:29       ` Alan Stern
2006-02-07 15:40         ` Brian King
2006-02-09 20:26           ` Alan Stern
2006-02-07 20:44         ` David Wysochanski
2006-02-07 21:22           ` Alan Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).