From 10f5f1aa33b30ade4ccbfccab7d389bd18c298c1 Mon Sep 17 00:00:00 2001 From: Oleg Hahm Date: Tue, 22 Mar 2016 16:41:51 +0100 Subject: [PATCH] make: introduce netif_default pseudomodule Additionally the dependencies for GNRC specific modules are centralized in Makefile.dep. --- Makefile.dep | 29 ++++++++++++++++++++++++---- Makefile.pseudomodules | 3 ++- boards/fox/Makefile.dep | 3 +-- boards/iotlab-m3/Makefile.dep | 3 +-- boards/msba2/Makefile.include | 4 ++-- boards/mulle/Makefile.dep | 3 +-- boards/native/Makefile.dep | 3 +-- boards/pba-d-01-kw2x/Makefile.dep | 3 +-- boards/samr21-xpro/Makefile.dep | 3 +-- cpu/native/README.md | 2 +- examples/ccn-lite-relay/Makefile | 2 +- examples/default/Makefile | 2 +- examples/gnrc_border_router/Makefile | 2 +- examples/gnrc_minimal/Makefile | 2 +- examples/gnrc_networking/Makefile | 2 +- examples/gnrc_tftp/Makefile | 2 +- examples/microcoap_server/Makefile | 2 +- examples/posix_sockets/Makefile | 2 +- sys/include/net/gnrc.h | 2 +- tests/conn_ip/Makefile | 2 +- tests/driver_enc28j60/Makefile | 2 +- tests/gnrc_ipv6_ext/Makefile | 2 +- tests/zep/Makefile | 4 ++-- 23 files changed, 50 insertions(+), 34 deletions(-) diff --git a/Makefile.dep b/Makefile.dep index 553b16894c..bdb81e4c8d 100644 --- a/Makefile.dep +++ b/Makefile.dep @@ -12,8 +12,33 @@ ifneq (,$(filter nhdp,$(USEMODULE))) USEMODULE += oonf_rfc5444 endif +ifneq (,$(filter gnrc_netdev_default,$(USEMODULE))) + USEMODULE += gnrc_netif + USEMODULE += netdev_default +endif + +ifneq (,$(filter cc110x,$(USEMODULE))) + ifneq (,$(filter gnrc_netdev_default,$(USEMODULE))) + USEMODULE += gnrc_cc110x + # XXX: this can be modelled as a dependency for gnrc_netdev_default as soon + # as all drivers are ported to netdev2 + USEMODULE += gnrc_netdev2 + endif +endif + +ifneq (,$(filter kw2xrf,$(USEMODULE))) + ifneq (,$(filter gnrc_netdev_default,$(USEMODULE))) + USEMODULE += gnrc_nomac + endif +endif + ifneq (,$(filter at86rf2%,$(USEMODULE))) USEMODULE += netdev2_ieee802154 + ifneq (,$(filter gnrc_netdev_default,$(USEMODULE))) + # XXX: this can be modelled as a dependency for gnrc_netdev_default as soon + # as all drivers are ported to netdev2 + USEMODULE += gnrc_netdev2 + endif endif ifneq (,$(filter netdev2_ieee802154,$(USEMODULE))) @@ -32,10 +57,6 @@ ifneq (,$(filter gnrc_conn_udp,$(USEMODULE))) USEMODULE += gnrc_udp endif -ifneq (,$(filter gnrc_netif_default,$(USEMODULE))) - USEMODULE += gnrc_netif -endif - ifneq (,$(filter netdev2_tap,$(USEMODULE))) USEMODULE += netif USEMODULE += netdev2_eth diff --git a/Makefile.pseudomodules b/Makefile.pseudomodules index 93be127dd7..ffd345d638 100644 --- a/Makefile.pseudomodules +++ b/Makefile.pseudomodules @@ -2,7 +2,7 @@ PSEUDOMODULES += conn PSEUDOMODULES += conn_ip PSEUDOMODULES += conn_tcp PSEUDOMODULES += conn_udp -PSEUDOMODULES += gnrc_netif_default +PSEUDOMODULES += gnrc_netdev_default PSEUDOMODULES += gnrc_ipv6_default PSEUDOMODULES += gnrc_ipv6_router PSEUDOMODULES += gnrc_ipv6_router_default @@ -16,6 +16,7 @@ PSEUDOMODULES += gnrc_sixlowpan_iphc_nhc PSEUDOMODULES += gnrc_pktbuf PSEUDOMODULES += log PSEUDOMODULES += log_printfnoformat +PSEUDOMODULES += netdev_default PSEUDOMODULES += newlib PSEUDOMODULES += newlib_nano PSEUDOMODULES += pktqueue diff --git a/boards/fox/Makefile.dep b/boards/fox/Makefile.dep index 1a15e53a2e..f58546b86b 100644 --- a/boards/fox/Makefile.dep +++ b/boards/fox/Makefile.dep @@ -1,6 +1,5 @@ -ifneq (,$(filter gnrc_netif_default,$(USEMODULE))) +ifneq (,$(filter netdev_default gnrc_netdev_default,$(USEMODULE))) USEMODULE += at86rf231 - USEMODULE += gnrc_netdev2 endif ifneq (,$(filter saul_default,$(USEMODULE))) diff --git a/boards/iotlab-m3/Makefile.dep b/boards/iotlab-m3/Makefile.dep index 92db731b1c..dda6d2ea73 100644 --- a/boards/iotlab-m3/Makefile.dep +++ b/boards/iotlab-m3/Makefile.dep @@ -1,6 +1,5 @@ -ifneq (,$(filter gnrc_netif_default,$(USEMODULE))) +ifneq (,$(filter netdev_default gnrc_netdev_default,$(USEMODULE))) USEMODULE += at86rf231 - USEMODULE += gnrc_netdev2 endif ifneq (,$(filter saul_default,$(USEMODULE))) diff --git a/boards/msba2/Makefile.include b/boards/msba2/Makefile.include index 50d0de0347..f7d05c148d 100644 --- a/boards/msba2/Makefile.include +++ b/boards/msba2/Makefile.include @@ -1,5 +1,5 @@ -ifneq (,$(filter gnrc_netif_default,$(USEMODULE))) - USEMODULE += cc110x gnrc_netdev2 gnrc_cc110x +ifneq (,$(filter netdev_default gnrc_netdev_default,$(USEMODULE))) + USEMODULE += cc110x endif USEMODULE += msba2-common diff --git a/boards/mulle/Makefile.dep b/boards/mulle/Makefile.dep index cc3714b7c9..d2c93c70bc 100644 --- a/boards/mulle/Makefile.dep +++ b/boards/mulle/Makefile.dep @@ -1,6 +1,5 @@ -ifneq (,$(filter gnrc_netif_default,$(USEMODULE))) +ifneq (,$(filter netdev_default gnrc_netdev_default,$(USEMODULE))) USEMODULE += at86rf212b - USEMODULE += gnrc_netdev2 endif ifneq (,$(filter saul_default,$(USEMODULE))) diff --git a/boards/native/Makefile.dep b/boards/native/Makefile.dep index 76c68a2daf..0806ebe2a7 100644 --- a/boards/native/Makefile.dep +++ b/boards/native/Makefile.dep @@ -1,4 +1,3 @@ -ifneq (,$(filter gnrc_netif_default,$(USEMODULE))) +ifneq (,$(filter netdev_default gnrc_netdev_default,$(USEMODULE))) USEMODULE += netdev2_tap - USEMODULE += gnrc_netdev2 endif diff --git a/boards/pba-d-01-kw2x/Makefile.dep b/boards/pba-d-01-kw2x/Makefile.dep index f566299123..2fce1f0a46 100644 --- a/boards/pba-d-01-kw2x/Makefile.dep +++ b/boards/pba-d-01-kw2x/Makefile.dep @@ -1,6 +1,5 @@ -ifneq (,$(filter gnrc_netif_default,$(USEMODULE))) +ifneq (,$(filter netdev_default gnrc_netdev_default,$(USEMODULE))) USEMODULE += kw2xrf - USEMODULE += gnrc_nomac endif ifneq (,$(filter saul_default,$(USEMODULE))) diff --git a/boards/samr21-xpro/Makefile.dep b/boards/samr21-xpro/Makefile.dep index 874b4f2a5e..9cee237662 100644 --- a/boards/samr21-xpro/Makefile.dep +++ b/boards/samr21-xpro/Makefile.dep @@ -1,6 +1,5 @@ -ifneq (,$(filter gnrc_netif_default,$(USEMODULE))) +ifneq (,$(filter gnrc_netdev_default netdev_default,$(USEMODULE))) USEMODULE += at86rf233 - USEMODULE += gnrc_netdev2 endif ifneq (,$(filter saul_default,$(USEMODULE))) diff --git a/cpu/native/README.md b/cpu/native/README.md index fe7832fec5..d3d63f55bf 100644 --- a/cpu/native/README.md +++ b/cpu/native/README.md @@ -40,7 +40,7 @@ module, you need to specify a network interface like this: make term PORT=tap0 **Please note:** in case you're using RIOT's default network stack, the GNRC -stack, you may also use `gnrc_netif_default` module and also add +stack, you may also use `gnrc_netdev_default` module and also add `auto_init_gnrc_netif` in order to automatically initialize the interface. diff --git a/examples/ccn-lite-relay/Makefile b/examples/ccn-lite-relay/Makefile index f481e4b55e..c4c44f64d0 100644 --- a/examples/ccn-lite-relay/Makefile +++ b/examples/ccn-lite-relay/Makefile @@ -26,7 +26,7 @@ USEMODULE += shell USEMODULE += shell_commands # Include packages that pull up and auto-init the link layer. # NOTE: 6LoWPAN will be included if IEEE802.15.4 devices are present -USEMODULE += gnrc_netif_default +USEMODULE += gnrc_netdev_default USEMODULE += auto_init_gnrc_netif USEMODULE += timex USEMODULE += xtimer diff --git a/examples/default/Makefile b/examples/default/Makefile index 1db4b1ac22..9d5206cbd6 100644 --- a/examples/default/Makefile +++ b/examples/default/Makefile @@ -46,7 +46,7 @@ ifneq (,$(filter $(BOARD),$(BOARD_PROVIDES_NETIF))) # gnrc is a meta module including all required, basic gnrc networking modules USEMODULE += gnrc # use the default network interface for the board - USEMODULE += gnrc_netif_default + USEMODULE += gnrc_netdev_default # automatically initialize the network interface USEMODULE += auto_init_gnrc_netif # the application dumps received packets to stdout diff --git a/examples/gnrc_border_router/Makefile b/examples/gnrc_border_router/Makefile index cbbe76ffa5..1dde2b2a13 100644 --- a/examples/gnrc_border_router/Makefile +++ b/examples/gnrc_border_router/Makefile @@ -28,7 +28,7 @@ CFLAGS += -DSLIP_BAUDRATE=$(SLIP_BAUDRATE) # Include packages that pull up and auto-init the link layer. # NOTE: 6LoWPAN will be included if IEEE802.15.4 devices are present -USEMODULE += gnrc_netif_default +USEMODULE += gnrc_netdev_default USEMODULE += auto_init_gnrc_netif # Include SLIP package for IP over Serial communication USEMODULE += gnrc_slip diff --git a/examples/gnrc_minimal/Makefile b/examples/gnrc_minimal/Makefile index ed5126ce21..702e9d45ab 100644 --- a/examples/gnrc_minimal/Makefile +++ b/examples/gnrc_minimal/Makefile @@ -11,7 +11,7 @@ BOARD_INSUFFICIENT_MEMORY := chronos msb-430 msb-430h # Include packages that pull up and auto-init the link layer. # NOTE: 6LoWPAN will be included if IEEE802.15.4 devices are present -USEMODULE += gnrc_netif_default +USEMODULE += gnrc_netdev_default USEMODULE += auto_init_gnrc_netif # Specify the minimum networking modules for IPv6 USEMODULE += gnrc_ipv6 diff --git a/examples/gnrc_networking/Makefile b/examples/gnrc_networking/Makefile index c7eb7c84c0..b5b534e926 100644 --- a/examples/gnrc_networking/Makefile +++ b/examples/gnrc_networking/Makefile @@ -14,7 +14,7 @@ BOARD_INSUFFICIENT_MEMORY := airfy-beacon chronos msb-430 msb-430h nrf51dongle \ # Include packages that pull up and auto-init the link layer. # NOTE: 6LoWPAN will be included if IEEE802.15.4 devices are present -USEMODULE += gnrc_netif_default +USEMODULE += gnrc_netdev_default USEMODULE += auto_init_gnrc_netif # Specify the mandatory networking modules for IPv6 and UDP USEMODULE += gnrc_ipv6_router_default diff --git a/examples/gnrc_tftp/Makefile b/examples/gnrc_tftp/Makefile index 3c06fc1f2e..bad532d285 100644 --- a/examples/gnrc_tftp/Makefile +++ b/examples/gnrc_tftp/Makefile @@ -14,7 +14,7 @@ BOARD_INSUFFICIENT_MEMORY := airfy-beacon chronos msb-430 msb-430h nrf51dongle \ # Include packages that pull up and auto-init the link layer. # NOTE: 6LoWPAN will be included if IEEE802.15.4 devices are present -USEMODULE += gnrc_netif_default +USEMODULE += gnrc_netdev_default USEMODULE += auto_init_gnrc_netif # Specify the mandatory networking modules for IPv6 and UDP USEMODULE += gnrc_ipv6_router_default diff --git a/examples/microcoap_server/Makefile b/examples/microcoap_server/Makefile index ea269df925..74de95f902 100644 --- a/examples/microcoap_server/Makefile +++ b/examples/microcoap_server/Makefile @@ -14,7 +14,7 @@ BOARD_INSUFFICIENT_MEMORY := airfy-beacon chronos msb-430 msb-430h nrf51dongle \ # Include packages that pull up and auto-init the link layer. # NOTE: 6LoWPAN will be included if IEEE802.15.4 devices are present -USEMODULE += gnrc_netif_default +USEMODULE += gnrc_netdev_default USEMODULE += auto_init_gnrc_netif # Specify the mandatory networking modules for IPv6 and UDP USEMODULE += gnrc_ipv6_router_default diff --git a/examples/posix_sockets/Makefile b/examples/posix_sockets/Makefile index c58f418949..a4d77e515d 100644 --- a/examples/posix_sockets/Makefile +++ b/examples/posix_sockets/Makefile @@ -13,7 +13,7 @@ BOARD_INSUFFICIENT_MEMORY := airfy-beacon chronos msb-430 msb-430h nrf51dongle n # Include packages that pull up and auto-init the link layer. # NOTE: 6LoWPAN will be included if IEEE802.15.4 devices are present -USEMODULE += gnrc_netif_default +USEMODULE += gnrc_netdev_default USEMODULE += auto_init_gnrc_netif # Specify the mandatory networking modules for socket communication via UDP USEMODULE += gnrc_ipv6_default diff --git a/sys/include/net/gnrc.h b/sys/include/net/gnrc.h index 7a2145d8a4..89ffb96696 100644 --- a/sys/include/net/gnrc.h +++ b/sys/include/net/gnrc.h @@ -180,7 +180,7 @@ * * - To include the default network device(s) on your board: * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.mk} - * USEMODULE += gnrc_netif_default + * USEMODULE += gnrc_netdev_default * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * * - To auto-initialize these network devices as GNRC network interfaces diff --git a/tests/conn_ip/Makefile b/tests/conn_ip/Makefile index 99f35e0145..ecf8a496d0 100644 --- a/tests/conn_ip/Makefile +++ b/tests/conn_ip/Makefile @@ -7,7 +7,7 @@ RIOTBASE ?= $(CURDIR)/../.. BOARD_INSUFFICIENT_MEMORY := chronos msb-430 msb-430h nucleo-f334 stm32f0discovery telosb \ weio wsn430-v1_3b wsn430-v1_4 z1 -USEMODULE += gnrc_netif_default +USEMODULE += gnrc_netdev_default USEMODULE += auto_init_gnrc_netif USEMODULE += gnrc_icmpv6_echo USEMODULE += gnrc_ipv6_default diff --git a/tests/driver_enc28j60/Makefile b/tests/driver_enc28j60/Makefile index c17e17d78c..c324d3c047 100644 --- a/tests/driver_enc28j60/Makefile +++ b/tests/driver_enc28j60/Makefile @@ -6,7 +6,7 @@ FEATURES_REQUIRED = periph_spi periph_gpio BOARD_INSUFFICIENT_MEMORY := msb-430h nucleo-f334 stm32f0discovery weio z1 USEMODULE += gnrc_netdev2 -USEMODULE += gnrc_netif_default +USEMODULE += gnrc_netdev_default USEMODULE += auto_init_gnrc_netif USEMODULE += enc28j60 USEMODULE += gnrc_ipv6_router_default diff --git a/tests/gnrc_ipv6_ext/Makefile b/tests/gnrc_ipv6_ext/Makefile index 3a4db2d10e..ffa542c1af 100644 --- a/tests/gnrc_ipv6_ext/Makefile +++ b/tests/gnrc_ipv6_ext/Makefile @@ -14,7 +14,7 @@ BOARD_INSUFFICIENT_MEMORY := airfy-beacon chronos msb-430 msb-430h nrf51dongle \ # Include packages that pull up and auto-init the link layer. # NOTE: 6LoWPAN will be included if IEEE802.15.4 devices are present -USEMODULE += gnrc_netif_default +USEMODULE += gnrc_netdev_default USEMODULE += auto_init_gnrc_netif # Specify the mandatory networking modules for IPv6 USEMODULE += gnrc_ipv6_router_default diff --git a/tests/zep/Makefile b/tests/zep/Makefile index 4c65e3c364..529ab8487f 100644 --- a/tests/zep/Makefile +++ b/tests/zep/Makefile @@ -6,7 +6,7 @@ include ../Makefile.tests_common BOARD_WHITELIST = native USEMODULE += gnrc_zep -USEMODULE += gnrc_netif_default +USEMODULE += gnrc_netdev_default USEMODULE += auto_init_gnrc_netif USEMODULE += gnrc_ipv6_default USEMODULE += gnrc_nomac @@ -25,7 +25,7 @@ CFLAGS += -DZEP_DST="\"$(ZEP_DST)\"" CFLAGS += -DZEP_SRC_PORT=$(ZEP_SRC_PORT) CFLAGS += -DZEP_DST_PORT=$(ZEP_DST_PORT) -# one for gnrc_netif_default and one for ZEP +# one for gnrc_netdev_default and one for ZEP CFLAGS += -DGNRC_NETIF_NUMOF=2 include $(RIOTBASE)/Makefile.include