summaryrefslogtreecommitdiff
path: root/common/cmd_net.c
Commit message (Collapse)AuthorAgeLines
* net: Add link-local addressing supportJoe Hershberger2012-05-23-0/+31
| | | | | | | Code based on networking/zcip.c in busybox commit 8531d76a15890c2c535908ce888b2e2aed35b172 Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
* net: Don't write the "serverip" env var if configured not toJoe Hershberger2012-05-23-2/+6
| | | | | | | Before this patch, bootp would not overwrite the value, but the value was still clobbered in the env Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
* bootstage: Plumb in bootstage calls for basic operationsSimon Glass2012-03-18-1/+6
| | | | | | | | This inserts bootstage calls into tftp, usb start and bootm. We could go further, but this is a reasonable start to illustrate the concept. Signed-off-by: Simon Glass <sjg@chromium.org>
* bootstage: Replace show_boot_progress/error() with bootstage_...()Simon Glass2012-03-18-8/+8
| | | | | | | These calls should not be made directly any more, since bootstage will call the show_boot_...() functions as needed. Signed-off-by: Simon Glass <sjg@chromium.org>
* bootstage: Convert net progress numbers to enumsSimon Glass2012-03-18-8/+9
| | | | | | | This changes over the network-related progress numbers to use enums from bootstage.h. Signed-off-by: Simon Glass <sjg@chromium.org>
* bootstage: Use show_boot_error() for -ve progress numbersSimon Glass2012-03-18-7/+7
| | | | | | | | Rather than the caller negating our progress numbers to indicate an error has occurred, which seems hacky, add a function to indicate this. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Mike Frysinger <vapier@gentoo.org>
* Convert cmd_usage() calls in common to use a return valueSimon Glass2012-03-06-3/+3
| | | | | | | | | Change all files in common/ to use CMD_RET_USAGE instead of calling cmd_usage() directly. I'm not completely sure about this patch since the code since impact is small (100 byte or so on ARM) and it might need splitting into smaller patches. But for now here it is. Signed-off-by: Simon Glass <sjg@chromium.org>
* net: Fix arguments in tftpput commandSimon Glass2011-12-20-2/+5
| | | | | | | | | | | | The switch to strict_strtoul() was not done correctly - this fixes the compile error when CONFIG_CMD_TFTPPUT is active. There appears to very little use of strict_strtoul() in commands, so it might be easier to switch to simple_strtoul(). If not, we should decide the best way to use strict_strtoul(). For now I have added a friendly message which will of course increase code size. Signed-off-by: Simon Glass <sjg@chromium.org>
* net: tftpput: add tftpput commandSimon Glass2011-10-26-0/+23
| | | | | | This adds the tftpput command to U-Boot. Signed-off-by: Simon Glass <sjg@chromium.org>
* net: tftpput: Rename TFTP to TFTPGETSimon Glass2011-10-26-4/+4
| | | | | | | | This is a better name for this protocol. Also remove the typedef to keep checkpatch happy, and move zeroing of NetBootFileXferSize a little earlier since TFTPPUT will need to change this. Signed-off-by: Simon Glass <sjg@chromium.org>
* autostart: unify duplicated logic into the bootm codeMike Frysinger2011-07-25-11/+2
| | | | | | | | | | | Rather than having a bunch of random commands handle autostart behavior, unify the logic in a single place. This also fixes building of these different commands when bootm is disabled. Acked-by: Matthew McClintock <msm@freescale.com> Acked-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sntp: avoid use of uninitialized variableLuuk Paulussen2011-06-01-1/+2
| | | | | | | | | | | When we use the ntpserverip environment variable argv[1] may not be set. Printing the error message using the NetNtpServerIP variable ensures the correct output in both cases. Signed-off-by: Luuk Paulussen <luuk.paulussen@alliedtelesis.co.nz> Acked-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Cc: Ben Warren <biggerbadderben@gmail.com> Acked-by: Detlev Zundel <dzu@denx.de>
* TFTP: add tftpsrv commandLuca Ceresoli2011-05-19-0/+17
| | | | | | Signed-off-by: Luca Ceresoli <luca.ceresoli@comelit.it> Cc: Wolfgang Denk <wd@denx.de> Acked-by: Detlev Zundel <dzu@denx.de>
* Revert "boot cmds: convert to getenv_yesno() with autostart"Wolfgang Denk2011-01-11-1/+1
| | | | | | | | | | This reverts commit 5a442c0addc69d0c4b58e98e5aec1cf07576debb. This commit changed the behaviour of getenv_yesno() (both the default behaviour and the documented behaviour for abbreviated arguments) which resulted in problems in several areas. Signed-off-by: Wolfgang Denk <wd@denx.de>
* cmd_net.c: fix build breakageWolfgang Denk2010-12-23-0/+1
| | | | | | | | | | | | Commit 722b061 "autocomplete: remove runtime handler install" caused some boards (like NETTA2_V2) to break with errors like these: cmd_net.c:296: error: expected expression before ',' token Fix this. Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Mike Frysinger <vapier@gentoo.org>
* boot cmds: convert to getenv_yesno() with autostartMike Frysinger2010-11-28-1/+1
| | | | | | | Use the new helper func to clean up duplicate logic handling of the autostart env var. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* do_bootm: unify duplicate prototypesMike Frysinger2010-11-28-2/+0
| | | | | | | | The duplication of the do_bootm prototype has gotten out of hand, and they're pretty much all outdated (wrt constness). Unify them all in command.h. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Revert "cmd_net: drop spurious comma in U_BOOT_CMD"Wolfgang Denk2010-10-27-1/+1
| | | | | | | | | | This commit causes build errors like this: cmd_net.c:301:1: error: macro "U_BOOT_CMD" requires 6 arguments, but only 5 given cmd_net.c:298: warning: data definition has no type or storage class cmd_net.c:298: warning: type defaults to 'int' in declaration of 'U_BOOT_CMD' This reverts commit 8f4cb77ef7183ce1bb3f767604a0677c6f6d84a7.
* cmd_net: drop spurious comma in U_BOOT_CMDMike Frysinger2010-10-26-1/+1
| | | | | | | Building for boards that have CONFIG_CMD_CDP enabled fail with: cmd_net.c:301: error: expected expression before ',' token Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* rarp: Condtionally compile rarp supportPeter Tyser2010-10-11-0/+2
| | | | | | | | Most people don't use the 'rarpboot' command, so only enable it when CONFIG_CMD_RARP is defined. Signed-off-by: Peter Tyser <ptyser@xes-inc.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* cmd_usage(): simplify return code handlingWolfgang Denk2010-07-24-10/+6
| | | | | | | | | | | | | | | | Lots of code use this construct: cmd_usage(cmdtp); return 1; Change cmd_usage() let it return 1 - then we can replace all these ocurrances by return cmd_usage(cmdtp); This fixes a few places with incorrect return code handling, too. Signed-off-by: Wolfgang Denk <wd@denx.de>
* Make sure that argv[] argument pointers are not modified.Wolfgang Denk2010-07-04-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The hush shell dynamically allocates (and re-allocates) memory for the argument strings in the "char *argv[]" argument vector passed to commands. Any code that modifies these pointers will cause serious corruption of the malloc data structures and crash U-Boot, so make sure the compiler can check that no such modifications are being done by changing the code into "char * const argv[]". This modification is the result of debugging a strange crash caused after adding a new command, which used the following argument processing code which has been working perfectly fine in all Unix systems since version 6 - but not so in U-Boot: int main (int argc, char **argv) { while (--argc > 0 && **++argv == '-') { /* ====> */ while (*++*argv) { switch (**argv) { case 'd': debug++; break; ... default: usage (); } } } ... } The line marked "====>" will corrupt the malloc data structures and usually cause U-Boot to crash when the next command gets executed by the shell. With the modification, the compiler will prevent this with an error: increment of read-only location '*argv' N.B.: The code above can be trivially rewritten like this: while (--argc > 0 && **++argv == '-') { char *arg = *argv; while (*++arg) { switch (*arg) { ... Signed-off-by: Wolfgang Denk <wd@denx.de> Acked-by: Mike Frysinger <vapier@gentoo.org>
* Remove deprecated 'autoscr' command/variablesPeter Tyser2009-09-22-15/+0
| | | | | | | | | | | | | | | The more standard 'source' command provides identical functionality to the autoscr command. Environment variable names/values on the MVBC_P, MVBML7, kmeter1, mgcoge, and km8xx boards are updated to no longer refernce 'autoscr'. The 'autoscript' and 'autoscript_uname' environment variables are also removed. Signed-off-by: Peter Tyser <ptyser@xes-inc.com> Acked-by: Andre Schwarz <andre.schwarz@matrix-vision.de> Acked-by: Heiko Schocher <hs@denx.de>
* Coding Style cleanup; update CHANGELOG.Wolfgang Denk2009-07-23-1/+0
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* Add DNS supportRobin Getz2009-07-22-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On 04 Oct 2008 Pieter posted a dns implementation for U-Boot. http://www.mail-archive.com/u-boot-users@lists.sourceforge.net/msg10216.html > > DNS can be enabled by setting CFG_CMD_DNS. After performing a query, > the serverip environment var is updated. > > Probably there are some cosmetic issues with the patch. Unfortunatly I > do not have the time to correct these. So if anybody else likes DNS > support in U-Boot and has the time, feel free to patch it in the main tree. Here it is again - slightly modified & smaller: - update to 2009-06 (Pieter's patch was for U-Boot 1.2.0) - README.dns is added - syntax is changed (now takes a third option, the env var to store the result in) - add a random port() function in net.c - sort Makefile in ./net/Makefile - dns just returns unless a env var is given - run through checkpatch, and clean up style issues - remove packet from stack - cleaned up some comments - failure returns much faster (if server responds, don't wait for timeout) - use built in functions (memcpy) rather than byte copy. Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org> Signed-off-by: Pieter Voorthuijsen <pieter.voorthuijsen@prodrive.nl> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* General help message cleanupWolfgang Denk2009-06-12-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many of the help messages were not really helpful; for example, many commands that take no arguments would not print a correct synopsis line, but "No additional help available." which is not exactly wrong, but not helpful either. Commit ``Make "usage" messages more helpful.'' changed this partially. But it also became clear that lots of "Usage" and "Help" messages (fields "usage" and "help" in struct cmd_tbl_s respective) were actually redundant. This patch cleans this up - for example: Before: => help dtt dtt - Digital Thermometer and Thermostat Usage: dtt - Read temperature from digital thermometer and thermostat. After: => help dtt dtt - Read temperature from Digital Thermometer and Thermostat Usage: dtt Signed-off-by: Wolfgang Denk <wd@denx.de>
* Fix quoting bug introduced by commit 74de7aefWolfgang Denk2009-04-04-1/+1
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* Add "source" command; prepare removal of "autoscr" commandWolfgang Denk2009-04-03-3/+4
| | | | | | | | | | | | | | | | | | | | | According to the doc/feature-removal-schedule.txt, the "autoscr" command will be replaced by the "source" command in approximately 6 months from now. This patch prepares this change and starts a 6 month transition period as follows: - The new "source" command has been added, which implements exactly the same functionlaity as the old "autoscr" command before - The old "autoscr" command name is kept as an alias for compatibility - Command sequences, script files atc. have been adapted to use the new "source" command - Related environment variables ("autoscript", "autoscript_uname") have *not* been adapted yet; these will be renamed resp. removed in a separate patch when the support for the "autoscr" command get's finally dropped. Signed-off-by: Wolfgang Denk <wd@denx.de>
* Command usage cleanupPeter Tyser2009-01-28-8/+8
| | | | | | | | Remove command name from all command "usage" fields and update common/command.c to display "name - usage" instead of just "usage". Also remove newlines from command usage fields. Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
* Standardize command usage messages with cmd_usage()Peter Tyser2009-01-28-2/+2
| | | | Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
* net: Fix download command parsingPeter Tyser2008-12-04-8/+12
| | | | | | | | | | | | | | | | When CONFIG_SYS_HUSH_PARSER is defined network download commands with 1 argument in the format 'tftp "/path/file"' do not work as expected. The hush command parser strips the quotes from "/path/file" which causes the network commands to interpret "/path/file" as an address instead of the intended filename. The previous check for a leading quote in netboot_common() was replaced with a check which ensures only valid numbers are treated as addresses. Signed-off-by: Peter Tyser <ptyser@xes-inc.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* Standardize bootp, tftpboot, rarpboot, dhcp, and nfs command descriptionsPeter Tyser2008-08-26-5/+5
| | | | | | | | | cmd_net.c command descriptions were updated to describe the optional hostIPaddr argument. The dhcp command help message was also updated to more closely reflect the other commands in cmd_net.c Signed-off-by: Peter Tyser <ptyser@xes-inc.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* [new uImage] Add new uImage format support to autoscript routineMarian Balakowicz2008-03-12-2/+9
| | | | | | | | | | | | | | | autoscript() routine is updated to accept second argument, which is only used for FIT images and provides a FIT subimage unit name. autoscript() routine callers must now pass two arguments. For non-interactive use (like in cmd_load.c, cmd_net.c), new environment variable 'autoscript_uname' is introduced and used as a FIT subimage unit name source. autoscript command accepts extended syntax of the addr argument: addr:<subimg_uname> Signed-off-by: Marian Balakowicz <m8@semihalf.com>
* TFTP: add host ip addr supportJean-Christophe PLAGNIOL-VILLARD2008-02-05-1/+1
| | | | | | | | allow to use a different server as set in serverip add CONFIG_TFTP_FILE_NAME_MAX_LEN to configure the file name length if not defined the max length will be at 128 Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Fix nfs command help to reflect that the serverip is optionalJean-Christophe PLAGNIOL-VILLARD2008-01-16-1/+1
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* [BUILD] conditionally compile common/cmd_*.c in common/MakefileGrant Likely2007-11-20-4/+0
| | | | | | | Modify common/Makefile to conditionally compile the cmd_*.c files based on the board config. Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
* Merge with /home/wd/git/u-boot/custodian/u-boot-testingWolfgang Denk2007-08-06-15/+17
|\
| * Merge branch 'testing' into workingAndy Fleming2007-08-03-15/+17
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: CHANGELOG fs/fat/fat.c include/configs/MPC8560ADS.h include/configs/pcs440ep.h net/eth.c
| | * common/: Remove lingering references to CFG_CMD_* symbols.Jon Loeliger2007-07-10-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | Fixed some broken instances of "#ifdef CMD_CFG_IDE" too. Those always evaluated TRUE, and thus were always compiled even when IDE really wasn't defined/wanted. Signed-off-by: Jon Loeliger <jdl@freescale.com>
| | * Finally retire cmd_confdefs.h and CONFIG_BOOTP_MASK!Jon Loeliger2007-07-09-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All of the choices for CONFIG_BOOTP_ are now documented in the README file. You must now individually select exactly the set that you want using a series of #define CONFIG_BOOTP_<x> statements in the board port config files now. Signed-off-by: Jon Loeliger <jdl@freescale.com>
| | * common/cmd_[i-n]*: Remove obsolete references to CONFIG_COMMANDS.Jon Loeliger2007-07-08-8/+8
| | | | | | | | | | | | Signed-off-by: Jon Loeliger <jdl@freescale.com>
| | * common/cmd_[i-z]* : Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*).Jon Loeliger2007-07-04-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a compatibility step that allows both the older form and the new form to co-exist for a while until the older can be removed entirely. All transformations are of the form: Before: #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) After: #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT) Signed-off-by: Jon Loeliger <jdl@freescale.com>
* | | make show_boot_progress () weak.Heiko Schocher2007-07-13-19/+9
|/ / | | | | | | Signed-off-by: Heiko Schocher <hs@denx.de>
* | [PCS440EP] upgrade the PCS440EP board:Heiko Schocher2007-06-22-2/+24
|/ | | | | | | | | | | | - Show on the Status LEDs, some States of the board. - Get the MAC addresses from the EEProm - use PREBOOT - use the CF on the board. - check the U-Boot image in the Flash with a SHA1 checksum. - use dynamic TLB entries generation for the SDRAM Signed-off-by: Heiko Schocher <hs@denx.de>
* * Patch by Ladislav Michl, 05 Apr 2005:wdenk2005-04-05-2/+2
| | | | | | | | | Add support for VoiceBlue board. * Patch by Ladislav Michl, 05 Apr 2005: Fix netboot_common() prototypes. * Cleanup.
* Fix problems with SNTP support;wdenk2005-04-02-2/+2
| | | | enable SNTP support in some boards.
* * Patch by Masami Komiya, 30 Mar 2005:wdenk2005-04-01-0/+51
| | | | | | | | add SNTP support and expand time server and time offset fields of DHCP support. See doc/README.SNTP * Patch by Steven Scholz, 13 Dec 2004: Fix bug in at91rm920 ethernet driver
* Patch by Thomas Viehweger, 14 May 2004:wdenk2004-06-09-5/+5
| | | | | | | - flash.h: more flash types added - immap_8260.h: some bits added (useful for RMII) - cmd_coninfo.c: typo corrected, printf -> puts - reduced size by replacing spaces with tab
* * Cleanup, minor fixeswdenk2004-04-18-45/+33
| | | | | | | | | * Patch by Rune Torgersen, 16 Apr 2004: LBA48 fixes * Patches by Pantelis Antoniou, 16 Apr 2004: - Fix some compile problems; add "once" functionality for the netretry variable
* Patches by Pantelis Antoniou, 30 Mar 2004:wdenk2004-04-15-1/+54
| | | | add networking support for VLANs (802.1q), and CDP (Cisco Discovery Protocol)