|
@@ -1263,7 +1263,19 @@ void scsi_sysfs_device_initialize(struct scsi_device *sdev)
|
|
sdev->sdev_dev.class = &sdev_class;
|
|
sdev->sdev_dev.class = &sdev_class;
|
|
dev_set_name(&sdev->sdev_dev, "%d:%d:%d:%llu",
|
|
dev_set_name(&sdev->sdev_dev, "%d:%d:%d:%llu",
|
|
sdev->host->host_no, sdev->channel, sdev->id, sdev->lun);
|
|
sdev->host->host_no, sdev->channel, sdev->id, sdev->lun);
|
|
|
|
+ /*
|
|
|
|
+ * Get a default scsi_level from the target (derived from sibling
|
|
|
|
+ * devices). This is the best we can do for guessing how to set
|
|
|
|
+ * sdev->lun_in_cdb for the initial INQUIRY command. For LUN 0 the
|
|
|
|
+ * setting doesn't matter, because all the bits are zero anyway.
|
|
|
|
+ * But it does matter for higher LUNs.
|
|
|
|
+ */
|
|
sdev->scsi_level = starget->scsi_level;
|
|
sdev->scsi_level = starget->scsi_level;
|
|
|
|
+ if (sdev->scsi_level <= SCSI_2 &&
|
|
|
|
+ sdev->scsi_level != SCSI_UNKNOWN &&
|
|
|
|
+ !shost->no_scsi2_lun_in_cdb)
|
|
|
|
+ sdev->lun_in_cdb = 1;
|
|
|
|
+
|
|
transport_setup_device(&sdev->sdev_gendev);
|
|
transport_setup_device(&sdev->sdev_gendev);
|
|
spin_lock_irqsave(shost->host_lock, flags);
|
|
spin_lock_irqsave(shost->host_lock, flags);
|
|
list_add_tail(&sdev->same_target_siblings, &starget->devices);
|
|
list_add_tail(&sdev->same_target_siblings, &starget->devices);
|