From c7a3a19f5accb8ebbc58c403fd2f7a7254cf2dbc Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Mon, 27 Jul 2026 21:32:31 -0700 Subject: [PATCH] [sub-mac] do not claim `kCapRxOnWhenIdle` in `SubMac::GetCaps()` (#13427) This commit updates `SubMac::GetCaps()` to no longer include `kCapRxOnWhenIdle` in the set of capabilities that `SubMac` claims to provide. The `kCapRxOnWhenIdle` capability was originally introduced in #9554. In that same PR, `SubMac::GetCaps()` was updated to claim that `SubMac` provides this capability. However, supporting `kCapRxOnWhenIdle` requires implementing all radio behaviors documented in `otPlatRadioSetRxOnWhenIdle()` (such as handling rx-on-when-idle state transitions, sleep after frame reception or tx done, etc), which `SubMac` does not actually implement. Due to this incorrect claim, in RCP/Host architecture, an RCP running `SubMac` would falsely report to the Host that `kCapRxOnWhenIdle` was supported. The Host would then assume the RCP radio platform managed `RxOnWhenIdle` state handling internally, leading to radio state desynchronization and unexpected issues. With this commit, `SubMac` only reports `kCapRxOnWhenIdle` if the underlying platform radio natively supports it (via `otPlatRadioGetCaps()`). It also removes the `OPENTHREAD_CONFIG_MAC_SOFTWARE_RX_ON_WHEN_IDLE_ENABLE` configuration which was never actually implemented in `SubMac and adds a compile-time check against its use in `openthread-core-config-check.h`. --- src/core/config/mac.h | 9 --------- src/core/config/openthread-core-config-check.h | 5 +++++ src/core/mac/sub_mac.cpp | 2 +- src/core/mac/sub_mac.hpp | 1 - 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/core/config/mac.h b/src/core/config/mac.h index 74c937eaf..540bba47e 100644 --- a/src/core/config/mac.h +++ b/src/core/config/mac.h @@ -373,15 +373,6 @@ #define OPENTHREAD_CONFIG_MAC_SOFTWARE_ENERGY_SCAN_ENABLE 0 #endif -/** - * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_RX_ON_WHEN_IDLE_ENABLE - * - * Define to 1 to enable software rx off when idle switching. - */ -#ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_RX_ON_WHEN_IDLE_ENABLE -#define OPENTHREAD_CONFIG_MAC_SOFTWARE_RX_ON_WHEN_IDLE_ENABLE 0 -#endif - /** * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_RETX_SECURITY_ENABLE * diff --git a/src/core/config/openthread-core-config-check.h b/src/core/config/openthread-core-config-check.h index fc43c7b0d..ed584ab40 100644 --- a/src/core/config/openthread-core-config-check.h +++ b/src/core/config/openthread-core-config-check.h @@ -707,4 +707,9 @@ "It was originally implemented as a provisional solution for the wake mechanism." #endif +#ifdef OPENTHREAD_CONFIG_MAC_SOFTWARE_RX_ON_WHEN_IDLE_ENABLE +#error "OPENTHREAD_CONFIG_MAC_SOFTWARE_RX_ON_WHEN_IDLE_ENABLE was removed. " \ + "Software support for RxOnWhenIdle in SubMac was never implemented." +#endif + #endif // OT_CORE_CONFIG_OPENTHREAD_CORE_CONFIG_CHECK_H_ diff --git a/src/core/mac/sub_mac.cpp b/src/core/mac/sub_mac.cpp index 8227e651d..b7b86a30c 100644 --- a/src/core/mac/sub_mac.cpp +++ b/src/core/mac/sub_mac.cpp @@ -116,7 +116,7 @@ SubMac::Capabilities SubMac::GetCaps(void) const #endif { caps |= (kCapAckTimeout | kCapCsmaBackoff | kCapTransmitRetries | kCapEnergyScan | kCapTransmitSec | - kCapTransmitTiming | kCapReceiveTiming | kCapRxOnWhenIdle); + kCapTransmitTiming | kCapReceiveTiming); } return caps; diff --git a/src/core/mac/sub_mac.hpp b/src/core/mac/sub_mac.hpp index 4a07483d9..5c12a3aad 100644 --- a/src/core/mac/sub_mac.hpp +++ b/src/core/mac/sub_mac.hpp @@ -521,7 +521,6 @@ private: ConditionalCap(kCapTransmitSec, OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE) | ConditionalCap(kCapTransmitTiming, OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE) | ConditionalCap(kCapReceiveTiming, OPENTHREAD_CONFIG_MAC_SOFTWARE_RX_TIMING_ENABLE) | - ConditionalCap(kCapRxOnWhenIdle, OPENTHREAD_CONFIG_MAC_SOFTWARE_RX_ON_WHEN_IDLE_ENABLE) | ConditionalCap(kCapSleepToTx, OPENTHREAD_RADIO); #undef ConditionalCap