On Sat, 8 Apr 2006, ashili wrote: > I am able submit URBs for bulk out and bulk in > endpoints for sending & recieving data from USB device > (which is Net2280 for now); but I am seeing the > following limitation. I know Net2280 sends me 5 data > packets on bulk-in endpoint for every request I submit > on bulk out endpoint ; but I am able to reap data only > from first reap request (my subsequent reap requests > are just waiting/blocking. I am using devio.c > interface to talk to Net2280. this is how my code is > structured now > 1)read the descriptors from dev node > 2)I do set configuration > 3)submit command (as part of URB) on bulk-out > endpoint. it returns immediately > 4)submit URB on bulk-in endpoint for getting data from > the device (I am not using signals, since I donot want > signals to drive my code). > 5)submit ioctl for reapurb (I am using the blocking > version, because that is what I wanted to). I get the > data on return from reapurb. > 6)I immediately submit second reapurb to the same > endpoint and it just hangs. I gave a different data > buffer and different URB to reapurb ioctl(not the one > used in step 5), but no luck. > > Why is that step 6 is always hanging. I know my > Net2280 will send multiple (5) packets on single > request/command. Is there something else I should do > before sending a second reapurb (like send a request > to UNLINK; or send non blocking version of reap urb). > Or is there something else I should be doing in first > place (like sending a "setinterface" request after > step 2).
If I'm reading your description correctly, you do a single submit followed by two calls to reapurb. That's not right. There should be a one-to-one correspondence between submits and reaps. So after step 5 you need to submit another URB (it can use the same memory as the one you just reaped if you want). Then step 6 would be the reap call for this next URB. Alternatively, if the amount of data involved isn't too large, you could simplify things by making the data buffer of the URB in step 4 large enough to hold all 5 reply packets. Then you wouldn't need to submit anything else. > FYI: I put step4 and step5 in a while loop where I was > able to submit multiple commands and get corresponding > first response from device; but I just dont get any > response for second reapurb (that is if I move step 6 > into my while loop, system just hangs and snoop output > tells me reapurb is never returning). > > I appreciate any thoughts on this one. If you want to get more information about what's happening, try using the usbmon facility. It's described in Documentation/usb/usbmon.txt in the kernel source. That will show you exactly what URBs are getting submitted and completed. Alan Stern ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel