mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 22:30:54 +07:00
usb-storage: fix for UFI LUN detection
The UFI specification doesn't permit devices to indicate non-existent LUNs in the manner prescribed by the SCSI spec. This patch (as773) sets a special flag so that the SCSI scanner will recognize these devices and treat them specially. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
e113f29c90
commit
3a3416b12f
@ -72,12 +72,27 @@ static const char* host_info(struct Scsi_Host *host)
|
|||||||
|
|
||||||
static int slave_alloc (struct scsi_device *sdev)
|
static int slave_alloc (struct scsi_device *sdev)
|
||||||
{
|
{
|
||||||
|
struct us_data *us = host_to_us(sdev->host);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set the INQUIRY transfer length to 36. We don't use any of
|
* Set the INQUIRY transfer length to 36. We don't use any of
|
||||||
* the extra data and many devices choke if asked for more or
|
* the extra data and many devices choke if asked for more or
|
||||||
* less than 36 bytes.
|
* less than 36 bytes.
|
||||||
*/
|
*/
|
||||||
sdev->inquiry_len = 36;
|
sdev->inquiry_len = 36;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The UFI spec treates the Peripheral Qualifier bits in an
|
||||||
|
* INQUIRY result as reserved and requires devices to set them
|
||||||
|
* to 0. However the SCSI spec requires these bits to be set
|
||||||
|
* to 3 to indicate when a LUN is not present.
|
||||||
|
*
|
||||||
|
* Let the scanning code know if this target merely sets
|
||||||
|
* Peripheral Device Type to 0x1f to indicate no LUN.
|
||||||
|
*/
|
||||||
|
if (us->subclass == US_SC_UFI)
|
||||||
|
sdev->sdev_target->pdt_1f_for_no_lun = 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user