Skip to content

Commit 4b4e298

Browse files
edmontcfriedt
authored andcommitted
net: openthread: propagate security and header updated flags
When transmitting a frame, inform the radio driver whether security processing and/or header updates are needed or not. When a frame was transmitted, inform back to OpenThread whether the security procedure and/or header updates were completed for the frame or not. Signed-off-by: Eduardo Montoya <[email protected]>
1 parent 6c69923 commit 4b4e298

File tree

1 file changed

+8
-0
lines changed
  • subsys/net/lib/openthread/platform

1 file changed

+8
-0
lines changed

subsys/net/lib/openthread/platform/radio.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,10 @@ void transmit_message(struct k_work *tx_job)
272272
radio_api->set_channel(radio_dev, sTransmitFrame.mChannel);
273273
radio_api->set_txpower(radio_dev, tx_power);
274274

275+
net_pkt_set_ieee802154_frame_secured(tx_pkt,
276+
sTransmitFrame.mInfo.mTxInfo.mIsSecurityProcessed);
277+
net_pkt_set_ieee802154_mac_hdr_rdy(tx_pkt, sTransmitFrame.mInfo.mTxInfo.mIsHeaderUpdated);
278+
275279
if ((radio_api->get_capabilities(radio_dev) & IEEE802154_HW_TXTIME) &&
276280
(sTransmitFrame.mInfo.mTxInfo.mTxDelay != 0)) {
277281
uint64_t tx_at = sTransmitFrame.mInfo.mTxInfo.mTxDelayBaseTime +
@@ -325,6 +329,10 @@ void transmit_message(struct k_work *tx_job)
325329

326330
static inline void handle_tx_done(otInstance *aInstance)
327331
{
332+
sTransmitFrame.mInfo.mTxInfo.mIsSecurityProcessed =
333+
net_pkt_ieee802154_frame_secured(tx_pkt);
334+
sTransmitFrame.mInfo.mTxInfo.mIsHeaderUpdated = net_pkt_ieee802154_mac_hdr_rdy(tx_pkt);
335+
328336
if (IS_ENABLED(CONFIG_OPENTHREAD_DIAG) && otPlatDiagModeGet()) {
329337
otPlatDiagRadioTransmitDone(aInstance, &sTransmitFrame, tx_result);
330338
} else {

0 commit comments

Comments
 (0)