Re: file_storage.c vs f_mass_storage.c - why some devices cannot see storage that uses f_mass_storage.c

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

 



On Sun, 12 Sep 2010, Zachary Burke wrote:

> This may be a lengthy post, before I get into details, I will pose my question:
> Q. What tools can I use to determine why a closed host cannot see a
> linux-based mass storage peripheral that is implemented with
> f_mass_storage.c?

The quickest approach is to plug the peripheral into an open host, find
out what happens, and then try to extrapolate the result to the closed
host.

A more precise approach, although more expensive and time consuming, is 
to use a USB bus analyzer.

> BACKGROUND:
> I am attempting to use the Palm Pre (WebOS) phone as a mass storage
> device for the Xbox 360.  Like Android-based devices, WebOS uses
> f_mass_storage.c (based on file_storage.c) to implement mass storage
> functionality using the bulk-only transport protocol.
> 
> The Xbox 360 is a closed device - no access to logs, drivers, etc.
> The Palm Pre is open with full access to the kernel/module source.
> 
> WHAT WORKS/WHAT DOESN'T:
> When I use f_mass_storage.c, the Xbox does not see the device.  When I
> use file_storage.c, the Xbox can see and use the device.
> 
> WHERE I'VE BEEN:
> Product/Vendor id - Thinking that perhaps the Xbox was blocking based
> on these, I found a working USB storage device and made the Palm Pre
> look identical to it.  This is not the issue.
> 
> usbmon - I have snooped traffic on the Palm Pre while using both
> f_mass_storage.c and file_storage.c, the results are identical both
> for the control requests and the return values.  In the interest of
> verbosity, I will omit these results, if you are interested they can
> be seen here:
> http://mobilecoder.wordpress.com/2010/09/12/using-the-palm-pre-as-xbox-360-storage-part-2/

usbmon on the Palm Pre won't do any good.  It reports only on data sent 
through host controllers, not data sent through device controllers.

What you need to do is attach the Palm Pre to a Linux host and run 
usbmon on the host.  Compare the results for f_mass_storage and 
g_file_storage on the Palm.

> If there is anyone familiar with these two modules that might know why
> one works while the other does not, I am eager to hear why.
> Recommendations for tools and documents for further study are also
> greatly appreciated.

Probably this has nothing to do with the internal design of those 
drivers but rather with the environment in which they run.  
g_file_storage is standalone whereas f_mass_storage works as part of 
the composite-gadget framework.  I'd guess that's the reason for the 
difference.

Alan Stern

--
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