1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

tree-wide: Introduce netif feature and use it

This gets rid of a long list of boards with network interfaces and
instead let's boards (or MCUs with peripheral network interfaces)
provide the netif feature.

The apps that before used the long list are not depending on the
feature instead (in case of the default example, this is an
optional dependency).

Co-authored-by: mguetschow <mikolai.guetschow@tu-dresden.de>
Co-authored-by: mewen.berthelot <mewen.berthelot@orange.com>
This commit is contained in:
Marian Buschsieweke 2024-05-21 21:22:01 +02:00
parent aef06f4ed2
commit 97a6543c10
No known key found for this signature in database
GPG Key ID: 77AA882EC78084E6
38 changed files with 93 additions and 99 deletions

View File

@ -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

View File

@ -11,4 +11,5 @@ FEATURES_PROVIDED += periph_uart
# Various other features (if any)
FEATURES_PROVIDED += emulator_renode
FEATURES_PROVIDED += netif
FEATURES_PROVIDED += riotboot

View File

@ -11,3 +11,4 @@ FEATURES_PROVIDED += periph_uart
# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += riotboot
FEATURES_PROVIDED += netif

View File

@ -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

View File

@ -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)
FEATURES_PROVIDED += netif
FEATURES_PROVIDED += riotboot

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -15,3 +15,4 @@ FEATURES_PROVIDED += periph_uart
# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += riotboot
FEATURES_PROVIDED += netif

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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."

View File

@ -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

View File

@ -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
@ -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

View File

@ -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

View File

@ -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.

View File

@ -132,6 +132,7 @@ FEATURES_EXISTING := \
highlevel_stdio \
libstdcpp \
motor_driver \
netif \
newlib \
no_idle_thread \
periph_adc \

View File

@ -1,63 +0,0 @@
# Non-exhaustive list of BOARDs providing a net interface, extend as needed
# keeping alfabetical order
BOARD_PROVIDES_NETIF := \
airfy-beacon \
arduino-nano-33-ble \
atmega256rfr2-xpro \
avr-rss2 \
b-l072z-lrwan1 \
calliope-mini \
cc2538dk \
derfmega128 \
derfmega256 \
dwm1001 \
esp32-wroom-32 \
frdm-kw41z \
generic-cc2538-cc2592-dk \
hamilton \
iotlab-a8-m3 \
iotlab-m3 \
lobaro-lorabox \
lora-e5-dev \
lsn50 \
microbit \
microbit-v2 \
microduino-corerf \
msba2 \
mulle \
native \
native64 \
nrf51dk \
nrf51dongle \
nrf52840-mdk \
nrf52840dk \
nrf52840dongle \
nrf52dk \
nrf6310 \
nucleo-f207zg \
nucleo-f429zi \
nucleo-f439zi \
nucleo-f767zi \
nucleo-wl55jc \
openlabs-kw41z-mini \
openlabs-kw41z-mini-256kib \
openmote-b \
openmote-cc2538 \
pba-d-01-kw2x \
phynode-kw41z \
remote-pa \
remote-reva \
ruuvitag \
same54-xpro \
samr21-xpro \
samr30-xpro \
spark-core \
stm32f746g-disco \
stm32f7508-dk \
telosb \
thingy52 \
usb-kw41z \
yunjia-nrf51822 \
z1 \
zigduino \
#

View File

@ -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

View File

@ -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