Colleen Przybyla wrote:
Hello again,

I had written previously in regards to getting an embedded PXA255 chip
to work as a simulated USB mouse using the GadgetFS API.  I have been
able to properly alter the example usb.c code example from GadgetFS to
initialize properly as a USB mouse. ...

Good start. I suspect user mode is exactly the right place to start building some HID infrastructure, too!


After the device sends the HID report descriptor to the host, the device
is unable to perform any additional writes to fd.

The fragment of code you sent was trying to send two separate data stages for one control request. That's not going to work; write the control-IN response all at once. You already have a loop that's filling out the response data ... it can add more data.

Remember that all control responses are just going to be one read()
or write() system call.


I have tried
writing this buffer in numerous places of the code following the report
descriptor, and the write fails every time. The errno on the failure is
ESRCH = No such process.

If you look at the source to gadgetfs, you'll notice that's a response code used in a very few places. Two spots were initialization; you're well past those. The ep0_read() and ep0_write() paths were two others.

Given what you said, I'll guess this is in ep0_write().  I saw
this value getting returned on two paths, each with a different
debug message:

                } else {
                        DBG(dev, "bogus ep0out stall!\n");
                }
        } else
                DBG (dev, "fail %s, state %d\n", __FUNCTION__, dev->state);

You probably hit the second case: no control request was
pending, since the previous write() completed the response.
("No process was expecting that response!")


Try leaving debug messages on in gadgetfs for a while. Normally, only "interesting" paths like faults (and some initialization or shutdown actions) cause messages. Or there's "VERBOSE"...

- Dave





-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to