diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-07-02 10:59:30 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-07-02 10:59:30 +0200 |
commit | 6e4b15537b522fc6d393d664c12f40b4a00b5ef6 (patch) | |
tree | dc6dde42fe31820cd86719ed1d0c3e20983dff6b /commands | |
parent | dd3c898d06a55a4c6fe94dae3f732a541e983432 (diff) | |
parent | a0b061147767c16eb443f510b7424e03d2f07209 (diff) | |
download | barebox-6e4b15537b522fc6d393d664c12f40b4a00b5ef6.tar.gz barebox-6e4b15537b522fc6d393d664c12f40b4a00b5ef6.tar.xz |
Merge branch 'for-next/misc'
Diffstat (limited to 'commands')
-rw-r--r-- | commands/Kconfig | 4 | ||||
-rw-r--r-- | commands/Makefile | 1 | ||||
-rw-r--r-- | commands/go.c | 2 | ||||
-rw-r--r-- | commands/msleep.c | 40 | ||||
-rw-r--r-- | commands/net.c | 29 | ||||
-rw-r--r-- | commands/sleep.c | 2 |
6 files changed, 47 insertions, 31 deletions
diff --git a/commands/Kconfig b/commands/Kconfig index 4555b71893..41ebf6c587 100644 --- a/commands/Kconfig +++ b/commands/Kconfig @@ -25,6 +25,10 @@ config CMD_SLEEP tristate prompt "sleep" +config CMD_MSLEEP + tristate + prompt "msleep" + config CMD_SAVEENV tristate select ENV_HANDLING diff --git a/commands/Makefile b/commands/Makefile index 3f5f166de1..0710bb46a4 100644 --- a/commands/Makefile +++ b/commands/Makefile @@ -10,6 +10,7 @@ obj-$(CONFIG_CMD_MTEST) += memtest.o obj-$(CONFIG_CMD_EDIT) += edit.o obj-$(CONFIG_CMD_EXEC) += exec.o obj-$(CONFIG_CMD_SLEEP) += sleep.o +obj-$(CONFIG_CMD_MSLEEP) += msleep.o obj-$(CONFIG_CMD_RESET) += reset.o obj-$(CONFIG_CMD_GO) += go.o obj-$(CONFIG_NET) += net.o diff --git a/commands/go.c b/commands/go.c index e9e9d40dbe..14569a52e5 100644 --- a/commands/go.c +++ b/commands/go.c @@ -92,5 +92,5 @@ BAREBOX_CMD_START(go) .cmd = do_go, .usage = "start application at address or file", BAREBOX_CMD_HELP(cmd_go_help) - BAREBOX_CMD_COMPLETE(cammand_var_complete) + BAREBOX_CMD_COMPLETE(command_var_complete) BAREBOX_CMD_END diff --git a/commands/msleep.c b/commands/msleep.c new file mode 100644 index 0000000000..c9fa23cc45 --- /dev/null +++ b/commands/msleep.c @@ -0,0 +1,40 @@ +/* + * msleep.c - delay execution for n milliseconds + * + * Copyright (c) 2012 Steffen Trumtrar <s.trumtrar@pengutronix.de>, Pengutronix + * + * derived from commands/sleep.c + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include <common.h> +#include <command.h> +#include <clock.h> + +static int do_msleep(int argc, char *argv[]) +{ + ulong delay; + + if (argc != 2) + return COMMAND_ERROR_USAGE; + + delay = simple_strtoul(argv[1], NULL, 10); + + mdelay(delay); + + return 0; +} + +BAREBOX_CMD_START(msleep) + .cmd = do_msleep, + .usage = "delay execution for n milliseconds", +BAREBOX_CMD_END diff --git a/commands/net.c b/commands/net.c index a453f4ed33..e77f12fce6 100644 --- a/commands/net.c +++ b/commands/net.c @@ -36,35 +36,6 @@ #include <errno.h> #include <libbb.h> -#ifdef CONFIG_NET_RARP -extern void RarpRequest(void); - -static int do_rarpb(int argc, char *argv[]) -{ - int size; - - if (NetLoopInit(RARP) < 0) - return 1; - - NetOurIP = 0; - RarpRequest(); /* Basically same as BOOTP */ - - if ((size = NetLoop()) < 0) - return 1; - - /* NetLoop ok, update environment */ - netboot_update_env(); - - return 0; -} - -BAREBOX_CMD_START(rarpboot) - .cmd = do_rarpb, - .usage = "boot image via network using rarp/tftp protocol", - BAREBOX_CMD_HELP("[loadAddress] [bootfilename]\n") -BAREBOX_CMD_END -#endif /* CONFIG_NET_RARP */ - static int do_ethact(int argc, char *argv[]) { struct eth_device *edev; diff --git a/commands/sleep.c b/commands/sleep.c index c5f7867400..950ec08743 100644 --- a/commands/sleep.c +++ b/commands/sleep.c @@ -47,5 +47,5 @@ static int do_sleep(int argc, char *argv[]) BAREBOX_CMD_START(sleep) .cmd = do_sleep, .usage = "delay execution for n seconds", - BAREBOX_CMD_COMPLETE(cammand_var_complete) + BAREBOX_CMD_COMPLETE(command_var_complete) BAREBOX_CMD_END |