All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/5] Convert CONFIG_KEEP_SERVERADDR to Kconfig
@ 2021-12-18 18:27 Simon Glass
  2021-12-18 18:27 ` [PATCH v2 2/5] Convert CONFIG_UDP_CHECKSUM " Simon Glass
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Simon Glass @ 2021-12-18 18:27 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Joe Hershberger, Tom Rini, Simon Glass, Heinrich Schuchardt,
	Marek Behún, Mario Six, Patrick Delaunay, Priyanka Jain,
	Ramon Fried, Rasmus Villemoes, Stefan Roese

This converts the following to Kconfig:
   CONFIG_KEEP_SERVERADDR

Drop the preprocessor usage also.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 README                       | 5 -----
 include/configs/sandbox.h    | 1 -
 net/Kconfig                  | 9 +++++++++
 net/arp.c                    | 5 ++---
 scripts/config_whitelist.txt | 1 -
 5 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/README b/README
index 056b717557b..79843787eeb 100644
--- a/README
+++ b/README
@@ -1193,11 +1193,6 @@ The following options need to be configured:
 		server to contact when using the "tftboot" command.
 		(Environment variable "serverip")
 
-		CONFIG_KEEP_SERVERADDR
-
-		Keeps the server's MAC address, in the env 'serveraddr'
-		for passing to bootargs (like Linux's netconsole option)
-
 - Gateway IP address:
 		CONFIG_GATEWAYIP
 
diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index cd7d99ec69c..1dd21d5e925 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -25,7 +25,6 @@
 #define CONFIG_SYS_BAUDRATE_TABLE	{4800, 9600, 19200, 38400, 57600,\
 					115200}
 
-#define CONFIG_KEEP_SERVERADDR
 #define CONFIG_UDP_CHECKSUM
 #define CONFIG_TIMESTAMP
 #define CONFIG_BOOTP_SERVERIP
diff --git a/net/Kconfig b/net/Kconfig
index 7a2d1450188..fb6420f9bbe 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -98,4 +98,13 @@ config SERVERIP_FROM_PROXYDHCP_DELAY_MS
 		receiving response from main DHCP server. Has no effect if
 		SERVERIP_FROM_PROXYDHCP is false.
 
+config KEEP_SERVERADDR
+	bool "Write the server's MAC address to 'serveraddr'"
+	default y if SANDBOX
+	help
+	  Keeps the server's MAC address, in the env 'serveraddr'
+	  for passing to bootargs (like Linux's netconsole option). If this is
+	  enabled, when an ARP reply is received, the server's IP address is
+	  written there.
+
 endif   # if NET
diff --git a/net/arp.c b/net/arp.c
index 1d06ed25722..0b086dc8d21 100644
--- a/net/arp.c
+++ b/net/arp.c
@@ -196,13 +196,12 @@ void arp_receive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len)
 		if (!arp_is_waiting())
 			break;
 
-#ifdef CONFIG_KEEP_SERVERADDR
-		if (net_server_ip.s_addr == net_arp_wait_packet_ip.s_addr) {
+		if (IS_ENABLED(CONFIG_KEEP_SERVERADDR) &&
+		    net_server_ip.s_addr == net_arp_wait_packet_ip.s_addr) {
 			char buf[20];
 			sprintf(buf, "%pM", &arp->ar_sha);
 			env_set("serveraddr", buf);
 		}
-#endif
 
 		reply_ip_addr = net_read_ip(&arp->ar_spa);
 
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index 6d961ccb3e6..3285d3cd30e 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -639,7 +639,6 @@ CONFIG_JFFS2_PART_SIZE
 CONFIG_JFFS2_SUMMARY
 CONFIG_JRSTARTR_JR0
 CONFIG_JTAG_CONSOLE
-CONFIG_KEEP_SERVERADDR
 CONFIG_KEY_REVOCATION
 CONFIG_KIRKWOOD_EGIGA_INIT
 CONFIG_KIRKWOOD_GPIO
-- 
2.34.1.173.g76aa8bc2d0-goog


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-01-21 19:09 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-18 18:27 [PATCH v2 1/5] Convert CONFIG_KEEP_SERVERADDR to Kconfig Simon Glass
2021-12-18 18:27 ` [PATCH v2 2/5] Convert CONFIG_UDP_CHECKSUM " Simon Glass
2022-01-21 19:02   ` Tom Rini
2021-12-18 18:27 ` [PATCH v2 3/5] Convert CONFIG_TIMESTAMP " Simon Glass
2022-01-21 19:02   ` Tom Rini
2021-12-18 18:27 ` [PATCH v2 4/5] Convert CONFIG_BOOTP_SERVERIP " Simon Glass
2022-01-21 19:02   ` Tom Rini
2021-12-18 18:27 ` [PATCH v2 5/5] net: Drop #ifdefs with CONFIG_BOOTP_SERVERIP Simon Glass
2021-12-19 11:41   ` Ramon Fried
2022-01-21 19:02   ` Tom Rini
2022-01-21 19:02 ` [PATCH v2 1/5] Convert CONFIG_KEEP_SERVERADDR to Kconfig Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.