On Wed, 2 Jan 2013, Dan Clapp wrote: > As you suggested, to make things more up to date, I have switched to Fedora 17, > kernel 3.6.10-2. > > I have now successfully loaded the kernel modules > > udc-core > dummy_hcd > g_zero > > I am using libusb to read and try and do a IN/OUT transfer from the host side. > > I am successfully reading the enumeration, and can see the endpoint > configuration for the g_zero driver. But I am getting errors when I try and do > a bulk endpoint write and/or read. > > In troubleshooting, I noticed the following error code output when I load the > gadget g_zero module (output from dmesg): > > [5104.4532] dummy_udc dummy_udc: enabled ep-a (ep1in-bulk) maxpacket 512 stream > disabled > [5104.4532] dummy_udc dummy_udc: enabled ep-b (ep2out-builk) maxpacket 512 > stream disabled > [5104.4532] gadget: source/sink enabled, alt intf 0 > [5104.4824] dummy_dc dummy_udc: setup--> -22 > > Is this error -22 an issue, and if so, what could cause it? Yes, it is an error. It could be caused by a bug in a driver or a bug in your program. Have you tried using usbmon to debug your program? See Documentation/usb/usbmon.txt. > I can read the enumeration with libusb calls: > > Number of possible configurations: 2 Device Class: 255 VendorID: 1317 > ProductID: 42144 > Interfaces: 1 ||| Number of alternate settings: 2 | Interface Number: 0 | > Number of endpoints: 2 | Descriptor Type: 5 | EP Address: 129 | > Descriptor Type: 5 | EP Address: 2 | Interface Number: 0 | > Number of endpoints: 4 | Descriptor Type: 5 | EP Address: 129 | > Descriptor Type: 5 | EP Address: 2 | Descriptor Type: 5 | > EP Address: 131 | Descriptor Type: 5 | EP Address: 4 | > > When I write to EP 2 I get an error is dmesg > > [ 9421.189601] gadget: bad OUT byte, buf[0] = 97 > > where I am sending four bytes "abcd", so I am getting an error on the first byte. You need to know how the gadget works before you can use it. g_zero has several parameters; one of them is named "pattern". If pattern is 0 then g_zero expects the data you send it to consist entirely of 0's; if pattern is 1 then g_zero expects the data you send it to be equal to (i % 63) in byte i; if pattern is 2 then g_zero accepts any data. 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