From bc657af963925bb681ca8498c469b6f02b563c15 Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Thu, 21 Aug 2008 15:14:14 -0500 Subject: [PATCH] --- yaml --- r: 109775 b: refs/heads/master c: 01b291bd66564b4bd826326af6bd0b6d17e99439 h: refs/heads/master i: 109773: dfb2240adebc1b9375f9e825fdc8e04d92ea7502 109771: b1169ad9e93d750de7a559f4dc5419af83a33f46 109767: 2894bdb04510112f83ccda74da6c01ae8a60948d 109759: b8133a3157f9298a42478f8148d62372eedb2076 v: v3 --- [refs] | 2 +- trunk/drivers/scsi/scsi_scan.c | 3 ++- trunk/include/scsi/scsi.h | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 96dfd0bafa5c..d035e6b66eda 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: bb0003c1e189d5766b6b39299b08c690c985c4dc +refs/heads/master: 01b291bd66564b4bd826326af6bd0b6d17e99439 diff --git a/trunk/drivers/scsi/scsi_scan.c b/trunk/drivers/scsi/scsi_scan.c index 84b4879cff11..34d0de6cd511 100644 --- a/trunk/drivers/scsi/scsi_scan.c +++ b/trunk/drivers/scsi/scsi_scan.c @@ -1080,7 +1080,8 @@ static int scsi_probe_and_add_lun(struct scsi_target *starget, * PDT=1Fh none (no FDD connected to the requested logical unit) */ if (((result[0] >> 5) == 1 || starget->pdt_1f_for_no_lun) && - (result[0] & 0x1f) == 0x1f) { + (result[0] & 0x1f) == 0x1f && + !scsi_is_wlun(lun)) { SCSI_LOG_SCAN_BUS(3, printk(KERN_INFO "scsi scan: peripheral device type" " of 31, no device added\n")); diff --git a/trunk/include/scsi/scsi.h b/trunk/include/scsi/scsi.h index 5c40cc537d4c..192f8716aa9e 100644 --- a/trunk/include/scsi/scsi.h +++ b/trunk/include/scsi/scsi.h @@ -308,6 +308,20 @@ struct scsi_lun { __u8 scsi_lun[8]; }; +/* + * The Well Known LUNS (SAM-3) in our int representation of a LUN + */ +#define SCSI_W_LUN_BASE 0xc100 +#define SCSI_W_LUN_REPORT_LUNS (SCSI_W_LUN_BASE + 1) +#define SCSI_W_LUN_ACCESS_CONTROL (SCSI_W_LUN_BASE + 2) +#define SCSI_W_LUN_TARGET_LOG_PAGE (SCSI_W_LUN_BASE + 3) + +static inline int scsi_is_wlun(unsigned int lun) +{ + return (lun & 0xff00) == SCSI_W_LUN_BASE; +} + + /* * MESSAGE CODES */