提交 9a971dda 编写于 作者: M Ming Lei 提交者: Greg Kroah-Hartman

usb: ehci: only prepare zero packet for out transfer if required

Obviously, ZLP is only required for transfer of OUT direction,
so just take same policy with UHCI for ZLP packet.
Signed-off-by: NMing Lei <tom.leiming@gmail.com>
Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 0412560e
...@@ -722,7 +722,8 @@ qh_urb_transaction ( ...@@ -722,7 +722,8 @@ qh_urb_transaction (
/* /*
* control requests may need a terminating data "status" ack; * 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)) { if (likely (urb->transfer_buffer_length != 0)) {
int one_more = 0; int one_more = 0;
...@@ -731,7 +732,7 @@ qh_urb_transaction ( ...@@ -731,7 +732,7 @@ qh_urb_transaction (
one_more = 1; one_more = 1;
token ^= 0x0100; /* "in" <--> "out" */ token ^= 0x0100; /* "in" <--> "out" */
token |= QTD_TOGGLE; /* force DATA1 */ 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_flags & URB_ZERO_PACKET)
&& !(urb->transfer_buffer_length % maxpacket)) { && !(urb->transfer_buffer_length % maxpacket)) {
one_more = 1; one_more = 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册