Hi,
On 09/27/2010 11:06 PM, ext Brett Werling wrote:
Can you describe to me how I begin to build around g_mtp in order to
get an MTP responder up and running? It looks like I will just need
to read and write from specified file descriptors, however I'm unable
to determine if it is indeed that trivial. So far I have included to
the g_mtp patches into my working tree, and now I am unsure of how to
proceed. Can anyone give me guidance?
For a reference example see
http://meego.gitorious.org/meego-middleware/buteo-mtp/trees/master/mts/transport/usb
To summarize,
There is only one file descriptor for the MTP interface.
You have to use read/write/poll on the file.
supported IOCTLS are listed in include/linux/usb/ptp.h
You will get notification of events (e.g. RESET, CANCEL) via POLLPRI. Then use
the appropriate ioctl to read the event.
To signal end of data/response block (i.e. ZLP/SLP) you need to use fsync().
This is pretty much all you'll need to implement the responder.
--
regards,
-roger
--
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