Skip to content

Commit 7b45a16

Browse files
committed
Merge branch 'feat/update_ot_upstream_v5.5' into 'release/v5.5'
feat(openthread): update OT upstream to 3b3dd203b (v5.5) See merge request espressif/esp-idf!42216
2 parents 1a760a9 + 0861e3b commit 7b45a16

File tree

8 files changed

+31
-115
lines changed

8 files changed

+31
-115
lines changed

components/openthread/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ if(CONFIG_OPENTHREAD_ENABLED)
113113
"openthread/src/core/thread/mesh_forwarder.cpp"
114114
"openthread/src/core/thread/mesh_forwarder_ftd.cpp"
115115
"openthread/src/core/thread/mesh_forwarder_mtd.cpp"
116+
"openthread/src/core/thread/message_framer.cpp"
116117
"openthread/src/core/thread/mle.cpp"
117118
"openthread/src/core/thread/mle_router.cpp"
118119
"openthread/src/core/thread/mle_types.cpp"

components/openthread/include/esp_radio_spinel.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,6 @@ typedef struct
5757
void (*energy_scan_done)(int8_t max_rssi); /* Callback for Energy Scan Done.*/
5858
void (*transmit_started)(const uint8_t *frame); /* Callback for Transmit Started.*/
5959
void (*switchover_done)(bool success); /* Callback for Switchover Done.*/
60-
61-
#if CONFIG_OPENTHREAD_DIAG
62-
void (*diag_receive_done)(const uint8_t *frame, esp_ieee802154_frame_info_t *frame_info); /* Callback for Receive Done (diag).*/
63-
void (*diag_transmit_done)(const uint8_t *frame, esp_ieee802154_frame_info_t *frame_info); /* Callback for Transmit Done (diag).*/
64-
void (*diag_transmit_failed)(esp_ieee802154_tx_error_t error); /* Callback for Transmit Failed (diag).*/
65-
#endif // CONFIG_OPENTHREAD_DIAG
6660
} esp_radio_spinel_callbacks_t; /* ESP Radio Spinel Callbacks.*/
6761

6862
/**

components/openthread/openthread

Submodule openthread updated 474 files

components/openthread/sbom_openthread.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ supplier: 'Organization: Espressif Systems (Shanghai) CO LTD'
55
originator: 'Organization: Google LLC'
66
description: OpenThread released by Google is an open-source implementation of the Thread networking
77
url: https://github.com/espressif/openthread
8-
hash: b945928d722177cd9caeab2e1025499628c101ef
8+
hash: 3b3dd203be690995d1a89b110322e4eafafc3a3b

components/openthread/src/port/esp_openthread_radio.c

Lines changed: 27 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -165,51 +165,39 @@ esp_err_t esp_openthread_radio_process(otInstance *aInstance, const esp_openthre
165165

166166
if (get_event(EVENT_TX_DONE)) {
167167
clr_event(EVENT_TX_DONE);
168-
#if CONFIG_OPENTHREAD_DIAG
169-
if (otPlatDiagModeGet()) {
170-
otPlatDiagRadioTransmitDone(aInstance, &s_transmit_frame, OT_ERROR_NONE);
171-
} else
172-
#endif
173-
{
174-
if (s_ack_frame.mPsdu == NULL) {
175-
otPlatRadioTxDone(aInstance, &s_transmit_frame, NULL, OT_ERROR_NONE);
176-
} else {
177-
otPlatRadioTxDone(aInstance, &s_transmit_frame, &s_ack_frame, OT_ERROR_NONE);
178-
esp_ieee802154_receive_handle_done(s_ack_frame.mPsdu - 1);
179-
s_ack_frame.mPsdu = NULL;
180-
}
168+
169+
if (s_ack_frame.mPsdu == NULL) {
170+
otPlatRadioTxDone(aInstance, &s_transmit_frame, NULL, OT_ERROR_NONE);
171+
} else {
172+
otPlatRadioTxDone(aInstance, &s_transmit_frame, &s_ack_frame, OT_ERROR_NONE);
173+
esp_ieee802154_receive_handle_done(s_ack_frame.mPsdu - 1);
174+
s_ack_frame.mPsdu = NULL;
181175
}
182176
}
183177

184178
if (get_event(EVENT_TX_FAILED)) {
185179
clr_event(EVENT_TX_FAILED);
186-
#if CONFIG_OPENTHREAD_DIAG
187-
if (otPlatDiagModeGet()) {
188-
otPlatDiagRadioTransmitDone(aInstance, &s_transmit_frame, OT_ERROR_CHANNEL_ACCESS_FAILURE);
189-
} else
190-
#endif
191-
{
192-
otError err = OT_ERROR_NONE;
193-
194-
switch (s_tx_error) {
195-
case ESP_IEEE802154_TX_ERR_CCA_BUSY:
196-
case ESP_IEEE802154_TX_ERR_ABORT:
197-
case ESP_IEEE802154_TX_ERR_COEXIST:
198-
err = OT_ERROR_CHANNEL_ACCESS_FAILURE;
199-
break;
200-
201-
case ESP_IEEE802154_TX_ERR_NO_ACK:
202-
case ESP_IEEE802154_TX_ERR_INVALID_ACK:
203-
err = OT_ERROR_NO_ACK;
204-
break;
205-
206-
default:
207-
ETS_ASSERT(false);
208-
break;
209-
}
210180

211-
otPlatRadioTxDone(aInstance, &s_transmit_frame, NULL, err);
181+
otError err = OT_ERROR_NONE;
182+
183+
switch (s_tx_error) {
184+
case ESP_IEEE802154_TX_ERR_CCA_BUSY:
185+
case ESP_IEEE802154_TX_ERR_ABORT:
186+
case ESP_IEEE802154_TX_ERR_COEXIST:
187+
err = OT_ERROR_CHANNEL_ACCESS_FAILURE;
188+
break;
189+
190+
case ESP_IEEE802154_TX_ERR_NO_ACK:
191+
case ESP_IEEE802154_TX_ERR_INVALID_ACK:
192+
err = OT_ERROR_NO_ACK;
193+
break;
194+
195+
default:
196+
ETS_ASSERT(false);
197+
break;
212198
}
199+
200+
otPlatRadioTxDone(aInstance, &s_transmit_frame, NULL, err);
213201
}
214202

215203
if (get_event(EVENT_ENERGY_DETECT_DONE)) {
@@ -219,14 +207,7 @@ esp_err_t esp_openthread_radio_process(otInstance *aInstance, const esp_openthre
219207

220208
while (atomic_load(&s_recv_queue.used)) {
221209
if (s_receive_frame[s_recv_queue.head].mPsdu != NULL) {
222-
#if CONFIG_OPENTHREAD_DIAG
223-
if (otPlatDiagModeGet()) {
224-
otPlatDiagRadioReceiveDone(aInstance, &s_receive_frame[s_recv_queue.head], OT_ERROR_NONE);
225-
} else
226-
#endif
227-
{
228-
otPlatRadioReceiveDone(aInstance, &s_receive_frame[s_recv_queue.head], OT_ERROR_NONE);
229-
}
210+
otPlatRadioReceiveDone(aInstance, &s_receive_frame[s_recv_queue.head], OT_ERROR_NONE);
230211
esp_ieee802154_receive_handle_done(s_receive_frame[s_recv_queue.head].mPsdu - 1);
231212
s_receive_frame[s_recv_queue.head].mPsdu = NULL;
232213
s_recv_queue.head = (s_recv_queue.head + 1) % CONFIG_IEEE802154_RX_BUFFER_SIZE;

components/openthread/src/port/esp_openthread_radio_spinel.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,6 @@ esp_err_t esp_openthread_radio_init(const esp_openthread_platform_config_t *conf
100100

101101
ot::Spinel::RadioSpinelCallbacks callbacks;
102102
memset(&callbacks, 0, sizeof(callbacks));
103-
#if CONFIG_OPENTHREAD_DIAG
104-
callbacks.mDiagReceiveDone = otPlatDiagRadioReceiveDone;
105-
callbacks.mDiagTransmitDone = otPlatDiagRadioTransmitDone;
106-
#endif // CONFIG_OPENTHREAD_DIAG
107103
callbacks.mEnergyScanDone = otPlatRadioEnergyScanDone;
108104
callbacks.mReceiveDone = otPlatRadioReceiveDone;
109105
callbacks.mTransmitDone = otPlatRadioTxDone;

components/openthread/src/spinel/esp_radio_spinel.cpp

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -185,58 +185,6 @@ void SwitchoverDone(otInstance *aInstance, bool aSuccess)
185185
s_esp_radio_spinel_callbacks[idx].switchover_done(aSuccess);
186186
}
187187

188-
#if CONFIG_OPENTHREAD_DIAG
189-
void DiagReceiveDone(otInstance *aInstance, otRadioFrame *aFrame, otError aError)
190-
{
191-
esp_radio_spinel_idx_t idx = get_index_from_instance(aInstance);
192-
assert(s_esp_radio_spinel_callbacks[idx].diag_receive_done);
193-
uint8_t *frame = (uint8_t *)malloc(aFrame->mLength + 1);
194-
esp_ieee802154_frame_info_t frame_info;
195-
if (frame) {
196-
frame[0] = aFrame->mLength;
197-
memcpy((void *)(frame + 1), aFrame->mPsdu, frame[0]);
198-
frame_info.rssi = aFrame->mInfo.mRxInfo.mRssi;
199-
frame_info.timestamp = aFrame->mInfo.mRxInfo.mTimestamp;
200-
frame_info.pending = aFrame->mInfo.mRxInfo.mAckedWithFramePending;
201-
s_esp_radio_spinel_callbacks[idx].diag_receive_done(frame, &frame_info);
202-
free(frame);
203-
} else {
204-
ESP_LOGE(ESP_SPINEL_LOG_TAG, "Fail to alloc memory for frame");
205-
}
206-
}
207-
208-
void DiagTransmitDone(otInstance *aInstance, otRadioFrame *aFrame, otError aError)
209-
{
210-
esp_radio_spinel_idx_t idx = get_index_from_instance(aInstance);
211-
assert(s_esp_radio_spinel_callbacks[idx].diag_transmit_done && s_esp_radio_spinel_callbacks[idx].diag_transmit_failed);
212-
if (aError == OT_ERROR_NONE) {
213-
uint8_t *frame = (uint8_t *)malloc(aFrame->mLength + 1);
214-
if (frame) {
215-
esp_ieee802154_frame_info_t ack_info;
216-
frame[0] = aFrame->mLength;
217-
memcpy((void *)(frame + 1), aFrame->mPsdu, frame[0]);
218-
s_esp_radio_spinel_callbacks[idx].diag_transmit_done(frame, &ack_info);
219-
free(frame);
220-
} else {
221-
ESP_LOGE(ESP_SPINEL_LOG_TAG, "Fail to alloc memory for frame");
222-
}
223-
} else {
224-
switch (aError) {
225-
case OT_ERROR_CHANNEL_ACCESS_FAILURE:
226-
s_esp_radio_spinel_callbacks[idx].diag_transmit_failed(ESP_IEEE802154_TX_ERR_CCA_BUSY);
227-
break;
228-
case OT_ERROR_NO_ACK:
229-
s_esp_radio_spinel_callbacks[idx].diag_transmit_failed(ESP_IEEE802154_TX_ERR_NO_ACK);
230-
break;
231-
default:
232-
s_esp_radio_spinel_callbacks[idx].diag_transmit_failed(ESP_IEEE802154_TX_ERR_CCA_BUSY);
233-
break;
234-
}
235-
}
236-
}
237-
#endif // CONFIG_OPENTHREAD_DIAG
238-
239-
240188
void esp_radio_spinel_set_callbacks(const esp_radio_spinel_callbacks_t aCallbacks, esp_radio_spinel_idx_t idx)
241189
{
242190
s_esp_radio_spinel_callbacks[idx] = aCallbacks;
@@ -247,10 +195,6 @@ void esp_radio_spinel_set_callbacks(const esp_radio_spinel_callbacks_t aCallback
247195
Callbacks.mEnergyScanDone = EnergyScanDone;
248196
Callbacks.mTxStarted = TxStarted;
249197
Callbacks.mSwitchoverDone = SwitchoverDone;
250-
#if CONFIG_OPENTHREAD_DIAG
251-
Callbacks.mDiagReceiveDone = DiagReceiveDone;
252-
Callbacks.mDiagTransmitDone = DiagTransmitDone;
253-
#endif // CONFIG_OPENTHREAD_DIAG
254198

255199
s_radio[idx].SetCallbacks(Callbacks);
256200
}

0 commit comments

Comments
 (0)