Skip to content

Commit ad8f175

Browse files
committed
Merge branch 'feat/updatae_openthread_submodule' into 'master'
feat(openthread): update openthread submodule See merge request espressif/esp-idf!31815
2 parents f85ff57 + 3712dfa commit ad8f175

14 files changed

+96
-32
lines changed

components/openthread/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@ if(CONFIG_OPENTHREAD_ENABLED OR CONFIG_OPENTHREAD_SPINEL_ONLY)
266266
PUBLIC
267267
"OPENTHREAD_CONFIG_FILE=\"openthread-core-esp32x-${CONFIG_FILE_TYPE}-config.h\""
268268
"${device_type}"
269+
"OPENTHREAD_PROJECT_LIB_CONFIG_FILE=\"openthread-core-esp32x-${CONFIG_FILE_TYPE}-config.h\""
270+
"${device_type}"
269271
PRIVATE
270272
"PACKAGE_VERSION=\"${IDF_VERSION_FOR_OPENTHREAD_PACKAGE}-${OPENTHREAD_VERSION}\""
271273
"OPENTHREAD_BUILD_DATETIME=\"${OT_BUILD_TIMESTAMP}\""

components/openthread/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,8 @@ menu "OpenThread"
259259
config OPENTHREAD_SPINEL_RX_FRAME_BUFFER_SIZE
260260
int "The size of openthread spinel rx frame buffer"
261261
depends on OPENTHREAD_ENABLED || OPENTHREAD_SPINEL_ONLY
262-
default 2048
262+
default 1024 if OPENTHREAD_MTD || OPENTHREAD_RADIO
263+
default 2048 if OPENTHREAD_FTD || OPENTHREAD_SPINEL_ONLY
263264

264265
config OPENTHREAD_MAC_MAX_CSMA_BACKOFFS_DIRECT
265266
int "Maximum backoffs times before declaring a channel access failure."

components/openthread/openthread

Submodule openthread updated 1560 files

components/openthread/private_include/openthread-core-esp32x-ftd-config.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,13 +355,13 @@
355355
#define OPENTHREAD_CONFIG_MAX_STATECHANGE_HANDLERS 3
356356

357357
/**
358-
* @def OPENTHREAD_CONFIG_PLATFORM_RADIO_SPINEL_RX_FRAME_BUFFER_SIZE
358+
* @def OPENTHREAD_LIB_SPINEL_RX_FRAME_BUFFER_SIZE
359359
*
360360
* Specifies the rx frame buffer size used by `SpinelInterface` in RCP host code. This is applicable/used when
361361
* `RadioSpinel` platform is used.
362362
*
363363
*/
364-
#define OPENTHREAD_CONFIG_PLATFORM_RADIO_SPINEL_RX_FRAME_BUFFER_SIZE CONFIG_OPENTHREAD_SPINEL_RX_FRAME_BUFFER_SIZE
364+
#define OPENTHREAD_LIB_SPINEL_RX_FRAME_BUFFER_SIZE CONFIG_OPENTHREAD_SPINEL_RX_FRAME_BUFFER_SIZE
365365

366366
/**
367367
* @def OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE

components/openthread/private_include/openthread-core-esp32x-mtd-config.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,13 @@
169169
#define OPENTHREAD_CONFIG_MAX_STATECHANGE_HANDLERS 3
170170

171171
/**
172-
* @def OPENTHREAD_CONFIG_PLATFORM_RADIO_SPINEL_RX_FRAME_BUFFER_SIZE
172+
* @def OPENTHREAD_LIB_SPINEL_RX_FRAME_BUFFER_SIZE
173173
*
174174
* Specifies the rx frame buffer size used by `SpinelInterface` in RCP host code. This is applicable/used when
175175
* `RadioSpinel` platform is used.
176176
*
177177
*/
178-
#define OPENTHREAD_CONFIG_PLATFORM_RADIO_SPINEL_RX_FRAME_BUFFER_SIZE 1024
178+
#define OPENTHREAD_LIB_SPINEL_RX_FRAME_BUFFER_SIZE CONFIG_OPENTHREAD_SPINEL_RX_FRAME_BUFFER_SIZE
179179

180180
/**
181181
* @def OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE

components/openthread/private_include/openthread-core-esp32x-radio-config.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,13 @@
142142
#define OPENTHREAD_CONFIG_MAX_STATECHANGE_HANDLERS 3
143143

144144
/**
145-
* @def OPENTHREAD_CONFIG_PLATFORM_RADIO_SPINEL_RX_FRAME_BUFFER_SIZE
145+
* @def OPENTHREAD_LIB_SPINEL_RX_FRAME_BUFFER_SIZE
146146
*
147147
* Specifies the rx frame buffer size used by `SpinelInterface` in RCP host code. This is applicable/used when
148148
* `RadioSpinel` platform is used.
149149
*
150150
*/
151-
#define OPENTHREAD_CONFIG_PLATFORM_RADIO_SPINEL_RX_FRAME_BUFFER_SIZE 1024
151+
#define OPENTHREAD_LIB_SPINEL_RX_FRAME_BUFFER_SIZE CONFIG_OPENTHREAD_SPINEL_RX_FRAME_BUFFER_SIZE
152152

153153
/**
154154
* @def OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE

components/openthread/private_include/openthread-core-esp32x-spinel-config.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@
3939
#endif
4040

4141
/**
42-
* @def OPENTHREAD_CONFIG_PLATFORM_RADIO_SPINEL_RX_FRAME_BUFFER_SIZE
42+
* @def OPENTHREAD_LIB_SPINEL_RX_FRAME_BUFFER_SIZE
4343
*
4444
* Specifies the rx frame buffer size used by `SpinelInterface` in RCP host code. This is applicable/used when
4545
* `RadioSpinel` platform is used.
4646
*
4747
*/
48-
#define OPENTHREAD_CONFIG_PLATFORM_RADIO_SPINEL_RX_FRAME_BUFFER_SIZE CONFIG_OPENTHREAD_SPINEL_RX_FRAME_BUFFER_SIZE
48+
#define OPENTHREAD_LIB_SPINEL_RX_FRAME_BUFFER_SIZE CONFIG_OPENTHREAD_SPINEL_RX_FRAME_BUFFER_SIZE
4949

5050
/**
5151
* @def OPENTHREAD_CONFIG_MAC_MAX_CSMA_BACKOFFS_DIRECT

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: be7d36e4ff9cf7df6dfce54e58a31163c87b93f7
8+
hash: f32c18bc0840f400182456e58ae3900fc2fb4af7

components/openthread/src/esp_openthread_netif_glue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ void *esp_openthread_netif_glue_init(const esp_openthread_platform_config_t *con
320320
otIp6SetAddressCallback(instance, process_thread_address, instance);
321321
otIp6SetReceiveCallback(instance, process_thread_receive, instance);
322322
otIp6SetReceiveFilterEnabled(instance, true);
323-
otIcmp6SetEchoMode(instance, OT_ICMP6_ECHO_HANDLER_DISABLED);
323+
otIcmp6SetEchoMode(instance, OT_ICMP6_ECHO_HANDLER_RLOC_ALOC_ONLY);
324324

325325
s_openthread_netif_glue.event_fd = eventfd(0, 0);
326326
if (s_openthread_netif_glue.event_fd < 0) {

components/openthread/src/port/esp_openthread_radio.c

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,13 @@ static otRadioFrame s_ack_frame;
6464
static int s_ed_power;
6565
static esp_ieee802154_tx_error_t s_tx_error;
6666
static int s_radio_event_fd = -1;
67-
static bool s_diag_mode = false;
6867
static const char *s_radio_workflow = "radio";
6968
static uint8_t s_txrx_events;
7069

70+
#if CONFIG_OPENTHREAD_DIAG
71+
static bool s_diag_mode = false;
72+
#endif
73+
7174
#if OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT
7275
static otRadioIeInfo s_transmit_ie_info;
7376
#endif // OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT
@@ -113,7 +116,7 @@ static inline bool get_event(uint8_t event)
113116
esp_err_t esp_openthread_radio_init(const esp_openthread_platform_config_t *config)
114117
{
115118
ESP_RETURN_ON_FALSE(s_radio_event_fd == -1, ESP_ERR_INVALID_STATE, OT_PLAT_LOG_TAG,
116-
"Radio was initalized already!");
119+
"Radio was initialized already!");
117120

118121
s_radio_event_fd = eventfd(0, EFD_SUPPORT_ISR);
119122

@@ -165,7 +168,7 @@ esp_err_t esp_openthread_radio_process(otInstance *aInstance, const esp_openthre
165168

166169
if (get_event(EVENT_TX_DONE)) {
167170
clr_event(EVENT_TX_DONE);
168-
#if OPENTHREAD_CONFIG_DIAG_ENABLE
171+
#if CONFIG_OPENTHREAD_DIAG
169172
if (otPlatDiagModeGet()) {
170173
otPlatDiagRadioTransmitDone(aInstance, &s_transmit_frame, OT_ERROR_NONE);
171174
} else
@@ -183,7 +186,7 @@ esp_err_t esp_openthread_radio_process(otInstance *aInstance, const esp_openthre
183186

184187
if (get_event(EVENT_TX_FAILED)) {
185188
clr_event(EVENT_TX_FAILED);
186-
#if OPENTHREAD_CONFIG_DIAG_ENABLE
189+
#if CONFIG_OPENTHREAD_DIAG
187190
if (otPlatDiagModeGet()) {
188191
otPlatDiagRadioTransmitDone(aInstance, &s_transmit_frame, OT_ERROR_CHANNEL_ACCESS_FAILURE);
189192
} else
@@ -219,7 +222,7 @@ esp_err_t esp_openthread_radio_process(otInstance *aInstance, const esp_openthre
219222

220223
while (atomic_load(&s_recv_queue.used)) {
221224
if (s_receive_frame[s_recv_queue.head].mPsdu != NULL) {
222-
#if OPENTHREAD_CONFIG_DIAG_ENABLE
225+
#if CONFIG_OPENTHREAD_DIAG
223226
if (otPlatDiagModeGet()) {
224227
otPlatDiagRadioReceiveDone(aInstance, &s_receive_frame[s_recv_queue.head], OT_ERROR_NONE);
225228
} else
@@ -302,7 +305,7 @@ otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aFrame)
302305
{
303306
esp_ieee802154_set_channel(aFrame->mChannel);
304307

305-
aFrame->mPsdu[-1] = aFrame->mLength; // lenth locates one byte before the psdu (esp_openthread_radio_tx_psdu);
308+
aFrame->mPsdu[-1] = aFrame->mLength; // length locates one byte before the psdu (esp_openthread_radio_tx_psdu);
306309

307310
if (otMacFrameIsSecurityEnabled(aFrame) && !aFrame->mInfo.mTxInfo.mIsSecurityProcessed) {
308311
if (!s_transmit_frame.mInfo.mTxInfo.mIsARetx) {
@@ -447,6 +450,15 @@ int8_t otPlatRadioGetReceiveSensitivity(otInstance *aInstance)
447450
return ESP_RECEIVE_SENSITIVITY;
448451
}
449452

453+
#if CONFIG_OPENTHREAD_DIAG
454+
455+
void otPlatDiagSetOutputCallback(otInstance *aInstance, otPlatDiagOutputCallback aCallback, void *aContext)
456+
{
457+
OT_UNUSED_VARIABLE(aInstance);
458+
OT_UNUSED_VARIABLE(aCallback);
459+
OT_UNUSED_VARIABLE(aContext);
460+
}
461+
450462
void otPlatDiagModeSet(bool mode)
451463
{
452464
s_diag_mode = mode;
@@ -479,6 +491,8 @@ void otPlatDiagAlarmCallback(otInstance *aInstance)
479491
OT_UNUSED_VARIABLE(aInstance);
480492
}
481493

494+
#endif // CONFIG_OPENTHREAD_DIAG
495+
482496
#if OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2
483497
void otPlatRadioSetMacKey(otInstance *aInstance, uint8_t aKeyIdMode, uint8_t aKeyId, const otMacKeyMaterial *aPrevKey,
484498
const otMacKeyMaterial *aCurrKey, const otMacKeyMaterial *aNextKey, otRadioKeyType aKeyType)

components/openthread/src/port/esp_openthread_radio_spinel.cpp

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include "esp_openthread_radio.h"
88

9+
#include "link_raw.h"
910
#include "sdkconfig.h"
1011
#include "esp_check.h"
1112
#include "esp_err.h"
@@ -23,9 +24,11 @@
2324
#include "openthread/platform/diag.h"
2425
#include "openthread/platform/radio.h"
2526
#include "platform/exit_code.h"
27+
#include "spinel_driver.hpp"
2628

2729
using ot::Spinel::RadioSpinel;
2830
using esp::openthread::SpinelInterfaceAdapter;
31+
using ot::Spinel::SpinelDriver;
2932

3033
#if CONFIG_OPENTHREAD_RADIO_SPINEL_UART // CONFIG_OPENTHREAD_RADIO_SPINEL_UART
3134
using esp::openthread::UartSpinelInterface;
@@ -35,7 +38,17 @@ using esp::openthread::SpiSpinelInterface;
3538
static SpinelInterfaceAdapter<SpiSpinelInterface> s_spinel_interface;
3639
#endif
3740

41+
static SpinelDriver s_spinel_driver;
3842
static RadioSpinel s_radio;
43+
static otRadioCaps s_radio_caps = (OT_RADIO_CAPS_ENERGY_SCAN |
44+
#if CONFIG_OPENTHREAD_RX_ON_WHEN_IDLE
45+
OT_RADIO_CAPS_RX_ON_WHEN_IDLE |
46+
#endif
47+
OT_RADIO_CAPS_TRANSMIT_SEC |
48+
OT_RADIO_CAPS_RECEIVE_TIMING |
49+
OT_RADIO_CAPS_TRANSMIT_TIMING |
50+
OT_RADIO_CAPS_ACK_TIMEOUT |
51+
OT_RADIO_CAPS_SLEEP_TO_TX);
3952

4053
static const char *radiospinel_workflow = "radio_spinel";
4154

@@ -60,7 +73,7 @@ esp_err_t esp_openthread_radio_init(const esp_openthread_platform_config_t *conf
6073
#if CONFIG_OPENTHREAD_DIAG
6174
callbacks.mDiagReceiveDone = otPlatDiagRadioReceiveDone;
6275
callbacks.mDiagTransmitDone = otPlatDiagRadioTransmitDone;
63-
#endif // OPENTHREAD_CONFIG_DIAG_ENABLE
76+
#endif // CONFIG_OPENTHREAD_DIAG
6477
callbacks.mEnergyScanDone = otPlatRadioEnergyScanDone;
6578
callbacks.mReceiveDone = otPlatRadioReceiveDone;
6679
callbacks.mTransmitDone = otPlatRadioTxDone;
@@ -70,14 +83,15 @@ esp_err_t esp_openthread_radio_init(const esp_openthread_platform_config_t *conf
7083
esp_openthread_radio_config_set(&config->radio_config);
7184
#if CONFIG_OPENTHREAD_RADIO_SPINEL_UART // CONFIG_OPENTHREAD_RADIO_SPINEL_UART
7285
ESP_RETURN_ON_ERROR(s_spinel_interface.GetSpinelInterface().Enable(config->radio_config.radio_uart_config), OT_PLAT_LOG_TAG,
73-
"Spinel interface init falied");
86+
"Spinel interface init failed");
7487
#else // CONFIG_OPENTHREAD_RADIO_SPINEL_SPI
7588
ESP_RETURN_ON_ERROR(s_spinel_interface.GetSpinelInterface().Enable(config->radio_config.radio_spi_config), OT_PLAT_LOG_TAG,
7689
"Spinel interface init failed");
7790
#endif
78-
s_radio.Init(s_spinel_interface.GetSpinelInterface(), /*reset_radio=*/true, /*skip_rcp_compatibility_check=*/false, iidList, ot::Spinel::kSpinelHeaderMaxNumIid);
91+
s_spinel_driver.Init(s_spinel_interface.GetSpinelInterface(), true, iidList, ot::Spinel::kSpinelHeaderMaxNumIid);
92+
s_radio.Init(/*skip_rcp_compatibility_check=*/false, /*reset_radio=*/true, &s_spinel_driver, s_radio_caps);
7993
#if CONFIG_OPENTHREAD_RADIO_SPINEL_SPI // CONFIG_OPENTHREAD_RADIO_SPINEL_SPI
80-
ESP_RETURN_ON_ERROR(s_spinel_interface.GetSpinelInterface().AfterRadioInit(), OT_PLAT_LOG_TAG, "Spinel interface init falied");
94+
ESP_RETURN_ON_ERROR(s_spinel_interface.GetSpinelInterface().AfterRadioInit(), OT_PLAT_LOG_TAG, "Spinel interface init failed");
8195
#endif
8296
return esp_openthread_platform_workflow_register(&esp_openthread_radio_update, &esp_openthread_radio_process,
8397
radiospinel_workflow);
@@ -106,7 +120,7 @@ esp_err_t esp_openthread_rcp_init(void)
106120
const esp_openthread_radio_config_t *radio_config = esp_openthread_radio_config_get();
107121
#if CONFIG_OPENTHREAD_RADIO_SPINEL_UART
108122
ESP_RETURN_ON_ERROR(s_spinel_interface.GetSpinelInterface().Enable(radio_config->radio_uart_config), OT_PLAT_LOG_TAG,
109-
"Spinel interface init falied");
123+
"Spinel interface init failed");
110124
#else // CONFIG_OPENTHREAD_RADIO_SPINEL_SPI
111125
ESP_RETURN_ON_ERROR(s_spinel_interface.GetSpinelInterface().Enable(radio_config->radio_spi_config), OT_PLAT_LOG_TAG,
112126
"Spinel interface init failed");
@@ -128,6 +142,7 @@ void esp_openthread_radio_deinit(void)
128142

129143
esp_err_t esp_openthread_radio_process(otInstance *instance, const esp_openthread_mainloop_context_t *mainloop)
130144
{
145+
s_spinel_driver.Process((void *)mainloop);
131146
s_radio.Process((void *)mainloop);
132147

133148
return ESP_OK;
@@ -211,7 +226,8 @@ int8_t otPlatRadioGetRssi(otInstance *instance)
211226

212227
otRadioCaps otPlatRadioGetCaps(otInstance *instance)
213228
{
214-
return s_radio.GetRadioCaps();
229+
s_radio_caps = s_radio.GetRadioCaps();
230+
return s_radio_caps;
215231
}
216232

217233
bool otPlatRadioGetPromiscuous(otInstance *instance)
@@ -319,7 +335,7 @@ void otPlatRadioSetMacFrameCounter(otInstance *aInstance, uint32_t aMacFrameCoun
319335
SuccessOrDie(s_radio.SetMacFrameCounter(aMacFrameCounter, true));
320336
}
321337

322-
#if OPENTHREAD_CONFIG_DIAG_ENABLE
338+
#if CONFIG_OPENTHREAD_DIAG
323339
otError otPlatDiagProcess(otInstance *instance, int argc, char *argv[], char *output, size_t output_max_len)
324340
{
325341
// deliver the platform specific diags commands to radio only ncp.
@@ -331,12 +347,19 @@ otError otPlatDiagProcess(otInstance *instance, int argc, char *argv[], char *ou
331347
cur += snprintf(cur, static_cast<size_t>(end - cur), "%s ", argv[index]);
332348
}
333349

334-
return s_radio.PlatDiagProcess(cmd, output, output_max_len);
350+
return s_radio.PlatDiagProcess(cmd);
351+
}
352+
353+
void otPlatDiagSetOutputCallback(otInstance *aInstance, otPlatDiagOutputCallback aCallback, void *aContext)
354+
{
355+
OT_UNUSED_VARIABLE(aInstance);
356+
OT_UNUSED_VARIABLE(aCallback);
357+
OT_UNUSED_VARIABLE(aContext);
335358
}
336359

337360
void otPlatDiagModeSet(bool aMode)
338361
{
339-
SuccessOrExit(s_radio.PlatDiagProcess(aMode ? "start" : "stop", NULL, 0));
362+
SuccessOrExit(s_radio.PlatDiagProcess(aMode ? "start" : "stop"));
340363
s_radio.SetDiagEnabled(aMode);
341364

342365
exit:
@@ -353,7 +376,7 @@ void otPlatDiagTxPowerSet(int8_t tx_power)
353376
char cmd[OPENTHREAD_CONFIG_DIAG_CMD_LINE_BUFFER_SIZE];
354377

355378
snprintf(cmd, sizeof(cmd), "power %d", tx_power);
356-
SuccessOrExit(s_radio.PlatDiagProcess(cmd, NULL, 0));
379+
SuccessOrExit(s_radio.PlatDiagProcess(cmd));
357380

358381
exit:
359382
return;
@@ -364,7 +387,7 @@ void otPlatDiagChannelSet(uint8_t channel)
364387
char cmd[OPENTHREAD_CONFIG_DIAG_CMD_LINE_BUFFER_SIZE];
365388

366389
snprintf(cmd, sizeof(cmd), "channel %d", channel);
367-
SuccessOrExit(s_radio.PlatDiagProcess(cmd, NULL, 0));
390+
SuccessOrExit(s_radio.PlatDiagProcess(cmd));
368391

369392
exit:
370393
return;
@@ -378,13 +401,13 @@ void otPlatDiagAlarmCallback(otInstance *instance)
378401
{
379402
}
380403

404+
#endif // CONFIG_OPENTHREAD_DIAG
405+
381406
const char *otPlatRadioGetVersionString(otInstance *aInstance)
382407
{
383408
return s_radio.GetVersion();
384409
}
385410

386-
#endif // OPENTHREAD_CONFIG_DIAG_ENABLE
387-
388411
uint64_t otPlatRadioGetNow(otInstance *aInstance)
389412
{
390413
OT_UNUSED_VARIABLE(aInstance);

components/openthread/src/spinel/esp_radio_spinel.cpp

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,27 @@
1212
#include "esp_radio_spinel.h"
1313
#include "esp_radio_spinel_adapter.hpp"
1414
#include "esp_radio_spinel_uart_interface.hpp"
15+
#include "spinel_driver.hpp"
1516

1617
using ot::Spinel::RadioSpinel;
1718
using ot::Spinel::RadioSpinelCallbacks;
1819
using esp::radio_spinel::SpinelInterfaceAdapter;
1920
using esp::radio_spinel::UartSpinelInterface;
21+
using ot::Spinel::SpinelDriver;
2022

2123
static SpinelInterfaceAdapter<UartSpinelInterface> s_spinel_interface[ot::Spinel::kSpinelHeaderMaxNumIid];
2224
static RadioSpinel s_radio[ot::Spinel::kSpinelHeaderMaxNumIid];
2325
static esp_radio_spinel_callbacks_t s_esp_radio_spinel_callbacks[ot::Spinel::kSpinelHeaderMaxNumIid];
26+
static SpinelDriver s_spinel_driver[ot::Spinel::kSpinelHeaderMaxNumIid];
2427
otRadioFrame s_transmit_frame;
2528

29+
static otRadioCaps s_radio_caps = (OT_RADIO_CAPS_ENERGY_SCAN |
30+
OT_RADIO_CAPS_TRANSMIT_SEC |
31+
OT_RADIO_CAPS_RECEIVE_TIMING |
32+
OT_RADIO_CAPS_TRANSMIT_TIMING |
33+
OT_RADIO_CAPS_ACK_TIMEOUT |
34+
OT_RADIO_CAPS_SLEEP_TO_TX);
35+
2636
static esp_radio_spinel_idx_t get_index_from_instance(otInstance *instance)
2737
{
2838
// TZ-563: Implement the function to get the esp radio spinel idx from otInstance for multipan rcp
@@ -213,7 +223,8 @@ void esp_radio_spinel_init(esp_radio_spinel_idx_t idx)
213223

214224
// Multipan is not currently supported
215225
iidList[0] = 0;
216-
s_radio[idx].Init(s_spinel_interface[idx].GetSpinelInterface(), /*reset_radio=*/true, /*skip_rcp_compatibility_check=*/false, iidList, ot::Spinel::kSpinelHeaderMaxNumIid);
226+
s_spinel_driver[idx].Init(s_spinel_interface[idx].GetSpinelInterface(), true, iidList, ot::Spinel::kSpinelHeaderMaxNumIid);
227+
s_radio[idx].Init(/*skip_rcp_compatibility_check=*/false, /*reset_radio=*/true, &s_spinel_driver[idx], s_radio_caps);
217228
}
218229

219230
esp_err_t esp_radio_spinel_enable(esp_radio_spinel_idx_t idx)
@@ -309,6 +320,7 @@ void esp_radio_spinel_radio_update(esp_radio_spinel_mainloop_context_t *mainloop
309320

310321
void esp_radio_spinel_radio_process(esp_radio_spinel_mainloop_context_t *mainloop_context, esp_radio_spinel_idx_t idx)
311322
{
323+
s_spinel_driver[idx].Process((void *)mainloop_context);
312324
s_radio[idx].Process(static_cast<void *>(mainloop_context));
313325
}
314326

@@ -354,3 +366,9 @@ esp_err_t esp_radio_spinel_rcp_version_get(char *running_rcp_version, esp_radio_
354366
strcpy(running_rcp_version, rcp_version);
355367
return ESP_OK;
356368
}
369+
370+
esp_err_t esp_radio_spinel_set_rcp_ready(esp_radio_spinel_idx_t idx)
371+
{
372+
s_spinel_driver[idx].SetCoprocessorReady();
373+
return ESP_OK;
374+
}

0 commit comments

Comments
 (0)