Merge patch series "pxe: Precursor series for supporting read_all() in extlinux / PXE"
Simon Glass <sjg@chromium.org> says: This series includes some patches related to allowing read_all() to be used with the extlinux / PXE bootmeths. These patches were split out from the stb4 series, since it will need to have additional patches for LWIP, to avoid breaking PXE booting when LWIP is used. Link: https://lore.kernel.org/r/20250306002533.2380866-1-sjg@chromium.org
This commit is contained in:
44
net/net.c
44
net/net.c
@@ -775,6 +775,50 @@ done:
|
||||
return ret;
|
||||
}
|
||||
|
||||
int netboot_run_(enum proto_t proto, ulong addr, const char *fname, ulong size,
|
||||
bool fname_explicit, bool ipv6)
|
||||
{
|
||||
int ret;
|
||||
|
||||
bootstage_mark(BOOTSTAGE_ID_NET_START);
|
||||
|
||||
/*
|
||||
* For now we use the global variables as that is the only way to
|
||||
* control the network stack. At some point, perhaps, the state could be
|
||||
* in a struct
|
||||
*/
|
||||
if (IS_ENABLED(CONFIG_CMD_TFTPPUT) && proto == TFTPPUT)
|
||||
image_save_addr = addr;
|
||||
else
|
||||
image_load_addr = addr;
|
||||
|
||||
net_boot_file_name_explicit = fname_explicit;
|
||||
copy_filename(net_boot_file_name, fname, sizeof(net_boot_file_name));
|
||||
if (IS_ENABLED(CONFIG_IPV6))
|
||||
use_ip6 = ipv6;
|
||||
if (IS_ENABLED(CONFIG_CMD_TFTPPUT) && proto == TFTPPUT) {
|
||||
image_save_addr = addr;
|
||||
image_save_size = size;
|
||||
} else {
|
||||
image_load_addr = addr;
|
||||
}
|
||||
|
||||
ret = net_loop(proto);
|
||||
if (ret < 0) {
|
||||
bootstage_error(BOOTSTAGE_ID_NET_NETLOOP_OK);
|
||||
return ret;
|
||||
}
|
||||
bootstage_mark(BOOTSTAGE_ID_NET_NETLOOP_OK);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int netboot_run(enum proto_t proto, ulong addr, const char *fname, ulong size,
|
||||
bool ipv6)
|
||||
{
|
||||
return netboot_run_(proto, addr, fname, size, true, ipv6);
|
||||
}
|
||||
|
||||
/**********************************************************************/
|
||||
|
||||
static void start_again_timeout_handler(void)
|
||||
|
Reference in New Issue
Block a user