[PATCH 6/6] USB: ene_usb6250: turn off the Removable flag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In the ene_usb6250 sub-driver for usb-storage, the INQUIRY data
returned by the driver indicates that the device has removable media.
While this is technically correct (memory cards can be removed from
the reader), it is not useful because the device automatically
disconnects itself from the USB bus when no media is present.

In addition, the driver does not support the PREVENT-ALLOW MEDIUM
REMOVAL and START STOP UNIT commands, and this can cause
user-interface frameworks to get confused when the user asks for the
card to be removed or ejected.

This patch fixes the problem by changing the INQUIRY data to specify
non-removable media; in practice this value works much better.

Signed-off-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
Reported-and-tested-by: Andreas Hartmann <andihartmann@xxxxxxxxxxxxxxx>

---


[as1831]


 drivers/usb/storage/ene_ub6250.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: usb-4.x/drivers/usb/storage/ene_ub6250.c
===================================================================
--- usb-4.x.orig/drivers/usb/storage/ene_ub6250.c
+++ usb-4.x/drivers/usb/storage/ene_ub6250.c
@@ -603,7 +603,7 @@ static int do_scsi_request_sense(struct
 static int do_scsi_inquiry(struct us_data *us, struct scsi_cmnd *srb)
 {
 	unsigned char data_ptr[36] = {
-		0x00, 0x80, 0x02, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x55,
+		0x00, 0x00, 0x02, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x55,
 		0x53, 0x42, 0x32, 0x2E, 0x30, 0x20, 0x20, 0x43, 0x61,
 		0x72, 0x64, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x20,
 		0x20, 0x20, 0x20, 0x20, 0x20, 0x30, 0x31, 0x30, 0x30 };


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux