Goodmorning.
My name is Mauro Ziliani, is write from Parma, and I'm and computer science adviser.
I'm apologize in advance for my english: sometimes is terrible.
I hope to be clear in my questions.


I'm in trouble because I don't understand what happen with my driver and ohci core.

I need to drive an USB device (Philips PUSBD12+Hitachi H8/3664) that has two alternate setting of interface 0, configuration 0.

The two setting are:
Setting0:
EP1IN Interrupt (bInterval=2, wMaxPacketSize=2)
EP2IN Interrupt (bInterval1=1, wMaxPacketSize=64)
EP2OUT Bulk (wMaxPAcketSize=16)


Setting1:
EP1IN Interrupt (bInterval=2, wMaxPacketSize=2)
EP2IN Interrupt (bInterval1=1, wMaxPacketSize=64)
EP2OUT Interrupt (one-shot, wMaxPAcketSize=64)


Every good transation between the PC and the device are displayed with a led flash.

The driver starts with Setting0: I use usb_set_interface(udev, 0,0) to ensure that the device works in the right setup.
Then I trasmit a packet to EP2OUT Bulk and receive some data from EP2IN with the sequence: tx EP2OUT, rx EP2IN, tx EP2OUT, rx EP2IN,...
The tx is made with usb_bulk_msg API.


Then I switch the setup to Setting1. When I write some data on EP2OUT (one-shot) the led doesn't flash and the completion handler for EP2OUT isn't thrwon.

I coded the write to the device by "write" system-call.
Inside "write" I submit the urb for the interrupt one-shot transaction: in the completion handler for ep2out I unlink the urb and "unlock" a wait_queue.


Because when a process calls a "close" I wait that all EP2OUT interrupt urbs are completed (clearly only if the device is setup with Setting1), the calling process locks forever because the completion handler isn't thrown by ohci level (and the wait queue rest "empty").

I try to comment out the wait on EP2OUT interrupt completion and replace it with an explicit usb_unlink_urb of the urb submitted in "write".
I see in the kernel log that the completion handler for EP2OUT interrupt are thrown.


When I switch between settings I always unlink Ep2in and Ep1in even if I don't really need it, because the only difference between the two set is EP2OUT.

Now, if I setup the device to setting0 then to setting1 (i.e. without tx/rx data in setting0) and I trasmit data on EP2OUT Interrput all works well , i.e. the EP2OUT interrupt completion handler is thrown regulary, and the "close" syscall (release function in the driver) doesn't lock the calling process.

I'm working with 2.4.23 kernel and gcc 3.2.2.

Why this strange OHCI behavior?

Thanks a lot, even if you cannot help me.

Best regards

Mauro Ziliani


------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to