mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 15:27:29 +00:00
SCSI & usb-storage: add flags for VPD pages and REPORT LUNS
This patch (as1507) adds a skip_vpd_pages flag to struct scsi_device and a no_report_luns flag to struct scsi_target. The first is used to control whether sd will look at VPD pages for information on block provisioning, limits, and characteristics. The second prevents scsi_report_lun_scan() from issuing a REPORT LUNS command. The patch also modifies usb-storage to set the new flag bits for all USB devices and targets, and to stop adjusting the scsi_level value. Historically we have seen that USB mass-storage devices often don't support VPD pages or REPORT LUNS properly. Until now we have avoided these things by setting the scsi_level to SCSI_2 for all USB devices. But this has the side effect of storing the LUN bits into the second byte of each CDB, and now we have a report of a device which doesn't like that. The best solution is to stop abusing scsi_level and instead have separate flags for VPD pages and REPORT LUNS. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Reported-by: Perry Wagle <wagle@mac.com> CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
de8c46bfc0
commit
09b6b51b0b
4 changed files with 24 additions and 11 deletions
|
@ -1295,6 +1295,7 @@ EXPORT_SYMBOL(int_to_scsilun);
|
|||
* LUNs even if it's older than SCSI-3.
|
||||
* If BLIST_NOREPORTLUN is set, return 1 always.
|
||||
* If BLIST_NOLUN is set, return 0 always.
|
||||
* If starget->no_report_luns is set, return 1 always.
|
||||
*
|
||||
* Return:
|
||||
* 0: scan completed (or no memory, so further scanning is futile)
|
||||
|
@ -1321,6 +1322,7 @@ static int scsi_report_lun_scan(struct scsi_target *starget, int bflags,
|
|||
* Only support SCSI-3 and up devices if BLIST_NOREPORTLUN is not set.
|
||||
* Also allow SCSI-2 if BLIST_REPORTLUN2 is set and host adapter does
|
||||
* support more than 8 LUNs.
|
||||
* Don't attempt if the target doesn't support REPORT LUNS.
|
||||
*/
|
||||
if (bflags & BLIST_NOREPORTLUN)
|
||||
return 1;
|
||||
|
@ -1332,6 +1334,8 @@ static int scsi_report_lun_scan(struct scsi_target *starget, int bflags,
|
|||
return 1;
|
||||
if (bflags & BLIST_NOLUN)
|
||||
return 0;
|
||||
if (starget->no_report_luns)
|
||||
return 1;
|
||||
|
||||
if (!(sdev = scsi_device_lookup_by_target(starget, 0))) {
|
||||
sdev = scsi_alloc_sdev(starget, 0, NULL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue