Skip to content

Commit 3a67a9e

Browse files
committed
nrf_802154: rev 559b3d38a1f490371ebac659959d2eebda078b58
This commit updates revision of the nrf_802154 component. Signed-off-by: Andrzej Kuros <[email protected]>
1 parent 8fa4251 commit 3a67a9e

File tree

12 files changed

+294
-26
lines changed

12 files changed

+294
-26
lines changed

nrf_802154/common/include/nrf_802154.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1594,6 +1594,24 @@ void nrf_802154_csl_writer_anchor_time_set(uint64_t anchor_time);
15941594
*/
15951595
void nrf_802154_rx_on_when_idle_set(bool rx_on_when_idle);
15961596

1597+
/**
1598+
* @brief Sets the value of CST period to inject into the CST information element.
1599+
*
1600+
* @param[in] period CST period value.
1601+
*/
1602+
void nrf_802154_cst_writer_period_set(uint16_t period);
1603+
1604+
/**
1605+
* @brief Sets the anchor time based on which the next CST window time and the CST phase is calculated.
1606+
*
1607+
* This function sets an anchor time which is a time of a CST window, based which on the times of future CST windows are
1608+
* calculated. It is assumed that all other CST windows occur at time @c anchor_time + @c n * @c cst_period where @c n is
1609+
* an integer. Note that the anchor time can be both in the past and in the future.
1610+
*
1611+
* @param[in] anchor_time Anchor time value.
1612+
*/
1613+
void nrf_802154_cst_writer_anchor_time_set(uint64_t anchor_time);
1614+
15971615
/**
15981616
* @}
15991617
* @defgroup nrf_802154_test_modes Test modes

nrf_802154/common/include/nrf_802154_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ extern "C" {
402402
*
403403
*/
404404
#ifndef NRF_802154_MAX_ACK_IE_SIZE
405-
#define NRF_802154_MAX_ACK_IE_SIZE 8
405+
#define NRF_802154_MAX_ACK_IE_SIZE 16
406406
#endif
407407

408408
/**

nrf_802154/common/include/nrf_802154_const.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@
212212
#define IE_VENDOR_THREAD_MARGIN_FLOOR 0 ///< Thread Vendor-specific ACK Probing margin floor value used for scaling
213213
#define IE_VENDOR_THREAD_RSSI_CEIL 0 ///< Thread Vendor-specific ACK Probing RSSI ceil value used for scaling
214214
#define IE_VENDOR_THREAD_MARGIN_CEIL 130 ///< Thread Vendor-specific ACK Probing margin ceil value used for scaling
215+
#define IE_VENDOR_THREAD_CST_ID 0x02 ///< Thread Vendor-specific CST IE subtype ID
216+
#define IE_VENDOR_THREAD_CST_SIZE 8 ///< Thread Vendor-specific CST IE size
215217
#define IE_CSL_SYMBOLS_PER_UNIT 10 ///< Number of symbols per phase/period unit
216218
#define IE_CSL_PERIOD_MAX 0xffff ///< Maximum CSL IE phase/period value
217219
#define IE_CSL_SIZE_MIN 4 ///< Minimal size of the CSL IE

nrf_802154/doc/CHANGELOG.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ Notable changes
2323
* The binaries of the nRF 802.15.4 SL library for the nRF54L15 SoC are provided also for the non-secure operation. (KRKNWK-19338)
2424
* The internal implementation of *notification* module is selected by the :c:macro:`NRF_802154_NOTIFICATION_IMPL` configuration macro.
2525
The internal implementation of *request* module is selected by the :c:macro:`NRF_802154_REQUEST_IMPL` configuration macro.
26+
* Introduced limited support for receiving and transmitting multipurpose frames. (KRKNWK-19492)
2627

2728
Added
2829
=====
2930

3031
* Added the :c:macro:`NRF_802154_EGU_USED_CHANNELS_MASK` to inform about the fixed EGU channels used by the driver. (KRKNWK-19408)
32+
* Added the functions :c:func:`nrf_802154_cst_writer_period_set` and :c:func:`nrf_802154_cst_writer_anchor_time_set`. (KRKNWK-19492)
3133

3234
nRF Connect SDK v2.7.0 - nRF 802.15.4 Radio Driver
3335
**************************************************

nrf_802154/driver/src/mac_features/ack_generator/nrf_802154_ack_data.c

Lines changed: 67 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -481,14 +481,28 @@ static bool addr_add(const uint8_t * p_addr,
481481
return false;
482482
}
483483

484-
memmove(p_addr_array + entry_size * (location + 1),
485-
p_addr_array + entry_size * (location),
484+
uint8_t * p_entry_at_location = p_addr_array + entry_size * location;
485+
486+
memmove(p_entry_at_location + entry_size,
487+
p_entry_at_location,
486488
(*p_addr_array_len - location) * entry_size);
487489

488-
memcpy(p_addr_array + entry_size * location,
490+
memcpy(p_entry_at_location,
489491
p_addr,
490492
extended ? EXTENDED_ADDRESS_SIZE : SHORT_ADDRESS_SIZE);
491493

494+
if (data_type == NRF_802154_ACK_DATA_IE)
495+
{
496+
/* The content of ie_data_t in the structure indexed by location
497+
* is uninitialized (can have old content). Let's initialize it. */
498+
ie_data_t * p_ie_data = extended ?
499+
&(((ack_ext_ie_data_t *)p_entry_at_location)->ie_data) :
500+
&(((ack_short_ie_data_t *)p_entry_at_location)->ie_data);
501+
502+
p_ie_data->len = 0U;
503+
/* p_ie_data->p_data does not need initialization when len is set to zero. */
504+
}
505+
492506
(*p_addr_array_len)++;
493507

494508
return true;
@@ -562,18 +576,60 @@ static bool addr_remove(uint32_t location, nrf_802154_ack_data_t data_type, bool
562576
return true;
563577
}
564578

565-
static void ie_data_add(uint32_t location, bool extended, const uint8_t * p_data, uint8_t data_len)
579+
/**
580+
* @brief Replace or append an Information Element to the ACK data.
581+
*
582+
* If the target ACK data already contains an Information Element with the same
583+
* ID as the new Information Element, the existing IE is replaced with the new
584+
* one. Otherwise, the new IE is appended to the target ACK data.
585+
*
586+
* @param[in] location Index of the ACK data buffer to be modified.
587+
* @param[in] extended Indication whether the ACK data buffer for
588+
* an extended or a short address is to be modified.
589+
* @param[in] p_data New Information Element data.
590+
* @param[in] data_len New Information Element data length.
591+
*
592+
* @retval true The new Information Element has been added successfully.
593+
* @retval false The new Information Element has not fitted in the buffer.
594+
*/
595+
static bool ie_data_set(uint32_t location, bool extended, const uint8_t * p_data, uint8_t data_len)
566596
{
567-
if (extended)
597+
ie_data_t * ie_data =
598+
extended ? &m_ie.ext_data[location].ie_data : &m_ie.short_data[location].ie_data;
599+
600+
const uint8_t new_ie_id = nrf_802154_frame_parser_ie_id_get(p_data);
601+
602+
for (const uint8_t * ie = nrf_802154_frame_parser_header_ie_iterator_begin(ie_data->p_data);
603+
nrf_802154_frame_parser_ie_iterator_end(ie, ie_data->p_data + ie_data->len) == false;
604+
ie = nrf_802154_frame_parser_ie_iterator_next(ie))
568605
{
569-
memcpy(m_ie.ext_data[location].ie_data.p_data, p_data, data_len);
570-
m_ie.ext_data[location].ie_data.len = data_len;
606+
if (nrf_802154_frame_parser_ie_id_get(ie) != new_ie_id)
607+
{
608+
continue;
609+
}
610+
611+
if (IE_DATA_OFFSET + nrf_802154_frame_parser_ie_length_get(ie) != data_len)
612+
{
613+
/* Overwriting an existing IE with a different size is not supported. */
614+
return false;
615+
}
616+
617+
memcpy((uint8_t *)ie, p_data, data_len);
618+
return true;
571619
}
572-
else
620+
621+
/* Append IE data with the new IE. */
622+
623+
if (ie_data->len + data_len > NRF_802154_MAX_ACK_IE_SIZE)
573624
{
574-
memcpy(m_ie.short_data[location].ie_data.p_data, p_data, data_len);
575-
m_ie.short_data[location].ie_data.len = data_len;
625+
/* No space to fit it the new IE. */
626+
return false;
576627
}
628+
629+
memcpy(ie_data->p_data + ie_data->len, p_data, data_len);
630+
ie_data->len += data_len;
631+
632+
return true;
577633
}
578634

579635
/***************************************************************************************************
@@ -607,7 +663,7 @@ bool nrf_802154_ack_data_for_addr_set(const uint8_t * p_addr,
607663
{
608664
if (data_type == NRF_802154_ACK_DATA_IE)
609665
{
610-
ie_data_add(location, extended, p_data, data_len);
666+
return ie_data_set(location, extended, p_data, data_len);
611667
}
612668

613669
return true;

nrf_802154/driver/src/mac_features/nrf_802154_frame_parser.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,14 @@ static inline bool nrf_802154_frame_parser_panid_compression_is_set(
431431
static inline bool nrf_802154_frame_parser_ar_bit_is_set(
432432
const nrf_802154_frame_parser_data_t * p_parser_data)
433433
{
434-
return (p_parser_data->p_frame[ACK_REQUEST_OFFSET] & ACK_REQUEST_BIT) ? true : false;
434+
if ((p_parser_data->p_frame[FRAME_TYPE_OFFSET] & FRAME_TYPE_MASK) == FRAME_TYPE_MULTIPURPOSE)
435+
{
436+
return false;
437+
}
438+
else
439+
{
440+
return (p_parser_data->p_frame[ACK_REQUEST_OFFSET] & ACK_REQUEST_BIT) ? true : false;
441+
}
435442
}
436443

437444
/**

0 commit comments

Comments
 (0)