mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 08:42:12 +02:00
env: Add a bootfile env handler
Remove the hard-coded bootfile handler and use a callback instead Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
This commit is contained in:
committed by
Tom Rini
parent
5e2b3e0c59
commit
a9f51c9b43
17
net/net.c
17
net/net.c
@@ -82,6 +82,7 @@
|
||||
|
||||
#include <common.h>
|
||||
#include <command.h>
|
||||
#include <environment.h>
|
||||
#include <net.h>
|
||||
#if defined(CONFIG_STATUS_LED)
|
||||
#include <miiphy.h>
|
||||
@@ -208,6 +209,22 @@ static int NetTryCount;
|
||||
|
||||
/**********************************************************************/
|
||||
|
||||
static int on_bootfile(const char *name, const char *value, enum env_op op,
|
||||
int flags)
|
||||
{
|
||||
switch (op) {
|
||||
case env_op_create:
|
||||
case env_op_overwrite:
|
||||
copy_filename(BootFile, value, sizeof(BootFile));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
U_BOOT_ENV_CALLBACK(bootfile, on_bootfile);
|
||||
|
||||
/*
|
||||
* Check if autoload is enabled. If so, use either NFS or TFTP to download
|
||||
* the boot file.
|
||||
|
Reference in New Issue
Block a user