greybus: es1: fix transfer-buffer alignment
Fix transfer-buffer alignment of outgoing transfers which are currently byte aligned. Some USB host drivers cannot handle byte-aligned buffers and will allocate temporary buffers, which the data is copied to or from on every transfer. This affects for example musb (e.g. Beaglebone Black) and ehci-tegra (e.g. Jetson). Instead of transferring pad bytes on the wire, let's (ab)use the pad bytes of the operation message header to transfer the cport id. This gives us properly aligned buffers and more efficient transfers in both directions. By using both pad bytes, we can also remove the arbitrary limitation of 256 cports. Note that the protocol between the host driver and the UniPro bridge is not necessarily Greybus. As long as the firmware clears the pad bytes before forwarding the data, and the host driver does the same before passing received data up the stack, this should be considered "legal" use. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Showing
Please register or sign in to comment