mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
276ad5716a
A if `netdev_driver_t::confirm_send()` is provided, it provides the new netdev API. However, detecting the API at runtime and handling both API styles comes at a cost. This can be optimized in case only new or only old style netdevs are in use. To do so, this adds the pseudo modules `netdev_legacy_api` and `netdev_new_api`. As right now no netdev actually implements the new API, all netdevs pull in `netdev_legacy_api`. If `netdev_legacy_api` is in used but `netdev_new_api` is not, we can safely assume at compile time that only legacy netdevs are in use. Similar, if only `netdev_new_api` is used, only support for the new API is needed. Only when both are in use, run time checks are needed. This provides two helper function to check for a netif if the corresponding netdev implements the old or the new API. (With one being the inverse of the other.) They are suitable for constant folding when only new or only legacy devices are in use. Consequently, dead branches should be eliminated by the optimizer.
27 lines
766 B
Plaintext
27 lines
766 B
Plaintext
# Copyright (c) 2022 HAW Hamburg
|
|
#
|
|
# This file is subject to the terms and conditions of the GNU Lesser
|
|
# General Public License v2.1. See the file LICENSE in the top level
|
|
# directory for more details.
|
|
#
|
|
|
|
config MODULE_ENC28J60
|
|
bool "ENC28J60 Ethernet Adapter"
|
|
depends on TEST_KCONFIG
|
|
depends on HAS_PERIPH_GPIO
|
|
depends on HAS_PERIPH_GPIO_IRQ
|
|
depends on HAS_PERIPH_SPI
|
|
select MODULE_NETDEV_ETH
|
|
select MODULE_NETDEV_LEGACY_API
|
|
select MODULE_PERIPH_EUI_PROVIDER
|
|
select MODULE_PERIPH_GPIO
|
|
select MODULE_PERIPH_GPIO_IRQ
|
|
select MODULE_PERIPH_SPI
|
|
select MODULE_XTIMER
|
|
|
|
config HAVE_ENC28J60
|
|
bool
|
|
select MODULE_ENC28J60 if MODULE_NETDEV_DEFAULT
|
|
help
|
|
Indicates that a ENC28J60 ethernet adapter is present.
|