How big is the buffer you're reading?

Are you sure there is data to be read from the device?

Can you try HZ * 4 (or larger)?

JE

On Tue, Dec 03, 2002, Roger Hosto <[EMAIL PROTECTED]> wrote:
> Okay I add in HZ*2 it decreased the number of error messages, but I am 
> still getting.
> kernel: usb_control/bulk_msg: timeout
> 
> Thanks,
> Roger Hosto.
> 
> Johannes Erdfelt wrote:
> 
> >On Tue, Dec 03, 2002, Roger Hosto <[EMAIL PROTECTED]> wrote:
> >  
> >
> >>Okay I am a novice in hardware programming, but I have always heard and 
> >>readed that if there is something you want in linux and no one else has 
> >>done it try it yourself. So I did.
> >>
> >>Here is my problem. I am writing a usb driver for x10 cm19a usb Wireless 
> >>Transceiver. It is a simple device that tranmits and receive X10 
> >>protocols. I have got everything working accept I have a problem with 
> >>the read control.
> >>Here is what I have tried.
> >>
> >>
> >>    /* do an immediate bulk read to get data from the device*/
> >>    retval = usb_bulk_msg (dev->udev,
> >>                   usb_rcvbulkpipe (dev->udev, dev->bulk_in_endpointAddr),
> >>                   dev->bulk_in_buffer,
> >>                   dev->bulk_in_size,
> >>                   &count,
> >>                   dev->bulk_in_bInterval*2);//increased by a factor of 
> >>2 to improve data received
> >>
> >>This works fine, but I receive the following error
> >>kernel: usb_control/bulk_msg: timeout
> >>
> >>So I tried the following to get rid of the error. which works but it 
> >>jacks my Processor up to 100%.
> >>  
> >>    /* check and make sure that read hasn't been submit yet*/
> >>    if(dev->read_urb->status == 0 ||
> >>       dev->read_urb->status == -ENOENT)
> >>    {
> >>        usb_fill_int_urb(dev->read_urb,
> >>                     dev->udev,
> >>                     usb_rcvbulkpipe(dev->udev,dev->bulk_in_endpointAddr),
> >>                      dev->bulk_in_buffer,
> >>                      count,
> >>                      cm19a_read_bulk_callback,
> >>                      dev,
> >>                     dev->bulk_in_bInterval);
> >>
> >>        retval = usb_submit_urb(dev->read_urb);
> >>    }
> >>  
> >>Any help would be cool.
> >>I am using  Linux 2.4.18-3 #1 Thu Apr 18 07:32:41 EDT 2002 i686 unknown
> >>    
> >>
> >
> >Don't use bInterval on a bulk pipe.
> >
> >Just use a fixed time, like HZ or HZ * 2 for the timeout.
> >
> >JE
> >
> >  
> >
> 
> -- 
> Your favorite stores, helpful shopping tools and great gift ideas. 
> Experience the convenience of buying online with Shop@Netscape! 
> http://shopnow.netscape.com/
> 


-------------------------------------------------------
This SF.net email is sponsored by: Microsoft Visual Studio.NET 
comprehensive development tool, built to increase your 
productivity. Try a free online hosted session at:
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr0003en
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

Reply via email to