Skip to contentSkip to conversation

usb: f_mass_storage: set removable flag in do_inquiry based on LUN

PATCH New Eric Nelson 3 participants 5 messages Sep 20, 2014 – Sep 22, 2014 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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

---

 drivers/usb/gadget/f_mass_storage.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/gadget/f_mass_storage.c +1 -0
index f274d96..e045957 100644
@@ -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 */
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 usb: f_mass_storage: set removable flag in do_inquiry based on LUN

Quoted 9 lines · Eric Nelson

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

I'm OK with this. This should go to current release too. Lukasz, do you agree ? Do you want to pick it + send me PR or shall I apply directly ?

Eric, please CC Lukasz on the gadget patches, he's the gadget guru.

Best regards,
Marek Vasut

#2 lore raw

PATCH 1/1 usb: f_mass_storage: set removable flag in do_inquiry based on LUN

Hi Marek, Eric

Quoted 9 lines · Eric Nelson
Quoted 8 lines

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

Quoted 7 lines
Quoted 1 line

I'm OK with this. This should go to current release too. Lukasz, do you agree ? Do you want to pick it + send me PR or shall I apply directly ?

Eric, please CC Lukasz on the gadget patches, he's the gadget guru.

I will do my best to look into those patches today or tomorrow.

Quoted 3 lines

Best regards,
Marek Vasut

Signature · 5 lines
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
#3 lore raw

PATCH 1/1 usb: f_mass_storage: set removable flag in do_inquiry based on LUN

In reply to Marek Vasut

Hi Marek,

Quoted 6 lines · Eric Nelson
Quoted 5 lines

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/

Quoted 8 lines
Quoted 4 lines

The code was pulled from the main-line kernel:
drivers/usb/gadget/function/f_mass_storage.c

I'm OK with this. This should go to current release too. Lukasz, do you agree ? Do you want to pick it + send me PR or shall I apply directly ?

Eric thanks for your patch.

Test HW (Trats - Exynos 4210)

I've applied this patch to u-boot-dfu branch.

I will send PR to Marek in a few days time.

Quoted 5 lines

Eric, please CC Lukasz on the gadget patches, he's the gadget guru.

Best regards,
Marek Vasut

Signature · 5 lines
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
#4 lore raw

PATCH 1/1 usb: f_mass_storage: set removable flag in do_inquiry based on LUN

Quoted 19 lines · Lukasz Majewski

Hi Marek,

Quoted 6 lines · Eric Nelson
Quoted 5 lines

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/

Quoted 8 lines
Quoted 4 lines

The code was pulled from the main-line kernel:
drivers/usb/gadget/function/f_mass_storage.c

I'm OK with this. This should go to current release too. Lukasz, do you agree ? Do you want to pick it + send me PR or shall I apply directly ?

Eric thanks for your patch.

Quoted 9 lines

Test HW (Trats - Exynos 4210)

I've applied this patch to u-boot-dfu branch.

I will send PR to Marek in a few days time.

Thanks Lukasz and Marek.