OSDN Git Service

usb: gadget: fix usb_ep_align_maybe endianness and new usb_ep_align
authorFelipe F. Tonello <eu@felipetonello.com>
Mon, 8 Aug 2016 20:30:04 +0000 (21:30 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 8 Apr 2018 09:51:56 +0000 (11:51 +0200)
commit01de6f0d9495a881ba0ac8da8afa438a6bfa704f
tree89d92159d22bba02371261f2e4f6061229cb1b25
parent022a60e3bfe302985f136d793661d1d624880ddc
usb: gadget: fix usb_ep_align_maybe endianness and new usb_ep_align

commit 16b114a6d7973cf027e4c2b23eae1076eaf98c25 upstream.

USB spec specifies wMaxPacketSize to be little endian (as other properties),
so when using this variable in the driver we should convert to the current
CPU endianness if necessary.

This patch also introduces usb_ep_align() which does always returns the
aligned buffer size for an endpoint. This is useful to be used by USB requests
allocator functions.

Signed-off-by: Felipe F. Tonello <eu@felipetonello.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/usb/gadget.h