On 10/01/2010 06:04 PM, ext Brett Werling wrote:
Please excuse my inexperience, but I'm afraid I've run into some
issues when attempting to use the file descriptor.
i'll be glad to help.
The first order of business as I see it is to respond to
"GetDeviceInfo", correct? I assume that means I should be able to open
the fd and either read the appropriate GetDeviceInfo operation code or
just write the DeviceInfo dataset to the fd.
the responder should always wait for a command block (that will come through a
read operation) and then respond via a data block (either read or write
depending on the direction of data flow), followed by a response block.
I am able to successfully open "/dev/gc0", however all attempts to
read, write, or poll simply hang. I have scaled back my implementation
to simply get a successful read or write to the fd, but I'm wondering
if I have missed a few steps.
Did you connect the device to the host? did it enumerate correctly there. Reads
and writes will block till there is an MTP initiator on the host side which is
sending commands and sending/receiving data and response packets.
The IOTCLS listed in the "ptp.h" file of buteo-mtp do not correspond
completely with those in the original g_mtp patches that I found. Is
it possible I am missing some key IOCTLS?
Yes you are most likely missing the recent version of the gadget driver. We will
push in the latest version for review by today or tomorrow.
If you have any suggestions for me or resources to point me to, I
would greatly appreciate it. I do not wish to waste anyone's time,
however understanding how I am supposed to successfully interact with
the fd really seems key to me in order to implement this responder
without QT dependency.
You should read the PTP spec PIMA15740, especially the chapter "USB
Implementation of PIMA15740" and of course the MTPv1.0 spec on usb.org
You should use some kind of USB sniffer/analyzer which will help a lot while
debugging.
some more pointers related to the gadget driver.
- All bulk in/out transactions will be done via fd read/write.
- MTP_IOCTL_WRITE_ON_INTERRUPT_EP is used to write to the INT endpoint.
- Events received over control endpoint are notified via POLLPRI and must be
read via MTP_IOCTL_GET_CONTROL_REQ
--
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