Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tree-wide: Introduce netif feature and use it #20682

Merged
merged 2 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions boards/b-l072z-lrwan1/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,5 @@ FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart

# Put other features for this board (in alphabetical order)
# For riotboot you need an openocd that supports dualbank flashing.
# The 0.10.0 openocd version in Ubuntu Bionic doesn't work. The change was
# introduced after Jun 8, 2017 - v0.10.0-1-20170607-2132-dev.
FEATURES_PROVIDED += netif
FEATURES_PROVIDED += riotboot
1 change: 1 addition & 0 deletions boards/cc2538dk/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ FEATURES_PROVIDED += periph_uart

# Various other features (if any)
FEATURES_PROVIDED += emulator_renode
FEATURES_PROVIDED += netif
FEATURES_PROVIDED += riotboot
1 change: 1 addition & 0 deletions boards/common/iotlab/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ FEATURES_PROVIDED += periph_uart

# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += riotboot
FEATURES_PROVIDED += netif
1 change: 1 addition & 0 deletions boards/common/kw41z/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart

# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += netif
FEATURES_PROVIDED += riotboot
3 changes: 3 additions & 0 deletions boards/common/nrf52/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ CPU = nrf52
# Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += periph_rtt
FEATURES_PROVIDED += periph_timer

# Put other features for this board (in alphabetical order)
maribu marked this conversation as resolved.
Show resolved Hide resolved
FEATURES_PROVIDED += netif
FEATURES_PROVIDED += riotboot
3 changes: 3 additions & 0 deletions boards/hamilton/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ FEATURES_PROVIDED += periph_rtc
FEATURES_PROVIDED += periph_rtt
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_timer

# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += netif
3 changes: 3 additions & 0 deletions boards/lobaro-lorabox/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ FEATURES_PROVIDED += periph_rtc
FEATURES_PROVIDED += periph_spi periph_spi_gpio_mode
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart

# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += netif
1 change: 1 addition & 0 deletions boards/lora-e5-dev/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ FEATURES_PROVIDED += periph_uart
# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += arduino_pins
FEATURES_PROVIDED += riotboot
FEATURES_PROVIDED += netif
4 changes: 1 addition & 3 deletions boards/lsn50/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,5 @@ FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart

# Put other features for this board (in alphabetical order)
# For riotboot you need an openocd that supports dualbank flashing.
# The 0.10.0 openocd version in Ubuntu Bionic doesn't work. The change was
# introduced after Jun 8, 2017 - v0.10.0-1-20170607-2132-dev.
FEATURES_PROVIDED += riotboot
FEATURES_PROVIDED += netif
3 changes: 3 additions & 0 deletions boards/mulle/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ FEATURES_PROVIDED += periph_rtt
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart

# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += netif
3 changes: 2 additions & 1 deletion boards/native/common_features.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ FEATURES_PROVIDED += periph_gpio
FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_qdec

# Various other features (if any)
# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += ethernet
FEATURES_PROVIDED += motor_driver
FEATURES_PROVIDED += netif
2 changes: 2 additions & 0 deletions boards/nucleo-f207zg/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += periph_usbdev

# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += ethernet
FEATURES_PROVIDED += netif
FEATURES_PROVIDED += riotboot
FEATURES_PROVIDED += tinyusb_device

Expand Down
2 changes: 2 additions & 0 deletions boards/nucleo-f429zi/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += periph_usbdev

# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += ethernet
FEATURES_PROVIDED += netif
FEATURES_PROVIDED += tinyusb_device

# load the common Makefile.features for Nucleo boards
Expand Down
2 changes: 2 additions & 0 deletions boards/nucleo-f439zi/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += periph_usbdev

# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += ethernet
FEATURES_PROVIDED += netif
FEATURES_PROVIDED += tinyusb_device

# load the common Makefile.features for Nucleo boards
Expand Down
2 changes: 2 additions & 0 deletions boards/nucleo-f767zi/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += periph_usbdev

# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += ethernet
FEATURES_PROVIDED += netif
FEATURES_PROVIDED += riotboot
FEATURES_PROVIDED += tinyusb_device

Expand Down
1 change: 1 addition & 0 deletions boards/nucleo-wl55jc/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ FEATURES_PROVIDED += periph_uart

# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += riotboot
FEATURES_PROVIDED += netif

# load the common Makefile.features for Nucleo boards
include $(RIOTBOARD)/common/nucleo64/Makefile.features
3 changes: 3 additions & 0 deletions boards/openlabs-kw41z-mini/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += riotboot

# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += netif
1 change: 1 addition & 0 deletions boards/pba-d-01-kw2x/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ FEATURES_PROVIDED += periph_uart

# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += riotboot
FEATURES_PROVIDED += netif
2 changes: 2 additions & 0 deletions boards/same54-xpro/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@ FEATURES_PROVIDED += periph_freqm
FEATURES_PROVIDED += periph_can

# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += ethernet
FEATURES_PROVIDED += netif
FEATURES_PROVIDED += riotboot
FEATURES_PROVIDED += tinyusb_device
1 change: 1 addition & 0 deletions boards/samr21-xpro/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ FEATURES_PROVIDED += periph_uart_hw_fc
FEATURES_PROVIDED += periph_usbdev

# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += netif
FEATURES_PROVIDED += riotboot
FEATURES_PROVIDED += tinyusb_device
1 change: 1 addition & 0 deletions boards/samr30-xpro/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += periph_usbdev

# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += netif
FEATURES_PROVIDED += riotboot
FEATURES_PROVIDED += tinyusb_device
3 changes: 3 additions & 0 deletions boards/spark-core/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ CPU_MODEL = stm32f103cb
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_uart

# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += netif
4 changes: 4 additions & 0 deletions boards/stm32f746g-disco/features-shared.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += periph_usbdev
FEATURES_PROVIDED += periph_usbdev_hs
FEATURES_PROVIDED += periph_usbdev_hs_ulpi

# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += ethernet
FEATURES_PROVIDED += netif
FEATURES_PROVIDED += tinyusb_device
3 changes: 2 additions & 1 deletion boards/telosb/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart

# Various other features (if any)
# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += netif
3 changes: 2 additions & 1 deletion boards/z1/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart

# Various other features (if any)
# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += netif
3 changes: 3 additions & 0 deletions boards/zigduino/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ FEATURES_PROVIDED += periph_uart
# Put defined MCU peripherals here (in alphabetical order)
# Peripherals are defined in common/arduino-atmega/Makefile.features
# Add only additional Peripherals
#
# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += netif
3 changes: 3 additions & 0 deletions cpu/atmega128rfa1/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ include $(RIOTCPU)/atmega_common/Makefile.features

# additional PCINT for atmega128rfa1
FEATURES_PROVIDED += atmega_pcint1

# MCU has a peripheral network interface
FEATURES_PROVIDED += netif
3 changes: 3 additions & 0 deletions cpu/atmega256rfr2/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ include $(RIOTCPU)/atmega_common/Makefile.features

# additional PCINT for atmega256rfr2
FEATURES_PROVIDED += atmega_pcint1

# MCU has a peripheral network interface
FEATURES_PROVIDED += netif
3 changes: 3 additions & 0 deletions cpu/cc2538/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ FEATURES_PROVIDED += periph_wdt

FEATURES_PROVIDED += cortexm_mpu

# MCU has a peripheral network interface
FEATURES_PROVIDED += netif

include $(RIOTCPU)/cortexm_common/Makefile.features
3 changes: 3 additions & 0 deletions cpu/esp_common/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,8 @@ ifeq (rv32,$(CPU_ARCH))
FEATURES_PROVIDED += arch_esp_riscv
endif

# All ESP* MCUs have a peripheral network interface
FEATURES_PROVIDED += netif

FEATURES_CONFLICT += esp_wifi_ap:esp_now
FEATURES_CONFLICT_MSG += "ESP_NOW and ESP_WIFI_AP can not be used at the same time."
1 change: 1 addition & 0 deletions cpu/nrf5x_common/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ ifeq (,$(filter nrf9160 nrf5340_app,$(CPU_MODEL)))
FEATURES_PROVIDED += ble_nimble
FEATURES_PROVIDED += radio_nrfble
FEATURES_PROVIDED += radio_nrfmin
FEATURES_PROVIDED += netif
endif

include $(RIOTCPU)/cortexm_common/Makefile.features
27 changes: 4 additions & 23 deletions examples/default/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,10 @@ USEMODULE += ps
# include and auto-initialize all available sensors
USEMODULE += saul_default

include $(RIOTBASE)/tests/Makefile.boards.netif
ifneq (,$(filter $(BOARD),$(BOARD_PROVIDES_NETIF)))
# Use modules for networking
# gnrc is a meta module including all required, basic gnrc networking modules
USEMODULE += gnrc
# use the default network interface for the board
USEMODULE += netdev_default
# automatically initialize the network interface
USEMODULE += auto_init_gnrc_netif
# shell command to send L2 packets with a simple string
USEMODULE += gnrc_txtsnd
# the application dumps received packets to stdout
USEMODULE += gnrc_pktdump
endif
# Use a network interface, if available. The handling is done in
# Makefile.board.dep, which is processed recursively as part of the dependency
# resolution.
FEATURES_OPTIONAL += netif

FEATURES_OPTIONAL += periph_rtc

Expand All @@ -58,14 +48,5 @@ endif

include $(RIOTBASE)/Makefile.include

ifneq (,$(filter $(BOARD),$(BOARD_PROVIDES_NETIF)))
# We use only the lower layers of the GNRC network stack, hence, we can
# reduce the size of the packet buffer a bit
# Set GNRC_PKTBUF_SIZE via CFLAGS if not being set via Kconfig.
ifndef CONFIG_GNRC_PKTBUF_SIZE
CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512
endif
endif

# Set a custom channel if needed
include $(RIOTMAKE)/default-radio-settings.inc.mk
20 changes: 20 additions & 0 deletions examples/default/Makefile.board.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
ifneq (,$(filter netif,$(FEATURES_USED)))
# Use modules for networking
# gnrc is a meta module including all required, basic gnrc networking modules
USEMODULE += gnrc
# use the default network interface for the board
USEMODULE += netdev_default
# automatically initialize the network interface
USEMODULE += auto_init_gnrc_netif
# shell command to send L2 packets with a simple string
USEMODULE += gnrc_txtsnd
# the application dumps received packets to stdout
USEMODULE += gnrc_pktdump

# We use only the lower layers of the GNRC network stack, hence, we can
# reduce the size of the packet buffer a bit
# Set GNRC_PKTBUF_SIZE via CFLAGS if not being set via Kconfig.
ifndef CONFIG_GNRC_PKTBUF_SIZE
CFLAGS += -DCONFIG_GNRC_PKTBUF_SIZE=512
endif
endif
2 changes: 2 additions & 0 deletions features.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,8 @@ groups:
features:
- name: ethernet
help: The board has Ethernet connectivity
- name: netif
help: The board has a network interface
- name: highlevel_stdio
help: A high-level stdio method (such as CDC ACM) is used. This requires a
running thread and set-up and will not print during a crash.
Expand Down
1 change: 1 addition & 0 deletions makefiles/features_existing.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ FEATURES_EXISTING := \
highlevel_stdio \
libstdcpp \
motor_driver \
netif \
newlib \
no_idle_thread \
periph_adc \
Expand Down
63 changes: 0 additions & 63 deletions tests/Makefile.boards.netif

This file was deleted.

3 changes: 1 addition & 2 deletions tests/net/netstats_l2/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
include ../Makefile.net_common
include $(RIOTBASE)/tests/Makefile.boards.netif

BOARD_WHITELIST += $(BOARD_PROVIDES_NETIF)
FEATURES_REQUIRED += netif

USEMODULE += shell
USEMODULE += shell_cmds_default
Expand Down
3 changes: 1 addition & 2 deletions tests/pkg/edhoc_c/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
include ../Makefile.pkg_common

include $(RIOTBASE)/tests/Makefile.boards.netif
BOARD_WHITELIST += $(BOARD_PROVIDES_NETIF)
FEATURES_REQUIRED += netif
# Cannot run the test on `murdock` in `native`
# open(/dev/net/tun): No such file or directory
TEST_ON_CI_BLACKLIST += native native64
Expand Down
Loading