On Fri, Jun 03, 2005 at 03:24:51PM +0800, Enzo Chen (?????h) wrote:
>  
> Dear Greg,
> 
>   Thanks for your quick response, we very appreciate it.
>  
>   Our driver is developed based on the usbserial module.
>   The code listed below is our open function:
> 
>       mxu2s_open() {
>               ......
>               if(port->read_urb->status != -EINPROGRESS) {
>                       port->read_urb->dev = port->serial->dev;
>                       port->read_urb->transfer_buffer_length =
>                               URB_TRANSFER_BUFFER_SIZE;
>       
>                       usb_fill_bulk_urb(port->read_urb, port->serial->dev,
>                               usb_rcvbulkpipe(port->serial->dev,
>                                       port->bulk_in_endpointAddress),
>                               port->read_urb->transfer_buffer,
>                               port->read_urb->transfer_buffer_length,
>                               mxu2s_read_bulk_callback, port);
> 
>                       rc = usb_submit_urb(port->read_urb, GFP_KERNEL);
>               ......
>       }
> 
>   we submit the read_urb here, and then it will be submit again
>   in the read_bulk_callback function : 
> 
>       mxu2s_read_bulk_callback() {
>               ......
>               if(port->read_urb->status != -EINPROGRESS) {

This will never be true from within a callback.

>                       rc = usb_submit_urb(port->read_urb, GFP_ATOMIC);
>               }
>               ......
>       }
> 
>   finally, we wanna unlink the read_urb in the close function, and it blocks:
> 
>       mxu2s_close() {
>               ......
>               if(serial->dev) {
>                       printk("unlinking...\n");
>                       usb_unlink_urb(priv->read_urb);
>                       printk("unlink finished\n"); // <-- you'll never see 
> this in kmsg

Are you sure you are checking the status in the callback to make sure
you don't resubmit it?  That is sounding like what you are doing.

>               }
>               .......
>       }
> 
>   we have not try the 2.6.12-rc5 or 2.6.11 version, cause many of our 
> customers may hope
>   to use it under the default S/W environment, which means we are asked to 
> support distributions
>   like Fedora core 2, core 3 or others.....  :~
> 
>   I'm afraid too many codes taking you too much time, so I cut off and make 
> this short.
>   If you'd like to check in detail, please feel free to contact me.

Sure, have a pointer to your whole driver?  It is released under the
GPL, right?

For what usb to serial device is this driver being written for?

thanks,

greg k-h


-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to