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

33 Commits

Author SHA1 Message Date
Benjamin Valentin
6ec3f54b3c drivers/slipdev: improve default UART selection 2023-10-26 16:10:05 +02:00
Marian Buschsieweke
adfe9ac306
drivers/slipdev: fix logic bug
A typo resulted in a boolean expression to always be true and the
`_poweron()` function to always exit early. This fixes the issue.
2023-05-19 23:01:30 +02:00
bors[bot]
385569c7bf
Merge #17810 #18348 #19120
17810: drivers/slipdev: implement sleep states r=benpicco a=benpicco



18348: sys/net/gnrc/pktbuf_static: make use of alignas() r=maribu a=maribu

### Contribution description

Since we are now using C11, we can make use of `alignas()` provided by `<stdalign.h>` to make the alignment code easier to read.

### Testing procedure

I didn't expect this to change binaries, but is safes 4 bytes. `elf_diff` shows that the compiler (at least GCC 11.3.0) was not able to detect that `gnrc_pktbuf_static_buf` was just an alias for `_pktbuf_buf`. That makes sense since it would be hard without LTO to rule out external writes to `gnrc_pktbuf_static_buf`, unless one would have added a `const` (to the pointer, not to the data the pointer points to).

The [output of `elf_diff`](https://mari-bu.de/pr_18348_gnrc_pktbuf_static_elf_diff.html) looks otherwise quite unscary.

Also:

```
$ make BOARD=nucleo-f767zi -C tests/unittests/ tests-pktbuf flash test
make: Entering directory '/home/maribu/Repos/software/RIOT/tests/unittests'
Building application "tests_unittests" for "nucleo-f767zi" with MCU "stm32".
[...]
Welcome to pyterm!
Type '/exit' to exit.
READY
s
START
.............................................
OK (45 tests)

make: Leaving directory '/home/maribu/Repos/software/RIOT/tests/unittests'
```

### Issues/PRs references

None

19120: CI: seperate check-labels and check-commits workflows r=maribu a=kaspar030



Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
Co-authored-by: Kaspar Schleiser <kaspar@schleiser.de>
2023-01-10 15:44:57 +00:00
Benjamin Valentin
bb084612f5 drivers/slipdev: implement sleep states 2023-01-10 12:24:30 +01:00
Benjamin Valentin
269b3c97c2 drivers/slipdev: fix off-by-one error in _recv() 2022-10-31 22:54:33 +01:00
Benjamin Valentin
838a5e4bd3 netdev_drivers: make sure to signal LINK_UP at least once 2022-09-16 22:57:28 +02:00
benpicco
28cedd52a0
Merge pull request #18201 from benpicco/slip_dose_rxqueue
drivers/{dose, slipdev, sam0_eth}: generate RX event for queued packets
2022-08-26 13:25:13 +02:00
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
Benjamin Valentin
86f55c5637 drivers/slipdev: generate RX event for queued packets 2022-06-17 10:50:31 +02:00
Jose Alamos
2d0802e31f
drivers/slipdev: avoid explicit cast to netdev 2021-07-09 11:35:22 +02:00
Benjamin Valentin
c1eead925d drivers/slipdev: register with netdev 2021-06-21 12:42:03 +02:00
Benjamin Valentin
9fbab8f0f8 drivers/slipdev: report NETOPT_ADDRESS to simulate l2 address
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.
2021-06-21 12:42:03 +02:00
Leandro Lanzieri
a492400cee
drivers/slipdev: add modules to Kconfig 2021-01-21 11:22:31 +01:00
Bas Stottelaar
92b1dfc703 drivers/*: realign ENABLE_DEBUG 2020-10-23 01:26:09 +02:00
Bas Stottelaar
4bdfe9a254 drivers/*: add missing include of assert.h 2020-10-22 11:13:08 +02:00
Leandro Lanzieri
d25fc243c4
treewide: change prefix for generated Kconfig symbols.
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_
2020-08-31 09:37:09 +02:00
304bce3724
drivers: configure per driver dependency resolution 2020-07-20 14:32:16 +02:00
490126cfa0
drivers: move USEMODULE_INCLUDES in each driver directories 2020-07-15 20:36:27 +02:00
Akshai M
e6924e525d drivers/slipdev : Expose to Kconfig
Expose configurations to Kconfig
2020-04-29 09:42:59 +05:30
Jose Alamos
3ad574a822 drivers/netdev: use netdev_trigger_event_isr function 2020-03-06 14:03:43 +01:00
Martine Lenders
ff425576a0
slipdev_stdio: provide stdio multiplexing over SLIP 2020-03-06 08:58:45 +01:00
Martine Lenders
8e827055f0
slipmux: remove inesc member
It's not needed anymore.
2020-03-06 08:58:45 +01:00
Martine Lenders
f11940973c
slipdev: internally expose byte stuffing functionality 2020-03-06 08:58:45 +01:00
Martine Lenders
79e80d4fec
slipdev: expose marker byte definitions 2020-03-06 08:56:40 +01:00
Martine Lenders
23f6cf8a37
slipdev: provide default configuration 2020-03-05 18:17:01 +01:00
Martine Lenders
f3ab285362 slipdev: make rxmem buffer uint8_t
`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`)
2019-06-05 21:24:38 +02:00
Martine Lenders
5dafce71be slipdev: adapt for tsrb API type change 2019-06-05 17:10:27 +02:00
Kees Bakker
7715c7cdc0 drivers/slipdev: do normal assignment instead of memcpy 2019-01-10 19:43:44 +01:00
Hauke Petersen
a07e71418e drivers/slipdev: use netdev_set_notsup() 2018-11-21 14:33:22 +01:00
23b414b732 drivers: net: adapt to iolist-using netdev 2018-03-06 14:00:31 +01:00
smlng
af3bfd101a driver/slipdev: ignore implicit fallthrough error by GCC 7 2018-01-24 20:09:49 +01:00
Martine Lenders
c61a343193 slipdev: simplify and solidify byte-unstuffing
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.
2018-01-08 11:51:24 +01:00
Martine Lenders
b74ee8869b slip: port to be used with netdev 2017-10-10 23:14:12 +02:00