-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[spinel] breakdown posix radio module #10051
Conversation
Size Report of OpenThread
|
8fcb020
to
0d020e6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
a75a2b5
to
403054b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great overall. Thanks @Irving-cl 👍
Couple of smaller questions/suggestions below.
403054b
to
368ccd7
Compare
368ccd7
to
1051211
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. Thanks @Irving-cl. 👍
Bug: 350646215 * github/main: [test] harden `test_srp_server` (openthread#10486) [cli] simplify parsing dataset TLVs (openthread#10476) [mesh-forwarder] track parsed IPv6 header in `RxInfo` (openthread#10467) github-actions: bump actions/setup-go from 5.0.0 to 5.0.1 (openthread#10489) [otci] add network management API to otci (openthread#10482) [srp-client] apply short random jitter to lease renew time (openthread#10473) [test] add script to test which diag commands RCP supports (openthread#10463) [csl] move csl related functions to sub_mac_csl.cpp (openthread#10477) [test] supplement state bitmap test (openthread#10318) [test] harden `test_advertising_proxy` (openthread#10474) [meshcop] update `ChannelMaskTlv` to use `OffsetRange` (openthread#10465) [mle] remove now undefined `UpdateChildAddresses()` (openthread#10475) [mesh-forwarder] use `RemoveMessageIfNoPendingTx()` on direct tx fails (openthread#10471) [routing-manager] add missing `exit` label (openthread#10472) [spinel] merge spinel config files (openthread#10468) [routing-manager] add support for tracking peer BRs (openthread#10445) [ip6] use `OffsetRange` for parsing options in extension headers (openthread#10466) [mesh-forwarder] add `RxInfo::ToString()` to simplify logging (openthread#10462) [tlv] use `OffsetRange` and make `ParsedInfo` public (openthread#10461) [cmake] disable c extensions (openthread#10460) [srp-client] enhance selection of TX jitter based on trigger reason (openthread#10357) [mesh-forwarder] restore `FrameData` in `GetForwardFramePriority()` (openthread#10459) [spinel] allow custom config file for lib spinel (openthread#10449) [posix] add rcp capability diag command to check the Spinel interface speed (openthread#10443) [core] add `OffsetRange` class (openthread#10436) [tcat] implement decommissioning in tcat_agent (openthread#10415) [mesh-forwarder] add `RxInfo` to encapsulate received frame info (openthread#10451) [otci] add diag commands support to otci (openthread#10450) [routing-manager] add `OnLinkPrefix::IsFavoredOver()` (openthread#10452) github-actions: bump github/codeql-action from 3.25.3 to 3.25.11 (openthread#10455) [mle] add RLOC16 related helper methods in `Mle` (openthread#10440) [srp] fix `otSrpClientStart` documentation (openthread#10435) [tlv] ensure handling of extended TLVs when iterating over sub-TLVs (openthread#10439) [dns-client] switch to separate SRV/TXT queries on response timeout (openthread#10444) [posix] skip 0x00 bytes at the start of the received SPI frame (openthread#10442) [meshcop] simplify appending and parsing of `NetworkNameTlv` (openthread#10441) [child] add `GetIp6Addresses()` and simplify MLR state tracking (openthread#10424) [routing-manager] centralize `RxRaTracker` decision logic and signaling (openthread#10389) [posix] check the max number of RCP supported sleepy children (openthread#10399) [core] use RLOC16-related constants and methods consistently across modules (openthread#10434) [tcat-agent] use `Dataset` directly when setting Active Dataset (openthread#10433) [child] update MLR masks when removing registered IPv6 addresses (openthread#10425) [posix] add rcp diag command to check RCP's radio and spinel capability flags (openthread#10400) [mesh-forwarder] update forwarding messages to ALOC destination (openthread#10419) [spinel] log sent Spinel frames (openthread#10429) [posix] fix build with custom netif prefix route set (openthread#10431) [mesh-forwarder] move `CheckReachability()` to `MeshForwarder` (openthread#10421) github-actions: bump step-security/harden-runner from 2.7.0 to 2.8.1 (openthread#10432) [doc] fix the broken link of `meshdiag topology` in CLI README (openthread#10430) [mle] add `IsRouterRloc16()` and `IsChildRloc16()` (openthread#10423) [child] use `Array<Ip6::Address>` to track registered addresses (openthread#10422) [mesh-forwarder] remove unused `SetDiscoverParameters()` method (openthread#10420) [child-table] add `HasMinimalChild()` and move logic from `MleRouter` (openthread#10418) [mle] remove `GetNextHop()` and directly use `RouterTable` method (openthread#10417) [cli] output service ID when listing services in network data (openthread#10408) [routing-manager] simplify `RxRaTracker::HandleRouterTimer()` (openthread#10382) [diag] add diag output callback (openthread#10354) [mle] replace `Mle::GetNextHop()` with `GetParentRloc16()` (openthread#10407) [ip6] add `Ip6::Address::IsLinkLocalUnicastOrMulticast()` (openthread#10405) [otci] fix the `setDaemon() is deprecated` warning (openthread#10409) [otci] add ADB USB connection support for OTCI (openthread#10406) [posix] check whether the RCP support specified Spinel properties (openthread#10387) [simulation] fix tiny issue of infra if (openthread#10402) [cli] `udp bind` doc update to clarify that multicast address cannot be used as argument (openthread#10370) [posix] add OT sys API to get the spinel driver (openthread#10393) [udp] add template `SocketIn` class for easier socket usage (openthread#10392) [routing-manager] add `mIsReachable` to `otBorderRoutingRouterEntry` (openthread#10388) [child-supervision] remove unused method declarations (openthread#10394) github-actions: bump codecov/codecov-action from 4.3.1 to 4.5.0 (openthread#10395) [mle] enhance RLOC and ALOC address generation (openthread#10391) [netif] remove multicast promiscuous mode configuration (openthread#10338) [ip6] fix warning when logging enabled (openthread#10375) [mle] rename mesh local address methods to use `Rloc` and `Eid` (openthread#10385) [mle] use `RouterIdMatch()` to compare Router IDs of two RLOC16 values (openthread#10384) [mle] add `GetLeaderRloc16()` helper method (openthread#10383) [dataset] move secure storage methods to `DatasetManager` (openthread#10381) [udp] clear all properties in `SocketHandle` from `Udp::Open()` (openthread#10380) [routing-manager] add `RxRaTracker::Router::IsReachable()` (openthread#10379) [mle] add `TxMessage::AppendLinkAndMleFrameCounterTlvs()` (openthread#10378) [cli] update `service add` command to allow empty server data (openthread#10377) [mdns] use `NextFireTime` for scheduling timers (openthread#10371) [diag] specify sending frame (openthread#10359) [cli] fix unused retval warning on `otPlatLogCrashDump()` call (openthread#10369) [test] update key-increment test scripts to align with cert test (openthread#10347) [key-manager] update how the "Key Switch Guard Timer" is reset (openthread#10347) [posix] improve the logging in netif (openthread#10362) [cmake] add option for `OPENTHREAD_CONFIG_MAC_CSL_REQUEST_AHEAD_US` (openthread#10361) [style] unify using member variable (openthread#10360) [mle] add `Mle::RxMessage::ReadAndSetNetworkDataTlv()` (openthread#10358) [srp-client] use sequential message IDs & allow older response IDs (openthread#10353) [routing-manager] schedule all timers in `RxRaTracker` together (openthread#10343) [dnssd-server] implement DNS-SD discovery proxy functionality in core (openthread#10050) github-actions: bump docker/login-action from 3.1.0 to 3.2.0 (openthread#10356) [mle] add `Mle::RxMessage::ReadAndSave{Active/Pending}Dataset()` (openthread#10348) [ncp] add property to instruct NCP to leave gracefully (openthread#10337) [mdns] add support for legacy unicast response feature (openthread#10053) [tcat] add TCAT Commissioner / Device certs for Thread certification testing (openthread#10211) [tcat] implement tcat advertisement (openthread#9858) [posix] extract co-processor init out of otSysInit (openthread#10344) [posix] add RCP capability diag module (openthread#10335) [routing-manager] enhance `TestPrefixStaleTime()` (openthread#10342) [mle] add `TxMessage::AppendActiveAndPendingTimestampTlvs()` (openthread#10341) [mle] add `Mle::TxMessage::AppendDatasetTlv()` (openthread#10340) [mle] allow appending pending timestamp TLV with zero seconds (openthread#10327) [timestamp] add `IsValid()` and comparison operator overloads (openthread#10325) [dataset] add `WriteTimestamp()` and `RemoveTimestamp()` (openthread#10333) [mle] minor enhancements to `HandleParentResponse()` (openthread#10331) [mdns] add APIs to iterate over browsers and resolvers (openthread#10140) [ip6] do not report an error for disabled host loopback (openthread#10339) [routing-manager] update stale time constant to 10 minute (openthread#10330) [dataset-manager] enhance starting of Pending Dataset delay timer (openthread#10334) [mbedtls] remove `-Wno-unused-but-set-variable` (openthread#10336) [spinel] remove including openthread-core-config.h (openthread#10322) [mbedtls] enable MBEDTLS_OID_C when MBEDTLS_PK_PARSE_C is enabled (openthread#10332) [mle] add `ConnectivityTlv::IsSingleton()` (openthread#10329) [encoding] declare `HostSwap()` functions as `constexpr` (openthread#10326) [meshcop] update `Timestamp::AdvanceRandomTicks()` (openthread#10320) github-actions: bump actions/download-artifact from 4.1.4 to 4.1.7 (openthread#10324) [routing-manager] fix and enhance prefix stale time calculation (openthread#10317) [mle] add helper methods to `RxMessage` (openthread#10319) [routing-manager] update stale time calculation for local RA header (openthread#10316) [routing-manager] update and simplify RA beacon timing (openthread#10309) [mle] simplify signaling of DUA address change (openthread#10296) [radio] update `otPlatRadioSetRxOnWhenIdle` documentation (openthread#10307) [routing-manager] fix lifetime management of PD prefix (openthread#10310) [utils] add API to reset/clear linked list of enh-ack link metrics (openthread#10294) [dso] use `NextFireTime` (openthread#10306) [mdns] use `NextFireTime` class (openthread#10304) [dataset-updater] enhance `DatasetUpdater` (openthread#10293) [mbedtls] optimize AES configuration (openthread#10286) [mbedtls] modify GitHub workflows to test MbedTLS v2.28.8 (openthread#10286) [mbedtls] migrate to MbedTLS v3.6.0 (openthread#10286) [fuzz] fix typo and enable SRP Advertising Proxy (openthread#10300) [cli] fix memory leak on TCP init failure (openthread#10300) github-actions: bump actions/checkout from 4.1.2 to 4.1.6 (openthread#10299) [timer] add `NextFireTime` class (openthread#10295) [mle] fix warning with storedCount (openthread#10301) [dataset] simplify `IsSubsetOf()` (openthread#10292) [routing-manager] simplify how `RxRaTracker` handles local on-link prefix (openthread#10291) [dataset-manager] simplify `Restore()` (openthread#10290) [mle] update router table after adding a new neighbor (openthread#10288) [spinel] parse correct RcpMinHostApiVersion capability (openthread#10285) [string] add `ParseDigit()`, `ParseHexDigit()`, and other helper functions (openthread#10282) [routing-manager] track whether a discovered router is local device (openthread#10284) [dataset] simplify `Clear()` methods (openthread#10283) [routing-manager] update and simplify decisions for processing PIO/RIO (openthread#10281) [dataset] move `ApplyConfiguration()` to `DatasetManager` (openthread#10280) [routing-manager] track and report last update time of routers (openthread#10244) [routing-manager] move decision to process PIO/RIO to `RxRaTracker` (openthread#10270) [posix] add spinel driver getter to allow external app to access (openthread#10272) [mdns] include additional records along with sub-type PTR answer (openthread#10276) [dataset-manager] track local dataset in `DatasetManager` (openthread#10275) [utils] fix build when `OPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=0` (openthread#10260) github-actions: bump docker/setup-buildx-action from 3.2.0 to 3.3.0 (openthread#10274) [dataset-manager] ensure `mDelayTimer` is stopped when no Pending Dataset (openthread#10268) [dataset-manager] combine `protected` and `private` sections (openthread#10267) [routing-manager] move handling of prefix stale timer to `RxRaTracker` (openthread#10265) [mdns] ensure callback is invoked when registering host with no address (openthread#10264) [mbedtls] remove config workaround (openthread#10263) [routing-manager] move tracking of local RA header to `RxRaTracker` (openthread#10257) [dataset] move `Read()` overload implementations to `DatasetManager` (openthread#10258) [dataset] move Active Dataset replacement check in `PendingDatasetManager` (openthread#10217) [tests] do not build unit tests in oss-fuzz (openthread#10259) [routing-manager] rename `DiscoveredPrefixTable` to `RxRaTracker` (openthread#10255) [mle] simplify `HandleLeaderData()` (openthread#10248) [spinel] remove dependency on ot core (openthread#10212) [routing-manager] signal table change on M/O flag update of routers (openthread#10250) [routing-manager] fix received NA message min length check (openthread#10256) [secure-transport] remove redundant null check (openthread#10254) [mle] add helper method `SetLeaderData(const LeaderData &)` (openthread#10245) [dataset] add `ContainsAllTlvs()` helper method (openthread#10249) [gitignore] do not ignore .cmake files (openthread#10247) [dataset] enforce successful Dataset saves in non-volatile (openthread#10237) [routing-manager] utilize `Network::Leader::ContainsOmrPrefix()` (openthread#10240) [gitignore] add more temp files to `.gitignore` (openthread#10243) [simulation] rename local host to local interface (openthread#10241) [gitignore] ignore files genereated by running toranj unit tests (openthread#10242) [network-data] optimize `ContainsOmrPrefix()` (openthread#10239) [test] fix description for `test-028-border-agent-ephemeral-key.py` (openthread#10238) [posix] add return of co-processor type in otSysInit and allow posix plat run with NCP (openthread#10220) [routing-manager] ignore checksum in RA hash calculation (openthread#10230) [dataset] simplify dataset `Save()` methods (openthread#10227) [routing-manager] track origin of received RA messages (openthread#10229) [routing-manager] add section comments (openthread#10228) [clang-format] accept different patch versions of `clang-format` (openthread#10042) [dataset] add support for handling `MGMT_ACTIVE_REPLACE` on leader (openthread#10201) [routing-manager] introduce `RoutePrefix` and `OnLinkPrefix` types (openthread#10216) [simulation] support simulating radio over IPv6 (openthread#10194) github-actions: bump ossf/scorecard-action from 2.3.1 to 2.3.3 (openthread#10225) [cli] add UDP socket openness check before sending with `udp send` (openthread#10206) [spinel] only request crash logs on RCP recovery if capable (openthread#10213) [routing-manager] use `OwningList` for `Router` and `Entry` lists (openthread#10214) [dns] add checks for multi-label looped compressed DNS names (openthread#10215) [owning-list] add `RemoveAndFreeAllMatching()` to `OwningList` class (openthread#10210) [spinel] move definition of coprocessor type to `lib/spinel` (openthread#10208) [routing-manager] add `CalculateExpirationTime()` (openthread#10207) [dataset] send 'reject' response to `MGMT_SET` on non-leader (openthread#10148) [routing-manager] enhance and streamline `PdPrefixManager` (openthread#10146) [routing-manager] ensure correct handling of shorter PD prefix (openthread#10145) github-actions: bump codecov/codecov-action from 4.0.2 to 4.3.1 (openthread#10195) [cli] fix `ipaddr` and `ipmaddr` commands in debug cli (openthread#10200) [style] add comment to indicate the which conditional endif is associated with (openthread#10197) [cli] add `br pd omrprefix` command to display DHCPv6 PD OMR prefix (openthread#10147) [dataset] simplify dataset manager `MGMT_SET` request handling (openthread#10139) [dataset] simplify `SendSetRequest` (openthread#10135) [dataset] add `ValidateTlvs()`, helper methods, and unit test (openthread#10111) [simulation] remove example log lines from `otPlatLogCrashDump()` (openthread#10137) [spinel] remove `mIsCoprocessorReady` flag check (openthread#10144) [routing-manager] remove unused method (openthread#10142) [routing-manager] update and simplify comments (openthread#10141) [spinel] breakdown posix radio module (openthread#10051) [cli] move a few static util methods to `Cli::Utils` class (openthread#10138) [dataset] define `MgmtSetCallback` type (openthread#10120) [cli] fix namespace usage (openthread#10088) github-actions: bump github/codeql-action from 3.24.6 to 3.25.3 (openthread#10077) [dtls] fix undesired kernel filtering of connected UDP (openthread#10069) [cli] fix ifdef guard (openthread#10068) [routing-manager] exclude on-link prefixes with short preferred lifetime (openthread#10062) [spinel] add support for logging crash dumps (openthread#10061) [test] add a CMake macro to simplify adding unit tests (openthread#10067) [dataset] update `SendGetRequest()` to use `TlvList` array (openthread#10066) [callback] add `InvokeAndClearIfSet()` helper (openthread#10064) [dataset] simplify `DatasetManager::HandleSet()` (openthread#10063) [cli] add cli toggle (for test harness) to accept tmf udp messages from unknown origins (openthread#10028) [link-metrics] add cli command to show link metrics manager state (openthread#10046) [dataset] relocate `IsTlvValid()` to `Dataset` (openthread#10060) [dataset] add generic `Read<Tlv>()` methods, refactor timestamp (openthread#10059) [spinel] restore the source match feature setting (openthread#10055) [spinel] fix spinel RCP min host api version cap bug (openthread#10057) [dhcp] add callback to notify DHCPv6 PD state change (openthread#9926) [mesh-diag] fix a typo in a variable name (openthread#10056) [mdns] add APIs to iterate over registered host/service/key entries (openthread#9954) [routing-manager] add support for to use a prefix received from DHCPv6 PD (openthread#10000) [zephyr] add module name (openthread#10041) github-actions: bump actions/setup-python from 5.0.0 to 5.1.0 (openthread#10052) [dnssd] allow `Dnssd` platform to use native OT mDNS modules (openthread#9944) [icmp] add `OT_ICMP6_ECHO_HANDLER_RLOC_ALOC_ONLY` to `otIcmp6EchoMode` (openthread#10014) [logging] fix print format when enabling csl debug (openthread#10045) [dataset] simplify `AppendMleDatasetTlv()` (openthread#10043) [dataset] use `IsActiveDataset()/IsPendingDataset()` for type checks (openthread#10040) [dns] add `Name::StripName()` and support in-place `ExtractLabels()` (openthread#10037) [tests] enhance expect test for link metrics manager feature (openthread#10035) [cmake] add `OT_BORDER_AGENT_EPSKC` in CMake options (openthread#10034) [spinel] breakdown radio spinel (openthread#10025) [cli] update README files to clarify a Commissioner is used for changing datasets (openthread#10026) [mle] restart role transition timeout from `SetRouterEligible(true)` (openthread#10033) [dataset] enforce maximum delay timer value and improve handling (openthread#10023) [dataset] simplify `DatasetManager::HandleGet()` & `SendGetResponse()` (openthread#10020) github-actions: bump docker/login-action from 3.0.0 to 3.1.0 (openthread#10029) [dnssd-server] remove unused private method (openthread#10024) [daemon] avoid using `defined(__ANDROID__)` macro in `daemon.cpp` (openthread#10021) [udp] add DHCP ports to `ShouldUsePlatformUdpFunction` (openthread#10017) [dataset] use `Tlv::Find<>()` to check commissioner session ID (openthread#10019) [dataset] define template method to check/get/set components (openthread#10018) [dataset] add `ApplyConfiguration()` overload without default parameter (openthread#10013) [message] introduce `RemoveFooter()` (openthread#10012) [dataset] `GenerateRandom()` to build network name using `StringWriter` (openthread#10007) [mdns] add native mDNS support in OT (openthread#9797) github-actions: bump actions/upload-artifact from 4.2.0 to 4.3.1 (openthread#10005) [utils] implement Verhoeff checksum calculation and validation (openthread#9966) [spinel] add time sync feature to the spinel (openthread#9977) [instance] support get multi instance reference or index (openthread#9947) Change-Id: I45c584fe06e497f2cbd47902349b307a1a616af2
This PR is another subset of PR #9898.
This PR breaks down current posix radio module into
Radio
andSpinelManager
. The static instance ofSpinelDriver
is moved fromRadio
toSpinelManager
. TheplatformRadioXXX
methods are alsobroken down into
platformSpinelXXX
andplatformRadioXXX
. Thepurpose is to make
platformSpinelXXX
resuable under both NCP andRCP cases. And to use
platformSpinelInit
to detect to co-processortype during initialization.