On Tue, 1 May 2007 [EMAIL PROTECTED] wrote: > After a big delay, I am now trying to write a driver for my USB-to-Irda > dongle. > This device reports the following in lsusb: > > Bus 002 Device 002: ID 07c0:4200 Code Mercenaries Hard- und Software GmbH > Device Descriptor: > bLength 18 > bDescriptorType 1 > bcdUSB 1.10
What version of the Linux kernel are you using? If you turn on CONFIG_USB_DEBUG, what shows up in the dmesg log? > My current attempt to write a driver for this dongle is attached to this > message. This is my very first attempt to write a Linux kernel driver, and > also > the first time I try to write an USB driver for any device whatsoever, so I > might be doing something stupid in the code. The problem I have is that > when I > submit the interrupt urbs for either endpoint in the driver code, my callback > code never gets called at all - not even to signal an error while > submitting the > urb. That never happens. The callback routine is invoked when the URB completes, and if the submission failed then the URB wasn't accepted so of course it can never complete. > However, when the irda0 network interface is brought down manually > (ifconfig irda0 down), I do get calls to my callbacks, with errors > corresponding > to the device being shut down. I have a suspicion that this is caused by the > required urb teardown in kingsun_net_close. > > Here is a dump of usbmon when my driver takes control of the dongle: > > Plugin of the dongle: > > ddf58140 410742248 C Ii:001:01 0 1 = 02 > ddf58140 410742276 S Ii:001:01 -115 2 < > cb8ebb40 410793172 S Ci:001:00 s a3 00 0000 0001 0004 4 < > cb8ebb40 410793182 C Ci:001:00 0 4 = 01030100 So this is a low-speed device, right? ... > da870b40 411151178 S Ci:007:00 s 80 06 0302 0409 00ff 255 < > da870b40 416154270 C Ci:007:00 -2 24 = 18035500 53004200 20007400 6f002000 > 49007200 64006100 This shouldn't happen! Reception of a short message should never fail with a timeout. Something must be wrong with your host controller or its driver. The dmesg log might provide a clue. ... > da87f140 421243731 S Co:007:00 s 00 09 0001 0000 0000 0 > da87f140 421246338 C Co:007:00 0 0 Apparently your driver doesn't send anything to the device when it is probed. > ifconfig irda0 up > > da87fec0 474705925 S Co:007:00 s 02 01 0000 0081 0000 0 > da87fec0 474708443 C Co:007:00 0 0 > da87fec0 474708548 S Co:007:00 s 02 01 0000 0002 0000 0 > da87fec0 474711422 C Co:007:00 0 0 Why does your driver bother to do a Clear-Halt? It should not be needed. > da87fec0 474711537 S Ii:007:01 -115 8 < > da870b40 475671204 S Io:007:02 -115 30 = ffffffff ffffffff ffffffff > c0ff3f01 c5257160 ffffffff 01000064 d2c1 > > ifconfig irda0 down > > da870b40 533710546 C Io:007:02 -2 0 > da87fec0 533711539 C Ii:007:01 -2 0 > > Please notice that usbmon does log the IrDA discovery packet (the one that > starts with ffffffff), only my code does not get called for any response > on the > send. It gets logged because your driver submitted the URB to be sent. The completion handler doesn't get called because the device never accepted the data. Like Oliver said, you probably need to do some sort of initialization of the device before it will start working. Alan Stern ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel