RE: strange usb behavior

Dunlap, Randy (randy.dunlap@intel.com)
Thu, 16 Dec 1999 08:49:55 -0800


This says that you did a control msg read/INput,
requesting 4 bytes, and 0 bytes were actually read
from the device (i.e., the device sent 0 bytes, not 4).

I don't see how this would have anything to do with
the registers being modified. Wouldn't that usually
be done with a control pipe write/OUTput message?

usb_bulk_msg() is a synchronous I/O function. It
waits until I/O complete (or timeout) to return to
your driver. usb_request_bulk() is an async I/O
request. Your driver will continue execution
immediately after the I/O to your device has been
setup. For any decent performance, I expect that
you would want to use usb_request_bulk().

usb_request_bulk() returns a void * ("handle")
which can be used to cancel/terminate your I/O
request by calling usb_terminate_bulk(device, handle).
Since your driver could have several I/Os outstanding,
you pass a context field to usb_request_bulk()
and in your driver's callback function, that context
value is passed back to you.

BTW, linux-usb has a web site (www.linux-usb.org) and
a mailing list (linux-usb@suse.com).

~Randy

> -----Original Message-----
> From: Petko Manolov [mailto:petkan@spct.net]
> Sent: Thursday, December 16, 1999 2:38 AM
> To: linux-kernel@vger.rutgers.edu
> Subject: strange usb behavior
>
>
> Hi folks,
>
> I got strange debug messages when i write to control pipe of my
> usb ethernet device. It looks like:
> requested 4 bytes, got 0
> I said strange because the registers are modified corectly, while
> the message make me think there is problem.
> I have two bulk pipes and still can't find out which one of
> bulk functions to chose (usb_bulk_msg or request_bulk), which
> is more suitable for a network driver.
>
> regards,
> Petkan
>
> -
> To unsubscribe from this list: send the line "unsubscribe
> linux-kernel" in
> the body of a message to majordomo@vger.rutgers.edu
> Please read the FAQ at http://www.tux.org/lkml/
>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/