Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pxe] Add startpxe and stoppxe commands
These commands can be used to activate or deactivate the PXE API (on a specifiable network interface). This is currently of limited use, since most image formats will call shutdown() before booting the image, meaning that the underlying net device gets shut down during remove_devices() anyway.
- Loading branch information
Michael Brown
committed
Jun 28, 2009
1 parent
76c915d
commit 546cc62
Showing
4 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#include <gpxe/netdevice.h> | ||
#include <gpxe/command.h> | ||
#include <hci/ifmgmt_cmd.h> | ||
#include <pxe_call.h> | ||
|
||
FILE_LICENCE ( GPL2_OR_LATER ); | ||
|
||
static int startpxe_payload ( struct net_device *netdev ) { | ||
if ( netdev->state & NETDEV_OPEN ) | ||
pxe_activate ( netdev ); | ||
return 0; | ||
} | ||
|
||
static int startpxe_exec ( int argc, char **argv ) { | ||
return ifcommon_exec ( argc, argv, startpxe_payload, | ||
"Activate PXE on" ); | ||
} | ||
|
||
static int stoppxe_exec ( int argc __unused, char **argv __unused ) { | ||
pxe_deactivate(); | ||
return 0; | ||
} | ||
|
||
struct command pxe_commands[] __command = { | ||
{ | ||
.name = "startpxe", | ||
.exec = startpxe_exec, | ||
}, | ||
{ | ||
.name = "stoppxe", | ||
.exec = stoppxe_exec, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters