Skip to content

Commit

Permalink
[nrf fromtree] net: openthread: upmerge to 7761b81
Browse files Browse the repository at this point in the history
additionaly, implement `otPlatRadioResetCsl` functionality

Signed-off-by: Maciej Baczmanski <[email protected]>
(cherry picked from commit 0f1747e)
  • Loading branch information
maciejbaczmanski authored and rlubos committed Jan 26, 2024
1 parent 93c590c commit b3c97b0
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
6 changes: 6 additions & 0 deletions drivers/ieee802154/ieee802154_nrf5.c
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,12 @@ static int nrf5_configure(const struct device *dev,
uint8_t element_id;
bool valid_vendor_specific_ie = false;

if (config->ack_ie.purge_ie) {
nrf_802154_ack_data_remove_all(false, NRF_802154_ACK_DATA_IE);
nrf_802154_ack_data_remove_all(true, NRF_802154_ACK_DATA_IE);
break;
}

if (config->ack_ie.short_addr == IEEE802154_BROADCAST_ADDRESS ||
config->ack_ie.ext_addr == NULL) {
return -ENOTSUP;
Expand Down
9 changes: 9 additions & 0 deletions include/zephyr/net/ieee802154_radio.h
Original file line number Diff line number Diff line change
Expand Up @@ -1241,6 +1241,15 @@ struct ieee802154_config {
* in CPU byte order
*/
uint16_t short_addr;

/**
* Flag for purging enh ACK header IEs.
* When flag is set to true, driver should remove all existing
* header IEs, and all other entries in config should be ignored.
* This means that purging current header IEs and
* configuring a new one in the same call is not allowed.
*/
bool purge_ie;
} ack_ie;
};
};
Expand Down
16 changes: 16 additions & 0 deletions modules/openthread/platform/radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1294,6 +1294,22 @@ otError otPlatRadioEnableCsl(otInstance *aInstance, uint32_t aCslPeriod, otShort
return result ? OT_ERROR_FAILED : OT_ERROR_NONE;
}

otError otPlatRadioResetCsl(otInstance *aInstance)
{
struct ieee802154_config config = { 0 };
int result;

result = radio_api->configure(radio_dev, IEEE802154_CONFIG_CSL_PERIOD, &config);
if (result) {
return OT_ERROR_FAILED;
}

config.ack_ie.purge_ie = true;
result = radio_api->configure(radio_dev, IEEE802154_CONFIG_ENH_ACK_HEADER_IE, &config);

return result ? OT_ERROR_FAILED : OT_ERROR_NONE;
}

void otPlatRadioUpdateCslSampleTime(otInstance *aInstance, uint32_t aCslSampleTime)
{
ARG_UNUSED(aInstance);
Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ manifest:
revision: 214f9fc1539f8e5937c0474cb6ee29b6dcb2d4b8
path: modules/lib/open-amp
- name: openthread
revision: 00076aff3ae571db7c90509ec9dc293457098c35
revision: 7761b81d23b10b3d5ee21b8504c67535cde10896
path: modules/lib/openthread
- name: percepio
path: modules/debug/percepio
Expand Down

0 comments on commit b3c97b0

Please sign in to comment.