aboutsummaryrefslogtreecommitdiff
path: root/include/net.h
diff options
context:
space:
mode:
authorLothar Felten2018-06-22 22:29:54 +0200
committerJoe Hershberger2018-07-02 14:14:20 -0500
commitd8970dae276377a0beff1c3e9d8b6f805ecf5cd5 (patch)
treeeb3fdb9ef7d734fbca0d0a92ddd30915c52ba44a /include/net.h
parent318b5d76b6661dcaf6934b0a925bbcfdf0469069 (diff)
net: Add new wol command - Wake on LAN
Add a new command 'wol': Wait for an incoming Wake-on-LAN packet or time out if no WoL packed is received. If the WoL packet contains a password, it is saved in the environment variable 'wolpassword' using the etherwake format (dot or colon separated decimals). Intended use case: a networked device should boot an alternate image. It's attached to a network on a client site, modifying the DHCP server configuration or setup of a tftp server is not allowed. After power on the device waits a few seconds for a WoL packet. If a packet is received, the device boots the alternate image. Otherwise it boots the default image. This method is a simple way to interact with a system via network even if only the MAC address is known. Tools to send WoL packets are available on all common platforms. Some Ethernet drivers seem to pad the incoming packet. The additional padding bytes might be recognized as Wake-on-LAN password bytes. By default enabled in pengwyn_defconfig. Signed-off-by: Lothar Felten <lothar.felten@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'include/net.h')
-rw-r--r--include/net.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/net.h b/include/net.h
index 57606855564..9c7199aca92 100644
--- a/include/net.h
+++ b/include/net.h
@@ -344,6 +344,7 @@ struct vlan_ethernet_hdr {
#define PROT_IP 0x0800 /* IP protocol */
#define PROT_ARP 0x0806 /* IP ARP protocol */
+#define PROT_WOL 0x0842 /* ether-wake WoL protocol */
#define PROT_RARP 0x8035 /* IP ARP protocol */
#define PROT_VLAN 0x8100 /* IEEE 802.1q protocol */
#define PROT_IPV6 0x86dd /* IPv6 over bluebook */
@@ -535,7 +536,7 @@ extern int net_restart_wrap; /* Tried all network devices */
enum proto_t {
BOOTP, RARP, ARP, TFTPGET, DHCP, PING, DNS, NFS, CDP, NETCONS, SNTP,
- TFTPSRV, TFTPPUT, LINKLOCAL, FASTBOOT
+ TFTPSRV, TFTPPUT, LINKLOCAL, FASTBOOT, WOL
};
extern char net_boot_file_name[1024];/* Boot File name */