From 5a27241e22521bfe5ed1f31198b2dce5dbc43d6e Mon Sep 17 00:00:00 2001 From: Jose Alamos Date: Wed, 29 Jun 2022 17:32:26 +0200 Subject: [PATCH 1/3] drivers/nrf802154: fix variable initialization --- cpu/nrf52/radio/nrf802154/nrf802154_radio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpu/nrf52/radio/nrf802154/nrf802154_radio.c b/cpu/nrf52/radio/nrf802154/nrf802154_radio.c index 4eb926a727..9fac72b9b5 100644 --- a/cpu/nrf52/radio/nrf802154/nrf802154_radio.c +++ b/cpu/nrf52/radio/nrf802154/nrf802154_radio.c @@ -197,7 +197,7 @@ static int _request_op(ieee802154_dev_t *dev, ieee802154_hal_op_t op, void *ctx) (void) dev; int res = -EBUSY; - int state; + int state = STATE_IDLE; switch (op) { case IEEE802154_HAL_OP_TRANSMIT: From 55dc62819a3ee186db5e58b44bb03068c9c0ec02 Mon Sep 17 00:00:00 2001 From: Jose Alamos Date: Wed, 29 Jun 2022 17:32:45 +0200 Subject: [PATCH 2/3] drivers/nrf802154: fix CCA result --- cpu/nrf52/radio/nrf802154/nrf802154_radio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cpu/nrf52/radio/nrf802154/nrf802154_radio.c b/cpu/nrf52/radio/nrf802154/nrf802154_radio.c index 9fac72b9b5..fcb20a547a 100644 --- a/cpu/nrf52/radio/nrf802154/nrf802154_radio.c +++ b/cpu/nrf52/radio/nrf802154/nrf802154_radio.c @@ -265,6 +265,10 @@ static int _confirm_op(ieee802154_dev_t *dev, ieee802154_hal_op_t op, void *ctx) state = STATE_IDLE; enable_shorts = true; + if (info) { + info->status = (_state == STATE_CCA_BUSY) ? TX_STATUS_MEDIUM_BUSY : TX_STATUS_SUCCESS; + } + break; case IEEE802154_HAL_OP_SET_RX: eagain = (radio_state == RADIO_STATE_STATE_RxRu); @@ -291,10 +295,6 @@ static int _confirm_op(ieee802154_dev_t *dev, ieee802154_hal_op_t op, void *ctx) _state = state; - if (info) { - info->status = (_state == STATE_CCA_BUSY) ? TX_STATUS_MEDIUM_BUSY : TX_STATUS_SUCCESS; - } - if (enable_shorts) { NRF_RADIO->SHORTS = DEFAULT_SHORTS; DEBUG("[nrf802154] TX Finished\n"); From 45ba9131c8f6aaf5322a53b087ed4ca67719306a Mon Sep 17 00:00:00 2001 From: Jose Alamos Date: Wed, 29 Jun 2022 17:39:30 +0200 Subject: [PATCH 3/3] drivers/nrf802154: do not filter broadcast PAN ID --- cpu/nrf52/radio/nrf802154/nrf802154_radio.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cpu/nrf52/radio/nrf802154/nrf802154_radio.c b/cpu/nrf52/radio/nrf802154/nrf802154_radio.c index fcb20a547a..1debb71af4 100644 --- a/cpu/nrf52/radio/nrf802154/nrf802154_radio.c +++ b/cpu/nrf52/radio/nrf802154/nrf802154_radio.c @@ -124,6 +124,11 @@ static bool _l2filter(uint8_t *mhr) int addr_len = ieee802154_get_dst(mhr, dst_addr, &dst_pan); + if ((mhr[0] & IEEE802154_FCF_TYPE_MASK) == IEEE802154_FCF_TYPE_BEACON) { + if ((memcmp(&nrf802154_pan_id, pan_bcast, 2) == 0)) { + return true; + } + } /* filter PAN ID */ /* Will only work on little endian platform (all?) */