summaryrefslogtreecommitdiff
path: root/cmd/net.c
AgeCommit message (Collapse)Author
2018-07-26net: Read bootfile from env on netboot_common()Joe Hershberger
Instead of depending on a env callback for bootfile, read it explicitly. We do this because the bootfile can be specified on the command line and if it is, we will overwrite the internal variable. If a netboot_common() is called again with no bootfile parameter, we want to use the one in the environment. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2018-07-02net: Prefer command line argumentsAlexander Graf
We can call commands like dhcp and bootp without arguments or with explicit command line arguments that really should tell the code where to look for files instead. Unfortunately, the current code simply overwrites command line arguments in the dhcp case with dhcp values. This patch allows the code to preserve the command line values if they were set on the command line. That way the semantics are slightly more intuitive. The reason this patch does that by introducing a new variable is that we can not rely on net_boot_file_name[0] being unset, as today it's completely legal to call "dhcp" and afterwards run "tftp" and expect the latter to repeat the same query as before. I would prefer not to break that behavior in case anyone relies on it. Signed-off-by: Alexander Graf <agraf@suse.de> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-04-13net: Make CMD_NET a menuconfigJoe Hershberger
Previously, CMD_NET was an alias for 2 commands (bootp and tftpboot) and they we not able to be disabled. Separate out those 2 commands and move CMD_NET up to the menu level, which more accurately represents the code. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Duncan Hare <dh@synoia.com>
2017-08-16env: Rename some other getenv()-related functionsSimon Glass
We are now using an env_ prefix for environment functions. Rename these other functions as well, for consistency: getenv_vlan() getenv_bootm_size() getenv_bootm_low() getenv_bootm_mapsize() env_get_default() Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16env: Rename getenv/_f() to env_get()Simon Glass
We are now using an env_ prefix for environment functions. Rename these two functions for consistency. Also add function comments in common.h. Quite a few places use getenv() in a condition context, provoking a warning from checkpatch. These are fixed up in this patch also. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16env: Rename setenv() to env_set()Simon Glass
We are now using an env_ prefix for environment functions. Rename setenv() for consistency. Also add function comments in common.h. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-07net: add static to do_tftpput()Masahiro Yamada
This is only used in cmd/net.c Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2016-12-27cmd: net: fix function name in commentBaruch Siach
In commit 7044c6bb6 (net: cosmetic: Clean up DHCP variables and functions) BootpCopyNetParams() was renamed to store_net_params(). Update the reference in comment. Cc: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
2016-10-13net: Fix cache misalignment message after network load operationsPeter Chubb
After any operation that downloads a file (e.g., pxe get, or dhcp), the buffer containing the downloaded data is flushed. This is unnecessary and annoying. Unnecessary, because the network driver should already have fliushed the cache for the DMAed area, and annoying because it generates a cache misalignment message. Signed-off-by: Peter Chubb <peter.chubb@data61.csiro.au> Acked-by: Heiko Schocher <hs@denx.de> Acked-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-01-25Remove the cmd_ prefix from command filesSimon Glass
Now that they are in their own directory, we can remove this prefix. This makes it easier to find a file since the prefix does not get in the way. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Heiko Schocher <hs@denx.de> Acked-by: Stefan Roese <sr@denx.de> Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>