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

47 Commits

Author SHA1 Message Date
Benjamin Valentin
98e18edab3 drivers/dose: make use of checksum module 2022-10-06 17:48:47 +02: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
benpicco
e1e99c3bf1
Merge pull request #18108 from benpicco/drivers/dose-rxbuf
drivers/dose: make RX buffer size configurable
2022-08-02 10:51:17 +02:00
Leandro Lanzieri
35aba45c1c
drivers/dose: model in Kconfig 2022-07-22 16:06:35 +02:00
Benjamin Valentin
74b401f1eb drivers/dose: generate RX event for queued packets 2022-06-17 10:50:31 +02:00
Benjamin Valentin
d0ca6294ea drivers/dose: make RX buffer size configurable
To benefit from the chunked ringbuffer if large frames are being sent,
we need to allocate more than one ethernet frame length to it.

Rename the define and make it overwriteable by the user.
2022-05-15 14:43:47 +02:00
Marian Buschsieweke
bae91c1660
Merge pull request #17723 from benpicco/periph_timer_periodic-set_stopped
drivers/periph/timer: add TIM_FLAG_SET_STOPPED flag
2022-05-03 12:06:37 +02:00
Benjamin Valentin
4b5858bc7f drivers/dose: make use of TIM_FLAG_SET_STOPPED 2022-04-29 22:33:07 +02:00
Benjamin Valentin
e6d2ff668b drivers/dose: only disable watchdog when transiting from RECV state
The DOSE watchdog should only run if at least one interface is in RECV
state.

That means it must be enabled when entering RECV state and disabled
when leaving RECV state.

The watchdog was *always* disabled on a transition to IDLE.
This is wrong: If there are two interfaces and one is in RECV state
but the other did just SEND something and transitions to IDLE state
from SEND state, it would still disable the watchdog.

Fix this by only disabling the watchdog if the current state is RECV.
2022-02-28 17:22:48 +01:00
Benjamin Valentin
0695a7e40e drivers/dose: include board.h
`DOSE_TIMER_DEV` is defined in `board.h`, so we have to include it.
It's not included by the header (and should not), so move the check
to the .c file.
2022-02-02 15:38:57 +01:00
Francisco Molina
dc27c080ea drivers/dose: migrate to ztimer_usec 2022-01-25 08:43:33 +01:00
Benjamin Valentin
a8ad618a71 drivers/dose: make use of ringbuffer for RX 2022-01-19 11:43:35 +01:00
Benjamin Valentin
3e1076e3b9 drivers/dose: set backoff timer before send 2022-01-18 15:41:38 +01:00
Benjamin Valentin
ddf80a8bdb drivers/dose: introduce watchdog timer 2022-01-18 15:41:38 +01:00
benpicco
e8cbf1ea90
Merge pull request #16681 from benpicco/drivers/dose-collision
drivers/dose: make use of UART collision detection feature
2021-12-08 20:48:28 +01:00
Benjamin Valentin
0c5631bd52 drivers/dose: make use of periph_uart_collision feature 2021-12-08 17:35:00 +01:00
Benjamin Valentin
965fa3ef10 drivers/dose: clarify timeout calculation 2021-11-11 14:43:07 +01:00
Benjamin Valentin
32c29bf062 drivers/dose: fix standby mode
Previously we would not disable the sense pin, this meant that
a node could still wake up if the standby pin is not connected.

Properly disable sensing when in standby and wait for a state
transition to IDLE to avoid aborting a reception and messing up the
DOSE internal state.
2021-11-11 14:33:55 +01:00
benpicco
026d6cfba1
Merge pull request #16768 from benpicco/drivers/dose-timeout_bytes
drivers/dose: calculate timeout based on symbol rate
2021-11-10 12:40:13 +01:00
Benjamin Valentin
6c1481b6ee drivers/dose: enable standby pin
Some CAN transceivers have a standby pin that has to be pulled low
in order to use it.
If the interface is disabled we can set it to high again to save some
power.
2021-11-09 15:19:35 +01:00
Benjamin Valentin
3399a6476a drivers/dose: calculate timeout based on symbol rate
A fixed timeout is either too long for high symbol rates or too short
for low symbol rates.

To fix this, calculate the timeout based on the symbol rate.

For this, the old 5ms timeout is equivalent to 58 bytes being transmitted
at 115200 baud (8 data bit + start & stop bit).

I rounded this to 50 bytes which should yield 4340 µs.
2021-08-25 20:48:54 +02:00
benpicco
feac187d54
Merge pull request #16506 from benpicco/drivers/dose-rx_start
drivers/dose: make use of start condition received interrupt
2021-07-28 17:21:29 +02:00
Benjamin Valentin
d48f673597 drivers/dose: make use of periph_uart_rx_start feature 2021-07-28 16:19:04 +02:00
Jose Alamos
d4052805f9
drivers/dose: avoid explicit cast to netdev 2021-07-09 11:35:21 +02:00
Benjamin Valentin
5b959364fc drivers/dose: return -EBUSY if medium is busy
If there was a collision, return -EBUSY so the frame can be put into
the packet queue and we can attempt to send it again.
2021-07-06 16:12:31 +02: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
Benjamin Valentin
08db12be3b drivers/dose: don't default to UART0
The first UART is usually used for the shell, so don't default
DOSE on it.
2020-09-03 20:20:16 +02:00
Benjamin Valentin
f4f1114ead drivers/dose: use EUI provider 2020-09-03 20:16:32 +02:00
Cenk Gündoğan
538155c344
Merge pull request #14904 from leandrolanzieri/pr/kconfig/change_prefix_convention
treewide: modify Kconfig symbol prefixes
2020-09-01 15:57:06 +02:00
Gunar Schorcht
6d61381d2a drivers: use inline functions for GPIO comparisons
The expandable GPIO API requires the comparison of structured GPIO types. This means that inline functions must be used instead of direct comparisons. For the migration process, drivers must first be changed so that they use the inline comparison functions.
2020-08-31 13:10:28 +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
Benjamin Valentin
decadc41a0 drivers/dose: register driver with netdev 2020-08-17 22:53:51 +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
3a65d163f6 drivers/dose : Expose to Kconfig
Expose Configurations to Kconfig

Co-Authored-By: Leandro Lanzieri <leandro.lanzieri@haw-hamburg.de>
2020-04-21 16:00:25 +05:30
Akshai M
0784190c9c drivers/dose : Add CONFIG_
Add CONFIG_ Prefix for DOSE_TIMEOUT_USEC
2020-04-21 16:00:25 +05:30
Benjamin Valentin
c4f248d51c drivers/dose: fix declaration of signal() 2020-03-23 20:35:54 +01:00
Jose Alamos
3ad574a822 drivers/netdev: use netdev_trigger_event_isr function 2020-03-06 14:03:43 +01:00
Jue
9cb8e2c941 drivers/dose: made the sense pin optional 2020-02-16 17:58:58 +01:00
Jue
cc184ca65b drivers/dose: fixed misspelled OCTET 2020-02-16 17:58:57 +01:00
benpicco
88f9d5870d
Merge pull request #13029 from jue89/feature/dose-optional-set-addr
drivers/dose: add setter for MAC address
2020-01-23 12:57:05 +01:00
Hyungsin
6eed5b9d43 remove XTIMER_OVERHEAD 2020-01-10 13:22:11 -08:00
Jue
2482eec07c drivers/dose: add setter for MAC address 2020-01-05 23:01:24 +01:00
Jue
bc46c7478f drivers: add Differentially Operated Serial Ethernet driver 2019-12-16 10:43:13 +01:00