diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2012-01-10 13:43:30 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-02-08 20:36:41 -0500 |
commit | 09b6b51b0b6c1b9bb61815baf205e4d74c89ff04 (patch) | |
tree | 03b7c55b764dc555b1d89528fac457a740f897c3 /include | |
parent | de8c46bfc032fbdf490cfb67f534d2a0188ebeb0 (diff) |
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/scsi/scsi_device.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 01cb3c4cb74d..b3a1c2daf6cc 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -136,6 +136,7 @@ struct scsi_device { | |||
136 | unsigned use_10_for_ms:1; /* first try 10-byte mode sense/select */ | 136 | unsigned use_10_for_ms:1; /* first try 10-byte mode sense/select */ |
137 | unsigned skip_ms_page_8:1; /* do not use MODE SENSE page 0x08 */ | 137 | unsigned skip_ms_page_8:1; /* do not use MODE SENSE page 0x08 */ |
138 | unsigned skip_ms_page_3f:1; /* do not use MODE SENSE page 0x3f */ | 138 | unsigned skip_ms_page_3f:1; /* do not use MODE SENSE page 0x3f */ |
139 | unsigned skip_vpd_pages:1; /* do not read VPD pages */ | ||
139 | unsigned use_192_bytes_for_3f:1; /* ask for 192 bytes from page 0x3f */ | 140 | unsigned use_192_bytes_for_3f:1; /* ask for 192 bytes from page 0x3f */ |
140 | unsigned no_start_on_add:1; /* do not issue start on add */ | 141 | unsigned no_start_on_add:1; /* do not issue start on add */ |
141 | unsigned allow_restart:1; /* issue START_UNIT in error handler */ | 142 | unsigned allow_restart:1; /* issue START_UNIT in error handler */ |
@@ -248,6 +249,8 @@ struct scsi_target { | |||
248 | * for the device at a time. */ | 249 | * for the device at a time. */ |
249 | unsigned int pdt_1f_for_no_lun:1; /* PDT = 0x1f | 250 | unsigned int pdt_1f_for_no_lun:1; /* PDT = 0x1f |
250 | * means no lun present. */ | 251 | * means no lun present. */ |
252 | unsigned int no_report_luns:1; /* Don't use | ||
253 | * REPORT LUNS for scanning. */ | ||
251 | /* commands actually active on LLD. protected by host lock. */ | 254 | /* commands actually active on LLD. protected by host lock. */ |
252 | unsigned int target_busy; | 255 | unsigned int target_busy; |
253 | /* | 256 | /* |