提交 553fbcde 编写于 作者: J Jassi Brar 提交者: Greg Kroah-Hartman

USB: Gadget: Initialize wMaxPacketSize if not already set

Currently, for ISO and INT, a protocol driver must chose the value for
wMaxPacketSize arbitrarily. The value may be too low, resulting in lesser
than efficient operation or high enough to not work with all UDC drivers.

Take un-initialized wMaxPacketSize as a hint to provide maximum
possible packetsize for the selected endpoint. The protocol may
then choose a value not bigger than that.
Signed-off-by: NJassi Brar <jassi.brar@samsung.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 7af75af2
......@@ -128,6 +128,13 @@ ep_matches (
}
}
/*
* If the protocol driver hasn't yet decided on wMaxPacketSize
* and wants to know the maximum possible, provide the info.
*/
if (desc->wMaxPacketSize == 0)
desc->wMaxPacketSize = cpu_to_le16(ep->maxpacket);
/* endpoint maxpacket size is an input parameter, except for bulk
* where it's an output parameter representing the full speed limit.
* the usb spec fixes high speed bulk maxpacket at 512 bytes.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册