From 470dbf9b5f9f0176640fde6b8c4c51c5b7e4c5a3 Mon Sep 17 00:00:00 2001 From: Kurt Garloff Date: Mon, 3 Apr 2006 15:18:35 +0200 Subject: [PATCH] --- yaml --- r: 28151 b: refs/heads/master c: 6c7154c97e20c0ea28547240dc86731c0cee1b2f h: refs/heads/master i: 28149: fc7e419278a8ee5296c913dea62154ae2591808a 28147: 70fd2818ef87176c374b70c1a35323ac64f02a0e 28143: 1a5b3f91b54e7fb8df5457d06c829550be4abf1c v: v3 --- [refs] | 2 +- trunk/drivers/scsi/scsi_scan.c | 38 +++++++++++++++++++++++++++++++--- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 9de5abe6e820..a452c60f08c5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4186ab1973758190916703eb8889ebe8002c5c8f +refs/heads/master: 6c7154c97e20c0ea28547240dc86731c0cee1b2f diff --git a/trunk/drivers/scsi/scsi_scan.c b/trunk/drivers/scsi/scsi_scan.c index 820c4ad7b581..5603dc6eca47 100644 --- a/trunk/drivers/scsi/scsi_scan.c +++ b/trunk/drivers/scsi/scsi_scan.c @@ -808,6 +808,29 @@ static inline void scsi_destroy_sdev(struct scsi_device *sdev) put_device(&sdev->sdev_gendev); } +/** + * scsi_inq_str - print INQUIRY data from min to max index, + * strip trailing whitespace + * @buf: Output buffer with at least end-first+1 bytes of space + * @inq: Inquiry buffer (input) + * @first: Offset of string into inq + * @end: Index after last character in inq + */ +static unsigned char* scsi_inq_str(unsigned char* buf, unsigned char *inq, + unsigned first, unsigned end) +{ + unsigned term = 0, idx; + for (idx = 0; idx+first < end && idx+first < inq[4]+5; ++idx) { + if (inq[idx+first] > 0x20) { + buf[idx] = inq[idx+first]; + term = idx+1; + } else { + buf[idx] = ' '; + } + } + buf[term] = 0; + return buf; +} /** * scsi_probe_and_add_lun - probe a LUN, if a LUN is found add it @@ -888,9 +911,18 @@ static int scsi_probe_and_add_lun(struct scsi_target *starget, * logical disk configured at sdev->lun, but there * is a target id responding. */ - SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO - "scsi scan: peripheral qualifier of 3," - " no device added\n")); + SCSI_LOG_SCAN_BUS(2, sdev_printk(KERN_INFO, sdev, "scsi scan:" + " peripheral qualifier of 3, device not" + " added\n")) + if (lun == 0) { + unsigned char vend[9], mod[17]; + SCSI_LOG_SCAN_BUS(1, sdev_printk(KERN_INFO, sdev, + "scsi scan: consider passing scsi_mod." + "dev_flags=%s:%s:0x240 or 0x800240\n", + scsi_inq_str(vend, result, 8, 16), + scsi_inq_str(mod, result, 16, 32))); + } + res = SCSI_SCAN_TARGET_PRESENT; goto out_free_result; }