summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2025-05-26 16:07:19 -0600
committerTom Rini <trini@konsulko.com>2025-05-26 16:07:19 -0600
commit39b815d02d7ce6af32bcf023d20243c404b75a84 (patch)
tree68cd13fa83e90f69bf8c989fbcde768b676eb6d7 /lib
parentbab54f5942c428be698216224fd10b91d974d4da (diff)
parent2ca1398a5ece8d33d8feb6b410e6e38588b5d2bc (diff)
Merge tag 'v2025.07-rc3' into next
Prepare v2025.07-rc3
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_driver/efi_uclass.c1
-rw-r--r--lib/efi_loader/efi_bootbin.c1
-rw-r--r--lib/efi_loader/efi_bootmgr.c13
-rw-r--r--lib/efi_loader/efi_boottime.c1
-rw-r--r--lib/efi_loader/efi_capsule.c1
-rw-r--r--lib/efi_loader/efi_console.c27
-rw-r--r--lib/efi_loader/efi_device_path.c175
-rw-r--r--lib/efi_loader/efi_device_path_utilities.c3
-rw-r--r--lib/efi_loader/efi_disk.c1
-rw-r--r--lib/efi_loader/efi_fdt.c1
-rw-r--r--lib/efi_loader/efi_helper.c7
-rw-r--r--lib/efi_loader/efi_net.c3
-rw-r--r--lib/efi_loader/efi_tcg2.c1
-rw-r--r--lib/lwip/lwip/src/apps/altcp_tls/altcp_tls_mbedtls.c8
14 files changed, 92 insertions, 151 deletions
diff --git a/lib/efi_driver/efi_uclass.c b/lib/efi_driver/efi_uclass.c
index 495be53cb77..7392c60f0f9 100644
--- a/lib/efi_driver/efi_uclass.c
+++ b/lib/efi_driver/efi_uclass.c
@@ -20,6 +20,7 @@
#define LOG_CATEGORY LOGC_EFI
#include <dm.h>
+#include <efi_device_path.h>
#include <efi_driver.h>
#include <log.h>
#include <malloc.h>
diff --git a/lib/efi_loader/efi_bootbin.c b/lib/efi_loader/efi_bootbin.c
index 94ba7c5589b..b394f0d60ce 100644
--- a/lib/efi_loader/efi_bootbin.c
+++ b/lib/efi_loader/efi_bootbin.c
@@ -10,6 +10,7 @@
#include <charset.h>
#include <dm.h>
#include <efi.h>
+#include <efi_device_path.h>
#include <efi_loader.h>
#include <env.h>
#include <image.h>
diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c
index c0df5cb9acd..1a3461f5a9d 100644
--- a/lib/efi_loader/efi_bootmgr.c
+++ b/lib/efi_loader/efi_bootmgr.c
@@ -12,6 +12,7 @@
#include <charset.h>
#include <dm.h>
#include <efi.h>
+#include <efi_device_path.h>
#include <log.h>
#include <malloc.h>
#include <net.h>
@@ -479,6 +480,13 @@ static efi_status_t try_load_from_uri_path(struct efi_device_path_uri *uridp,
if (!ctx)
return EFI_OUT_OF_RESOURCES;
+ s = env_get("ipaddr");
+ if (!s && dhcp_run(0, NULL, false)) {
+ log_err("Error: Can't find a valid IP address\n");
+ ret = EFI_DEVICE_ERROR;
+ goto err;
+ }
+
s = env_get("loadaddr");
if (!s) {
log_err("Error: loadaddr is not set\n");
@@ -527,7 +535,7 @@ static efi_status_t try_load_from_uri_path(struct efi_device_path_uri *uridp,
* will be freed in return_to_efibootmgr event callback.
*/
loaded_dp = efi_dp_from_mem(EFI_RESERVED_MEMORY_TYPE,
- (uintptr_t)image_addr, image_size);
+ image_addr, image_size);
ret = efi_install_multiple_protocol_interfaces(
&mem_handle, &efi_guid_device_path, loaded_dp, NULL);
if (ret != EFI_SUCCESS)
@@ -855,7 +863,8 @@ efi_bootmgr_enumerate_boot_options(struct eficonfig_media_boot_option *opt,
lo.label = dev_name;
lo.attributes = LOAD_OPTION_ACTIVE;
lo.file_path = device_path;
- lo.file_path_length = efi_dp_size(device_path) + sizeof(END);
+ lo.file_path_length = efi_dp_size(device_path) +
+ sizeof(EFI_DP_END);
/*
* Set the dedicated guid to optional_data, it is used to identify
* the boot option that automatically generated by the bootmenu.
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index dbebb37dc04..24b0e52a2a2 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -11,6 +11,7 @@
#include <div64.h>
#include <dm/device.h>
#include <dm/root.h>
+#include <efi_device_path.h>
#include <efi_loader.h>
#include <irq_func.h>
#include <log.h>
diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c
index 1aa52ac7bb6..f19e78ae9d1 100644
--- a/lib/efi_loader/efi_capsule.c
+++ b/lib/efi_loader/efi_capsule.c
@@ -8,6 +8,7 @@
#define LOG_CATEGORY LOGC_EFI
+#include <efi_device_path.h>
#include <efi_loader.h>
#include <efi_variable.h>
#include <env.h>
diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c
index 9d9f786a6db..953f6831466 100644
--- a/lib/efi_loader/efi_console.c
+++ b/lib/efi_loader/efi_console.c
@@ -9,6 +9,7 @@
#include <ansi.h>
#include <charset.h>
+#include <efi_device_path.h>
#include <malloc.h>
#include <time.h>
#include <dm/device.h>
@@ -30,6 +31,17 @@ struct cout_mode {
__maybe_unused static struct efi_object uart_obj;
+/*
+ * suppress emission of ANSI escape-characters for use by unit tests. Leave it
+ * as 0 for the default behaviour
+ */
+static bool no_ansi;
+
+void efi_console_set_ansi(bool allow_ansi)
+{
+ no_ansi = !allow_ansi;
+}
+
static struct cout_mode efi_cout_modes[] = {
/* EFI Mode 0 is 80x25 and always present */
{
@@ -348,13 +360,6 @@ static int __maybe_unused query_vidconsole(int *rows, int *cols)
return 0;
}
-/**
- * efi_setup_console_size() - update the mode table.
- *
- * By default the only mode available is 80x25. If the console has at least 50
- * lines, enable mode 80x50. If we can query the console size and it is neither
- * 80x25 nor 80x50, set it as an additional mode.
- */
void efi_setup_console_size(void)
{
int rows = 25, cols = 80;
@@ -362,8 +367,12 @@ void efi_setup_console_size(void)
if (IS_ENABLED(CONFIG_VIDEO))
ret = query_vidconsole(&rows, &cols);
- if (ret)
- ret = query_console_serial(&rows, &cols);
+ if (ret) {
+ if (no_ansi)
+ ret = 0;
+ else
+ ret = query_console_serial(&rows, &cols);
+ }
if (ret)
return;
diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c
index c9bf2726fe2..7316a76f462 100644
--- a/lib/efi_loader/efi_device_path.c
+++ b/lib/efi_loader/efi_device_path.c
@@ -10,6 +10,7 @@
#include <blk.h>
#include <dm.h>
#include <dm/root.h>
+#include <efi_device_path.h>
#include <log.h>
#include <net.h>
#include <usb.h>
@@ -21,11 +22,11 @@
#include <asm-generic/unaligned.h>
#include <linux/compat.h> /* U16_MAX */
-/* template END node: */
-const struct efi_device_path END = {
+/* template EFI_DP_END node: */
+const struct efi_device_path EFI_DP_END = {
.type = DEVICE_PATH_TYPE_END,
.sub_type = DEVICE_PATH_SUB_TYPE_END,
- .length = sizeof(END),
+ .length = sizeof(EFI_DP_END),
};
#if defined(CONFIG_MMC)
@@ -46,10 +47,6 @@ static bool is_sd(struct blk_desc *desc)
}
#endif
-/*
- * Iterate to next block in device-path, terminating (returning NULL)
- * at /End* node.
- */
struct efi_device_path *efi_dp_next(const struct efi_device_path *dp)
{
if (dp == NULL)
@@ -62,12 +59,6 @@ struct efi_device_path *efi_dp_next(const struct efi_device_path *dp)
return (struct efi_device_path *)dp;
}
-/*
- * Compare two device-paths, stopping when the shorter of the two hits
- * an End* node. This is useful to, for example, compare a device-path
- * representing a device with one representing a file on the device, or
- * a device with a parent device.
- */
int efi_dp_match(const struct efi_device_path *a,
const struct efi_device_path *b)
{
@@ -90,20 +81,6 @@ int efi_dp_match(const struct efi_device_path *a,
}
}
-/**
- * efi_dp_shorten() - shorten device-path
- *
- * When creating a short boot option we want to use a device-path that is
- * independent of the location where the block device is plugged in.
- *
- * UsbWwi() nodes contain a serial number, hard drive paths a partition
- * UUID. Both should be unique.
- *
- * See UEFI spec, section 3.1.2 for "short-form device path".
- *
- * @dp: original device-path
- * Return: shortened device-path or NULL
- */
struct efi_device_path *efi_dp_shorten(struct efi_device_path *dp)
{
while (dp) {
@@ -180,16 +157,6 @@ static efi_handle_t find_handle(struct efi_device_path *dp,
return best_handle;
}
-/**
- * efi_dp_find_obj() - find handle by device path
- *
- * If @rem is provided, the handle with the longest partial match is returned.
- *
- * @dp: device path to search
- * @guid: GUID of protocol that must be installed on path or NULL
- * @rem: pointer to receive remaining device path
- * Return: matching handle
- */
efi_handle_t efi_dp_find_obj(struct efi_device_path *dp,
const efi_guid_t *guid,
struct efi_device_path **rem)
@@ -204,13 +171,6 @@ efi_handle_t efi_dp_find_obj(struct efi_device_path *dp,
return handle;
}
-/*
- * Determine the last device path node that is not the end node.
- *
- * @dp device path
- * Return: last node before the end node if it exists
- * otherwise NULL
- */
const struct efi_device_path *efi_dp_last_node(const struct efi_device_path *dp)
{
struct efi_device_path *ret;
@@ -224,7 +184,6 @@ const struct efi_device_path *efi_dp_last_node(const struct efi_device_path *dp)
return ret;
}
-/* get size of the first device path instance excluding end node */
efi_uintn_t efi_dp_instance_size(const struct efi_device_path *dp)
{
efi_uintn_t sz = 0;
@@ -239,7 +198,6 @@ efi_uintn_t efi_dp_instance_size(const struct efi_device_path *dp)
return sz;
}
-/* get size of multi-instance device path excluding end node */
efi_uintn_t efi_dp_size(const struct efi_device_path *dp)
{
const struct efi_device_path *p = dp;
@@ -253,11 +211,10 @@ efi_uintn_t efi_dp_size(const struct efi_device_path *dp)
return (void *)p - (void *)dp;
}
-/* copy multi-instance device path */
struct efi_device_path *efi_dp_dup(const struct efi_device_path *dp)
{
struct efi_device_path *ndp;
- size_t sz = efi_dp_size(dp) + sizeof(END);
+ size_t sz = efi_dp_size(dp) + sizeof(EFI_DP_END);
if (!dp)
return NULL;
@@ -270,21 +227,6 @@ struct efi_device_path *efi_dp_dup(const struct efi_device_path *dp)
return ndp;
}
-/**
- * efi_dp_concat() - Concatenate two device paths and add and terminate them
- * with an end node.
- *
- * @dp1: First device path
- * @dp2: Second device path
- * @split_end_node:
- * * 0 to concatenate
- * * 1 to concatenate with end node added as separator
- * * size of dp1 excluding last end node to concatenate with end node as
- * separator in case dp1 contains an end node
- *
- * Return:
- * concatenated device path or NULL. Caller must free the returned value
- */
struct
efi_device_path *efi_dp_concat(const struct efi_device_path *dp1,
const struct efi_device_path *dp2,
@@ -295,7 +237,7 @@ efi_device_path *efi_dp_concat(const struct efi_device_path *dp1,
if (!dp1 && !dp2) {
/* return an end node */
- ret = efi_dp_dup(&END);
+ ret = efi_dp_dup(&EFI_DP_END);
} else if (!dp1) {
ret = efi_dp_dup(dp2);
} else if (!dp2) {
@@ -312,9 +254,9 @@ efi_device_path *efi_dp_concat(const struct efi_device_path *dp1,
sz1 = split_end_node;
if (split_end_node)
- end_size = 2 * sizeof(END);
+ end_size = 2 * sizeof(EFI_DP_END);
else
- end_size = sizeof(END);
+ end_size = sizeof(EFI_DP_END);
p = efi_alloc(sz1 + sz2 + end_size);
if (!p)
return NULL;
@@ -323,14 +265,14 @@ efi_device_path *efi_dp_concat(const struct efi_device_path *dp1,
p += sz1;
if (split_end_node) {
- memcpy(p, &END, sizeof(END));
- p += sizeof(END);
+ memcpy(p, &EFI_DP_END, sizeof(EFI_DP_END));
+ p += sizeof(EFI_DP_END);
}
/* the end node of the second device path has to be retained */
memcpy(p, dp2, sz2);
p += sz2;
- memcpy(p, &END, sizeof(END));
+ memcpy(p, &EFI_DP_END, sizeof(EFI_DP_END));
}
return ret;
@@ -342,26 +284,26 @@ struct efi_device_path *efi_dp_append_node(const struct efi_device_path *dp,
struct efi_device_path *ret;
if (!node && !dp) {
- ret = efi_dp_dup(&END);
+ ret = efi_dp_dup(&EFI_DP_END);
} else if (!node) {
ret = efi_dp_dup(dp);
} else if (!dp) {
size_t sz = node->length;
- void *p = efi_alloc(sz + sizeof(END));
+ void *p = efi_alloc(sz + sizeof(EFI_DP_END));
if (!p)
return NULL;
memcpy(p, node, sz);
- memcpy(p + sz, &END, sizeof(END));
+ memcpy(p + sz, &EFI_DP_END, sizeof(EFI_DP_END));
ret = p;
} else {
/* both dp and node are non-null */
size_t sz = efi_dp_size(dp);
- void *p = efi_alloc(sz + node->length + sizeof(END));
+ void *p = efi_alloc(sz + node->length + sizeof(EFI_DP_END));
if (!p)
return NULL;
memcpy(p, dp, sz);
memcpy(p + sz, node, node->length);
- memcpy(p + sz + node->length, &END, sizeof(END));
+ memcpy(p + sz + node->length, &EFI_DP_END, sizeof(EFI_DP_END));
ret = p;
}
@@ -399,17 +341,17 @@ struct efi_device_path *efi_dp_append_instance(
return efi_dp_dup(dpi);
sz = efi_dp_size(dp);
szi = efi_dp_instance_size(dpi);
- p = efi_alloc(sz + szi + 2 * sizeof(END));
+ p = efi_alloc(sz + szi + 2 * sizeof(EFI_DP_END));
if (!p)
return NULL;
ret = p;
- memcpy(p, dp, sz + sizeof(END));
+ memcpy(p, dp, sz + sizeof(EFI_DP_END));
p = (void *)p + sz;
p->sub_type = DEVICE_PATH_SUB_TYPE_INSTANCE_END;
- p = (void *)p + sizeof(END);
+ p = (void *)p + sizeof(EFI_DP_END);
memcpy(p, dpi, szi);
p = (void *)p + szi;
- memcpy(p, &END, sizeof(END));
+ memcpy(p, &EFI_DP_END, sizeof(EFI_DP_END));
return ret;
}
@@ -424,17 +366,17 @@ struct efi_device_path *efi_dp_get_next_instance(struct efi_device_path **dp,
if (!dp || !*dp)
return NULL;
sz = efi_dp_instance_size(*dp);
- p = efi_alloc(sz + sizeof(END));
+ p = efi_alloc(sz + sizeof(EFI_DP_END));
if (!p)
return NULL;
- memcpy(p, *dp, sz + sizeof(END));
+ memcpy(p, *dp, sz + sizeof(EFI_DP_END));
*dp = (void *)*dp + sz;
if ((*dp)->sub_type == DEVICE_PATH_SUB_TYPE_INSTANCE_END)
- *dp = (void *)*dp + sizeof(END);
+ *dp = (void *)*dp + sizeof(EFI_DP_END);
else
*dp = NULL;
if (size)
- *size = sz + sizeof(END);
+ *size = sz + sizeof(EFI_DP_END);
return p;
}
@@ -449,9 +391,6 @@ bool efi_dp_is_multi_instance(const struct efi_device_path *dp)
return p->sub_type == DEVICE_PATH_SUB_TYPE_INSTANCE_END;
}
-/* size of device-path not including END node for device and all parents
- * up to the root device.
- */
__maybe_unused static unsigned int dp_size(struct udevice *dev)
{
if (!dev || !dev->driver)
@@ -820,29 +759,21 @@ static void *dp_part_fill(void *buf, struct blk_desc *desc, int part)
return dp_part_node(buf, desc, part);
}
-/* Construct a device-path from a partition on a block device: */
struct efi_device_path *efi_dp_from_part(struct blk_desc *desc, int part)
{
void *buf, *start;
- start = buf = efi_alloc(dp_part_size(desc, part) + sizeof(END));
- if (!buf)
+ start = efi_alloc(dp_part_size(desc, part) + sizeof(EFI_DP_END));
+ if (!start)
return NULL;
- buf = dp_part_fill(buf, desc, part);
+ buf = dp_part_fill(start, desc, part);
- *((struct efi_device_path *)buf) = END;
+ *((struct efi_device_path *)buf) = EFI_DP_END;
return start;
}
-/*
- * Create a device node for a block device partition.
- *
- * @buf buffer to which the device path is written
- * @desc block device descriptor
- * @part partition number, 0 identifies a block device
- */
struct efi_device_path *efi_dp_part_node(struct blk_desc *desc, int part)
{
efi_uintn_t dpsize;
@@ -892,13 +823,6 @@ static void path_to_uefi(void *uefi, const char *src)
*pos = 0;
}
-/**
- * efi_dp_from_file() - append file path node to device path.
- *
- * @dp: device path or NULL
- * @path: file path or NULL
- * Return: device path or NULL in case of an error
- */
struct efi_device_path *efi_dp_from_file(const struct efi_device_path *dp,
const char *path)
{
@@ -912,7 +836,7 @@ struct efi_device_path *efi_dp_from_file(const struct efi_device_path *dp,
if (fpsize > U16_MAX)
return NULL;
- buf = efi_alloc(dpsize + fpsize + sizeof(END));
+ buf = efi_alloc(dpsize + fpsize + sizeof(EFI_DP_END));
if (!buf)
return NULL;
@@ -929,7 +853,7 @@ struct efi_device_path *efi_dp_from_file(const struct efi_device_path *dp,
pos += fpsize;
}
- memcpy(pos, &END, sizeof(END));
+ memcpy(pos, &EFI_DP_END, sizeof(EFI_DP_END));
return buf;
}
@@ -938,7 +862,7 @@ struct efi_device_path *efi_dp_from_uart(void)
{
void *buf, *pos;
struct efi_device_path_uart *uart;
- size_t dpsize = dp_size(dm_root()) + sizeof(*uart) + sizeof(END);
+ size_t dpsize = dp_size(dm_root()) + sizeof(*uart) + sizeof(EFI_DP_END);
buf = efi_alloc(dpsize);
if (!buf)
@@ -949,7 +873,7 @@ struct efi_device_path *efi_dp_from_uart(void)
uart->dp.sub_type = DEVICE_PATH_SUB_TYPE_MSG_UART;
uart->dp.length = sizeof(*uart);
pos += sizeof(*uart);
- memcpy(pos, &END, sizeof(END));
+ memcpy(pos, &EFI_DP_END, sizeof(EFI_DP_END));
return buf;
}
@@ -963,13 +887,13 @@ struct efi_device_path __maybe_unused *efi_dp_from_eth(struct udevice *dev)
dpsize += dp_size(dev);
- start = buf = efi_alloc(dpsize + sizeof(END));
- if (!buf)
+ start = efi_alloc(dpsize + sizeof(EFI_DP_END));
+ if (!start)
return NULL;
- buf = dp_fill(buf, dev);
+ buf = dp_fill(start, dev);
- *((struct efi_device_path *)buf) = END;
+ *((struct efi_device_path *)buf) = EFI_DP_END;
return start;
}
@@ -979,7 +903,7 @@ struct efi_device_path __maybe_unused *efi_dp_from_eth(struct udevice *dev)
*
* Set the device path to an ethernet device path as provided by
* efi_dp_from_eth() concatenated with a device path of subtype
- * DEVICE_PATH_SUB_TYPE_MSG_IPV4, and an END node.
+ * DEVICE_PATH_SUB_TYPE_MSG_IPV4, and an EFI_DP_END node.
*
* @ip: IPv4 local address
* @mask: network mask
@@ -1010,7 +934,7 @@ static struct efi_device_path *efi_dp_from_ipv4(struct efi_ipv4_address *ip,
if (srv)
memcpy(&dp.ipv4dp.remote_ip_address, srv, sizeof(*srv));
pos = &dp.end;
- memcpy(pos, &END, sizeof(END));
+ memcpy(pos, &EFI_DP_END, sizeof(EFI_DP_END));
dp1 = efi_dp_from_eth(dev);
if (!dp1)
@@ -1023,17 +947,6 @@ static struct efi_device_path *efi_dp_from_ipv4(struct efi_ipv4_address *ip,
return dp2;
}
-/**
- * efi_dp_from_http() - set device path from http
- *
- * Set the device path to an IPv4 path as provided by efi_dp_from_ipv4
- * concatenated with a device path of subtype DEVICE_PATH_SUB_TYPE_MSG_URI,
- * and an END node.
- *
- * @server: URI of remote server
- * @dev: net udevice
- * Return: pointer to HTTP device path, NULL on error
- */
struct efi_device_path *efi_dp_from_http(const char *server, struct udevice *dev)
{
struct efi_device_path *dp1, *dp2;
@@ -1066,7 +979,7 @@ struct efi_device_path *efi_dp_from_http(const char *server, struct udevice *dev
}
uridp_len = sizeof(struct efi_device_path) + strlen(tmp) + 1;
- uridp = efi_alloc(uridp_len + sizeof(END));
+ uridp = efi_alloc(uridp_len + sizeof(EFI_DP_END));
if (!uridp) {
log_err("Out of memory\n");
return NULL;
@@ -1078,7 +991,7 @@ struct efi_device_path *efi_dp_from_http(const char *server, struct udevice *dev
memcpy(uridp->uri, tmp, strlen(tmp) + 1);
pos = (char *)uridp + uridp_len;
- memcpy(pos, &END, sizeof(END));
+ memcpy(pos, &EFI_DP_END, sizeof(EFI_DP_END));
dp2 = efi_dp_concat(dp1, (const struct efi_device_path *)uridp, 0);
@@ -1096,11 +1009,11 @@ struct efi_device_path *efi_dp_from_mem(uint32_t memory_type,
struct efi_device_path_memory *mdp;
void *buf, *start;
- start = buf = efi_alloc(sizeof(*mdp) + sizeof(END));
- if (!buf)
+ start = efi_alloc(sizeof(*mdp) + sizeof(EFI_DP_END));
+ if (!start)
return NULL;
- mdp = buf;
+ mdp = start;
mdp->dp.type = DEVICE_PATH_TYPE_HARDWARE_DEVICE;
mdp->dp.sub_type = DEVICE_PATH_SUB_TYPE_MEMORY;
mdp->dp.length = sizeof(*mdp);
@@ -1109,7 +1022,7 @@ struct efi_device_path *efi_dp_from_mem(uint32_t memory_type,
mdp->end_address = start_address + size;
buf = &mdp[1];
- *((struct efi_device_path *)buf) = END;
+ *((struct efi_device_path *)buf) = EFI_DP_END;
return start;
}
diff --git a/lib/efi_loader/efi_device_path_utilities.c b/lib/efi_loader/efi_device_path_utilities.c
index 552c5bb1f05..87d52df5066 100644
--- a/lib/efi_loader/efi_device_path_utilities.c
+++ b/lib/efi_loader/efi_device_path_utilities.c
@@ -7,6 +7,7 @@
#define LOG_CATEGORY LOGC_EFI
+#include <efi_device_path.h>
#include <efi_loader.h>
const efi_guid_t efi_guid_device_path_utilities_protocol =
@@ -31,7 +32,7 @@ static efi_uintn_t EFIAPI get_device_path_size(
efi_uintn_t sz = 0;
EFI_ENTRY("%pD", device_path);
- /* size includes the END node: */
+ /* size includes the EFI_DP_END node: */
if (device_path)
sz = efi_dp_size(device_path) + sizeof(struct efi_device_path);
return EFI_EXIT(sz);
diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c
index 5452640354e..47b583cc5e1 100644
--- a/lib/efi_loader/efi_disk.c
+++ b/lib/efi_loader/efi_disk.c
@@ -11,6 +11,7 @@
#include <dm.h>
#include <dm/device-internal.h>
#include <dm/tag.h>
+#include <efi_device_path.h>
#include <event.h>
#include <efi_driver.h>
#include <efi_loader.h>
diff --git a/lib/efi_loader/efi_fdt.c b/lib/efi_loader/efi_fdt.c
index 1ba6641d821..bfaa9cfc207 100644
--- a/lib/efi_loader/efi_fdt.c
+++ b/lib/efi_loader/efi_fdt.c
@@ -8,6 +8,7 @@
#define LOG_CATEGORY LOGC_EFI
+#include <efi_device_path.h>
#include <efi_loader.h>
#include <env.h>
#include <errno.h>
diff --git a/lib/efi_loader/efi_helper.c b/lib/efi_loader/efi_helper.c
index 19fb5d03fec..44b806aadc4 100644
--- a/lib/efi_loader/efi_helper.c
+++ b/lib/efi_loader/efi_helper.c
@@ -7,6 +7,7 @@
#include <blkmap.h>
#include <bootm.h>
+#include <efi_device_path.h>
#include <env.h>
#include <image.h>
#include <log.h>
@@ -199,7 +200,7 @@ efi_status_t efi_load_option_dp_join(struct efi_device_path **dp,
efi_free_pool(tmp_dp);
if (!*dp)
return EFI_OUT_OF_RESOURCES;
- *dp_size += efi_dp_size(initrd_dp) + sizeof(END);
+ *dp_size += efi_dp_size(initrd_dp) + sizeof(EFI_DP_END);
}
if (fdt_dp) {
@@ -209,10 +210,10 @@ efi_status_t efi_load_option_dp_join(struct efi_device_path **dp,
efi_free_pool(tmp_dp);
if (!*dp)
return EFI_OUT_OF_RESOURCES;
- *dp_size += efi_dp_size(fdt_dp) + sizeof(END);
+ *dp_size += efi_dp_size(fdt_dp) + sizeof(EFI_DP_END);
}
- *dp_size += sizeof(END);
+ *dp_size += sizeof(EFI_DP_END);
return EFI_SUCCESS;
}
diff --git a/lib/efi_loader/efi_net.c b/lib/efi_loader/efi_net.c
index b3291b4f1d5..8e708d8d350 100644
--- a/lib/efi_loader/efi_net.c
+++ b/lib/efi_loader/efi_net.c
@@ -17,6 +17,7 @@
#define LOG_CATEGORY LOGC_EFI
+#include <efi_device_path.h>
#include <efi_loader.h>
#include <dm.h>
#include <linux/sizes.h>
@@ -51,7 +52,7 @@ static int next_dp_entry;
static struct wget_http_info efi_wget_info = {
.set_bootdev = false,
.check_buffer_size = true,
-
+ .silent = true,
};
#endif
diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c
index 210a846ebc8..1832eeb5dce 100644
--- a/lib/efi_loader/efi_tcg2.c
+++ b/lib/efi_loader/efi_tcg2.c
@@ -10,6 +10,7 @@
#define LOG_CATEGORY LOGC_EFI
#include <dm.h>
+#include <efi_device_path.h>
#include <efi_loader.h>
#include <efi_variable.h>
#include <efi_tcg2.h>
diff --git a/lib/lwip/lwip/src/apps/altcp_tls/altcp_tls_mbedtls.c b/lib/lwip/lwip/src/apps/altcp_tls/altcp_tls_mbedtls.c
index ef51a5ac168..7459bfa468f 100644
--- a/lib/lwip/lwip/src/apps/altcp_tls/altcp_tls_mbedtls.c
+++ b/lib/lwip/lwip/src/apps/altcp_tls/altcp_tls_mbedtls.c
@@ -60,6 +60,8 @@
#if LWIP_ALTCP_TLS && LWIP_ALTCP_TLS_MBEDTLS
+#include "lwip/errno.h"
+
#include "lwip/altcp.h"
#include "lwip/altcp_tls.h"
#include "lwip/priv/altcp_priv.h"
@@ -299,7 +301,8 @@ altcp_mbedtls_lower_recv_process(struct altcp_pcb *conn, altcp_mbedtls_state_t *
LWIP_DEBUGF(ALTCP_MBEDTLS_DEBUG, ("mbedtls_ssl_handshake failed: %d\n", ret));
/* handshake failed, connection has to be closed */
if (ret == MBEDTLS_ERR_X509_CERT_VERIFY_FAILED) {
- printf("Certificate verification failed\n");
+ /* provide a cause for why the connection is closed to the called */
+ errno = EPERM;
}
if (conn->err) {
conn->err(conn->arg, ERR_CLSD);
@@ -844,9 +847,6 @@ altcp_tls_create_config(int is_server, u8_t cert_count, u8_t pkey_count, int hav
altcp_mbedtls_free_config(conf);
return NULL;
}
- if (authmode == MBEDTLS_SSL_VERIFY_NONE) {
- printf("WARNING: no CA certificates, HTTPS connections not authenticated\n");
- }
mbedtls_ssl_conf_authmode(&conf->conf, authmode);
mbedtls_ssl_conf_rng(&conf->conf, mbedtls_ctr_drbg_random, &altcp_tls_entropy_rng->ctr_drbg);