You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pxe_cmd.c 670B

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