From cefbc394ca4362c9283657e5e454e87d680c2c54 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Fri, 26 Apr 2024 21:16:00 +0200 Subject: [PATCH] pkg/lwip: automatically pull in lwip_netdev Pull in lwip_netdev for netdev integration automatically if there is any netdev to integrate, otherwise don't pull in the module. As a result, applications no longer need to select that module by hand. --- examples/benchmark_udp/Makefile | 1 - examples/gcoap/Makefile | 2 -- examples/gcoap_dtls/Makefile | 2 -- examples/paho-mqtt/Makefile.lwip | 1 - examples/telnet_server/Makefile | 1 - pkg/lwip/Makefile.dep | 5 +++++ tests/pkg/lwip/Makefile | 2 +- tests/pkg/lwip_sock_ip/Makefile | 1 - tests/pkg/lwip_sock_tcp/Makefile | 1 - tests/pkg/lwip_sock_udp/Makefile | 1 - 10 files changed, 6 insertions(+), 11 deletions(-) diff --git a/examples/benchmark_udp/Makefile b/examples/benchmark_udp/Makefile index f895c45c01..91a80e33a1 100644 --- a/examples/benchmark_udp/Makefile +++ b/examples/benchmark_udp/Makefile @@ -18,7 +18,6 @@ ifeq (0,$(LWIP)) USEMODULE += gnrc_ipv6_default else USEMODULE += lwip_ipv6 - USEMODULE += lwip_netdev endif # Add also the shell, some shell commands diff --git a/examples/gcoap/Makefile b/examples/gcoap/Makefile index 93bfc25e1b..6709318142 100644 --- a/examples/gcoap/Makefile +++ b/examples/gcoap/Makefile @@ -24,8 +24,6 @@ ifeq (,$(filter 1, $(LWIP_IPV4) $(LWIP_IPV6))) # Additional networking modules that can be dropped if not needed USEMODULE += gnrc_icmpv6_echo else - USEMODULE += lwip_netdev - ifeq (1,$(LWIP_IPV4)) USEMODULE += ipv4_addr diff --git a/examples/gcoap_dtls/Makefile b/examples/gcoap_dtls/Makefile index ce1ee3396b..c5b2a4630d 100644 --- a/examples/gcoap_dtls/Makefile +++ b/examples/gcoap_dtls/Makefile @@ -24,8 +24,6 @@ ifeq (,$(filter 1, $(LWIP_IPV4) $(LWIP_IPV6))) # Additional networking modules that can be dropped if not needed USEMODULE += gnrc_icmpv6_echo else - USEMODULE += lwip_netdev - ifeq (1,$(LWIP_IPV4)) USEMODULE += ipv4_addr diff --git a/examples/paho-mqtt/Makefile.lwip b/examples/paho-mqtt/Makefile.lwip index fe16608954..1ad78897c8 100644 --- a/examples/paho-mqtt/Makefile.lwip +++ b/examples/paho-mqtt/Makefile.lwip @@ -20,6 +20,5 @@ ifneq (0,$(LWIP_IPV6)) endif ifneq (0,$(USE_LWIP)) - USEMODULE += lwip_netdev USEMODULE += lwip endif diff --git a/examples/telnet_server/Makefile b/examples/telnet_server/Makefile index a865188ddf..468d171438 100644 --- a/examples/telnet_server/Makefile +++ b/examples/telnet_server/Makefile @@ -24,7 +24,6 @@ ifeq (0,$(LWIP)) USEMODULE += gnrc_icmpv6_echo else USEMODULE += lwip_ipv6 - USEMODULE += lwip_netdev endif USEMODULE += netutils diff --git a/pkg/lwip/Makefile.dep b/pkg/lwip/Makefile.dep index d040e64f1c..0574301ead 100644 --- a/pkg/lwip/Makefile.dep +++ b/pkg/lwip/Makefile.dep @@ -103,6 +103,11 @@ ifneq (,$(filter lwip_dhcp_auto,$(USEMODULE))) USEMODULE += lwip_dhcp endif +# if an actual netdev is used, we need lwip_netdev to integrate it +ifneq (,$(filter lwip_ethernet lwip_sixlowpan,$(USEMODULE))) + USEMODULE += lwip_netdev +endif + ifneq (,$(filter netif,$(USEMODULE))) USEMODULE += fmt endif diff --git a/tests/pkg/lwip/Makefile b/tests/pkg/lwip/Makefile index c129757ac7..a5b5baff56 100644 --- a/tests/pkg/lwip/Makefile +++ b/tests/pkg/lwip/Makefile @@ -18,7 +18,7 @@ ifneq (0, $(LWIP_IPV6)) endif # including lwip_ipv6_mld would currently break this test on at86rf2xx radios -USEMODULE += lwip lwip_netdev +USEMODULE += lwip USEMODULE += lwip_udp USEMODULE += lwip_tcp USEMODULE += sock_async_event diff --git a/tests/pkg/lwip_sock_ip/Makefile b/tests/pkg/lwip_sock_ip/Makefile index 7c3ca41fd2..8312e51f4d 100644 --- a/tests/pkg/lwip_sock_ip/Makefile +++ b/tests/pkg/lwip_sock_ip/Makefile @@ -22,7 +22,6 @@ endif USEMODULE += inet_csum USEMODULE += l2util -USEMODULE += lwip_netdev USEMODULE += netdev_eth USEMODULE += netdev_test USEMODULE += ps diff --git a/tests/pkg/lwip_sock_tcp/Makefile b/tests/pkg/lwip_sock_tcp/Makefile index 0454f9cc76..558ce04afb 100644 --- a/tests/pkg/lwip_sock_tcp/Makefile +++ b/tests/pkg/lwip_sock_tcp/Makefile @@ -16,7 +16,6 @@ ifneq (0, $(LWIP_IPV6)) endif USEMODULE += inet_csum -USEMODULE += lwip_netdev USEMODULE += netdev_eth USEMODULE += netdev_test USEMODULE += ps diff --git a/tests/pkg/lwip_sock_udp/Makefile b/tests/pkg/lwip_sock_udp/Makefile index 0712df9d69..cae1e23d14 100644 --- a/tests/pkg/lwip_sock_udp/Makefile +++ b/tests/pkg/lwip_sock_udp/Makefile @@ -22,7 +22,6 @@ endif USEMODULE += inet_csum USEMODULE += l2util -USEMODULE += lwip_netdev USEMODULE += netdev_eth USEMODULE += netdev_test USEMODULE += ps