linux/include/scsi
Alan Stern 50c4e96411 scsi: don't store LUN bits in CDB[1] for USB mass-storage devices
The SCSI specification requires that the second Command Data Byte
should contain the LUN value in its high-order bits if the recipient
device reports SCSI level 2 or below.  Nevertheless, some USB
mass-storage devices use those bits for other purposes in
vendor-specific commands.  Currently Linux has no way to send such
commands, because the SCSI stack always overwrites the LUN bits.

Testing shows that Windows 7 and XP do not store the LUN bits in the
CDB when sending commands to a USB device.  This doesn't matter if the
device uses the Bulk-Only or UAS transports (which virtually all
modern USB mass-storage devices do), as these have a separate
mechanism for sending the LUN value.

Therefore this patch introduces a flag in the Scsi_Host structure to
inform the SCSI midlayer that a transport does not require the LUN
bits to be stored in the CDB, and it makes usb-storage set this flag
for all devices using the Bulk-Only transport.  (UAS is handled by a
separate driver, but it doesn't really matter because no SCSI-2 or
lower device is at all likely to use UAS.)

The patch also cleans up the code responsible for storing the LUN
value by adding a bitflag to the scsi_device structure.  The test for
whether to stick the LUN value in the CDB can be made when the device
is probed, and stored for future use rather than being made over and
over in the fast path.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Tiziano Bacocco <tiziano.bacocco@gmail.com>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Acked-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-09-15 16:01:58 -07:00
..
fc
fc_encode.h
fc_frame.h
fcoe_sysfs.h
iscsi_if.h libiscsi: return new error code when nop times out 2014-08-01 08:16:39 -04:00
iscsi_proto.h
libfc.h
libfcoe.h
libiscsi.h Main batch of InfiniBand/RDMA changes for 3.15: 2014-04-03 16:57:19 -07:00
libiscsi_tcp.h [SCSI] libiscsi: Reduce locking contention in fast path 2014-03-15 10:19:18 -07:00
libsas.h libata, libsas: kill pm_result and related cleanup 2014-03-18 16:08:38 -04:00
osd_attributes.h
osd_initiator.h
osd_ore.h
osd_protocol.h include/scsi/osd_protocol.h: remove unnecessary __constant 2014-06-02 10:36:27 +02:00
osd_sec.h
osd_sense.h
osd_types.h
sas.h
sas_ata.h
scsi.h lib/scatterlist: make ARCH_HAS_SG_CHAIN an actual Kconfig 2014-08-08 15:57:26 -07:00
scsi_bsg_iscsi.h
scsi_cmnd.h scsi: remove various exports that were only used by scsi_tgt 2014-07-17 22:07:45 +02:00
scsi_dbg.h
scsi_device.h scsi: don't store LUN bits in CDB[1] for USB mass-storage devices 2014-09-15 16:01:58 -07:00
scsi_devinfo.h scsi: do not issue SCSI RSOC command to Promise Vtrak E610f 2014-07-29 18:01:10 -04:00
scsi_dh.h
scsi_driver.h scsi: mark scsi_setup_blk_pc_cmnd static 2014-07-17 22:16:29 +02:00
scsi_eh.h
scsi_host.h scsi: don't store LUN bits in CDB[1] for USB mass-storage devices 2014-09-15 16:01:58 -07:00
scsi_ioctl.h
scsi_tcq.h scsi: fix regression that accidentally disabled block-based tcq 2014-09-15 14:11:20 -07:00
scsi_transport.h scsi: use 64-bit LUNs 2014-07-17 22:07:37 +02:00
scsi_transport_fc.h scsi: add defines for new FC port speeds. 2014-07-25 17:16:54 -04:00
scsi_transport_iscsi.h SCSI/libiscsi: Add check_protection callback for transports 2014-03-17 22:33:58 -07:00
scsi_transport_sas.h
scsi_transport_spi.h
scsi_transport_srp.h scsi_transport_srp: Fix two kernel-doc warnings 2014-03-24 10:05:30 -07:00
scsicam.h
sg.h Merge branch 'for-3.17/drivers' of git://git.kernel.dk/linux-block 2014-08-14 09:10:21 -06:00
srp.h