Commit f9935c87b6c8e81ef8d621bd06d24a78eec8a821

Authored by Eric Nelson
Committed by Marek Vasut
1 parent ece91016c4

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>

Showing 1 changed file with 1 additions and 0 deletions Side-by-side Diff

drivers/usb/gadget/f_mass_storage.c
... ... @@ -1110,6 +1110,7 @@
1110 1110  
1111 1111 memset(buf, 0, 8);
1112 1112 buf[0] = TYPE_DISK;
  1113 + buf[1] = curlun->removable ? 0x80 : 0;
1113 1114 buf[2] = 2; /* ANSI SCSI level 2 */
1114 1115 buf[3] = 2; /* SCSI-2 INQUIRY data format */
1115 1116 buf[4] = 31; /* Additional length */