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

78 Commits

Author SHA1 Message Date
Benjamin Valentin
838a5e4bd3 netdev_drivers: make sure to signal LINK_UP at least once 2022-09-16 22:57:28 +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
Francisco Molina
5579fd2220 drivers/xbee: uncrustify 2021-11-02 21:46:19 +01:00
Francisco Molina
472f6495a8 drivers/xbee: migrate to ztimer_msec 2021-11-02 21:46:19 +01:00
Jan Romann
4384795cb9
treewide: Remove excessive newlines 2021-08-13 19:50:38 +02:00
Leandro Lanzieri
0e52e2747e
drivers: remove netif as dependency for network device drivers 2020-11-13 09:25:59 +01:00
Bas Stottelaar
92b1dfc703 drivers/*: realign ENABLE_DEBUG 2020-10-23 01:26:09 +02:00
Martine Lenders
45144fb4a4
treewide: use new gnrc_pkt API functions instead of utlist.h macros 2020-10-13 13:32:53 +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
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
Martine S. Lenders
14afbe1030
xbee: remove NETOPT_IPV6_IID support
This option is handled in the `gnrc_netif`-layer without any access to
the driver's option since 7ae90564d9.
2020-06-25 13:41:20 +02:00
Francisco Molina
922b35da2d
drivers/xbee: disable CTS/RTS pin unless periph_uart_hw_fc is used
If usinng an arduino xbee shield then CTS pin will be wired to the
ICSP connector RESET pin.

If also used on an arduino-% board then if xbee is busy sending or
receiving data it will assert CTS and this will trigger a reset on
the board.

To avoid this disable CTS functionality on start up unless hardware
flow control is explicitly requested.
2020-04-24 10:54:36 +02:00
Martine S. Lenders
62d48d5bf3
gnrc_netif: document new *_create() out parameter as such 2020-03-26 14:37:44 +01:00
Jose Alamos
67ed9defbe gnrc_netif_xxx_create: use external netif allocation 2020-03-26 11:12:23 +01:00
Jose Alamos
3ad574a822 drivers/netdev: use netdev_trigger_event_isr function 2020-03-06 14:03:43 +01:00
Leandro Lanzieri
40794cf5f1 drivers/xbee: Fix reference to device from netif in send function 2020-01-23 18:11:17 +01:00
Martine Lenders
14a2f6bc18 gnrc: use gnrc_netif_default_init() for all implementations 2019-11-07 11:00:36 +01:00
Martine Lenders
69eb7069e9
gnrc_xbee: use gnrc_netif_hdr_set_netif() 2019-08-29 14:51:45 +02:00
kYc0o
f673d5af1e drivers/xbee: prevent 0 length packet sent to UART
Since the API doc doesn't specify what to do with 0
len writings into UART, we cannot assume that is
safe to do it, so this commit prevents it by checking
the length prior to the `uart_write()` operation.
2019-04-02 16:47:13 +02:00
Marian Buschsieweke
a3f1f21410
drivers/xbee: Use NETOPT_MAX_DPU_SIZE
Updated xbee to use NETOPT_MAX_DPU_SIZE instead of the deprecated
NETOPT_MAX_PACKET_SIZE
2019-02-18 20:19:02 +01:00
smlng
6183d5f5c5 netdev: remove layer2 netstats from netdev drivers
Removing usage of netdev->stats in all net drivers, as it is
handled by gnrc_netif.
2019-02-01 11:25:27 +02:00
smlng
6d0384f068 netstats: collect layer 2 netstats in gnrc_netif
This the first step in moving the collection of layer 2 netstats from
the low level driver to a central location, ie. gnrc_netif, to avoid
code duplication.
2019-02-01 10:35:03 +02:00
Kees Bakker
b21399b25c drivers/xbee: do normal assignment instead of memcpy 2019-01-10 19:43:44 +01:00
23b414b732 drivers: net: adapt to iolist-using netdev 2018-03-06 14:00:31 +01:00
51f16203fa drivers: xbee: DEBUG fixes 2018-01-15 14:37:05 +01:00
Martine Lenders
31b1ceb440
gnrc_netif2: rename to gnrc_netif 2017-11-17 10:41:54 +01:00
Martine Lenders
546d05266e
xbee: port to gnrc_netif2 2017-11-14 12:01:16 +01:00
Martine Lenders
4682c129e3
xbee: provide device type on get() 2017-11-14 12:01:16 +01:00
94c753c07a drivers: doxygen cleanup 2017-09-01 15:12:20 +02:00
Joakim Nohlgård
065bc62e0a netdev: Make set() value parameter const void * 2017-08-25 13:41:19 +02:00
Martine Lenders
34d9c67def
xbee: provide NETOPT_PROTO
Fixes #6973.

The current 6Lo-ND implementation relies on `NETOPT_PROTO` being
returned for an IEEE 802.15.4 device. This isn't ideal, since it mixes
GNRC into device code (and the next iteration of NDP will do it
better), but for now this is the only way to fix #6973.
2017-07-05 12:22:27 +02:00
Martine Lenders
29842bb5e4 netdev2: rename to netdev and remove gnrc_netdev
With some minor hand-edits I used the following chain of commands:

```sh
git rm sys/include/net/gnrc/netdev.h
git grep --name-only -i netdev2 | \
        xargs sed -i -e 's/^\(NETDEV\)2\(.*\)\( [("]\)/\1\2 \3/g' \
                     -e 's/\(netdev\)2\(.*\)\( \/\*\*<\)/\1\2 \3/I' \
                     -e 's/\(netdev\)2/\1/gI'
git add -p
git commit --amend
git ls-tree --full-tree -r HEAD --name-only | \
        grep "netdev2" | xargs -I'{}' dirname '{}' | uniq | \
        grep "netdev2" | while read dir; do
                new_dir="$(echo "$dir" | sed "s/netdev2/netdev/g")"
                git mv -f "$dir" "$new_dir"
        done
git commit --amend
git ls-tree --full-tree -r HEAD --name-only | \
        grep "netdev2" | while read file; do
                new_file="$(echo "$file" | sed "s/netdev2/netdev/g")"
                git mv -f "$file" "$new_file"
        done
git commit --amend
git grep --name-only "\<drivers_netdev_netdev\>" | \
        xargs sed -i "s/\<drivers_netdev_netdev\>/drivers_netdev_api/g"
git add -p
git commit --amend
```
2017-03-15 09:31:20 +01:00
kYc0o
ee741a4296 drivers/xbee: add UL to constants for 8 and 16 bit compatibility 2017-01-20 14:22:19 +01:00
Oleg Hahm
4f4214235b timex: unambiguous time conversion macros 2017-01-19 13:18:08 +01:00
Hauke Petersen
83d206e2b0 drivers/xbee: adapted to netdev2 2017-01-10 11:47:31 +01:00
Francisco Acosta
84d0d61279 Merge pull request #5608 from gebart/pr/xtimer-ticks
xtimer: Allow arbitrary timer frequency, second attempt
2016-11-29 23:00:31 +01:00
Joakim Nohlgård
7c48c891a0 xtimer: Update xtimer usage to match API changes 2016-11-29 20:44:31 +01:00
Hauke Petersen
52fdf4c886 drivers/xbee: use named UART return values 2016-10-28 10:32:00 +02:00
Francesco Ermini
9fa4684203 drivers/xbee: encryption support
add encryption to drivers

fix new line at the end of file

add shell command for enable encryption and set encryption key on a given device

modify _net_if_set_encrypt_key to support any key length

modify _net_if_set_encrypt_key to support any key length of the key

modify blank line

fix ace before tab in indent

fix ace before tab indent

fix ace before tab indent an error

fix trailing white space

drivers/xbee: encryption support

add encryption to drivers

fix new line at the end of file

add shell command for enable encryption and set encryption key on a given device

modify _net_if_set_encrypt_key to support any key length

modify _net_if_set_encrypt_key to support any key length of the key

modify blank line

fix ace before tab in indent

fix ace before tab indent

fix ace before tab indent an error

fix trailing white space

modify drivers/xbee/xbee.c

fix white spaces on xbee.c

Update xbee encryption driver

white line at end xbee.h

fix error

fix sc_netif.c

fix rebase master interactive

drivers/xbee: encryption support

add encryption to drivers

fix new line at the end of file

add shell command for enable encryption and set encryption key on a given device

modify _net_if_set_encrypt_key to support any key length

modify _net_if_set_encrypt_key to support any key length of the key

modify blank line

fix ace before tab in indent

fix ace before tab indent

fix ace before tab indent an error

fix trailing white space

drivers/xbee: encryption support

add encryption to drivers

fix new line at the end of file

add shell command for enable encryption and set encryption key on a given device

modify _net_if_set_encrypt_key to support any key length

modify _net_if_set_encrypt_key to support any key length of the key

modify blank line

fix ace before tab in indent

fix ace before tab indent

fix ace before tab indent an error

fix trailing white space

modify drivers/xbee/xbee.c

fix white spaces on xbee.c

Update xbee encryption driver

white line at end xbee.h

fix error

fix rebase  conflict 4

fix same missing in patches changes

fix ascii to hex index parser

fix syntax rules

fix syntax issue 2

add _netopt_strmap NETOPT_ENCRYPTION e NETOPT_ENCRYPTION_KEY

fix trailng white spaces
2016-04-20 17:43:09 +02:00
kYc0o
724276e913 Merge pull request #4734 from Yonezawa-T2/xbee_resp_timeout
xbee: add timeout for AT command response (fixes #4731)
2016-04-19 13:34:21 +02:00
Yonezawa-T2
4042239b04 xbee: add timeout for AT command response (fixes #4731) 2016-04-19 11:19:25 +09:00
Yonezawa-T2
eb7cc30494 xbee: enriched debug output 2016-04-19 11:17:13 +09:00
Yonezawa-T2
15ecee46ee xbee: add packet filtering to emulate non-transitive network.
When debugging multihop wireless network, it is useful to emulate non-transitive
network, that is, node A can communicate with B and B can communicate with C,
but A cannot communicate with C directly.

If `XBEE_DENIED_ADDRESSES`, which is an array of XBee long addresses, is
defined, packets from those addresses are dropped silently.

Example:
CFLAGS += "-DXBEE_DENIED_ADDRESSES={ 0x02, 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0x02, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11 }"
2016-04-19 11:17:13 +09:00
Yonezawa-T2
a6ae7c8091 xbee: fixed that _set_addr destructed given address.
`_set_addr` is called from `xbee_init` with lower bytes of the long address.
If `_set_addr` destructs the given address, the long address is also destructed.
2016-04-19 11:17:13 +09:00
Yonezawa-T2
66dd84eff2 xbee: disable short address when the address length is set to 8
XBee sends short address even for `API_ID_TX_LONG_ADDR` if short address is
enabled. This results in check sum error of ICMPv6 since the IP address is
computed based on long address on the sender side while it is computed based on
short address on the receiver side.
2016-04-19 11:17:13 +09:00
Yonezawa-T2
8481d85ead xbee: fixed RSSI header parsing 2016-04-19 11:17:12 +09:00
Yonezawa-T2
bea5eacea2 xbee: fixed broadcast header
Destination address is at tx_buf[5] and tx_buf[6] rather than tx_buf[4] and
tx_buf[5].

Broadcast header is overridden by following code mistakenly.
2016-04-18 10:21:15 +09:00
Yonezawa-T2
4f864b0ec8 xbee: fixed missing unlocks 2016-04-18 10:20:52 +09:00
Oleg Hahm
a59e100d41 ieee802154: replace literals for lengths by macros 2016-04-04 15:24:47 +02:00