X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=net%2Fnet.c;h=f35695b4fc9f0b62ffd8189c4cc9693c9dc41f87;hb=9b2ebcc06048cf49c2f8a8d152177ed1a8363878;hp=a4932f46d905f51d0466983b2032a35b134e4e73;hpb=582d97b6d37ed1bfce575c32d3847a42fc633b8e;p=u-boot diff --git a/net/net.c b/net/net.c index a4932f46d9..f35695b4fc 100644 --- a/net/net.c +++ b/net/net.c @@ -78,6 +78,12 @@ * - own IP address * We want: - network time * Next step: none + * + * WOL: + * + * Prerequisites: - own ethernet address + * We want: - magic packet or timeout + * Next step: none */ @@ -108,6 +114,9 @@ #if defined(CONFIG_CMD_SNTP) #include "sntp.h" #endif +#if defined(CONFIG_CMD_WOL) +#include "wol.h" +#endif /** BOOTP EXTENTIONS **/ @@ -165,6 +174,8 @@ ushort net_native_vlan = 0xFFFF; /* Boot File name */ char net_boot_file_name[1024]; +/* Indicates whether the file name was specified on the command line */ +bool net_boot_file_name_explicit; /* The actual transferred size of the bootfile (in bytes) */ u32 net_boot_file_size; /* Boot file size in blocks as reported by the DHCP server */ @@ -393,6 +404,7 @@ void net_init(void) int net_loop(enum proto_t protocol) { int ret = -EINVAL; + enum net_loop_state prev_net_state = net_state; net_restarted = 0; net_dev_exists = 0; @@ -430,6 +442,7 @@ restart: case 1: /* network not configured */ eth_halt(); + net_set_state(prev_net_state); return -ENODEV; case 2: @@ -512,6 +525,11 @@ restart: case LINKLOCAL: link_local_start(); break; +#endif +#if defined(CONFIG_CMD_WOL) + case WOL: + wol_start(); + break; #endif default: break; @@ -655,6 +673,7 @@ done: net_set_udp_handler(NULL); net_set_icmp_handler(NULL); #endif + net_set_state(prev_net_state); return ret; } @@ -1278,6 +1297,11 @@ void net_process_received_packet(uchar *in_packet, int len) ntohs(ip->udp_src), ntohs(ip->udp_len) - UDP_HDR_SIZE); break; +#ifdef CONFIG_CMD_WOL + case PROT_WOL: + wol_receive(ip, len); + break; +#endif } }