This function requires access to env.h but it is a lot to include just for the env_get() function. It eventually pulls in linux/byteorder which causes a conflict with exfat which has its own byteorder functions. Move the function to a C file instead. Add includes to some other files to keep the build working. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
34 lines
665 B
C
34 lines
665 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
#include <env.h>
|
|
#include <net-common.h>
|
|
|
|
void copy_filename(char *dst, const char *src, int size)
|
|
{
|
|
if (src && *src && (*src == '"')) {
|
|
++src;
|
|
--size;
|
|
}
|
|
|
|
while ((--size > 0) && src && *src && (*src != '"'))
|
|
*dst++ = *src++;
|
|
*dst = '\0';
|
|
}
|
|
|
|
struct wget_http_info default_wget_info = {
|
|
.method = WGET_HTTP_METHOD_GET,
|
|
.set_bootdev = true,
|
|
};
|
|
|
|
struct wget_http_info *wget_info;
|
|
|
|
int wget_request(ulong dst_addr, char *uri, struct wget_http_info *info)
|
|
{
|
|
wget_info = info ? info : &default_wget_info;
|
|
return wget_with_dns(dst_addr, uri);
|
|
}
|
|
|
|
struct in_addr env_get_ip(char *var)
|
|
{
|
|
return string_to_ip(env_get(var));
|
|
}
|