]> err.no Git - linux-2.6/commit
USB: add direction bit to urb->transfer_flags
authorAlan Stern <stern@rowland.harvard.edu>
Mon, 30 Jul 2007 21:06:16 +0000 (17:06 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 12 Oct 2007 21:55:00 +0000 (14:55 -0700)
commitfea3409112a93581db18da4c4332c8bf8d68af6b
treec89b9fd9f8a64d2419d7888a6ab135851f4fee38
parentbdd016ba64d909329cb4bacacc8443901c00e112
USB: add direction bit to urb->transfer_flags

This patch (as945) adds a bit to urb->transfer_flags for recording the
direction of the URB.  The bit is set/cleared automatically in
usb_submit_urb() so drivers don't have to worry about it (although as
a result, it isn't valid until the URB has been submitted).  Inline
routines are added for easily checking an URB's direction.  They
replace calls to usb_pipein in the DMA-mapping parts of hcd.c.

For non-control endpoints, the direction is determined directly from
the endpoint descriptor.  However control endpoints are
bi-directional; for them the direction is determined from the
bRequestType byte and the wLength value in the setup packet.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/hcd.c
drivers/usb/core/urb.c
include/linux/usb.h