1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 05:12:57 +01:00
RIOT/drivers
Marian Buschsieweke 276ad5716a
sys/net/gnrc/netif: allow checking if a netdev is legacy or new API
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.
2022-08-17 12:56:07 +02:00
..
ad7746 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
adcxx1c drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
ads101x drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
adt7310 drivers/adt7310: Update kconfig model 2022-03-02 14:03:28 +01:00
adxl345 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
aip31068 drivers/aip31068: Update kconfig model 2022-03-02 14:03:29 +01:00
apa102 drivers/apa102: Update kconfig model 2022-03-02 14:03:29 +01:00
apds99xx drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
at drivers/at: remove deprecated AT_SEND_ECHO define 2022-01-14 09:06:17 +01:00
at24cxxx drivers/at2[45]: EEPROMs can be written byte-wise 2022-03-31 10:58:52 +02:00
at24mac Merge pull request #17255 from MrKevinWeiss/pr/kconfig/sam54 2021-11-29 23:22:23 +01:00
at25xxx drivers/at2[45]: EEPROMs can be written byte-wise 2022-03-31 10:58:52 +02:00
at30tse75x drivers/at30tse75x: Update kconfig model 2022-03-04 14:15:32 +01:00
at86rf2xx sys/net/gnrc/netif: allow checking if a netdev is legacy or new API 2022-08-17 12:56:07 +02:00
at86rf215 sys/net/gnrc/netif: allow checking if a netdev is legacy or new API 2022-08-17 12:56:07 +02:00
ata8520e drivers/ata8520e: migrate to ztimer 2021-11-05 12:49:37 +01:00
atwinc15x0 sys/net/gnrc/netif: allow checking if a netdev is legacy or new API 2022-08-17 12:56:07 +02:00
bh1750fvi drivers/bh1750fvi: Update kconfig model 2022-03-04 14:16:01 +01:00
bh1900nux drivers/bh1900nux: Update kconfig model 2022-03-04 14:15:32 +01:00
bme680 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
bmp180 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
bmx055 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
bmx280 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
bq2429x drivers/bq2429x: Update kconfig model 2022-03-04 14:15:34 +01:00
can_trx drivers/can_trx: add module to Kconfig 2020-11-25 12:00:37 +01:00
cc1xxx_common treewide: Remove excessive newlines 2021-08-13 19:50:38 +02:00
cc110x sys/net/gnrc/netif: allow checking if a netdev is legacy or new API 2022-08-17 12:56:07 +02:00
cc2420 sys/net/gnrc/netif: allow checking if a netdev is legacy or new API 2022-08-17 12:56:07 +02:00
ccs811 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
cst816s drivers/cst816s: use gpio_is_valid where appropriate 2022-04-14 11:31:36 +02:00
dac_dds drivers/dac_dds: Update kconfig model 2022-03-04 14:15:35 +01:00
dcf77 drivers/dcf77: Update kconfig model 2022-03-04 14:15:35 +01:00
dfplayer drivers/dfplayer: Update kconfig model 2022-03-04 14:15:35 +01:00
dht drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
disp_dev drivers/disp_dev: use struct to store display area coordinates 2022-04-13 12:49:58 +02:00
dose sys/net/gnrc/netif: allow checking if a netdev is legacy or new API 2022-08-17 12:56:07 +02:00
ds18 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
ds75lx drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
ds1307 drivers/ds1307: Update kconfig model 2022-03-04 14:15:36 +01:00
ds3231 drivers/ds3231: Update kconfig model 2022-03-04 14:15:37 +01:00
ds3234 drivers/ds3234: Update kconfig model 2022-03-04 14:15:37 +01:00
dsp0401 drivers/dsp0401: Update kconfig model 2022-03-04 14:15:38 +01:00
dynamixel treewide: Remove excessive newlines 2021-08-13 19:50:38 +02:00
edbg_eui drivers/edbg_eui: Update kconfig model 2022-03-04 14:15:38 +01:00
enc28j60 sys/net/gnrc/netif: allow checking if a netdev is legacy or new API 2022-08-17 12:56:07 +02:00
encx24j600 sys/net/gnrc/netif: allow checking if a netdev is legacy or new API 2022-08-17 12:56:07 +02:00
ethos sys/net/gnrc/netif: allow checking if a netdev is legacy or new API 2022-08-17 12:56:07 +02:00
feetech drivers/feetech: remove useless xtimer include 2021-12-01 10:06:24 +01:00
ft5x06 drivers/ft5x06: remove unnecessary pseudomodules 2022-01-21 14:13:49 +01:00
fxos8700 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
gp2y10xx drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
grove_ledbar drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
hd44780 Merge pull request #12665 from gschorcht/drivers/hd44780_i2c_pcf857x 2022-06-14 10:23:19 +02:00
hdc1000 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
hih6130 drivers/hih6130: Update kconfig model 2022-03-04 14:15:40 +01:00
hm330x drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
hmc5883l drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
hsc drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
hts221 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
ili9341 drivers/lcd: rework rotation modes and enable it with st7735 2022-04-19 16:22:10 +02:00
ina2xx drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
ina3221 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
include drivers/kw2xrf: add IEEE 802.15.4 Radio HAL support 2022-08-15 12:11:03 +02:00
io1_xplained drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
ir_nec drivers/ir_nec: ir remote implementation 2022-05-31 17:58:39 +02:00
isl29020 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
isl29125 drivers/isl29125: Update kconfig model 2022-03-04 14:15:44 +01:00
itg320x drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
jc42 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
kw2xrf sys/net/gnrc/netif: allow checking if a netdev is legacy or new API 2022-08-17 12:56:07 +02:00
kw41zrf drivers/kw41zrf: model Kconfig 2022-07-28 09:32:24 +02:00
l3g4200d drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
l3gxxxx drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
lc709203f drivers/lc709203f: Update kconfig model 2022-03-04 14:15:45 +01:00
lcd Merge pull request #17925 from aabadie/pr/drivers/lcd_params_rework 2022-04-19 16:21:42 +02:00
lis2dh12 drivers/lis2dh12: release instead of acquire 2022-07-21 15:51:01 +02:00
lis3dh drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
lis3mdl drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
lm75 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
lpd8808 drivers/lpd8808: Update kconfig model 2022-03-04 14:15:45 +01:00
lpsxxx drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
lsm6dsl drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
lsm303agr lsm303agr: New sensor driver using external Rust crate 2022-07-10 21:27:12 +02:00
lsm303dlhc drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
ltc4150 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
mag3110 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
mcp47xx drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
mcp2515 drivers/mcp2515: apply the filter to a target mailbox 2022-06-30 10:07:24 +02:00
mhz19 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
mma8x5x drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
mma7660 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
motor_driver drivers/motor_driver: Use irq_restore 2021-12-21 18:23:11 +01:00
mpl3115a2 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
mpu9x50 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
mq3 drivers/mq3: Update kconfig model 2022-03-04 14:15:47 +01:00
mrf24j40 sys/net/gnrc/netif: allow checking if a netdev is legacy or new API 2022-08-17 12:56:07 +02:00
mtd drivers/mtd: fix module name for mtd_sdcard in Kconfig 2022-08-03 08:26:59 +02:00
mtd_flashpage drivers/mtd: fix Kconfig dependencies 2021-09-22 09:22:51 +02:00
mtd_mapper drivers/mtd_mapper: inherit physical properties 2022-06-03 00:22:06 +02:00
mtd_mci drivers/mtd_{mci,sdcard}: Pages need to be written at once 2022-03-31 10:58:52 +02:00
mtd_sdcard drivers/mtd_{mci,sdcard}: Pages need to be written at once 2022-03-31 10:58:52 +02:00
mtd_spi_nor Merge pull request #17683 from chrysn-pull-requests/mtd-granularity 2022-05-20 11:52:03 +02:00
my9221 drivers/my9221: Update kconfig model 2022-03-04 14:15:47 +01:00
ncv7356 drivers/ncv7356: Update kconfig model 2022-03-04 14:16:01 +01:00
netdev sys/net/gnrc/netif: allow checking if a netdev is legacy or new API 2022-08-17 12:56:07 +02:00
netdev_ieee802154_submac sys/net/gnrc/netif: allow checking if a netdev is legacy or new API 2022-08-17 12:56:07 +02:00
nrf24l01p drivers/nrf24l01p: migrate to ztimer 2022-01-18 16:27:44 +01:00
nrf24l01p_ng sys/net/gnrc/netif: allow checking if a netdev is legacy or new API 2022-08-17 12:56:07 +02:00
nvram drivers/nvram: add module to Kconfig 2021-01-18 10:42:35 +01:00
nvram_spi drivers/nvmram_spi: convert to ztimer_usec 2022-01-18 16:27:44 +01:00
opt3001 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
pca9633 drivers/pca9633: Update kconfig model 2022-03-04 14:15:48 +01:00
pca9685 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
pcd8544 drivers/pcd8544: Update kconfig model 2022-03-04 14:15:49 +01:00
pcf857x drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
periph_common drivers: Add periph/gpio_ll API 2022-04-22 08:39:04 +02:00
ph_oem drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
pir drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
pn532 drivers/pn532: Update kconfig model 2022-03-04 14:15:50 +01:00
pulse_counter drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
qmc5883l drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
rgbled treewide: Remove excessive newlines 2021-08-13 19:50:38 +02:00
rn2xx3 sys/net/gnrc/netif: allow checking if a netdev is legacy or new API 2022-08-17 12:56:07 +02:00
rtt_rtc drivers/rtt_rtc: normalize tm struct in rtc_set_alarm 2022-06-12 15:57:04 +02:00
saul lsm303agr: New sensor driver using external Rust crate 2022-07-10 21:27:12 +02:00
scd30 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
sdcard_spi drivers/scard_spi: _dyn_spi_rxtx_byte return void 2022-04-20 14:54:36 +02:00
sdp3x drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
sds011 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
seesaw_soil drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
servo drivers/servo: add module to Kconfig 2021-01-21 11:22:29 +01:00
sgp30 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
sht1x drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
sht2x drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
sht3x drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
shtcx drivers/shtcx: releases I2C-line properly 2022-07-20 17:37:33 +02:00
si70xx drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
si114x drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
si1133 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
slipdev sys/net/gnrc/netif: allow checking if a netdev is legacy or new API 2022-08-17 12:56:07 +02:00
sm_pwm_01c drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
soft_spi drivers/soft_spi: remove nanosleep 2021-11-30 10:31:22 +01:00
soft_uart drivers/soft_uart: fix type usage 2021-11-18 10:14:51 +01:00
sps30 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
srf02 drivers/srf02: Update kconfig model 2022-03-04 14:15:57 +01:00
srf04 drivers/srf04: Update kconfig model 2022-03-04 14:15:57 +01:00
srf08 drivers/srf08: Update kconfig model 2022-03-04 14:15:58 +01:00
st7735 drivers/st7735/kconfig: add hardware feature symbol 2022-05-24 17:45:58 +02:00
stmpe811 drivers/stmpe811: don't use a choice to select the bus 2022-01-22 15:14:26 +01:00
sx126x sys/net/gnrc/netif: allow checking if a netdev is legacy or new API 2022-08-17 12:56:07 +02:00
sx127x sys/net/gnrc/netif: allow checking if a netdev is legacy or new API 2022-08-17 12:56:07 +02:00
sx1280 sys/net/gnrc/netif: allow checking if a netdev is legacy or new API 2022-08-17 12:56:07 +02:00
tcs37727 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
tja1042 drivers/tja1042: Update kconfig model 2022-03-04 14:16:02 +01:00
tmp00x drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
touch_dev drivers/{disp,touch}_dev: pull auto_init_screen by default 2021-05-25 14:21:58 +02:00
tps6274x drivers/tps6274x: Update kconfig model 2022-03-04 14:15:58 +01:00
tsl2561 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
tsl4531x drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
uart_half_duplex drivers/uart_half_duplex: add module to Kconfig 2020-12-02 10:13:50 +01:00
usbdev_mock usbdev_mock: Adapt to xmit API 2021-11-16 20:16:59 +01:00
vcnl40x0 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
veml6070 drivers/saul: use const qualifier for data to write 2022-05-23 08:35:27 +02:00
w5100 sys/net/gnrc/netif: allow checking if a netdev is legacy or new API 2022-08-17 12:56:07 +02:00
ws281x drivers/wx281x: fix DEBUG format string for ESP32-C3 2022-07-20 09:17:04 +02:00
xbee sys/net/gnrc/netif: allow checking if a netdev is legacy or new API 2022-08-17 12:56:07 +02:00
doc.txt drivers: Added doc group drivers_multimedia 2020-06-26 13:09:33 +02:00
Kconfig drivers/netdev: model netdev_eth in Kconfig 2022-07-22 16:06:34 +02:00
Kconfig.net drivers/kw41zrf: model Kconfig 2022-07-28 09:32:24 +02:00
Makefile sys/auto_init: allow delayed initialisation of SAUL 2020-03-04 16:13:40 +01:00
Makefile.dep sys/net/gnrc/netif: allow checking if a netdev is legacy or new API 2022-08-17 12:56:07 +02:00