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

7318 Commits

Author SHA1 Message Date
Marian Buschsieweke
a3e7abc2e2
sys/pm: Fix behavior of fallback pm_off() implementation
- pm_off() should prevent other threads from getting executed after it is
  called, as it should turn off the MCU completely according to its doc
    - Previously, the fallback implementation would still allow other threads
      to continue working
    - Simply disabling IRQs and never enabling them again should make sure
      the MCU behaves like it would be completely off
- pm_off() should reduce the power consumption as much as possible
    - Previously, when IRQs came after the call to pm_set_lowest() in the
      fallback implementation of pm_off(), `while(1) {}` got executed at full
      power consumption
    - Just calling `pm_set(0);` in a loop while make sure that lowest power mode
      is restored if the MCU wakes up again.
    - The check if the lowest power mode is available is skipped, as no code
      gets executed afterwards anyway
2020-04-29 12:08:12 +02:00
Marian Buschsieweke
f6873dbac3
sys/pm: Add pm_get_blocker()
Provide access to pm_blocker via a well-defined API rather than hacks.
2020-04-29 11:21:03 +02:00
Juergen Fitschen
73e22612e2 sys/ztimer: add power management for ztimer clocks 2020-04-29 10:55:10 +02:00
Benjamin Valentin
6ce0092982 shell/sc_gnrc_netif: fix vera++ errors 2020-04-29 10:41:37 +02:00
Benjamin Valentin
504d02038d gnrc_netif: update PDU after changing PHY mode 2020-04-29 10:41:37 +02:00
Benjamin Valentin
c77119957f shell/sc_gnrc_netif: fix space after NID
All option have a space behind them. This fixes the formatting of the
NID parameter if there are options after it.
2020-04-29 10:41:37 +02:00
Benjamin Valentin
fac35644d0 ieee802154: add definitions & config options for MR-O-QPSK
Define options for IEEE 802.15.4g MR-O-QPSK as well as shell commands
to set them via ifconfig.
2020-04-29 10:41:37 +02:00
Thomas Stilwell
325ab426d4
sys/shell/commands: pm: add set mode block mode unblock mode 2020-04-28 16:56:34 +02:00
Thomas Stilwell
7c82ac6838
sys/shell/commands: add pm show command to view current blockers 2020-04-28 16:51:23 +02:00
Martine Lenders
633d0f486d
Merge pull request #13669 from bergzand/pr/netif/async_events
gnrc_netif: Add support for internal event loop
2020-04-28 13:03:39 +02:00
943450a567
Merge pull request #13959 from leandrolanzieri/pr/nanocoap/kconfig/add_type
nanocoap/kconfig: Explicitly define type of MODULE_NANOCOAP
2020-04-28 12:48:47 +02:00
Francisco Molina
da7e14dc66
sys/ztimer/auto_init: fix rtt auto_init 2020-04-28 09:11:44 +02:00
Leandro Lanzieri
b91c8502dc
net/nanocoap/kconfig: Explicitly define type of MODULE_NANOCOAP 2020-04-27 10:06:01 +02:00
Martine S. Lenders
cb8a6c36b0
gnrc_ipv6_nib: 6ln: use interface-specific DR for address registration
With multiple 6LoWPAN interfaces the router for the given interface
—the one the triggering RA came over—should be used to register the
address with.

Co-Authored-By: Benjamin Valentin <benpicco@googlemail.com>
2020-04-25 01:20:55 +02:00
Martine S. Lenders
245c04f368
gnrc_ipv6_nib: internal: add capability to search DR by interface
Co-Authored-By: Benjamin Valentin <benpicco@googlemail.com>
2020-04-24 17:57:09 +02:00
Leandro Lanzieri
eeea9b7dae
net/coap: Expose configurations to Kconfig 2020-04-24 10:06:45 +02:00
Leandro Lanzieri
9e427e1584
net/coap: Move COAP_MAX_RETRANSMIT to 'CONFIG' namespace
COAP_MAX_RETRANSMIT is moved to the compile time configuration macro
namespace.
2020-04-24 10:06:43 +02:00
Leandro Lanzieri
afe4244ac9
net/coap: Move COAP_RANDOM_FACTOR_1000 to 'CONFIG' namespace
COAP_RANDOM_FACTOR_1000 is moved to the compile time configuration macro
namespace.
2020-04-24 10:06:43 +02:00
Leandro Lanzieri
072a0d8563
net/coap: Move COAP_ACK_TIMEOUT to 'CONFIG' namespace
COAP_ACK_TIMEOUT is moved to the compile time configuration macro
namespace.
2020-04-24 10:06:40 +02:00
Cenk Gündoğan
4e05a66ca2 nanocoap: add proxy_uri parsing 2020-04-23 22:41:12 +02:00
Marian Buschsieweke
7b67e74bed
sys/net/gnrc: Use %lu to print times 2020-04-23 21:16:57 +02:00
Marian Buschsieweke
654b558343
sys/timex: Fix integer width issue
The macros US_PER_MS and friends are assumed to be 32 bit unsigned integers
by users. However, e.g. on AVR a `1000U` is only 16 bit long. Thus, e.g.
`xtimer_usleep(100 * US_PER_MS)` will wrap around and only sleep for ~34ms.

This commit declares them as unsigned long, which is on all currently supported
platforms 32 bit wide.
2020-04-23 21:16:04 +02:00
5e5ed8233d
Merge pull request #13922 from kaspar030/ztimer_rtt_maxval_fix
ztimer: periph_rtt: ensure RTT_MAX_VALUE is honored
2020-04-23 18:42:00 +02:00
d8c129fc47 ztimer: periph_rtt: ensure RTT_MAX_VALUE is honored
Previously, ztimer would happily set an absolute RTT alarm value that exceeds
RTT's maximum value (though not a longer interval), as the `val` was
simply added to `rtt_get_counter()`.
This commit ensures that the target value wraps around RTT_MAX_VALUE.

Fixes #13920.
2020-04-23 16:19:25 +02:00
Cenk Gündoğan
ea616abfda nanocoap: allow coap_opt_add_string() for zero-terminated strings 2020-04-22 12:28:48 +02:00
Leandro Lanzieri
46507ff247
Merge pull request #13894 from kb2ma/gcoap/ping
net/gcoap: add CoAP ping request
2020-04-21 12:23:54 +02:00
5293e5400c
Merge pull request #13210 from kaspar030/add_xtimer_left
sys/xtimer: remove uses of xtimer internal struct members
2020-04-21 12:15:41 +02:00
0228553384 sys/shell: rpl: make use of xtimer_left_usec() 2020-04-21 11:26:56 +02:00
df520a70a7 sys/evtimer: make use of xtimer_left_usec() 2020-04-21 11:26:56 +02:00
c9c8c98a4b sys/xtimer: introduce xtimer_left_usec() 2020-04-21 11:26:56 +02:00
40cb065a45
Merge pull request #13839 from leandrolanzieri/pr/kconfig_migrate/sys/usbus_ecm
usbus/cdc/ecm: Expose configurations to Kconfig
2020-04-21 10:12:30 +02:00
Ken Bannister
cac350901f
Merge pull request #13893 from cgundogan/pr/nanocoap-get-opt-uint
nanocoap: export coap_opt_get_uint()
2020-04-18 10:00:27 -04:00
Martine Lenders
55a7010a0a
Merge pull request #13157 from nmeum/pr/fuzzing_tcp_only
Add AFL-based fuzzing setup for network modules
2020-04-18 10:54:14 +02:00
Cenk Gündoğan
6859de7855 nanocoap: export coap_opt_get_uint() 2020-04-17 22:39:44 +02:00
Sören Tempel
ac9c1f4a69 gnrc_tcp: disable checksum checks during fuzzing 2020-04-17 17:11:15 +02:00
Ken Bannister
6eae4ded84 net/gcoap: create CoAP ping request 2020-04-17 08:15:20 -04:00
Ken Bannister
f5a85e2aff net/gcoap: handle CoAP ping request 2020-04-17 08:15:20 -04:00
Ken Bannister
2d3eb1a343 net/nanocoap: validate empty message length 2020-04-17 08:15:20 -04:00
Joakim Nohlgård
2013ac75f5
gnrc_netif: Add support for internal event loop
Enabled by the gnrc_netif_events pseudo module. Using an internal event
loop within the gnrc_netif thread eliminates the risk of lost interrupts
and lets ISR events always be handled before any send/receive requests
from other threads are processed.
The events in the event loop is also a potential hook for MAC layers and
other link layer modules which may need to inject and process events
before any external IPC messages are handled.

Co-Authored-By: Koen Zandberg <koen@bergzand.net>
2020-04-17 12:02:39 +02:00
Benjamin Valentin
795cd165fd ieee802154: add definitions for 802.15.4 PHY modes
This adds PHY modes for IEEE 802.15.4-2003 and IEEE 802.15.4g-2012.
2020-04-15 21:41:19 +02:00
Francisco Molina
2331448644
Makefile: remove usage of SUBMODULES_NOFORCE
With #10970 only existing *.c files will be added to SRC when using
the SUBMODULES mechanism, so SUBMODULES_NOFORCE (used to filter out
non existing source files) is now redundant so remove the usage.
2020-04-15 12:11:44 +02:00
benpicco
e499290f19
Merge pull request #13863 from yogo1212/rtc_iff
tm.h: fix typo
2020-04-14 23:02:25 +02:00
Leandro Lanzieri
b4655f6c91
Merge pull request #13848 from fjmolinas/pr_ccm_no_plaintext
sys/crypto/modes/ccm: handle input_len = 0
2020-04-14 10:49:54 +02:00
Martine S. Lenders
085c62ecdc
xtimer_core: piggy-back style fixes 2020-04-10 12:42:32 +02:00
Francisco Molina
8372286591
sys/crypto/modes/ccm: accept input_len=0
CCM may be used on messages with no plaintext data.
2020-04-10 10:41:01 +02:00
Martine S. Lenders
212fe15786
xtimer: set now pointer correctly in _update_short_timers() loop
This fixes `xtimer` to use `xtimer_now64()` instead of `xtimer_now()`
for updating the `*now` variable during the iteration in
`_update_short_timers()` function. The same function is used to
initialize `*now` in `_timer_callback()` below.

While using `xtimer_now()` in this iteration step does not hinder the
proper execution of all timers in the short term timers (for those the
`xtimer` module only looks at the `start_time` member, not the
`long_start_time` member) at least for the current long term time window
(I did not test higher cases), it sets the `long_start_time` member to 0
for all timers following in the list of timers after this iteration
step. However, external modules that rely on this to be correct,
e.g. evtimer [1], fail their calculations when trying to compare to
the current value to `xtimer_now64()`.

[1] https://github.com/RIOT-OS/RIOT/blob/11f3d68/sys/evtimer/evtimer.c#L118-L121

Co-Authored-By: Cenk Gündoğan <mail+dev@gundogan.net>
2020-04-10 00:02:33 +02:00
Leandro Lanzieri
a06d9bbb66
Merge pull request #13315 from jia200x/pr/kconfig/ieee802154
ieee802154: Expose configurations to Kconfig
2020-04-08 19:34:55 +02:00
Jose Alamos
77325b4cde ieee802154: add CONFIG_ prefix to config macros 2020-04-08 19:08:25 +02:00
Jose Alamos
d33e44a85c ieee802154: Expose configurations to Kconfig 2020-04-08 18:28:23 +02:00
Leandro Lanzieri
dddeb54e7d
usbus/cdc/ecm: Expose configurations to Kconfig 2020-04-08 16:31:46 +02:00
Leandro Lanzieri
8b857844fc
usbus/cdc/ecm: Move USBUS_CDC_ECM_CONFIG_SPEED to 'CONFIG_' 2020-04-08 16:30:58 +02:00
Leandro Lanzieri
335b0ceb50
usbus/cdc/ecm: Move USBUS_CDC_ECM_CONFIG_SPEED_UPSTREAM to 'CONFIG_' 2020-04-08 16:27:04 +02:00
Leandro Lanzieri
88e50658f3
usbus/cdc/ecm: Move USBUS_CDC_ECM_CONFIG_SPEED_DOWNSTREAM to 'CONFIG_' 2020-04-08 16:24:59 +02:00
14706d7423
Merge pull request #13243 from leandrolanzieri/pr/kconfig_migrate/net/nanocoap
net/nanocoap: Expose configurations to Kconfig
2020-04-08 10:51:54 +02:00
Martine Lenders
475048ab2f
Merge pull request #13833 from benpicco/dist/tools/sliptty-fix
gnrc_dhcpv6_client: fix for SLIP link-layer
2020-04-08 10:05:02 +02:00
Benjamin Valentin
f198d689be gnrc_dhcpv6_client: fix for SLIP link-layer
In a point-to-point serial connection, we don't have L2 addresses.
Set the link type & packet length accordingly and we will get a
prefix from KEA.
2020-04-07 22:08:57 +02:00
Ken Bannister
1ff78879ff net/nanocoap: remove obsolete functions to add Uri-Query option 2020-04-07 12:17:41 -04:00
Sören Tempel
65c7bbf76d gnrc_sock: Implement termination condition for fuzzing
The termination condition implemented in gnrc_pktbuf_malloc does not
work when using the sock interface as sock copies packet data to a local
buffer and frees the packet afterwards. As such, the fuzzing application
would exit before performing any input processing.

For this reason, the termination condition in gnrc_pktbuf_malloc is
disabled when using sock. Instead, the application terminates if
gnrc_sock_recv previously returned the fuzzing packet. The underlying
assumption of this implementation is that gnrc_sock_recv is called in a
loop.
2020-04-07 17:48:39 +02:00
Sören Tempel
e0570181e4 gnrc_pktbuf_malloc: Terminate when fuzzing packet is freed
Since RIOT is an operating system the native binary will never terminate
[0]. The termination condition for fuzzing GNRC is that the packet was
handled by the network stack and therefore freed. If it is never freed
we will deadlock meaning a memory leak was found, afl should be able to
detect this through timeouts.

This is currently only supported for gnrc_pktbuf_malloc since this is
the pktbuf implementation I used for fuzzing. Implementing this in
pktbuf.h is not possible.

[0]: Except NATIVE_AUTO_EXIT is defined, however, even with that define
set RIOT will only terminate when all threads terminated. Unfortunately,
gnrc_udp and other network threads will never terminate.
2020-04-07 17:48:39 +02:00
Sören Tempel
9e72f717e0 sys/fuzzing: Initialize
This adds a utility module which is used to write applications for
fuzzing RIOT network modules. The module provides a dummy network
interface which is configured with a static IPv6 addresses for modules
which perform operations on the underlying network interface. Besides,
it contains a utility function for transforming data received on
standard input into a `gnrc_pktsnip_t`.
2020-04-07 17:48:39 +02:00
Leandro Lanzieri
0137a06896
net/nanocoap: Expose configurations to Kconfig 2020-04-07 17:00:55 +02:00
Leandro Lanzieri
e80dcf2d8b
net/application_layer: Add Kconfig file and CoAP menu 2020-04-07 17:00:54 +02:00
Leandro Lanzieri
b6be8af81c
net/nanocoap: Move NANOCOAP_QS_MAX to 'CONFIG_' namespace 2020-04-07 17:00:53 +02:00
Leandro Lanzieri
2f72189aa2
net/nanocoap: Move NANOCOAP_BLOCK_SIZE_EXP_MAX to 'CONFIG_' namespace 2020-04-07 17:00:53 +02:00
Leandro Lanzieri
4052c01e85
net/nanocoap: Move NANOCOAP_URI_MAX to 'CONFIG_' namespace 2020-04-07 17:00:53 +02:00
Leandro Lanzieri
c84576ef6e
net/nanocoap: Move NANOCOAP_NOPTS_MAX to 'CONFIG_' namespace 2020-04-07 17:00:52 +02:00
c81c8ed104
Merge pull request #13375 from leandrolanzieri/pr/kconfig_migrate/sys/usbus_cdc
usbus/cdc/acm: Expose configurations to Kconfig
2020-04-07 15:00:36 +02:00
Leandro Lanzieri
934bede70e
usbus/cdc/acm: Expose configurations to Kconfig 2020-04-07 14:34:57 +02:00
Leandro Lanzieri
51c4f119a5
usbus/cdc/acm: Move USBUS_CDC_ACM_BULK_EP_SIZE to 'CONFIG_' namespace 2020-04-07 14:34:56 +02:00
Leandro Lanzieri
cd3ac726d9
usbus/cdc/acm: Move USBUS_CDC_ACM_STDIO_BUF_SIZE to 'CONFIG_' namespace 2020-04-07 14:34:52 +02:00
Ken Bannister
b32fcd28d1
Merge pull request #13815 from kb2ma/nanocoap/add_canonical_uri_query
net/gcoap: add canonical uri query function names
2020-04-07 06:32:13 -04:00
Ken Bannister
5d95436334 net/cord: use canonical function name to add Uri-Query option 2020-04-06 06:19:44 -04:00
Ken Bannister
04d14ae104 net/gcoap: reference canonical function name to add Uri-Query option 2020-04-06 06:19:44 -04:00
Ken Bannister
d57340c964 net/nanocoap: use new Uri-Query functions as primary implementation 2020-04-06 06:19:44 -04:00
Cenk Gündoğan
abd399b934
Merge pull request #13804 from chrysn-pull-requests/uri-test-isabsolute
uri_parser: Fix and test non-relative recognition
2020-04-05 13:42:11 +02:00
Martine Lenders
5c95df3151
Merge pull request #13806 from benpicco/sys/net/dhcpv6-multiple_prefixes
sys/net/dhcpv6: fix requesting multiple prefixes
2020-04-05 01:14:27 +02:00
Ken Bannister
127f8ca407
Merge pull request #13805 from benpicco/nanocoap_path
nanocoap: add convenience function for adding path elements
2020-04-04 12:50:16 -04:00
Benjamin Valentin
c8b2483de5 net/gcoap: make use of coap_opt_add_path() 2020-04-04 17:06:04 +02:00
Benjamin Valentin
1a4a5d4a9e nanocoap: add convenience function for adding path elements
Add a convenience function to make adding additional sub-path
options easier.
2020-04-04 17:06:04 +02:00
Ken Bannister
c463c45939 net/nanocoap: add canonical function names to add Uri-Query option 2020-04-04 07:56:58 -04:00
Benjamin Valentin
0e5595cffd sys/net/dhcpv6: fix requesting multiple prefixes
There were two subtle bugs that prevented the DHCPv6 client to request
multiple prefixes for different interfaces.

 - `dhcpv6_client_req_ia_pd()` would fill up *all* leases with the same interface
 - `_parse_reply()` would return after parsing the first answer

With this patch, `gnrc_border_router` gets a prefix on both interfaces of the at86rf215.
2020-04-03 17:02:57 +02:00
chrysn
050af95666 uri_parser: Fix relative recognition
Relative refernces with colons in their names can not be told by their
first character alone.
2020-04-03 15:22:13 +02:00
Cenk Gündoğan
f1bf9693a6
Merge pull request #13803 from chrysn-pull-requests/uri-terminology-strictness
uri_parser: terminology strictness
2020-04-03 15:21:42 +02:00
Cenk Gündoğan
fca7548762
Merge pull request #13374 from leandrolanzieri/pr/kconfig_migrate/sys/usbus
sys/usbus: Expose configurations to Kconfig
2020-04-03 15:19:22 +02:00
Leandro Lanzieri
06920a1f7a
sys/usbus: Expose configurations to Kconfig 2020-04-03 14:45:27 +02:00
Leandro Lanzieri
4d47921947
sys/usbus: Move USBUS_EP0_SIZE to 'CONFIG_' namespace 2020-04-03 14:45:26 +02:00
Leandro Lanzieri
7bd5f86bdd
sys/usbus: Move USBUS_AUTO_ATTACH to 'CONFIG_' namespace
In code now 'IS_ACTIVE' is used to check for this configuration.
2020-04-03 14:45:25 +02:00
chrysn
7f67077338 uri_parser: Document that fragment identifiers are not handled 2020-04-03 14:32:55 +02:00
chrysn
6991f62338 uri_parser: Differentiate between URI and URI reference in documentation 2020-04-03 14:30:38 +02:00
Cenk Gündoğan
e3d9097974 sys/uri_parser: check for uri_end instead of 0 2020-04-02 10:04:12 +02:00
Martine Lenders
76acde0984
Merge pull request #13779 from miri64/sock/enh/sock_buf_recv-iterate-chunks
sock: amend API to iterate over stack-internal buffer chunks
2020-04-01 16:59:03 +02:00
Martine S. Lenders
d934579817
gnrc_sock: adapt for *_recv_buf() API change 2020-04-01 15:50:51 +02:00
Martine S. Lenders
58685af8a6
sock: sock_*_recv_buf: mark as experimental 2020-04-01 15:50:51 +02:00
Martine S. Lenders
f9e17ac025
sock: amend API to iterate over stack-internal chunks
With lwIP we have a chunked UDP payload, so just providing the
stack-internal buffer is not possible. To be able to iterate over such
a chunked payload, this change allows the `sock_*_recv_buf()` functions
to use the internal buffer context as an iteration state.

As the internal buffer space can be released when the function would
return 0, `sock_recv_buf_free()` becomes unnecessary.
2020-04-01 15:50:46 +02:00
Leandro Lanzieri
461f40949d
gnrc/ipv6: Group IPv6 related Kconfig files 2020-04-01 14:34:13 +02:00
Cenk Gündoğan
abc1cb17ca sys/uri_parser: initialize has_authority in _consume_scheme() 2020-04-01 12:32:40 +02:00
Martine Lenders
d9b9426a86
Merge pull request #13758 from cgundogan/uri_parser
sys/uri_parser: minimal and non-destructive URI parsing
2020-04-01 00:40:27 +02:00
Cenk Gündoğan
b9012fb5d9 uri_parser: add minimal and non-destructive URI parser 2020-03-31 23:54:40 +02:00
Peter Kietzmann
767cfc21a9
Merge pull request #13341 from Einhornhool/cryptoauth-shellhandler
sys/shell: add shell handler for CryptoAuth devices
2020-03-31 22:19:21 +02:00
Lena Boeckmann
5bc0b15114 sys/shell: add cryptoauthlib shell handler 2020-03-31 21:31:24 +02:00