Maybe my problem isn't related to using the interrupt endpoints at
all.  My problem only shows up when I call usb_urb_submit on an
interrupt urb though.  My code is at

http://dataplay.bkbits.net:[EMAIL PROTECTED]?nav=index.html|src/|src/drivers|src/drivers/usb

Here's what I think I know about using interrupt endpoints.  You
create a urb with a completion handler.  You fill in the urb with a
data transfer buffer the size of the endpoint's wMaxPacketSize and the
interval set to endpoint->bInterval.  Then you submit this urb.  What
happens is that every bInterval milliseconds, the usb-core does a read
on the interrupt endpoint.  If something's read, your completion
handler gets called.  Then, kindly enough your urb keeps getting
resubmitted every bInterval milliseconds until you unlink the urb.

Assuming that is about right, here's how my code works.  I have a
probe function (probe_dp) that initializes the endpoints
(init_endpoints_dp).  That initialization simply loops over the
endpoints and saves them off to my private device structure.  When the
interrupt endpoint is found, a urb is filled in with the usb_device, a
rcv int pipe, a freshly allocated buffer, my call-back, and the
bInterval timeout.  After the endpoints are initialized, I call
getdeviceinfo_dp which actually writes two packets to the device and
reads two packets from the device.  All this is done with usb_bulk_msg
and works wonderfully. 

When this get device info function returns to my probing function I
assume I really do have a device I'm going to keep.  So, I submit the
interrupt urb.  At this point, the submission fails with an -ENODEV.
What this likely means is that either I don't have a urb, or the urb's
usb_device pointer is bad.  I can't figure out why either would be the
case.  If someone smart could take a look at my code or my logic
described here and tell me why I'm loosing my device I'd appreciate
it.

me: "head, meet brick wall.  brick wall, meet head."

-- 
 (__) Doug Alcorn - Unix/Linux/Web Developing
 oo / PGP 02B3 1E26 BCF2 9AAF 93F1  61D7 450C B264 3E63 D543
 |_/  mailto:[EMAIL PROTECTED] http://www.lathi.net


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to