Skip to content

Commit

Permalink
Merge branch 'openthread:main' into feature/jaul-nsc/extend-dataset-h…
Browse files Browse the repository at this point in the history
…ex-cmd
  • Loading branch information
jaul-nsc authored Oct 14, 2024
2 parents b80f0d8 + ff19e03 commit 9de6390
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 30 deletions.
2 changes: 0 additions & 2 deletions script/test
Original file line number Diff line number Diff line change
Expand Up @@ -706,12 +706,10 @@ main()
cert)
shift
do_cert "$@"
shift $#
;;
cert_suite)
shift
do_cert_suite "$@"
shift $#
;;
get_thread_wireshark)
do_get_thread_wireshark
Expand Down
2 changes: 1 addition & 1 deletion src/core/mac/mac_frame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ class RxFrame : public Frame
* 6.9.1 (albeit both unrelated to OT).
*
* The time is relative to the local radio clock as defined by
* `otPlatRadioGetNow`.
* `Radio::GetNow()`.
*
* @returns The timestamp in microseconds.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/core/mac/sub_mac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ void SubMac::StartCsmaBackoff(void)
{
static constexpr uint32_t kAheadTime = kCcaSampleInterval + kCslTransmitTimeAhead + kRadioHeaderShrDuration;
Time txStartTime = Time(mTransmitFrame.mInfo.mTxInfo.mTxDelayBaseTime);
Time radioNow = Time(static_cast<uint32_t>(otPlatRadioGetNow(&GetInstance())));
Time radioNow = Time(static_cast<uint32_t>(Get<Radio>().GetNow()));

txStartTime += (mTransmitFrame.mInfo.mTxInfo.mTxDelay - kAheadTime);

Expand Down
4 changes: 2 additions & 2 deletions src/core/mac/sub_mac_csl_receiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ bool SubMac::UpdateCsl(uint16_t aPeriod, uint8_t aChannel, otShortAddress aShort
mCslTimer.Stop();
if (mCslPeriod > 0)
{
mCslSampleTime = TimeMicro(static_cast<uint32_t>(otPlatRadioGetNow(&GetInstance())));
mCslSampleTime = TimeMicro(static_cast<uint32_t>(Get<Radio>().GetNow()));
mIsCslSampling = false;
HandleCslTimer();
}
Expand Down Expand Up @@ -248,7 +248,7 @@ uint32_t SubMac::GetLocalTime(void)
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_LOCAL_TIME_SYNC
now = TimerMicro::GetNow().GetValue();
#else
now = static_cast<uint32_t>(otPlatRadioGetNow(&GetInstance()));
now = static_cast<uint32_t>(Get<Radio>().GetNow());
#endif

return now;
Expand Down
25 changes: 12 additions & 13 deletions src/core/net/ip6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1219,22 +1219,21 @@ Error Ip6::HandleDatagram(OwnedPtr<Message> aMessagePtr, bool aIsReassembled)
SuccessOrExit(error);
}

if (aMessagePtr->IsOriginHostUntrusted() && (nextHeader == kProtoUdp))
{
uint16_t destPort;

SuccessOrExit(
error = aMessagePtr->Read(aMessagePtr->GetOffset() + Udp::Header::kDestPortFieldOffset, destPort));
destPort = BigEndian::HostSwap16(destPort);

if (destPort == Tmf::kUdpPort
#if OPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE
&& mTmfOriginFilterEnabled
if (mTmfOriginFilterEnabled)
#endif
)
{
if (aMessagePtr->IsOriginHostUntrusted() && (nextHeader == kProtoUdp))
{
LogNote("Dropping TMF message from untrusted origin");
ExitNow(error = kErrorDrop);
Udp::Header udpHeader;

SuccessOrExit(error = aMessagePtr->Read(aMessagePtr->GetOffset(), udpHeader));

if (udpHeader.GetDestinationPort() == Tmf::kUdpPort)
{
LogNote("Dropping TMF message from untrusted origin");
ExitNow(error = kErrorDrop);
}
}
}

Expand Down
14 changes: 12 additions & 2 deletions src/core/radio/radio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,14 @@ class Radio : public InstanceLocator, private NonCopyable
#endif // OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE

#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE
/**
* Get the current radio time in microseconds referenced to a continuous monotonic local radio clock (64 bits
* width).
*
* @returns The current radio clock time.
*/
uint64_t GetNow(void);

/**
* Get the current accuracy, in units of ± ppm, of the clock used for scheduling CSL operations.
*
Expand Down Expand Up @@ -921,10 +929,10 @@ inline Error Radio::ResetCsl(void) { return otPlatRadioResetCsl(GetInstancePtr()
#endif

#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE
inline uint64_t Radio::GetNow(void) { return otPlatRadioGetNow(GetInstancePtr()); }

inline uint8_t Radio::GetCslAccuracy(void) { return otPlatRadioGetCslAccuracy(GetInstancePtr()); }
#endif

#if OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE
inline uint8_t Radio::GetCslUncertainty(void) { return otPlatRadioGetCslUncertainty(GetInstancePtr()); }
#endif

Expand Down Expand Up @@ -1029,6 +1037,8 @@ inline Error Radio::ResetCsl(void) { return kErrorNotImplemented; }
#endif

#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE
inline uint64_t Radio::GetNow(void) { return NumericLimits<uint64_t>::kMax; }

inline uint8_t Radio::GetCslAccuracy(void) { return NumericLimits<uint8_t>::kMax; }

inline uint8_t Radio::GetCslUncertainty(void) { return NumericLimits<uint8_t>::kMax; }
Expand Down
2 changes: 1 addition & 1 deletion src/core/thread/csl_tx_scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ uint32_t CslTxScheduler::GetNextCslTransmissionDelay(const Child &aChild,
uint32_t &aDelayFromLastRx,
uint32_t aAheadUs) const
{
uint64_t radioNow = otPlatRadioGetNow(&GetInstance());
uint64_t radioNow = Get<Radio>().GetNow();
uint32_t periodInUs = aChild.GetCslPeriod() * kUsPerTenSymbols;

/* see CslTxScheduler::ChildInfo::mCslPhase */
Expand Down
2 changes: 2 additions & 0 deletions src/core/thread/mlr_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,8 @@ void MlrManager::CheckInvariants(void) const
#if OPENTHREAD_EXAMPLES_SIMULATION && OPENTHREAD_CONFIG_ASSERT_ENABLE
uint16_t registeringNum = 0;

OT_UNUSED_VARIABLE(registeringNum);

OT_ASSERT(!mMlrPending || mSendDelay == 0);

#if OPENTHREAD_CONFIG_MLR_ENABLE
Expand Down
4 changes: 4 additions & 0 deletions src/lib/spinel/spinel_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,8 @@ otError Buffer::OutFrameRemove(void)
uint8_t numSegments;
FrameTag tag;

OT_UNUSED_VARIABLE(numSegments);

EXPECT(!IsEmpty(), error = OT_ERROR_NOT_FOUND);

OutFrameSelectReadDirection();
Expand Down Expand Up @@ -884,6 +886,8 @@ uint16_t Buffer::OutFrameGetLength(void)
otMessage *message = nullptr;
#endif

OT_UNUSED_VARIABLE(numSegments);

// If the frame length was calculated before, return the previously calculated length.
EXPECT(mReadFrameLength == kUnknownFrameLength, frameLength = mReadFrameLength);

Expand Down
8 changes: 0 additions & 8 deletions tests/nexus/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@
# POSSIBILITY OF SUCH DAMAGE.
#

display_usage()
{
echo ""
echo "Nexus build script "
echo ""
echo ""
}

die()
{
echo " *** ERROR: " "$*"
Expand Down

0 comments on commit 9de6390

Please sign in to comment.