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.
A lot of things break if `GNRC_NETIF_FLAGS_HAS_L2ADDR` is not set.
In order to handle router advertisements and auto-configureation,
generate a faux l2 address based on the netdev ID.
This changes the prefixes of the symbols generated from USEMODULE and
USEPKG variables. The changes are as follow:
KCONFIG_MODULE_ => KCONFIG_USEMODULE_
KCONFIG_PKG_ => KCONFIG_USEPKG_
MODULE_ => USEMODULE_
PKG_ => USEPKG_
`tsrb` changed to that type, so there is no reason for us, to keep the
internally used buffer as a `char` (especially since the rest of the
driver already uses `uint8_t`)
This simplifies and solidifies the reversal of SLIP's byte-stuffing
(aka byte-unstuffing ;-)) by
1. Using `tsrb` instead of `ringbuffer`: there are two actors. The ISR
and the device's event handler.
2. Moving the byte-unstuffing from the UART RX-handler (i.e. the ISR)
to the device's receive function (potentially not the ISR)
3. Removing the `pktfifo` member. The current number of bytes in the
ringbuffer is returned for `recv(data = NULL, len = 0)`. If that is
more than the packet contains (due to the byte stuffing it most
likely will be) the packet is reallocated in GNRC anyway.