Re: g_mass_storage emulation of flash drive - difficulties with passing vendor/product ID

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

 



Hi,

Paul Zimmerman <pauldzim@xxxxxxxxx> writes:
>>>> > Did you try enabling verbose debugging in g_mass_storage?  This
>>>> > requires setting CONFIG_USB_GADGET_DEBUG and CONFIG_USB_GADGET_VERBOSE
>>>> > in the kernel configuration and then rebuilding g_mass_storage.ko.
>>>> > And at runtime you may need to enable dynamic debugging by doing
>>>> >
>>>> >         echo 'module g_mass_storage =p' >/sys/kernel/dynamic_debug/control
>>>> >
>>>> > before plugging the device into anything.  Then compare the contents of
>>>> > the dmesg log for the different scenarios.  In particular, look for
>>>> > differences between plugging it into System 2 (say) right after boot
>>>> > vs. after plugging it into System 1.
>>>>
>>>> OK interesting - I'll need to do some searching to understand how to
>>>> change that and rebuild g_mass_storage.ko but I like the idea of
>>>> seeing more detail about what is happening as the systems are closed
>>>> so I'm unable to do any troubleshooting at that end.
>>>
>>> Do you have any experience in building a kernel for the Raspberry Pi?
>>> The procedure is explained on several web sites, but you have to know
>>> what you're doing.
>>
>> No I don't - I'll have a read over things to see what I can suss out.
>
> The 'Linux File-Stor Gadget' string is part of the SCSI inquiry data, and
> is set by the fsg_common_set_inquiry_string() function in f_mass_storage.c.
> This must be what the problematic host systems are reacting to, and not any
> of the USB info that you have overridden. It looks like there is a way to
> override this string using configfs, perhaps Alan will know how to do this.

There should be a file named "inquiry_string" on mass storage's function
directory:

# find /c/usb_gadget/storage/functions/mass_storage.1/
/c/usb_gadget/storage/functions/mass_storage.1/
/c/usb_gadget/storage/functions/mass_storage.1/lun.0
/c/usb_gadget/storage/functions/mass_storage.1/lun.0/inquiry_string
/c/usb_gadget/storage/functions/mass_storage.1/lun.0/nofua
/c/usb_gadget/storage/functions/mass_storage.1/lun.0/cdrom
/c/usb_gadget/storage/functions/mass_storage.1/lun.0/removable
/c/usb_gadget/storage/functions/mass_storage.1/lun.0/ro
/c/usb_gadget/storage/functions/mass_storage.1/lun.0/file
/c/usb_gadget/storage/functions/mass_storage.1/stall

Just write your string to it:

# echo "My Inquiry String" > /c/usb_gadget/storage/functions/mass_storage.1/lun.0/inquiry_string

-- 
balbi

Attachment: signature.asc
Description: PGP signature


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

  Powered by Linux