net: tftp: use IS_ENABLED(CONFIG_NET_TFTP_VARS) instead of #if
[platform/kernel/u-boot.git] / net / bootp.c
index a896e1e..6c01e38 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 */
@@ -64,7 +59,7 @@ ulong         bootp_start;
 ulong          bootp_timeout;
 char net_nis_domain[32] = {0,}; /* Our NIS domain */
 char net_hostname[32] = {0,}; /* Our hostname */
-char net_root_path[64] = {0,}; /* Our bootpath */
+char net_root_path[CONFIG_BOOTP_MAX_ROOT_PATH_LEN] = {0,}; /* Our bootpath */
 
 static ulong time_taken_max;
 
@@ -1082,7 +1077,9 @@ static void dhcp_handler(uchar *pkt, unsigned dest, struct in_addr sip,
                            strlen(CONFIG_SYS_BOOTFILE_PREFIX)) == 0) {
 #endif /* CONFIG_SYS_BOOTFILE_PREFIX */
                        dhcp_packet_process_options(bp);
-                       efi_net_set_dhcp_ack(pkt, len);
+                       if (CONFIG_IS_ENABLED(EFI_LOADER) &&
+                           CONFIG_IS_ENABLED(NET_DEVICES))
+                               efi_net_set_dhcp_ack(pkt, len);
 
 #if defined(CONFIG_SERVERIP_FROM_PROXYDHCP)
                        if (!net_server_ip.s_addr)