Skip to content

Commit

Permalink
usb: ehci: only prepare zero packet for out transfer if required
Browse files Browse the repository at this point in the history
Obviously, ZLP is only required for transfer of OUT direction,
so just take same policy with UHCI for ZLP packet.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Ming Lei authored and Greg Kroah-Hartman committed Sep 18, 2011
1 parent 0412560 commit 9a971dd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/usb/host/ehci-q.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,8 @@ qh_urb_transaction (

/*
* control requests may need a terminating data "status" ack;
* bulk ones may need a terminating short packet (zero length).
* other OUT ones may need a terminating short packet
* (zero length).
*/
if (likely (urb->transfer_buffer_length != 0)) {
int one_more = 0;
Expand All @@ -731,7 +732,7 @@ qh_urb_transaction (
one_more = 1;
token ^= 0x0100; /* "in" <--> "out" */
token |= QTD_TOGGLE; /* force DATA1 */
} else if (usb_pipebulk (urb->pipe)
} else if (usb_pipeout(urb->pipe)
&& (urb->transfer_flags & URB_ZERO_PACKET)
&& !(urb->transfer_buffer_length % maxpacket)) {
one_more = 1;
Expand Down

0 comments on commit 9a971dd

Please sign in to comment.