firmware: ti_sci_static_data: Make file board agnostic
[platform/kernel/u-boot.git] / net / bootp.c
index 58e30cd..a544bfc 100644 (file)
@@ -31,7 +31,7 @@
 
 /*
  * The timeout for the initial BOOTP/DHCP request used to be described by a
- * counter of fixed-length timeout periods. TIMEOUT_COUNT represents
+ * counter of fixed-length timeout periods. CONFIG_NET_RETRY_COUNT represents
  * that counter
  *
  * Now that the timeout periods are variable (exponential backoff and retry)
  * execute that many retries, and keep sending retry packets until that time
  * is reached.
  */
-#ifndef CONFIG_NET_RETRY_COUNT
-# define TIMEOUT_COUNT 5               /* # of timeouts before giving up */
-#else
-# define TIMEOUT_COUNT (CONFIG_NET_RETRY_COUNT)
-#endif
-#define TIMEOUT_MS     ((3 + (TIMEOUT_COUNT * 5)) * 1000)
+#define TIMEOUT_MS     ((3 + (CONFIG_NET_RETRY_COUNT * 5)) * 1000)
 
 #define PORT_BOOTPS    67              /* BOOTP server UDP port */
 #define PORT_BOOTPC    68              /* BOOTP client UDP port */
@@ -148,10 +143,12 @@ static int check_reply_packet(uchar *pkt, unsigned dest, unsigned src,
 
 static void store_bootp_params(struct bootp_hdr *bp)
 {
-#if !defined(CONFIG_BOOTP_SERVERIP)
        struct in_addr tmp_ip;
        bool overwrite_serverip = true;
 
+       if (IS_ENABLED(CONFIG_BOOTP_SERVERIP))
+               return;
+
 #if defined(CONFIG_BOOTP_PREFER_SERVERIP)
        overwrite_serverip = false;
 #endif
@@ -179,7 +176,6 @@ static void store_bootp_params(struct bootp_hdr *bp)
         */
        if (*net_boot_file_name)
                env_set("bootfile", net_boot_file_name);
-#endif
 }
 
 /*
@@ -1037,9 +1033,6 @@ static void dhcp_send_request_packet(struct bootp_hdr *bp_offer)
        bcast_ip.s_addr = 0xFFFFFFFFL;
        net_set_udp_header(iphdr, bcast_ip, PORT_BOOTPS, PORT_BOOTPC, iplen);
 
-#ifdef CONFIG_BOOTP_DHCP_REQUEST_DELAY
-       udelay(CONFIG_BOOTP_DHCP_REQUEST_DELAY);
-#endif /* CONFIG_BOOTP_DHCP_REQUEST_DELAY */
        debug("Transmitting DHCPREQUEST packet: len = %d\n", pktlen);
        net_send_packet(net_tx_packet, pktlen);
 }