Compare commits

...

23 Commits

Author SHA1 Message Date
José Alamos
1a4b35a503
Merge pull request #16648 from jia200x/backport/2021.07/pr/revert/rx_symbol
net/lorawan: Revert #16604 and fix NETOPT_RX_SYMBOL_TIMEOUT documentation [backport 2021.07]
2021-07-14 16:03:58 -04:00
Jose Alamos
38c987354d
netopt: fix NETOPT_RX_SYMBOL_TIMEOUT documentation 2021-07-14 19:50:00 +02:00
Jose Alamos
2714035e03
Revert "drivers/sx127x: fix size of rx symbol timeout"
This reverts commit 26ead7b5be88453b6904c5551591ecdfb8ba4688.
2021-07-14 19:50:00 +02:00
Jose Alamos
e024d6dadc
Revert "pkg/semtech-loramac: use uint8_t for NETOPT_RX_SYMBOL_TIMEOUT"
This reverts commit 79e194783c1b34d6249dbb56a888e4beac162255.
2021-07-14 19:50:00 +02:00
Jose Alamos
db69969df2
Revert "net/gnrc_lorawan: use uint8_t for NETOPT_RX_SYMBOL_TIMEOUT"
This reverts commit e791a86971785babb9a7750a4be01cce760a7527.
2021-07-14 19:49:59 +02:00
Jose Alamos
67374dacac
Revert "tests/driver_sx127x: use uint8_t for NETOPT_RX_SYMBOL_TIMEOUT"
This reverts commit 5ef4c0a778ab7d4f625d63fdafe5e8347bfe479d.
2021-07-14 19:49:57 +02:00
Kevin "Tristate Tom" Weiss
60364b256f
Merge pull request #16647 from miri64/backport/2021.07/gnrc_sock/fix/imply-only-unset-netif
gnrc_sock: imply end-point netif only if unset [backport 2021.07]
2021-07-14 16:13:09 +02:00
Martine Lenders
26afb55700
gnrc_sock: imply end-point netif only if unset
(cherry picked from commit 5c3c1b6a5f4385b1f3ea0c58aad93b11a56d3fbb)
2021-07-14 14:18:07 +02:00
Kevin "Tristate Tom" Weiss
0c586d86ac
Merge pull request #16642 from maribu/backport/2021.07/fix-esp8266-boot
cpu/esp_common: fix boot issue on ESP8266 [backport 2021.07]
2021-07-14 13:55:05 +02:00
Marian Buschsieweke
a20bd7cba6
cpu/esp_common: fix bootloop on ESP8266
(cherry picked from commit 6c4f0da7a76d874054493bf30980fb331d330497)
2021-07-14 10:21:43 +02:00
efd80adc84
Merge pull request #16626 from MrKevinWeiss/pr/gnrc_lorawan_fix_release
gnrc_lorawan: fix gnrc_pktbuf_release_error (introduced by #16080) [backport 2021.07]
2021-07-07 22:42:22 +02:00
Jose Alamos
ddeca04823
gnrc_lorawan: fix gnrc_pktbuf_release_error 2021-07-07 19:37:55 +02:00
José Alamos
ecbafcdaab
Merge pull request #16620 from MrKevinWeiss/pr/sx126x/fix_netdev_write
drivers/sx126x: fix netdev send and recv function [backport 2021.07]
2021-07-07 18:10:38 +02:00
Jose Alamos
0262c36960
drivers/sx126x: fix wrong return value in recv function 2021-07-07 15:22:09 +02:00
Jose Alamos
3978f51166
drivers/sx126x: fix netdev send function
This commit fixes the send function of sx126x. The loop that reads the
iolist was not considering the offset. Therefore each iolist snippet was
being written into the first position.

The loop was also setting the payload length to the size of the iolist
snippet. Then the payload was also wrong.

With this commit an iolist is copied sequentially into the framebuffer
and the payload length is set to `iolist_size`
2021-07-07 15:22:05 +02:00
José Alamos
b490a66e9e
Merge pull request #16621 from MrKevinWeiss/pr/lora/fix_rx_timeout_size
netdev/lora: fix size of NETOPT_RX_SYMBOL_TIMEOUT [backport 2021.07]
2021-07-07 14:27:58 +02:00
Jose Alamos
71cdbd5501
tests/driver_sx127x: use uint8_t for NETOPT_RX_SYMBOL_TIMEOUT 2021-07-07 11:52:00 +02:00
Jose Alamos
34cb17d531
net/gnrc_lorawan: use uint8_t for NETOPT_RX_SYMBOL_TIMEOUT 2021-07-07 11:52:00 +02:00
Jose Alamos
a0c9828b20
pkg/semtech-loramac: use uint8_t for NETOPT_RX_SYMBOL_TIMEOUT 2021-07-07 11:52:00 +02:00
Jose Alamos
e7dd2e0fc0
drivers/sx127x: fix size of rx symbol timeout 2021-07-07 11:51:56 +02:00
Martine Lenders
4963df259a
Merge pull request #16615 from kaspar030/backport/2021.07/fix_tests-ipv4_addr
unittests/tests-ipv?_addr: fix some uninitialized variable bugs [backport 2021.07]
2021-07-05 22:04:45 +02:00
6a871b1fd2 unittests/tests-ipv6_addr: test_ipv6_addr_to_str__addr_NULL(): zero a
(cherry picked from commit ddc30a198a79e4d9c21125986a3b4b2691e3b359)
2021-07-05 21:18:25 +02:00
8a1da6ffde unittests/tests-ipv4_addr: test_ipv4_addr_to_str__addr_NULL(): zero a
(cherry picked from commit b388a2a4406449133abafed2d31ea9e2f8e20227)
2021-07-05 21:18:25 +02:00
8 changed files with 24 additions and 23 deletions

View File

@ -88,7 +88,7 @@ LINKFLAGS += -nostdlib -Wl,-gc-sections -Wl,-static
ifeq (,$(filter esp_idf_heap,$(USEMODULE)))
# use the wrapper functions for calloc to add correct overflow detection missing
# in the newlib's version.
LINKFLAGS += -Wl,-wrap=calloc
LINKFLAGS += -Wl,-wrap=_calloc_r
endif
# LINKFLAGS += -Wl,--verbose

View File

@ -289,7 +289,7 @@ void* IRAM_ATTR __wrap__calloc_r(struct _reent *r, size_t count, size_t size)
#else /* MODULE_ESP_IDF_HEAP */
void *__wrap_calloc(size_t nmemb, size_t size)
void* IRAM_ATTR __wrap__calloc_r(struct _reent *r, size_t nmemb, size_t size)
{
/* The xtensa support has not yet upstreamed to newlib. Hence, the fixed
* calloc implementation of newlib >= 4.0.0 is not available to the ESP
@ -299,7 +299,7 @@ void *__wrap_calloc(size_t nmemb, size_t size)
return NULL;
}
void *res = malloc(total_size);
void *res = _malloc_r(r, total_size);
if (res) {
memset(res, 0, total_size);

View File

@ -51,23 +51,24 @@ static int _send(netdev_t *netdev, const iolist_t *iolist)
return -ENOTSUP;
}
uint8_t size = iolist_size(iolist);
/* Ignore send if packet size is 0 */
if (!size) {
return 0;
}
DEBUG("[sx126x] netdev: sending packet now (size: %d).\n", size);
size_t pos = 0;
/* Write payload buffer */
for (const iolist_t *iol = iolist; iol; iol = iol->iol_next) {
if (iol->iol_len > 0) {
sx126x_set_lora_payload_length(dev, iol->iol_len);
sx126x_write_buffer(dev, 0, iol->iol_base, iol->iol_len);
sx126x_write_buffer(dev, pos, iol->iol_base, iol->iol_len);
DEBUG("[sx126x] netdev: send: wrote data to payload buffer.\n");
pos += iol->iol_len;
}
}
/* Ignore send if packet size is 0 */
if (!pos) {
return 0;
}
DEBUG("[sx126x] netdev: sending packet now (size: %d).\n", pos);
sx126x_set_lora_payload_length(dev, pos);
state = NETOPT_STATE_TX;
netdev->driver->set(netdev, NETOPT_STATE, &state, sizeof(uint8_t));
DEBUG("[sx126x] netdev: send: transmission in progress.\n");
@ -107,7 +108,7 @@ static int _recv(netdev_t *netdev, void *buf, size_t len, void *info)
sx126x_read_buffer(dev, rx_buffer_status.buffer_start_pointer, buf, size);
return 0;
return size;
}
static int _init(netdev_t *netdev)

View File

@ -748,7 +748,7 @@ typedef enum {
NETOPT_RANDOM,
/**
* @brief (uint8_t) Get or set the number of PHY symbols before assuming there's no data
* @brief (uint16_t) Get or set the number of PHY symbols before assuming there's no data
*/
NETOPT_RX_SYMBOL_TIMEOUT,

View File

@ -300,10 +300,11 @@ static int _send(gnrc_netif_t *netif, gnrc_pktsnip_t *payload)
mlme_request_t mlme_request;
mlme_confirm_t mlme_confirm;
gnrc_pktsnip_t *head;
uint8_t port;
int res = -EINVAL;
assert(payload);
if (IS_ACTIVE(CONFIG_GNRC_NETIF_LORAWAN_NETIF_HDR)) {
gnrc_netif_hdr_t *netif_hdr;
const uint8_t *dst;
@ -318,11 +319,10 @@ static int _send(gnrc_netif_t *netif, gnrc_pktsnip_t *payload)
}
/* Remove the netif hdr snip and point to the MSDU */
head = gnrc_pktbuf_remove_snip(payload, payload);
payload = gnrc_pktbuf_remove_snip(payload, payload);
}
else {
head = payload;
port = netif->lorawan.port;
}
@ -335,18 +335,18 @@ static int _send(gnrc_netif_t *netif, gnrc_pktsnip_t *payload)
mcps_request_t req =
{ .type = netif->lorawan.ack_req ? MCPS_CONFIRMED : MCPS_UNCONFIRMED,
.data =
{ .pkt = (iolist_t *)head, .port = port,
{ .pkt = (iolist_t *)payload, .port = port,
.dr = netif->lorawan.datarate } };
mcps_confirm_t conf;
gnrc_lorawan_mcps_request(&netif->lorawan.mac, &req, &conf);
res = conf.status;
end:
if (res < 0) {
gnrc_pktbuf_release_error(payload, res);
}
end:
return res;
}

View File

@ -125,7 +125,7 @@ static inline void gnrc_ep_set(sock_ip_ep_t *out, const sock_ip_ep_t *in,
size_t in_size)
{
memcpy(out, in, in_size);
if (gnrc_netif_highlander()) {
if (gnrc_netif_highlander() && (out->netif == 0)) {
/* set interface implicitly */
gnrc_netif_t *netif = gnrc_netif_iter(NULL);

View File

@ -54,7 +54,7 @@ static void test_ipv4_addr_to_str__addr_NULL(void)
static void test_ipv4_addr_to_str__result_NULL(void)
{
ipv4_addr_t a;
ipv4_addr_t a = {0};
TEST_ASSERT_NULL(ipv4_addr_to_str(NULL, &a, IPV4_ADDR_MAX_STR_LEN));
}

View File

@ -826,7 +826,7 @@ static void test_ipv6_addr_to_str__addr_NULL(void)
static void test_ipv6_addr_to_str__result_NULL(void)
{
ipv6_addr_t a;
ipv6_addr_t a = {0};
TEST_ASSERT_NULL(ipv6_addr_to_str(NULL, &a, IPV6_ADDR_MAX_STR_LEN));
}