summaryrefslogtreecommitdiffstats
path: root/src/arch
diff options
context:
space:
mode:
authorMichael Brown2013-11-04 17:15:21 +0100
committerMichael Brown2013-11-05 18:15:24 +0100
commit55e85ad1ee318aa559f071d95741391eaf2dc1de (patch)
tree3800d4c1246319e68c914664a6d4afbad1d5b313 /src/arch
parent[ifmgmt] Rewrite iflinkwait() to use monojob_wait() (diff)
downloadipxe-55e85ad1ee318aa559f071d95741391eaf2dc1de.tar.gz
ipxe-55e85ad1ee318aa559f071d95741391eaf2dc1de.tar.xz
ipxe-55e85ad1ee318aa559f071d95741391eaf2dc1de.zip
[cmdline] Allow "if<xxx>" commands to take options
Allow commands implemented using ifcommon_exec() to accept command-specific options. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/i386/hci/commands/pxe_cmd.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/arch/i386/hci/commands/pxe_cmd.c b/src/arch/i386/hci/commands/pxe_cmd.c
index f86f180ce..c7cdb07f8 100644
--- a/src/arch/i386/hci/commands/pxe_cmd.c
+++ b/src/arch/i386/hci/commands/pxe_cmd.c
@@ -31,18 +31,21 @@ FILE_LICENCE ( GPL2_OR_LATER );
*
*/
-/** "startpxe" command descriptor */
-static struct command_descriptor startpxe_cmd =
- COMMAND_DESC ( struct ifcommon_options, ifcommon_opts, 0, MAX_ARGUMENTS,
- "[<interface>]" );
+/** "startpxe" options */
+struct startpxe_options {};
+
+/** "startpxe" option list */
+static struct option_descriptor startpxe_opts[] = {};
/**
* "startpxe" payload
*
* @v netdev Network device
+ * @v opts Command options
* @ret rc Return status code
*/
-static int startpxe_payload ( struct net_device *netdev ) {
+static int startpxe_payload ( struct net_device *netdev,
+ struct startpxe_options *opts __unused ) {
if ( netdev_is_open ( netdev ) )
pxe_activate ( netdev );
@@ -50,6 +53,12 @@ static int startpxe_payload ( struct net_device *netdev ) {
return 0;
}
+/** "startpxe" command descriptor */
+static struct ifcommon_command_descriptor startpxe_cmd =
+ IFCOMMON_COMMAND_DESC ( struct startpxe_options, startpxe_opts,
+ 0, MAX_ARGUMENTS, "[<interface>]",
+ startpxe_payload, 0 );
+
/**
* The "startpxe" command
*
@@ -58,7 +67,7 @@ static int startpxe_payload ( struct net_device *netdev ) {
* @ret rc Return status code
*/
static int startpxe_exec ( int argc, char **argv ) {
- return ifcommon_exec ( argc, argv, &startpxe_cmd, startpxe_payload, 0 );
+ return ifcommon_exec ( argc, argv, &startpxe_cmd );
}
/** "stoppxe" options */