phy: atheros: move delay config to common function
[oweals/u-boot.git] / net / link_local.c
index ea5b4f4332b7b3e443741d524b6b76f4d85b44fe..1986b9b9d3b63b03831daa5e5f6bc72958c64153 100644 (file)
@@ -12,7 +12,9 @@
  */
 
 #include <common.h>
+#include <env.h>
 #include <net.h>
+#include <rand.h>
 #include "arp.h"
 #include "net_rand.h"
 
@@ -99,19 +101,19 @@ static void configure_wait(void)
        debug_cond(DEBUG_DEV_PKT, "...wait %d %s nprobes=%u, nclaims=%u\n",
                   timeout_ms, eth_get_name(), nprobes, nclaims);
 
-       NetSetTimeout(timeout_ms, link_local_timeout);
+       net_set_timeout_handler(timeout_ms, link_local_timeout);
 }
 
 void link_local_start(void)
 {
-       ip = getenv_ip("llipaddr");
+       ip = env_get_ip("llipaddr");
        if (ip.s_addr != 0 &&
            (ntohl(ip.s_addr) & IN_CLASSB_NET) != LINKLOCAL_ADDR) {
                puts("invalid link address");
                net_set_state(NETLOOP_FAIL);
                return;
        }
-       net_netmask.s_addr = IN_CLASSB_NET;
+       net_netmask.s_addr = htonl(IN_CLASSB_NET);
 
        seed = seed_mac();
        if (ip.s_addr == 0)
@@ -182,7 +184,7 @@ static void link_local_timeout(void)
                        conflicts = 0;
                        timeout_ms = -1;
                        /* Never timeout in the monitor state */
-                       NetSetTimeout(0, NULL);
+                       net_set_timeout_handler(0, NULL);
 
                        /* NOTE: all other exit paths should deconfig ... */
                        net_set_state(NETLOOP_SUCCESS);