Hi,

>> Configuration:
>> Distribution:Linux Fedora Core 2
>> Kernel:2.6.7
>> Problem occured also with the RedHat 7.3 distribution (kernel 2.4.18)
>> HCD:uhci_hcd
>>
>> Hi,
>> I'm writing an USB driver for a specific device.
>> If I terminate an IO (a read on a BULK or an interrupt pipe) by calling
>> usb_unlink_urb()
>> then I submit another URB, I miss some data. With an USB analyser, I can
>> see a packet that is missed.
>
>(I assume the packet was sent in response to the first URB, not the
>second.)  The data will be available in the transfer_buffer for the URB
>that you unlinked.  The amount of data in the buffer is
>urb->actual_length.  That's true even though urb->status is -ECONNRESET or

>-ENOENT.
>
>> The driver  IO completion call-back will never be called until the
device
>> send other data.
>
>Do you mean the completion handler for the second URB?  The handler
>for the first URB will be called shortly after you unlink it.

Sorry, my explanations were not very clear:

1 - A first URB is submitted.
2 - The device doesn't send any data
3 - The first URB is unlinked and freed (timeout managment for example;
usb_bulk_msg() does this)
    The completion handler is called, everything works well (I use
synchronous URB unlink).
4 - A second URB is submitted
5 - The device send data (with a mouse, for example, press one a button and
don't release it).
    Whith an USB analyser, I can see a packet but the IO completion handler
(of the second URB) isn't called.
6 - Then submit a third URB
7 - The device send data and everything goes well (with a mouse, release
the mouse button)

Strange isn't it ?

>
>A more interesting question is: Why do you have to unlink the URB to
>terminate the I/O transfer?  Why doesn't the transfer terminate by itself
>when the device has sent all the data it has available?
>
In fact, I'm writting a generic USB driver. This driver works with a
library that provides an abstraction
of the USB API. We've got this abstration library working on other OS such
lick QNX and MS Windows.
The lib provides common functions (open,close,read,write...) to acces any
USB devices. It provides also a way
to abort a read or a write pending on a pipe. In the generic driver (or
module) the abort result to usb_unlink_urb() call.
This may looks a bit strange but whith this abstration layer we've got USB
device drivers that work on three OS.

Thank you in advance for your help
Regards
Thierry






******************************************************************************
Ce message et les pieces jointes associees sont confidentiels et a l'attention
exclusive des destinataires. Si vous avez recu ce message par erreur, merci
d'avertir l'administrateur de la messagerie: [EMAIL PROTECTED]                         
                

This email and files transmitted with it are confidential and intended solely     
for the use of the individual to whom they are addressed. If you have received    
this email in error, please notify the system manager: [EMAIL PROTECTED]               
                                  
******************************************************************************



-------------------------------------------------------
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