On Thu, 15 Feb 2007, Sven Anders wrote: > On Wed, 14 Feb 2007, Sven Anders wrote: > >> After I called > >> usb_fill_int_urb(dev->urb, udev, > >> usb_rcvintpipe(udev, int_in_endpointAddr), > >> dev->data, dev->datalen, atp_complete, dev, 1); > >> > >> the driver waits until the USB device (here the touchpad) starts sending > >> data (after I touched it). It does this continuously until I unload the > >> driver. > > > > Isn't that exactly what it's supposed to do? What good is a driver if it > > doesn't wait for the device to send data? > > Right, it waits, but I does not if I want it to wait...
You mean, sometimes you want it to wait for data and sometimes you don't? I still don't understand. Is the real problem caused by the driver or is it caused by the device? > >> If I change the driver to not (re)call the function > >> > >> usb_submit_urb(dev->urb, GFP_ATOMIC); > >> > >> in the "atp_complete" function, it stops. But it does not wait (as the > >> first time) to restart the transfer. Is it possible to let the USB device > >> restart the transfer after I touched the pad again? > > > > Yes. :-) > > > > Your question isn't clear. It looks like you're asking how to restart the > > transfer. The answer is obvious: Change the driver back so that it _does_ > > call usb_submit_urb() inside atp_complete(). > > Yes will call the 'usb_submit_urb' in each invocation of the 'atp_complete' > function. And if I do this the 'atp_complete' function will be called > continuously. That isn't right. It should be called only when the device transfers some data, not continuously. Are you saying that the device constantly sends data, even when you aren't touching the pad? You should try using usbmon to examine the data you receive. > My problem is: If I decide (upon the data I received from the touchpad), that > there isn't a finger any longer on the pad, I want to stop the calling of the > 'atp_complete' function until I'm sure the touchpad is touched again. It sounds like you need to tell the touchpad not to send any data when it isn't being touched. > Then I > want the data again till it's released again. > > After I suspend and resume the computer this works. How can I archive this > within the interrupt-handler-code? How can you prevent the completion handler from being called? There are two ways: (1) Stop resubmitting the URB, or (2) Tell the device not to send any data. > Another possibility (for me) would be to make the interval (in the untouched > times) > longer. Is this possible? The interval doesn't matter very much. The touchpad should not be sending any data at all when nothing is happening. Does the touchpad use the HID protocol? If it does, did you remember to send a Set-Idle request to prevent the device from sending any data when no events have occurred? Alan Stern ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel