mirror of
https://github.com/espressif/openthread.git
synced 2026-09-01 06:49:54 +00:00
[mac] replace more !OPENTHREAD_RADIO with direct FTD/MTD check (#11375)
This is a follow up to #11190 where more indirect `!OPENTHREAD_RADIO` checks are replaced with direct MTD and FTD checks.
This commit is contained in:
+11
-11
@@ -1336,9 +1336,7 @@ void TxFrame::CopyFrom(const TxFrame &aFromFrame)
|
|||||||
|
|
||||||
void TxFrame::ProcessTransmitAesCcm(const ExtAddress &aExtAddress)
|
void TxFrame::ProcessTransmitAesCcm(const ExtAddress &aExtAddress)
|
||||||
{
|
{
|
||||||
#if OPENTHREAD_RADIO && !OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE
|
#if OPENTHREAD_FTD || OPENTHREAD_MTD || OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE
|
||||||
OT_UNUSED_VARIABLE(aExtAddress);
|
|
||||||
#else
|
|
||||||
uint32_t frameCounter = 0;
|
uint32_t frameCounter = 0;
|
||||||
uint8_t securityLevel;
|
uint8_t securityLevel;
|
||||||
uint8_t nonce[Crypto::AesCcm::kNonceSize];
|
uint8_t nonce[Crypto::AesCcm::kNonceSize];
|
||||||
@@ -1364,7 +1362,9 @@ void TxFrame::ProcessTransmitAesCcm(const ExtAddress &aExtAddress)
|
|||||||
|
|
||||||
exit:
|
exit:
|
||||||
return;
|
return;
|
||||||
#endif // OPENTHREAD_RADIO && !OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE
|
#else
|
||||||
|
OT_UNUSED_VARIABLE(aExtAddress);
|
||||||
|
#endif // OPENTHREAD_FTD || OPENTHREAD_MTD || OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE
|
||||||
}
|
}
|
||||||
|
|
||||||
void TxFrame::GenerateImmAck(const RxFrame &aFrame, bool aIsFramePending)
|
void TxFrame::GenerateImmAck(const RxFrame &aFrame, bool aIsFramePending)
|
||||||
@@ -1512,12 +1512,7 @@ exit:
|
|||||||
|
|
||||||
Error RxFrame::ProcessReceiveAesCcm(const ExtAddress &aExtAddress, const KeyMaterial &aMacKey)
|
Error RxFrame::ProcessReceiveAesCcm(const ExtAddress &aExtAddress, const KeyMaterial &aMacKey)
|
||||||
{
|
{
|
||||||
#if OPENTHREAD_RADIO
|
#if OPENTHREAD_FTD || OPENTHREAD_MTD
|
||||||
OT_UNUSED_VARIABLE(aExtAddress);
|
|
||||||
OT_UNUSED_VARIABLE(aMacKey);
|
|
||||||
|
|
||||||
return kErrorNone;
|
|
||||||
#else
|
|
||||||
Error error = kErrorSecurity;
|
Error error = kErrorSecurity;
|
||||||
uint32_t frameCounter = 0;
|
uint32_t frameCounter = 0;
|
||||||
uint8_t securityLevel;
|
uint8_t securityLevel;
|
||||||
@@ -1555,7 +1550,12 @@ Error RxFrame::ProcessReceiveAesCcm(const ExtAddress &aExtAddress, const KeyMate
|
|||||||
|
|
||||||
exit:
|
exit:
|
||||||
return error;
|
return error;
|
||||||
#endif // OPENTHREAD_RADIO
|
#else
|
||||||
|
OT_UNUSED_VARIABLE(aExtAddress);
|
||||||
|
OT_UNUSED_VARIABLE(aMacKey);
|
||||||
|
|
||||||
|
return kErrorNone;
|
||||||
|
#endif // OPENTHREAD_FTD || OPENTHREAD_MTD
|
||||||
}
|
}
|
||||||
|
|
||||||
// LCOV_EXCL_START
|
// LCOV_EXCL_START
|
||||||
|
|||||||
Reference in New Issue
Block a user