From 5ca23ed5bc63832baa24a6107537fdd229c458ae Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Thu, 5 Oct 2017 16:36:07 +0200 Subject: efi_loader: supply EFI network test This patch provides an EFI application to check the correct function of the Simple Network Protocol implementation. It sends a DHCP request and analyzes the DHCP offer. Different error conditions including a 10s timeout are checked. A successful execution will look like this: => bootefi nettest Scanning disk ide.blk#0... Found 1 disks WARNING: Invalid device tree, expect boot to fail Network test DHCP Discover DHCP reply received from 192.168.76.2 (52:55:c0:a8:4c:02) as broadcast message. OK. The test was completed successfully. Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass Signed-off-by: Alexander Graf --- include/efi_selftest.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/efi_selftest.h') diff --git a/include/efi_selftest.h b/include/efi_selftest.h index 2f0992f06e..7ec42a0406 100644 --- a/include/efi_selftest.h +++ b/include/efi_selftest.h @@ -60,6 +60,17 @@ void efi_st_exit_boot_services(void); void efi_st_printf(const char *fmt, ...) __attribute__ ((format (__printf__, 1, 2))); +/* + * Compare memory. + * We cannot use lib/string.c due to different CFLAGS values. + * + * @buf1: first buffer + * @buf2: second buffer + * @length: number of bytes to compare + * @return: 0 if both buffers contain the same bytes + */ +int efi_st_memcmp(const void *buf1, const void *buf2, size_t length); + /* * Reads an Unicode character from the input device. * -- cgit v1.2.1