From d9e289a5fb350ef67fe5d0ec8e1a6c572f0ef9a5 Mon Sep 17 00:00:00 2001 From: zhangwenxu Date: Thu, 18 May 2023 16:35:04 +0800 Subject: [PATCH 1/3] esp_phy: updating lib phy to adapt the voltage changes --- components/esp_phy/lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp_phy/lib b/components/esp_phy/lib index d39766d34e..89f0a98c97 160000 --- a/components/esp_phy/lib +++ b/components/esp_phy/lib @@ -1 +1 @@ -Subproject commit d39766d34edf7bf22dddc91d5f45f2b91576a407 +Subproject commit 89f0a98c976ddd7c56056fcdb57fd252b7b3f938 From 2016bddbdaad9d2cc8c3f2dad9b8e501f5401ddc Mon Sep 17 00:00:00 2001 From: zhangwenxu Date: Fri, 19 May 2023 13:24:07 +0800 Subject: [PATCH 2/3] openthread: add kconfig for enabling mac filter --- components/openthread/Kconfig | 7 +++++++ .../private_include/openthread-core-esp32x-ftd-config.h | 4 ++++ .../private_include/openthread-core-esp32x-mtd-config.h | 4 ++++ 3 files changed, 15 insertions(+) diff --git a/components/openthread/Kconfig b/components/openthread/Kconfig index ac195606a3..03f154d11c 100644 --- a/components/openthread/Kconfig +++ b/components/openthread/Kconfig @@ -201,6 +201,13 @@ menu "OpenThread" help Select this option to enable link metrics feature + config OPENTHREAD_MACFILTER_ENABLE + bool "Enable mac filter feature" + depends on OPENTHREAD_ENABLED + default n + help + Select this option to enable mac filter feature + config OPENTHREAD_CSL_ENABLE bool "Enable CSL feature" depends on OPENTHREAD_ENABLED diff --git a/components/openthread/private_include/openthread-core-esp32x-ftd-config.h b/components/openthread/private_include/openthread-core-esp32x-ftd-config.h index 040453a84c..2cb8ede33c 100644 --- a/components/openthread/private_include/openthread-core-esp32x-ftd-config.h +++ b/components/openthread/private_include/openthread-core-esp32x-ftd-config.h @@ -408,6 +408,10 @@ #define OPENTHREAD_CONFIG_COMMISSIONER_ENABLE 1 #endif +#if CONFIG_OPENTHREAD_MACFILTER_ENABLE +#define OPENTHREAD_CONFIG_MAC_FILTER_ENABLE 1 +#endif + #if CONFIG_OPENTHREAD_JOINER #define OPENTHREAD_CONFIG_JOINER_ENABLE 1 #endif diff --git a/components/openthread/private_include/openthread-core-esp32x-mtd-config.h b/components/openthread/private_include/openthread-core-esp32x-mtd-config.h index 463934f433..7ecfbca1c1 100644 --- a/components/openthread/private_include/openthread-core-esp32x-mtd-config.h +++ b/components/openthread/private_include/openthread-core-esp32x-mtd-config.h @@ -212,6 +212,10 @@ #define OPENTHREAD_CONFIG_COMMISSIONER_ENABLE 0 #endif +#if CONFIG_OPENTHREAD_MACFILTER_ENABLE +#define OPENTHREAD_CONFIG_MAC_FILTER_ENABLE 1 +#endif // CONFIG_OPENTHREAD_MACFILTER_ENABLE + #if CONFIG_OPENTHREAD_JOINER #define OPENTHREAD_CONFIG_JOINER_ENABLE 0 #endif From 7eb9af58065c2741c276285fb25ac7b371447ecc Mon Sep 17 00:00:00 2001 From: zhangwenxu Date: Fri, 19 May 2023 13:36:12 +0800 Subject: [PATCH 3/3] openthread: fix frame counter when re-transmition --- components/openthread/port/esp_openthread_radio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/openthread/port/esp_openthread_radio.c b/components/openthread/port/esp_openthread_radio.c index 80f8020f9f..a8616a7fdf 100644 --- a/components/openthread/port/esp_openthread_radio.c +++ b/components/openthread/port/esp_openthread_radio.c @@ -300,7 +300,9 @@ otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aFrame) aFrame->mPsdu[-1] = aFrame->mLength; // lenth locates one byte before the psdu (esp_openthread_radio_tx_psdu); if (otMacFrameIsSecurityEnabled(aFrame) && !aFrame->mInfo.mTxInfo.mIsSecurityProcessed) { - otMacFrameSetFrameCounter(aFrame, s_mac_frame_counter++); + if (!s_transmit_frame.mInfo.mTxInfo.mIsARetx) { + otMacFrameSetFrameCounter(aFrame, s_mac_frame_counter++); + } if (otMacFrameIsKeyIdMode1(aFrame)) { s_transmit_frame.mInfo.mTxInfo.mAesKey = &s_current_key; if (!s_transmit_frame.mInfo.mTxInfo.mIsARetx) {