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

Merge pull request #20682 from maribu/buildsystem/netif-feature

tree-wide: Introduce netif feature and use it
This commit is contained in:
mguetschow 2024-05-22 12:25:03 +00:00 committed by GitHub
commit fc78e1f7db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
57 changed files with 168 additions and 103 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

@ -1,5 +1 @@
USEMODULE += boards_common_esp32x
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif

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

@ -4,3 +4,13 @@ include $(RIOTBOARD)/common/esp32/Makefile.dep
ifneq (,$(filter netdev_default,$(USEMODULE)))
USEMODULE += esp_eth
endif
# saul_gpio does conflict eth, as the only SAUL enabled GPIO is the boot button.
# But that GPIO doubles as phy clock input.
ifneq (,$(filter esp_eth,$(USEMODULE)))
DISABLE_MODULE += saul_gpio
endif
ifneq (,$(filter saul_default,$(USEMODULE)))
DEFAULT_MODULE += saul_gpio
endif

View File

@ -2,4 +2,8 @@ ifneq (,$(filter netdev_default,$(USEMODULE)))
USEMODULE += sx1276
endif
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif
include $(RIOTBOARD)/common/esp32/Makefile.dep

View File

@ -10,4 +10,8 @@ ifneq (,$(filter sdcard_spi,$(USEMODULE)))
endif
endif
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif
include $(RIOTBOARD)/common/esp32/Makefile.dep

View File

@ -2,4 +2,8 @@ ifneq (,$(filter esp32_ttgo_t_beam_v1_0,$(USEMODULE)))
FEATURES_REQUIRED += periph_i2c
endif
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif
include $(RIOTBOARD)/common/esp32/Makefile.dep

View File

@ -8,4 +8,8 @@ ifneq (,$(filter vfs_default,$(USEMODULE)))
USEMODULE += mtd
endif
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif
include $(RIOTBOARD)/common/esp32/Makefile.dep

View File

@ -1 +1,5 @@
include $(RIOTBOARD)/common/esp32/Makefile.dep
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif

View File

@ -18,4 +18,8 @@ ifneq (,$(filter mtd,$(USEMODULE)))
endif
endif
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif
include $(RIOTBOARD)/common/esp32/Makefile.dep

View File

@ -1 +1,5 @@
include $(RIOTBOARD)/common/esp32c3/Makefile.dep
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif

View File

@ -7,4 +7,8 @@ ifeq (,$(filter esp32c3_wemos_mini_v%,$(USEMODULE)))
USEMODULE += esp32c3_wemos_mini_v2_1_0
endif
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif
include $(RIOTBOARD)/common/esp32c3/Makefile.dep

View File

@ -1 +1,5 @@
include $(RIOTBOARD)/common/esp32s2/Makefile.dep
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif

View File

@ -16,4 +16,8 @@ ifneq (,$(filter disp_dev,$(USEMODULE)))
USEMODULE += st7789
endif
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif
include $(RIOTBOARD)/common/esp32s2/Makefile.dep

View File

@ -1,2 +1,6 @@
include $(RIOTBOARD)/common/makefiles/stdio_tinyusb_cdc_acm.dep.mk
include $(RIOTBOARD)/common/esp32s2/Makefile.dep
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif

View File

@ -14,5 +14,9 @@ ifneq (,$(filter disp_dev,$(USEMODULE)))
USEMODULE += ili9341
endif
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif
include $(RIOTBOARD)/common/esp32s3/Makefile.dep
include $(RIOTBOARD)/common/makefiles/stdio_cdc_acm.dep.mk

View File

@ -1 +1,5 @@
include $(RIOTBOARD)/common/esp32s3/Makefile.dep
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif

View File

@ -10,5 +10,9 @@ ifeq (,$(filter stdio_% slipdev_stdio usbus usbus% tinyusb_device,$(USEMODULE)))
include $(RIOTMAKE)/tools/usb_board_reset.mk
endif
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif
include $(RIOTBOARD)/common/esp32s3/Makefile.dep
include $(RIOTBOARD)/common/makefiles/stdio_cdc_acm.dep.mk

View File

@ -26,3 +26,7 @@ endif
ifneq (,$(filter disp_dev,$(USEMODULE)))
USEMODULE += st7789
endif
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif

View File

@ -39,3 +39,7 @@ endif
ifneq (,$(filter periph_i2c,$(USEMODULE)))
USEMODULE += esp_i2c_hw
endif
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif

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

@ -4,6 +4,7 @@ endif
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += sgp30
USEMODULE += saul_gpio
endif
include $(RIOTBOARD)/common/esp32c3/Makefile.dep

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