1#include <gpxe/netdevice.h> 2#include <gpxe/command.h> 3#include <hci/ifmgmt_cmd.h> 4#include <pxe_call.h> 5 6FILE_LICENCE ( GPL2_OR_LATER ); 7 8static int startpxe_payload ( struct net_device *netdev ) { 9 if ( netdev->state & NETDEV_OPEN ) 10 pxe_activate ( netdev ); 11 return 0; 12} 13 14static int startpxe_exec ( int argc, char **argv ) { 15 return ifcommon_exec ( argc, argv, startpxe_payload, 16 "Activate PXE on" ); 17} 18 19static int stoppxe_exec ( int argc __unused, char **argv __unused ) { 20 pxe_deactivate(); 21 return 0; 22} 23 24struct command pxe_commands[] __command = { 25 { 26 .name = "startpxe", 27 .exec = startpxe_exec, 28 }, 29 { 30 .name = "stoppxe", 31 .exec = stoppxe_exec, 32 }, 33}; 34

