summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/f_mass_storage.c
diff options
context:
space:
mode:
authorEric Nelson <eric.nelson@boundarydevices.com>2014-09-19 17:06:46 -0700
committerMarek Vasut <marex@denx.de>2014-10-06 14:50:43 +0200
commitf9935c87b6c8e81ef8d621bd06d24a78eec8a821 (patch)
tree8cc214ce9396cae157e54714f2edc4c1c368e38e /drivers/usb/gadget/f_mass_storage.c
parentece91016c46b9945485b41f50589ea92f1f04ce1 (diff)
usb: f_mass_storage: set removable flag in do_inquiry based on LUN
Without this flag, tools like Alex Page's USB Image Tool won't see drives exposed over USB Gadget as removable, and won't allow access to them. http://www.alexpage.de/usb-image-tool/ The code was pulled from the main-line kernel: drivers/usb/gadget/function/f_mass_storage.c Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
Diffstat (limited to 'drivers/usb/gadget/f_mass_storage.c')
-rw-r--r--drivers/usb/gadget/f_mass_storage.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index f274d9679f..e045957d07 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -1110,6 +1110,7 @@ static int do_inquiry(struct fsg_common *common, struct fsg_buffhd *bh)
memset(buf, 0, 8);
buf[0] = TYPE_DISK;
+ buf[1] = curlun->removable ? 0x80 : 0;
buf[2] = 2; /* ANSI SCSI level 2 */
buf[3] = 2; /* SCSI-2 INQUIRY data format */
buf[4] = 31; /* Additional length */