Skip to contentSkip to conversation

3/6: allow host adapters to avoid REPORT_LUNS

PATCH New Kurt Garloff 1 participant 1 message Apr 18, 2004 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 3/6: allow host adapters to avoid REPORT_LUNS

Feature.

This patch introduces a field in the per SCSI host struct that allows host adapters to switch off the user of REPORT_LUNS during SCSI scanning. Some host adapters/devices may not cope with the way Linux maps the 8byte LUNS to a 32bit number and may provide their own mechanism. zfcp (S/390) is known to do this.

 drivers/scsi/scsi_scan.c |    1 +
 include/scsi/scsi_host.h |    6 ++++++
 2 files changed, 7 insertions(+)
drivers/scsi/scsi_scan.c +1 -0
diff -uNrp linux-2.6.5.replun2/drivers/scsi/scsi_scan.c linux-2.6.5.noreplunhost/drivers/scsi/scsi_scan.c
@@ -951,6 +951,7 @@ static int scsi_report_lun_scan(struct s
 	 */
 	
 	if ( scsi_noreportlun ||
+	     sdev->host->no_reportlun ||
 	     sdev->scsi_level < SCSI_2 || 
 	    (sdev->scsi_level < SCSI_3 &&
 	     (!scsi_reportlun2 || sdev->host->max_lun <= 8)))

Files linux-2.6.5.replun2/drivers/scsi/.scsi_scan.c.swp and linux-2.6.5.noreplunhost/drivers/scsi/.scsi_scan.c.swp differ

include/scsi/scsi_host.h +6 -0
diff -uNrp linux-2.6.5.replun2/include/scsi/scsi_host.h linux-2.6.5.noreplunhost/include/scsi/scsi_host.h
@@ -459,6 +459,12 @@ struct Scsi_Host {
 	unsigned reverse_ordering:1;
 
 	/*
+	 * True for host adapters that dislike REPORT_LUN as they
+	 * use a different mapping of 8byte LUNs to (long) integers
+	 */
+	unsigned no_reportlun:1;
+
+	/*
 	 * Host has rejected a command because it was busy.
 	 */
 	unsigned int host_blocked;

Files linux-2.6.5.replun2/include/scsi/.scsi_host.h.swp and linux-2.6.5.noreplunhost/include/scsi/.scsi_host.h.swp differ

Signature · 2 lines
Kurt Garloff  <[email protected]>                            Cologne, DE 
SUSE LINUX AG, Nuernberg, DE                          SUSE Labs (Head)