efi_loader: correctly aligned transmit buffer
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Fri, 30 Nov 2018 23:16:32 +0000 (00:16 +0100)
committerAlexander Graf <agraf@suse.de>
Sun, 2 Dec 2018 20:59:37 +0000 (21:59 +0100)
commit622fe621a2e7f431f7dc5dcdfd30d56af00de0ae
tree4e700daaf20366cd8358f4411b99bcf3dfb22e48
parent0fdb9e30b325f52422fe9cf5e4c9d060a6d33562
efi_loader: correctly aligned transmit buffer

Calling net_send_packet() requires that the buffer is aligned to a multiple
of PKTALIGN (= ARCH_DMA_MINALIGN). The UEFI spec does not require
efi_net_transmit() to be called with a buffer with any special alignment.
So we have to copy to an aligned buffer. The current coding copies to an
aligned buffer only if CONFIG_EFI_LOADER_BOUNCE_BUFFER=y. Many boards
like the Odroid C2 do not use a bounce buffer.

With the patch we copy to a correctly aligned buffer in all cases.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
lib/efi_loader/efi_net.c