Hi,
        I have a curious problem with a usb driver that I have written
for the lego tower (an IR transceiver that allows a PC to talk to a
computer built into a lego brick); perhaps someone here can shed some
light on it.

        The tower has two interrupt endpoints, one for input and one
for output; the driver is very simple - the open() call submits a read
urb (with a non-zero interval field, so that it runs continuosuly);
its completion routine just stuffs the data into a ring buffer to be
picked up by the read() call. The write() call just checks a flag to
be sure that the previous write urb has completed (sleeping on a wait
queue if need be), fills and submits the urb, and returns. The write
urb's completion routine does nothing but set a 'completed' flag and
wake the tasks on the sleep queue.

        This works, in the sense that the urbs all complete as
expected, no errors get returned, etc. However, the higher level comms
protocol (ie as driven by the program using the driver) fails unless
I do one of two things:

1) move the mouse around during the comms procedure, or

2) put a printk() call into the write urb's completion routine; it
doesn't matter whether the printk() comes before or after the
completion routine wakes the sleep queue. Putting a busy loop into the
completion call, or putting a printk() call into the write() call
doesn't do the trick - ie it doesn't seem to be simply a matter of
timing.

My system uses the 2.4.14 kernel (single processor) and the uhci
module (it doesn't work at all with usb-uhci). The lego tower is the
only usb device plugged in.

        Does anyone have any ideas on what could be going on here ? Is
there perhaps a known bug that could cause this sort of behaviour ?

Thanks,
        Richard



_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to