From acf689d39e64bfe3b006b0497d1329663f89778b Mon Sep 17 00:00:00 2001 From: Jerry Xie <139205137+jerrysxie@users.noreply.github.com> Date: Mon, 20 Apr 2026 17:48:28 -0500 Subject: [PATCH 1/7] Add guardrails and update audit sources for cargo-vet workflow (#803) This pull request introduces several important improvements to the cargo-vet audit process documentation and configuration, focusing on stricter exemption policies, duplicate audit entry prevention, and the addition of new audit records. The main themes are: enhanced documentation for reviewers, stricter exemption and deduplication workflows, and updates to the audit registry. **Documentation and Workflow Improvements:** * Added explicit instructions to always run `cargo vet` commands non-interactively to prevent blocking on terminal input, and clarified how to set the pager and use `--accept-all` for certification. (.github/agents/cargo-vet-auditor.agent.md) * Strengthened the policy that exemptions (`[[exemptions]]`) should only be used as a last resort, requiring explicit user confirmation and justification, and that every exemption must include a `notes` field explaining its necessity and removal conditions. (.github/agents/cargo-vet-auditor.agent.md, .github/skills/cargo-vet-audit/SKILL.md) [[1]](diffhunk://#diff-34643b14215fa0cbb482e40432146ebcf329c13cd61ef7b7fed20e112b8e19e6R89-R127) [[2]](diffhunk://#diff-c18d588b43b8f757894f63618ccb4e6f2d9a5adb55452ac09267853410462f77R63-R85) * Introduced a duplicate-audit guardrail: before certifying, the workflow now checks for identical existing audit entries and instructs reviewers to deduplicate them, preventing redundant audit records. (.github/agents/cargo-vet-auditor.agent.md, .github/skills/cargo-vet-audit/SKILL.md) [[1]](diffhunk://#diff-34643b14215fa0cbb482e40432146ebcf329c13cd61ef7b7fed20e112b8e19e6R89-R127) [[2]](diffhunk://#diff-c18d588b43b8f757894f63618ccb4e6f2d9a5adb55452ac09267853410462f77L107-R155) **Audit Registry Updates:** * Added new or updated audit entries for the following crates: `autocfg`, `crunchy`, `serde_spanned`, `tap`, `thread_local`, and `valuable`, all with detailed notes and criteria. (supply-chain/audits.toml) [[1]](diffhunk://#diff-eb494298b7630e575978d77f3bdd3178163bb7f5dbbf7e24316abe77210549f6R49-R54) [[2]](diffhunk://#diff-eb494298b7630e575978d77f3bdd3178163bb7f5dbbf7e24316abe77210549f6R81-R86) [[3]](diffhunk://#diff-eb494298b7630e575978d77f3bdd3178163bb7f5dbbf7e24316abe77210549f6R475-R480) [[4]](diffhunk://#diff-eb494298b7630e575978d77f3bdd3178163bb7f5dbbf7e24316abe77210549f6R501-R512) [[5]](diffhunk://#diff-eb494298b7630e575978d77f3bdd3178163bb7f5dbbf7e24316abe77210549f6R568-R573) * Added a new trusted entry for `rustc-demangle` with `safe-to-deploy` criteria. (supply-chain/audits.toml) **Configuration Clean-up:** * Removed unused or unnecessary import sources from `supply-chain/config.toml` (specifically `embark-studios` and `zcash`). (supply-chain/config.toml) --- .github/agents/cargo-vet-auditor.agent.md | 43 ++++++++- .github/skills/cargo-vet-audit/SKILL.md | 44 ++++++++- supply-chain/audits.toml | 42 ++++++++ supply-chain/config.toml | 6 -- supply-chain/imports.lock | 111 +++------------------- 5 files changed, 136 insertions(+), 110 deletions(-) diff --git a/.github/agents/cargo-vet-auditor.agent.md b/.github/agents/cargo-vet-auditor.agent.md index 800c5b991..5b4a7eae9 100644 --- a/.github/agents/cargo-vet-auditor.agent.md +++ b/.github/agents/cargo-vet-auditor.agent.md @@ -86,10 +86,49 @@ For every crate you review, systematically check ALL of the following: ## How to Review +### Non-Interactive Execution + +**CRITICAL:** All `cargo vet` commands must run non-interactively: + +- **`diff` / `inspect`:** Always set the pager to a non-interactive command to + prevent the pager from waiting for input. Use `$env:PAGER='more.com';` + (PowerShell) or `PAGER=cat` (POSIX) before the command. +- **`certify`:** Always pass `--accept-all` along with `--criteria`, `--who`, + and `--notes` to skip all interactive prompts. + +Never run a `cargo vet` command that could block waiting for terminal input. + +### Exemptions Are a Last Resort + +Do **not** recommend adding `[[exemptions]]` entries without good reason. +Each exemption bypasses the audit process entirely and requires explicit manual +confirmation from the user. Always prefer performing a full or delta audit over +exempting a crate. If an exemption is truly necessary (e.g., the crate is only +needed at `safe-to-run` level for dev tooling, or an import source removal +requires temporary coverage), flag it clearly and let the user decide. + +Every exemption **must** include a `notes` field explaining why the exemption +exists and under what conditions it can be removed. + +### Duplicate-Audit Guardrail + +Before recommending or running certification, check whether an identical +`[[audits.]]` entry (same who/criteria/version-or-delta/notes) already +exists in `supply-chain/audits.toml`. + +If an identical entry already exists: + +- Do not recommend re-certifying with the same data +- Report that the crate is already certified with identical audit content +- If duplicates already exist, explicitly recommend deduplicating by keeping one + copy and removing the rest + +Rationale: retried `cargo vet certify` commands can append duplicate blocks. + ### For Delta Audits Use `PAGER=cat cargo vet diff CRATE FROM TO` (POSIX) or -`$env:PAGER='cat'; cargo vet diff CRATE FROM TO` (PowerShell) to view the diff. +`$env:PAGER='more.com'; cargo vet diff CRATE FROM TO` (PowerShell) to view the diff. Focus on: 1. New `unsafe` blocks or modifications to existing ones @@ -101,7 +140,7 @@ Focus on: ### For Full Version Audits Use `PAGER=cat cargo vet inspect CRATE VERSION` (POSIX) or -`$env:PAGER='cat'; cargo vet inspect CRATE VERSION` (PowerShell) to view source. +`$env:PAGER='more.com'; cargo vet inspect CRATE VERSION` (PowerShell) to view source. Focus on: 1. All `unsafe` code (search for `unsafe`) diff --git a/.github/skills/cargo-vet-audit/SKILL.md b/.github/skills/cargo-vet-audit/SKILL.md index 6ac54a1ef..587c3f1c4 100644 --- a/.github/skills/cargo-vet-audit/SKILL.md +++ b/.github/skills/cargo-vet-audit/SKILL.md @@ -60,6 +60,29 @@ Confidence scoring rubric: ## Step 5: Certify +### Exemptions Are a Last Resort + +Do **not** add `[[exemptions]]` entries without explicit user confirmation. +Each exemption bypasses the audit process entirely and must be justified. +Valid reasons include: + +- The crate is only needed for `safe-to-run` (test/dev tooling) and a full + audit is disproportionate +- An upstream import source was removed and the crate needs temporary coverage + while a first-party audit is scheduled +- The user explicitly requests an exemption after reviewing the trade-offs + +Always prefer auditing (full or delta) over exempting. When an exemption is +unavoidable, present it to the user for manual approval before adding it. + +Every exemption **must** include a `--notes` explaining why the exemption exists +and under what conditions it can be removed: + +```shell +cargo vet add-exemption CRATE VERSION --criteria CRITERIA \ + --notes "Reason for exemption; plan for resolution" +``` + For each crate that passes (confidence ≥ 70), run: ```shell @@ -104,9 +127,24 @@ the human reviewer, never the AI agent. ## Step 6: Verify and Clean Up -1. Run `cargo vet` again to confirm everything passes -2. Run `cargo vet prune` to remove stale exemptions -3. Run `cargo vet` one final time to confirm clean state +Before final verification, detect and remove identical duplicate `[[audits.*]]` +entries that may have been appended by retried `cargo vet certify` commands. + +Duplicate-check workflow: + +1. Scan `supply-chain/audits.toml` for byte-for-byte identical audit blocks +2. If duplicates exist, keep one copy (usually the first) and remove the rest +3. Re-run `cargo vet` after deduplication to ensure state is still valid + +To detect duplicates, scan `supply-chain/audits.toml` for repeated blocks +with identical crate name, who, criteria, version/delta, and notes fields. +Remove any duplicates before proceeding. + +Then run the normal cleanup sequence: + +4. Run `cargo vet` again to confirm everything passes +5. Run `cargo vet prune` to remove stale exemptions +6. Run `cargo vet` one final time to confirm clean state ## Reviewing Import Sources diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml index 6850d8fae..a840c3ced 100644 --- a/supply-chain/audits.toml +++ b/supply-chain/audits.toml @@ -46,6 +46,12 @@ who = "Douglas Cheah " criteria = "safe-to-run" version = "1.1.0" +[[audits.autocfg]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +delta = "1.4.0 -> 1.5.0" +notes = "No unsafe, no build.rs, no network access; delta adds edition-aware rustc probing and best-effort probe-file cleanup only. Assisted-by: copilot-cli:GPT-5.3-Codex cargo-vet" + [[audits.backtrace]] who = "Robert Zieba " criteria = "safe-to-run" @@ -72,6 +78,12 @@ who = "Jerry Xie " criteria = "safe-to-deploy" version = "1.0.0" +[[audits.crunchy]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +delta = "0.2.3 -> 0.2.4" +notes = "Tiny diff to use newer core/std features via build.rs env var for path separator; no safety impact. Assisted-by: copilot-cli:GPT-5.3-Codex cargo-vet" + [[audits.embassy-embedded-hal]] who = "Jerry Xie " criteria = "safe-to-deploy" @@ -460,6 +472,12 @@ who = "jerrysxie " criteria = "safe-to-deploy" version = "0.6.8" +[[audits.serde_spanned]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +delta = "0.6.8 -> 0.6.9" +notes = "Trivial delta: metadata, lint config, and doc formatting only. No functional code changes, no unsafe, no build script, no I/O. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.smbus-pec]] who = "Matteo Tullo " criteria = "safe-to-deploy" @@ -480,6 +498,18 @@ who = "Matteo Tullo " criteria = "safe-to-deploy" version = "1.1.2" +[[audits.tap]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "1.0.1" +notes = "No unsafe, no build.rs, no ambient I/O/process/network capabilities; behavior matches no_std tap/pipe/conv utility traits. Assisted-by: copilot-cli:GPT-5.3-Codex cargo-vet" + +[[audits.thread_local]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +delta = "1.1.4 -> 1.1.9" +notes = "No build script, no FS/net/process capability expansion; unsafe refactor to lock-free insertion and nightly TLS path appears sound on review. Assisted-by: copilot-cli:GPT-5.3-Codex cargo-vet" + [[audits.tokio]] who = "Robert Zieba " criteria = "safe-to-run" @@ -535,6 +565,12 @@ who = "Jerry Xie " criteria = "safe-to-deploy" version = "1.17.0" +[[audits.valuable]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "0.1.1" +notes = "No unsafe code; build.rs only sets target atomic cfg via env; no fs/net/process capability use observed; behavior matches value-inspection purpose. Assisted-by: copilot-cli:GPT-5.3-Codex cargo-vet" + [[audits.windows-targets]] who = "Robert Zieba " criteria = "safe-to-run" @@ -654,6 +690,12 @@ user-id = 189 # Andrew Gallant (BurntSushi) start = "2019-02-25" end = "2026-09-03" +[[trusted.rustc-demangle]] +criteria = "safe-to-deploy" +user-id = 55123 # rust-lang-owner +start = "2023-03-23" +end = "2027-04-17" + [[trusted.rustversion]] criteria = "safe-to-deploy" user-id = 3618 # David Tolnay (dtolnay) diff --git a/supply-chain/config.toml b/supply-chain/config.toml index 6e301deba..b79c103d9 100644 --- a/supply-chain/config.toml +++ b/supply-chain/config.toml @@ -10,18 +10,12 @@ url = "https://raw.githubusercontent.com/OpenDevicePartnership/rust-crate-audits [imports.bytecode-alliance] url = "https://raw.githubusercontent.com/bytecodealliance/wasmtime/main/supply-chain/audits.toml" -[imports.embark-studios] -url = "https://raw.githubusercontent.com/EmbarkStudios/rust-ecosystem/main/audits.toml" - [imports.google] url = "https://raw.githubusercontent.com/google/rust-crate-audits/main/audits.toml" [imports.mozilla] url = "https://raw.githubusercontent.com/mozilla/supply-chain/main/audits.toml" -[imports.zcash] -url = "https://raw.githubusercontent.com/zcash/rust-ecosystem/main/supply-chain/audits.toml" - [policy.embassy-imxrt] audit-as-crates-io = false diff --git a/supply-chain/imports.lock b/supply-chain/imports.lock index 9b0ce2fb2..3fff0359b 100644 --- a/supply-chain/imports.lock +++ b/supply-chain/imports.lock @@ -69,6 +69,12 @@ user-id = 189 user-login = "BurntSushi" user-name = "Andrew Gallant" +[[publisher.rustc-demangle]] +version = "0.1.26" +when = "2025-07-27" +user-id = 55123 +user-login = "rust-lang-owner" + [[publisher.rustversion]] version = "1.0.22" when = "2025-08-08" @@ -598,17 +604,6 @@ a few `unsafe` blocks related to utf-8 validation which are locally verifiable as correct and otherwise this crate is good to go. """ -[[audits.bytecode-alliance.audits.rustc-demangle]] -who = "Alex Crichton " -criteria = "safe-to-deploy" -version = "0.1.21" -notes = "I am the author of this crate." - -[[audits.bytecode-alliance.audits.rustc-demangle]] -who = "Alex Crichton " -criteria = "safe-to-deploy" -delta = "0.1.21 -> 0.1.24" - [[audits.bytecode-alliance.audits.semver]] who = "Pat Hickey " criteria = "safe-to-deploy" @@ -653,18 +648,6 @@ who = "Pat Hickey " criteria = "safe-to-deploy" version = "0.3.17" -[[audits.embark-studios.audits.tap]] -who = "Johan Andersson " -criteria = "safe-to-deploy" -version = "1.0.1" -notes = "No unsafe usage or ambient capabilities" - -[[audits.embark-studios.audits.valuable]] -who = "Johan Andersson " -criteria = "safe-to-deploy" -version = "0.1.0" -notes = "No unsafe usage or ambient capabilities, sane build script" - [[audits.google.audits.autocfg]] who = "Manish Goregaokar " criteria = "safe-to-deploy" @@ -1342,6 +1325,12 @@ end = "2026-02-01" notes = "All code written or reviewed by Manish" aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" +[[audits.mozilla.audits.adler2]] +who = "Erich Gubler " +criteria = "safe-to-deploy" +delta = "2.0.0 -> 2.0.1" +aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" + [[audits.mozilla.audits.arraydeque]] who = "Lars Eggert " criteria = "safe-to-deploy" @@ -1645,79 +1634,3 @@ who = "Mark Hammond " criteria = "safe-to-deploy" delta = "0.3.19 -> 0.3.20" aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" - -[[audits.zcash.audits.adler2]] -who = "Jack Grigg " -criteria = "safe-to-deploy" -delta = "2.0.0 -> 2.0.1" -aggregated-from = "https://raw.githubusercontent.com/zcash/zcash/master/qa/supply-chain/audits.toml" - -[[audits.zcash.audits.autocfg]] -who = "Jack Grigg " -criteria = "safe-to-deploy" -delta = "1.4.0 -> 1.5.0" -notes = "Filesystem change is to remove the generated LLVM IR output file after probing." -aggregated-from = "https://raw.githubusercontent.com/zcash/zcash/master/qa/supply-chain/audits.toml" - -[[audits.zcash.audits.crunchy]] -who = "Jack Grigg " -criteria = "safe-to-deploy" -delta = "0.2.3 -> 0.2.4" -notes = """ -Build script change is to fix a bug where a path separator for an included file -was being selected by the target OS instead of the host OS. -""" -aggregated-from = "https://raw.githubusercontent.com/zcash/zcash/master/qa/supply-chain/audits.toml" - -[[audits.zcash.audits.rustc-demangle]] -who = "Jack Grigg " -criteria = "safe-to-deploy" -delta = "0.1.24 -> 0.1.25" -aggregated-from = "https://raw.githubusercontent.com/zcash/zcash/master/qa/supply-chain/audits.toml" - -[[audits.zcash.audits.rustc-demangle]] -who = "Jack Grigg " -criteria = "safe-to-deploy" -delta = "0.1.25 -> 0.1.26" -notes = "Parser changes use existing parsing machinery in an obvious way." -aggregated-from = "https://raw.githubusercontent.com/zcash/wallet/main/supply-chain/audits.toml" - -[[audits.zcash.audits.serde_spanned]] -who = "Jack Grigg " -criteria = "safe-to-deploy" -delta = "0.6.8 -> 0.6.9" -aggregated-from = "https://raw.githubusercontent.com/zcash/wallet/main/supply-chain/audits.toml" - -[[audits.zcash.audits.thread_local]] -who = "Jack Grigg " -criteria = "safe-to-deploy" -delta = "1.1.4 -> 1.1.7" -notes = """ -New `unsafe` usage: -- An extra `deallocate_bucket`, to replace a `Mutex::lock` with a `compare_exchange`. -- Setting and getting a `#[thread_local] static mut Option` on nightly. -""" -aggregated-from = "https://raw.githubusercontent.com/zcash/zcash/master/qa/supply-chain/audits.toml" - -[[audits.zcash.audits.thread_local]] -who = "Daira-Emma Hopwood " -criteria = "safe-to-deploy" -delta = "1.1.7 -> 1.1.8" -notes = """ -Adds `unsafe` code that makes an assumption that `ptr::null_mut::>()` is a valid representation -of an `AtomicPtr>`, but this is likely a correct assumption. -""" -aggregated-from = "https://raw.githubusercontent.com/zcash/zcash/master/qa/supply-chain/audits.toml" - -[[audits.zcash.audits.thread_local]] -who = "Jack Grigg " -criteria = "safe-to-deploy" -delta = "1.1.8 -> 1.1.9" -aggregated-from = "https://raw.githubusercontent.com/zcash/zcash/master/qa/supply-chain/audits.toml" - -[[audits.zcash.audits.valuable]] -who = "Jack Grigg " -criteria = "safe-to-deploy" -delta = "0.1.0 -> 0.1.1" -notes = "Build script changes are for linting." -aggregated-from = "https://raw.githubusercontent.com/zcash/zcash/master/qa/supply-chain/audits.toml" From 1b6049ca8ae22526377acfa8f8f1dade34103ead Mon Sep 17 00:00:00 2001 From: RobertZ2011 <33537514+RobertZ2011@users.noreply.github.com> Date: Tue, 21 Apr 2026 13:02:34 -0700 Subject: [PATCH 2/7] power-policy-service: Shorten lock held in disconnect flow (#813) This lock was being held for the duration of the conditional branch, causing a deadlock in `update_current_consumer`. --- power-policy-service/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/power-policy-service/src/lib.rs b/power-policy-service/src/lib.rs index 3b40efa67..edb205d9c 100644 --- a/power-policy-service/src/lib.rs +++ b/power-policy-service/src/lib.rs @@ -81,13 +81,13 @@ impl PowerPolicy { self.context.send_response(Ok(policy::ResponseData::Complete)).await; self.remove_connected_provider(device.id()).await; - if let Some(consumer) = self + let current_consumer = self .state .lock() .await .current_consumer_state - .take_if(|d| d.device_id == device.id()) - { + .take_if(|d| d.device_id == device.id()); + if let Some(consumer) = current_consumer { // Current PSU is disconnected, disconnect chargers, and attempt to select next PSU info!("Device{}: Connected consumer disconnected", consumer.device_id.0); self.disconnect_chargers().await?; From 771d3675153afcad712bca91adc6f4d8ce0707aa Mon Sep 17 00:00:00 2001 From: Jerry Xie <139205137+jerrysxie@users.noreply.github.com> Date: Wed, 22 Apr 2026 10:48:40 -0500 Subject: [PATCH 3/7] Audit cargo vet exemptions (#812) This pull request significantly reduces the number of explicit exemptions listed in the `supply-chain/config.toml` file. Many crates that were previously exempted from certain audit criteria have been removed from the exemptions list, leaving only a single exemption for the `generator` crate. Dependency audit policy updates: * Removed numerous crate exemptions from the `[exemptions]` section, which previously allowed specific versions of various dependencies to bypass the default audit criteria. Now, only the `generator` crate remains explicitly exempted. --- supply-chain/audits.toml | 450 ++++++++++++++++++++++++++++++++++++++ supply-chain/config.toml | 296 ------------------------- supply-chain/imports.lock | 237 ++++++++++++++++++++ 3 files changed, 687 insertions(+), 296 deletions(-) diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml index a840c3ced..c93b214e5 100644 --- a/supply-chain/audits.toml +++ b/supply-chain/audits.toml @@ -6,6 +6,12 @@ who = "Robert Zieba " criteria = "safe-to-run" version = "0.24.2" +[[audits.ahash]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "0.8.12" +notes = "All unsafe is SIMD intrinsics (AES-NI, SSE2, SSSE3, ARM NEON) with correct cfg guards. zerocopy::transmute! for type conversions. Build script only checks target arch and compiler features. No I/O, no proc macros. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.aligned]] who = "jerrysxie " criteria = "safe-to-deploy" @@ -52,22 +58,94 @@ criteria = "safe-to-deploy" delta = "1.4.0 -> 1.5.0" notes = "No unsafe, no build.rs, no network access; delta adds edition-aware rustc probing and best-effort probe-file cleanup only. Assisted-by: copilot-cli:GPT-5.3-Codex cargo-vet" +[[audits.az]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "1.2.1" +notes = "No unsafe code. no_std library with only safe numeric cast traits. Build script probes for track_caller via rustc in OUT_DIR only. No network, no ambient capabilities. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.backtrace]] who = "Robert Zieba " criteria = "safe-to-run" version = "0.3.75" +[[audits.bbq2]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "0.4.2" +notes = "no_std SPSC bip-buffer queue. Non-trivial unsafe for lock-free coordination and pointer arithmetic, all reviewed and sound. No build script, no proc macros, no I/O. Has Miri CI. Assisted-by: copilot-chat:claude-opus-4.6 cargo-vet" + +[[audits.bincode]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "2.0.1" +notes = "no_std binary serialization library. ~15 unsafe blocks for u8 type-specialization guarded by unty::type_equal and MaybeUninit patterns. No build script, no proc macros. std imports only for Encode/Decode trait impls. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.bincode_derive]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "2.0.1" +notes = "Proc-macro derive for bincode Encode/Decode. No unsafe, no build script, no I/O. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.bitfield]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +delta = "0.13.2 -> 0.15.0" +notes = "Delta audit: BitRange/Bit traits split into read-only and mutable variants (BitRangeMut/BitMut); added mask constant generation; clippy fixes; MSRV bump. No unsafe, no build script, no proc macros, no powerful imports. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.bitfield]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +delta = "0.15.0 -> 0.17.0" +notes = "Delta: adds bitwise op derives, constructor derives, arbitrary visibility. Pure declarative macros. No unsafe, no build script. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.bitfield]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +delta = "0.15.0 -> 0.19.2" +notes = "Delta: refactored to proc macros in bitfield-macros, added BitAnd/BitOr/BitXor, signed types, bool arrays. No unsafe. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.bitfield-macros]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "0.19.2" +notes = "Proc-macro generating bitfield getters/setters/masks. No unsafe, no build script, no powerful imports. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.bitfield-struct]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "0.10.1" +notes = "Proc-macro crate generating safe bitfield structs. No unsafe, no build script. Standard proc-macro deps only. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.bitfield-struct]] who = "matteotullo " criteria = "safe-to-deploy" delta = "0.10.1 -> 0.12.1" notes = "Adds hash and bitenum derives, mostly parsing and refactoring changes. No code execution nor writing to the filesystem." +[[audits.bitvec]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "1.0.1" +notes = "Bit-level addressable memory library. Extensive unsafe inherent to sub-byte addressing: BitSpan bit-packs pointer+index+length, BitPtr/BitRef bit-level pointer/proxy types. All Send/Sync bounds mirror std. No build script, no proc macros, no filesystem/network/process access. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.block-device-driver]] who = "jerrysxie " criteria = "safe-to-deploy" version = "0.2.0" +[[audits.bytemuck]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +delta = "1.22.0 -> 1.23.2" +notes = "Delta 1.22.0->1.23.2: new ZeroableInOption impls for function pointer types (sound, uses guaranteed niche optimization), core::error::Error impls behind feature flag, safe derive helper module. No new unsafe blocks, no build script, no I/O. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.cfg-if]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +delta = "1.0.0 -> 1.0.3" +notes = "Delta 1.0.0->1.0.3: formatting/readability refactor of macro identifiers, removed compiler_builtins dep, updated CI. No unsafe, no build script, no imports. Pure macro_rules crate. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.colorchoice]] who = "Robert Zieba " criteria = "safe-to-run" @@ -78,30 +156,114 @@ who = "Jerry Xie " criteria = "safe-to-deploy" version = "1.0.0" +[[audits.convert_case]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "0.6.0" +notes = "Pure string case-conversion library. No unsafe code, no build script, no powerful imports. Only dependency is unicode-segmentation. Assisted-by: copilot-chat:claude-opus-4.6 cargo-vet" + +[[audits.cordyceps]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "0.3.4" +notes = "Intrusive data structures crate (no_std). ~115 unsafe blocks, all necessary for intrusive linked list/queue/stack ops. Correct patterns: addr_of_mut, proper atomic orderings, Vyukov MPSC algorithm. No build script, no proc macros, no powerful imports. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.crc]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "3.3.0" +notes = "No unsafe (forbid(unsafe_code)), no build script, no I/O, no_std pure CRC computation. Assisted-by: copilot-chat:claude-opus-4.6 cargo-vet" + +[[audits.crc-catalog]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "2.4.0" +notes = "Pure no_std data-only crate. No unsafe, no build script, no dependencies, no I/O. Contains only const CRC algorithm parameter structs. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.crunchy]] who = "Jerry Xie " criteria = "safe-to-deploy" delta = "0.2.3 -> 0.2.4" notes = "Tiny diff to use newer core/std features via build.rs env var for path separator; no safety impact. Assisted-by: copilot-cli:GPT-5.3-Codex cargo-vet" +[[audits.dd-manifest-tree]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "1.0.0" +notes = "No unsafe code, no build script, no proc macros, no powerful imports. Pure trait abstraction unifying JSON/YAML/TOML value types. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.defmt]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "0.3.100" +notes = "Compatibility shim: no_std crate that re-exports defmt 1.x items for 0.3 API compatibility. No unsafe code, no build script, no powerful imports, no logic - pure pub-use re-exports. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.device-driver]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "1.0.7" +notes = "no_std device driver toolkit. Unsafe limited to ops.rs bitfield load/store using get_unchecked with documented invariants; fuzz-tested against bitvec. No build script, no proc macros, no filesystem/network/process access. Assisted-by: copilot-chat:claude-opus-4.6 cargo-vet" + +[[audits.device-driver-generation]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "1.0.7" +notes = "Code generation library for device-driver. No unsafe in generator itself; generated code uses unsafe for register bit ops (validated by MIR passes). Spawns rustfmt via std::process::Command. No filesystem/network access. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.device-driver-macros]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "1.0.7" +notes = "Proc macro crate; no unsafe code, no build script. Reads manifest files from disk (relative to CARGO_MANIFEST_DIR) as expected for compile-time codegen. All code generation delegated to device-driver-generation. No network, process, or unexpected filesystem access. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.embassy-embedded-hal]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "0.5.0" +notes = "No unsafe, no build script, no proc macros. no_std shared bus/flash partition utilities for embedded-hal traits. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.embassy-embedded-hal]] who = "Jerry Xie " criteria = "safe-to-deploy" delta = "0.5.0 -> 0.6.0" notes = "No unsafe code, no build script, no powerful imports. Added Clone for I2C devices. Updated embassy dependencies (embassy-sync 0.7→0.8, embassy-hal-internal 0.3→0.4, embassy-time 0.5→0.5.1). All changes safe." +[[audits.embassy-futures]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "0.1.2" +notes = "no_std future combinators. All unsafe is pin-projection and no-op RawWaker - reviewed and sound. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.embassy-hal-internal]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "0.3.0" +notes = "no_std HAL internals. Unsafe in atomic ring buffer (sound SPSC), peripheral singletons, cortex-m interrupt priority. Build script emits cfg flags only. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.embassy-hal-internal]] who = "Jerry Xie " criteria = "safe-to-deploy" delta = "0.3.0 -> 0.4.0" notes = "Rust 2024 edition update with new ring buffer methods (available, is_half_full). All unsafe code is sound HAL pattern usage. Build script unchanged (cfg flags only). No powerful imports." +[[audits.embassy-sync]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "0.8.0" +notes = "no_std async sync primitives. Substantial unsafe for UnsafeCell-based interiors and Send/Sync impls -- all reviewed and sound, guarded by RawMutex/critical_section. Build script only reads TARGET env var. No proc macros, no powerful imports. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.embassy-time]] who = "Jerry Xie " criteria = "safe-to-deploy" delta = "0.5.0 -> 0.5.1" notes = "Rust 2024 edition update with import reordering. Unsafe pin projection patterns unchanged and sound. No build script. No new security concerns." +[[audits.embassy-time-driver]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "0.2.1" +notes = "no_std driver trait for embassy-time. Minimal unsafe for extern Rust FFI calls (sound via links key). Empty build.rs. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.embassy-time-driver]] who = "Jerry Xie " criteria = "safe-to-deploy" @@ -201,6 +363,42 @@ criteria = "safe-to-deploy" version = "0.2.0" notes = "ODP crates are always trusted." +[[audits.embedded-hal]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +delta = "0.2.7 -> 1.0.0" +notes = "Pure no_std trait crate. Complete API redesign for 1.0: removed nb-based traits, CAN module, all unsafe code. Only defines traits/enums/types for digital, I2C, SPI, PWM, delay. No build script, no proc macros, no powerful imports. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.embedded-hal-async]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "1.0.0" +notes = "no_std async HAL trait definitions. No unsafe in library. Build script only runs rustc --version. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.embedded-hal-nb]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "1.0.0" +notes = "no_std trait-only crate. No unsafe, no build script, no proc macros, no powerful imports. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.embedded-io]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +delta = "0.6.1 -> 0.7.1" +notes = "No unsafe, no build script, no I/O. Trait evolution: Error requires core::error::Error (MSRV 1.81), BufRead: Read, Seek gains seek_relative, new VecDeque impls, defmt bumped to v1. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.embedded-io-async]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "0.6.1" +notes = "No unsafe. Build script only detects nightly via rustc --version. Pure async trait definitions for embedded I/O. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.embedded-io-async]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +delta = "0.6.1 -> 0.7.0" +notes = "Delta 0.6.1->0.7.0: No unsafe. Build script removed (AFIT now stable). flush() made required, BufRead requires Read, new VecDeque impls. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.embedded-mcu-hal]] who = "Jerry Xie " criteria = "safe-to-deploy" @@ -219,6 +417,18 @@ criteria = "safe-to-deploy" version = "0.3.0" notes = "ODP crates are always trusted." +[[audits.embedded-storage]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "0.3.1" +notes = "Pure no_std storage abstraction traits. deny(unsafe_code), no build script, no dependencies, no powerful imports. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.embedded-storage-async]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "0.4.1" +notes = "Pure no_std async trait definitions for NOR flash storage. No unsafe code, no build script, no powerful imports. Only dependency is embedded-storage. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.env_filter]] who = "Robert Zieba " criteria = "safe-to-run" @@ -229,6 +439,18 @@ who = "Robert Zieba " criteria = "safe-to-run" version = "0.11.8" +[[audits.fixed]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "1.29.0" +notes = "no_std fixed-point number library. Unsafe limited to: bytemuck Pod/Zeroable impls on repr(transparent) types, NonZero::new_unchecked after proven-nonzero guards, unreachable_unchecked in exhaustive remainder logic. Build script probes compiler features in OUT_DIR. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.funty]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "2.0.0" +notes = "Pure trait definitions over Rust primitives. No unsafe, no build script, no proc macros, no powerful imports. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.futures-task]] who = "Jerry Xie " criteria = "safe-to-deploy" @@ -255,6 +477,42 @@ criteria = "safe-to-deploy" delta = "2.5.0 -> 2.6.0" notes = "Big change seems to be a change in the repo URL, but both the old and new URL resolve to the same place so it looks like the author is still in control." +[[audits.hash32]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "0.3.1" +notes = "no_std 32-bit hashing (FNV, MurmurHash3). ~10 unsafe blocks in murmur3.rs for MaybeUninit buffer handling - all sound. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.hashbrown]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +delta = "0.13.2 -> 0.14.5" +notes = "SwissTable hash map delta. Major changes: allocator refactored out of RawTableInner, new InsertSlot type, NEON SIMD for aarch64, allocator-api2 integration, new HashTable API, strict provenance. Extensive unsafe reviewed for soundness. No build script, no proc macros, no powerful imports. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.hashlink]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "0.7.0" +notes = "Reviewed full source. Extensive unsafe for intrusive doubly-linked list (NonNull, MaybeUninit, union Links, unsafe Send/Sync) -- all gated correctly and follow standard patterns. Passes miri. No build script, no proc macros, no FS/net/process access. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.hashlink]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +delta = "0.7.0 -> 0.9.1" +notes = "Delta audit. Migrates from hashbrown::HashMap+NullHasher to hashbrown::HashTable. Adds no_std support. New CursorMut API, retain_with_order, shrink_to_fit. All unsafe follows pre-existing linked-list pointer patterns with guard node sentinel checks. Send/Sync extended with S bounds. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.heapless]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "0.8.0" +notes = "no_std fixed-capacity data structures. Extensive unsafe for MaybeUninit buffer management, lock-free queues (Vyukov MPMC, SPSC), and Treiber stack memory pools with ABA prevention. Patterns mirror std or published algorithms. Build script probes for atomic/LLSC support. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.heapless]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "0.9.2" +notes = "no_std fixed-capacity data structures. Extensive unsafe for MaybeUninit buffers, lock-free queues (Vyukov MPMC, SPSC), Treiber stack pools with ABA prevention (CAS tagged pointers + ARM LLSC). All Send/Sync bounds verified correct. Build script probes for ARM LLSC. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.heck]] who = "Matteo Tullo " criteria = "safe-to-deploy" @@ -275,6 +533,18 @@ who = "jerrysxie " criteria = "safe-to-deploy" version = "2.9.0" +[[audits.indexmap]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +delta = "2.9.0 -> 2.11.0" +notes = "Forward delta audit covering serde_core migration, get_key_value_mut API, and Ord bound relaxation. No unsafe, no build script, no I/O. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.io-uring]] +who = "Jerry Xie " +criteria = "safe-to-run" +delta = "0.5.13 -> 0.7.10" +notes = "Delta audit. Linux io_uring bindings. +15 hand-written unsafe (new from_fd, buffer/file registration APIs). SeqCst fence fix improves atomics correctness. Probe refactored to stack allocation. Build script adds cfg checks only. All unsafe for expected syscall/mmap/fd operations. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.is_terminal_polyfill]] who = "Robert Zieba " criteria = "safe-to-run" @@ -301,16 +571,34 @@ who = "Robert Zieba " criteria = "safe-to-run" version = "0.2.18" +[[audits.kdl]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "6.3.4" +notes = "Pure KDL document language parser/formatter. No unsafe code, no build script, no proc macros, no filesystem/network/process access. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.libc]] who = "Robert Zieba " criteria = "safe-to-run" version = "0.2.172" +[[audits.litrs]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +delta = "0.4.1 -> 0.4.2" +notes = "Delta 0.4.1->0.4.2: Bug fixes for non-ASCII byte string escapes, removes CR LF normalization to align with spec, fixes error span for out-of-range Unicode escapes. No unsafe code, no build script, no powerful imports. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.log]] who = "Jerry Xie " criteria = "safe-to-deploy" delta = "0.4.27 -> 0.4.28" +[[audits.maitake-sync]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "0.2.2" +notes = "No-std async sync primitives. Extensive unsafe for Send/Sync impls, UnsafeCell access under locks/atomics, intrusive linked list nodes, spinlocks -- all follow standard patterns. Uses unreachable_unchecked! macro (panics in debug). No build script, no proc macros. Loom-tested. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.matchers]] who = "Jerry Xie " criteria = "safe-to-deploy" @@ -321,6 +609,24 @@ who = "Robert Zieba " criteria = "safe-to-run" version = "2.7.4" +[[audits.miette]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "7.6.0" +notes = "Diagnostic/error reporting library. Substantial unsafe in eyreish/ module (type-erased vtable pattern forked from eyre): repr(C) layout, TypeId-guarded downcasts, ManuallyDrop -- all sound. std::fs used in one opt-in function. No build script, no proc macros. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.miette-derive]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "7.6.0" +notes = "Proc-macro derive for miette::Diagnostic. No unsafe, no build script, no powerful imports. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.mimxrt600-fcb]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "0.2.1" +notes = "Pure no_std data-definition crate for MIMXRT600 flash config blocks. No unsafe, no build script. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.mimxrt633s-pac]] who = "Robert Zieba " criteria = "safe-to-deploy" @@ -346,16 +652,52 @@ who = "Robert Zieba " criteria = "safe-to-run" version = "0.8.8" +[[audits.mio]] +who = "Jerry Xie " +criteria = "safe-to-run" +delta = "1.0.1 -> 1.0.4" +notes = "Delta 1.0.1->1.0.4: I/O safety trait impls, AIX poll(2) support, windows-sys 0.59 pointer fixes. Unsafe Send/Sync for CompletionPort/Inner sound. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.mutex-traits]] who = "Jerry Xie " criteria = "safe-to-deploy" version = "1.0.1" +[[audits.mycelium-bitfield]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "0.1.5" +notes = "Pure safe no_std bitfield macro crate. No unsafe code, no build script, no proc macros, no dependencies, no powerful imports. Only core:: types used. Assisted-by: copilot-chat:claude-opus-4.6 cargo-vet" + [[audits.nu-ansi-term]] who = "Jerry Xie " criteria = "safe-to-deploy" delta = "0.46.0 -> 0.50.1" +[[audits.num]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +delta = "0.4.0 -> 0.4.3" +notes = "Pure re-export facade crate. Delta is edition bump (2018->2021), MSRV bump (1.31->1.60), and sub-crate version bumps. No unsafe, no build script, no I/O. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.num-bigint]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +delta = "0.4.3 -> 0.4.6" +notes = "Delta 0.4.3->0.4.6: build.rs removed (radix tables now const fn), new x86 inline asm div_wide with safe fallback (sound), new modinv/ConstZero/Euclid/FromBytes APIs, serde OOM mitigation. No fs/net/process access. Assisted-by: copilot-chat:claude-opus-4.6 cargo-vet" + +[[audits.num-complex]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +delta = "0.4.2 -> 0.4.6" +notes = "Delta 0.4.2->0.4.6: edition 2021 upgrade, const ZERO/ONE/I, c32/c64 constructors, rkyv/bytecheck support, powc zero fix, relaxed serde bounds. No new unsafe, no build script, no powerful imports. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.num-iter]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +delta = "0.1.43 -> 0.1.45" +notes = "Delta audit: edition upgrade to 2018, MSRV 1.31, build.rs removed, i128 now unconditional, DoubleEndedIterator uses Integer::dec(). No unsafe, no powerful imports, no_std only. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.num_enum]] who = "Matteo Tullo " criteria = "safe-to-deploy" @@ -395,11 +737,29 @@ who = "Robert Zieba " criteria = "safe-to-run" version = "0.36.7" +[[audits.once_cell]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "1.20.1" +notes = "Single-assignment cells and lazy values. All unsafe reviewed: UnsafeCell access, Send/Sync impls, atomic waiter queue, strict provenance polyfill - all sound with correct bounds. No build script, no proc macros, no powerful imports beyond std::thread/atomic. Assisted-by: copilot-chat:claude-opus-4.6 cargo-vet" + [[audits.once_cell_polyfill]] who = "Robert Zieba " criteria = "safe-to-run" version = "1.70.2" +[[audits.pin-project]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "1.1.10" +notes = "no_std pin-projection helper. Re-exports proc macros from pin-project-internal. Minimal unsafe in __private module (drop guards, UnsafeUnpin forwarding) -- all sound with SAFETY comments. No build script, no powerful imports. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.pin-project-internal]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "1.1.10" +notes = "Proc-macro for pin projection. forbid(unsafe_code) in macro itself. Generated unsafe is sound pin projection (Pin::new_unchecked, get_unchecked_mut) with compile-time safety enforced via trait tricks. No build script, no I/O. Deps: proc-macro2, quote, syn only. Assisted-by: copilot-chat:claude-opus-4.6 cargo-vet" + [[audits.portable-atomic]] who = "Robert Zieba " criteria = "safe-to-deploy" @@ -420,6 +780,12 @@ who = "Jerry Xie " criteria = "safe-to-deploy" version = "1.0.4" +[[audits.radium]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +delta = "0.5.3 -> 0.7.0" +notes = "No unsafe, no proc macros. Build script reads TARGET env only. Delta adds if_atomic! macro, fetch_update method. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.rand_core]] who = "Billy Price " criteria = "safe-to-deploy" @@ -478,6 +844,12 @@ criteria = "safe-to-deploy" delta = "0.6.8 -> 0.6.9" notes = "Trivial delta: metadata, lint config, and doc formatting only. No functional code changes, no unsafe, no build script, no I/O. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" +[[audits.slab]] +who = "Jerry Xie " +criteria = "safe-to-run" +delta = "0.4.8 -> 0.4.11" +notes = "Delta 0.4.8->0.4.11: new get_disjoint_mut uses unsafe (MaybeUninit + raw ptrs) with sound bounds/overlap checks. build.rs removed. No powerful imports. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.smbus-pec]] who = "Matteo Tullo " criteria = "safe-to-deploy" @@ -515,6 +887,12 @@ who = "Robert Zieba " criteria = "safe-to-run" version = "1.45.0" +[[audits.tokio]] +who = "Jerry Xie " +criteria = "safe-to-run" +delta = "1.45.0 -> 1.47.1" +notes = "Delta audit. New SetOnce sync primitive, OwnedNotified, spawn location tracking (tokio_unstable), experimental io_uring behind cfg gate, block_in_place hardening. All new unsafe follows existing patterns with safety comments. No build script, no proc macros. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.tokio-macros]] who = "Robert Zieba " criteria = "safe-to-run" @@ -525,16 +903,34 @@ who = "jerrysxie " criteria = "safe-to-deploy" version = "0.8.22" +[[audits.toml]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +delta = "0.8.22 -> 0.8.23" +notes = "Delta: adds TupleVariant/StructVariant serialization support. All new code is thin wrappers delegating to toml_edit. No unsafe (forbid(unsafe_code)), no build script, no powerful imports. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.toml_datetime]] who = "jerrysxie " criteria = "safe-to-deploy" version = "0.6.9" +[[audits.toml_datetime]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +delta = "0.6.9 -> 0.6.11" +notes = "Delta 0.6.9->0.6.11: parser refactored from char-by-char to lexer-based tokenizer with improved error messages; no unsafe (forbid(unsafe_code)), no build script, no powerful imports. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.toml_edit]] who = "jerrysxie " criteria = "safe-to-deploy" version = "0.22.26" +[[audits.toml_edit]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +delta = "0.22.26 -> 0.22.27" +notes = "Delta: no changes to unsafe code (all pre-existing from_utf8_unchecked on ASCII-validated buffers). Visibility reductions on parser internals, serializer refactoring, new consuming accessors. No build script, no proc macros, no powerful imports. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.tracing-attributes]] who = "Jerry Xie " criteria = "safe-to-deploy" @@ -550,11 +946,23 @@ who = "Jerry Xie " criteria = "safe-to-deploy" delta = "0.1.3 -> 0.2.0" +[[audits.typenum]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "1.18.0" +notes = "Pure no_std type-level numbers crate. forbid(unsafe_code) -- zero unsafe anywhere. Build script only writes generated test code to OUT_DIR. No proc macros, no FFI, no network/filesystem/process access in library. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.ufmt-write]] who = "Jerry Xie " criteria = "safe-to-deploy" version = "0.1.0" +[[audits.unty]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "0.0.4" +notes = "Tiny no_std crate (1 file, ~120 LOC, zero deps). Two unsafe blocks: transmute_copy guarded by TypeId check in unty(), and a dtolnay-pattern transmute in non_static_type_id(). Both documented; no build script, no powerful imports. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.usb-device]] who = "Jerry Xie " criteria = "safe-to-deploy" @@ -571,6 +979,24 @@ criteria = "safe-to-deploy" version = "0.1.1" notes = "No unsafe code; build.rs only sets target atomic cfg via env; no fs/net/process capability use observed; behavior matches value-inspection purpose. Assisted-by: copilot-cli:GPT-5.3-Codex cargo-vet" +[[audits.version_check]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +delta = "0.9.4 -> 0.9.5" +notes = "Delta 0.9.4->0.9.5: documentation-only changes (added feature detection guidance, doc cross-references) and Cargo.toml normalization. No code changes, no unsafe, no new imports. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.virtue]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "0.0.18" +notes = "Proc-macro derive helper library. No unsafe code, no build script. Uses std::fs/std::env only in opt-in export_to_file() debug helper scoped to target/ dir. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.wasi]] +who = "Jerry Xie " +criteria = "safe-to-run" +version = "0.11.1+wasi-snapshot-preview1" +notes = "Auto-generated WASI snapshot-preview1 bindings from Bytecode Alliance. no_std, no build script, zero runtime deps. Unsafe limited to FFI wrappers for WASI host calls and unreachable_unchecked in exhaustive enum match arms. Assisted-by: copilot-chat:claude-opus-4.6 cargo-vet" + [[audits.windows-targets]] who = "Robert Zieba " criteria = "safe-to-run" @@ -621,11 +1047,35 @@ who = "Robert Zieba " criteria = "safe-to-run" version = "0.52.6" +[[audits.winnow]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "0.6.24" +notes = "Direct audit of 0.6.24. Contains fewer unsafe stream APIs than 0.7.10. Retains 4 sound unsafe blocks: 2 repr(transparent) transmutes, 2 from_utf8_unchecked on ASCII-only bytes. No build script, no proc macros. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.winnow]] who = "jerrysxie " criteria = "safe-to-deploy" version = "0.7.10" +[[audits.winnow]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +delta = "0.7.10 -> 0.7.13" +notes = "Delta adds Accumulate impls (Cow str, String, VecDeque), fixes macro PartialEq/PartialOrd, optimizes str::next_token, adds tests, improves docs. No unsafe changes, no build script, no new powerful imports. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.wyz]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "0.5.1" +notes = "Pointer abstraction unsafe in comu.rs delegates to std NonNull ops. wm.rs Send/Sync behind Mutex/RwLock (std+garbage only). Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + +[[audits.yaml-rust2]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +version = "0.9.0" +notes = "Pure YAML parser, no unsafe, no build script, no proc macros. Reviewed version 0.9.0 directly; differences from 0.10.x are minor: hashlink dep range, MSRV, emitter quoting list, scanner reserve(), float parsing guard. Assisted-by: copilot-cli:claude-opus-4.6 cargo-vet" + [[audits.zerocopy]] who = "Matteo Tullo " criteria = "safe-to-deploy" diff --git a/supply-chain/config.toml b/supply-chain/config.toml index b79c103d9..d2b556ca3 100644 --- a/supply-chain/config.toml +++ b/supply-chain/config.toml @@ -22,302 +22,6 @@ audit-as-crates-io = false [policy.keyberon] audit-as-crates-io = false -[[exemptions.ahash]] -version = "0.8.12" -criteria = "safe-to-deploy" - -[[exemptions.az]] -version = "1.2.1" -criteria = "safe-to-deploy" - -[[exemptions.bbq2]] -version = "0.4.2" -criteria = "safe-to-deploy" - -[[exemptions.bincode]] -version = "2.0.1" -criteria = "safe-to-deploy" - -[[exemptions.bincode_derive]] -version = "2.0.1" -criteria = "safe-to-deploy" - -[[exemptions.bitfield]] -version = "0.15.0" -criteria = "safe-to-deploy" - -[[exemptions.bitfield]] -version = "0.17.0" -criteria = "safe-to-deploy" - -[[exemptions.bitfield]] -version = "0.19.2" -criteria = "safe-to-deploy" - -[[exemptions.bitfield-macros]] -version = "0.19.2" -criteria = "safe-to-deploy" - -[[exemptions.bitfield-struct]] -version = "0.10.1" -criteria = "safe-to-deploy" - -[[exemptions.bitvec]] -version = "1.0.1" -criteria = "safe-to-deploy" - -[[exemptions.bytemuck]] -version = "1.23.2" -criteria = "safe-to-deploy" - -[[exemptions.cfg-if]] -version = "1.0.3" -criteria = "safe-to-deploy" - -[[exemptions.convert_case]] -version = "0.6.0" -criteria = "safe-to-deploy" - -[[exemptions.cordyceps]] -version = "0.3.4" -criteria = "safe-to-deploy" - -[[exemptions.crc]] -version = "3.3.0" -criteria = "safe-to-deploy" - -[[exemptions.crc-catalog]] -version = "2.4.0" -criteria = "safe-to-deploy" - -[[exemptions.dd-manifest-tree]] -version = "1.0.0" -criteria = "safe-to-deploy" - -[[exemptions.defmt]] -version = "0.3.100" -criteria = "safe-to-deploy" - -[[exemptions.device-driver]] -version = "1.0.7" -criteria = "safe-to-deploy" - -[[exemptions.device-driver-generation]] -version = "1.0.7" -criteria = "safe-to-deploy" - -[[exemptions.device-driver-macros]] -version = "1.0.7" -criteria = "safe-to-deploy" - -[[exemptions.embassy-embedded-hal]] -version = "0.5.0" -criteria = "safe-to-deploy" - -[[exemptions.embassy-futures]] -version = "0.1.2" -criteria = "safe-to-deploy" - -[[exemptions.embassy-hal-internal]] -version = "0.3.0" -criteria = "safe-to-deploy" - -[[exemptions.embassy-sync]] -version = "0.8.0" -criteria = "safe-to-deploy" - -[[exemptions.embassy-time-driver]] -version = "0.2.1" -criteria = "safe-to-deploy" - -[[exemptions.embedded-hal]] -version = "1.0.0" -criteria = "safe-to-deploy" - -[[exemptions.embedded-hal-async]] -version = "1.0.0" -criteria = "safe-to-deploy" - -[[exemptions.embedded-hal-nb]] -version = "1.0.0" -criteria = "safe-to-deploy" - -[[exemptions.embedded-io]] -version = "0.7.1" -criteria = "safe-to-deploy" - -[[exemptions.embedded-io-async]] -version = "0.6.1" -criteria = "safe-to-deploy" - -[[exemptions.embedded-io-async]] -version = "0.7.0" -criteria = "safe-to-deploy" - -[[exemptions.embedded-storage]] -version = "0.3.1" -criteria = "safe-to-deploy" - -[[exemptions.embedded-storage-async]] -version = "0.4.1" -criteria = "safe-to-deploy" - -[[exemptions.fixed]] -version = "1.29.0" -criteria = "safe-to-deploy" - -[[exemptions.funty]] -version = "2.0.0" -criteria = "safe-to-deploy" - [[exemptions.generator]] version = "0.8.5" criteria = "safe-to-deploy" - -[[exemptions.hash32]] -version = "0.3.1" -criteria = "safe-to-deploy" - -[[exemptions.hashbrown]] -version = "0.14.5" -criteria = "safe-to-deploy" - -[[exemptions.hashlink]] -version = "0.9.1" -criteria = "safe-to-deploy" - -[[exemptions.heapless]] -version = "0.8.0" -criteria = "safe-to-deploy" - -[[exemptions.heapless]] -version = "0.9.2" -criteria = "safe-to-deploy" - -[[exemptions.indexmap]] -version = "2.11.0" -criteria = "safe-to-deploy" - -[[exemptions.io-uring]] -version = "0.7.10" -criteria = "safe-to-run" - -[[exemptions.kdl]] -version = "6.3.4" -criteria = "safe-to-deploy" - -[[exemptions.litrs]] -version = "0.4.2" -criteria = "safe-to-deploy" - -[[exemptions.maitake-sync]] -version = "0.2.2" -criteria = "safe-to-deploy" - -[[exemptions.miette]] -version = "7.6.0" -criteria = "safe-to-deploy" - -[[exemptions.miette-derive]] -version = "7.6.0" -criteria = "safe-to-deploy" - -[[exemptions.mimxrt600-fcb]] -version = "0.2.2" -criteria = "safe-to-deploy" - -[[exemptions.mio]] -version = "1.0.4" -criteria = "safe-to-run" - -[[exemptions.mycelium-bitfield]] -version = "0.1.5" -criteria = "safe-to-deploy" - -[[exemptions.num]] -version = "0.4.3" -criteria = "safe-to-deploy" - -[[exemptions.num-bigint]] -version = "0.4.6" -criteria = "safe-to-deploy" - -[[exemptions.num-complex]] -version = "0.4.6" -criteria = "safe-to-deploy" - -[[exemptions.num-iter]] -version = "0.1.45" -criteria = "safe-to-deploy" - -[[exemptions.once_cell]] -version = "1.21.3" -criteria = "safe-to-deploy" - -[[exemptions.pin-project]] -version = "1.1.10" -criteria = "safe-to-deploy" - -[[exemptions.pin-project-internal]] -version = "1.1.10" -criteria = "safe-to-deploy" - -[[exemptions.radium]] -version = "0.7.0" -criteria = "safe-to-deploy" - -[[exemptions.slab]] -version = "0.4.11" -criteria = "safe-to-run" - -[[exemptions.tokio]] -version = "1.47.1" -criteria = "safe-to-run" - -[[exemptions.toml]] -version = "0.8.23" -criteria = "safe-to-deploy" - -[[exemptions.toml_datetime]] -version = "0.6.11" -criteria = "safe-to-deploy" - -[[exemptions.toml_edit]] -version = "0.22.27" -criteria = "safe-to-deploy" - -[[exemptions.typenum]] -version = "1.18.0" -criteria = "safe-to-deploy" - -[[exemptions.unty]] -version = "0.0.4" -criteria = "safe-to-deploy" - -[[exemptions.version_check]] -version = "0.9.5" -criteria = "safe-to-deploy" - -[[exemptions.virtue]] -version = "0.0.18" -criteria = "safe-to-deploy" - -[[exemptions.wasi]] -version = "0.11.1+wasi-snapshot-preview1" -criteria = "safe-to-run" - -[[exemptions.winnow]] -version = "0.6.24" -criteria = "safe-to-deploy" - -[[exemptions.winnow]] -version = "0.7.13" -criteria = "safe-to-deploy" - -[[exemptions.wyz]] -version = "0.5.1" -criteria = "safe-to-deploy" - -[[exemptions.yaml-rust2]] -version = "0.9.0" -criteria = "safe-to-deploy" diff --git a/supply-chain/imports.lock b/supply-chain/imports.lock index 3fff0359b..edf4c338a 100644 --- a/supply-chain/imports.lock +++ b/supply-chain/imports.lock @@ -398,6 +398,12 @@ criteria = "safe-to-deploy" version = "0.2.7" aggregated-from = "https://raw.githubusercontent.com/OpenDevicePartnership/mcxa-pac/refs/heads/main/supply-chain/audits.toml" +[[audits.OpenDevicePartnership.audits.mimxrt600-fcb]] +who = "Jerry Xie " +criteria = "safe-to-deploy" +delta = "0.2.1 -> 0.2.2" +aggregated-from = "https://raw.githubusercontent.com/OpenDevicePartnership/embassy-imxrt/refs/heads/main/supply-chain/audits.toml" + [[audits.OpenDevicePartnership.audits.proc-macro-error-attr2]] who = "Felipe Balbi " criteria = "safe-to-deploy" @@ -480,6 +486,12 @@ criteria = "safe-to-deploy" delta = "2.7.0 -> 2.9.4" notes = "Tweaks to the macro, nothing out of order." +[[audits.bytecode-alliance.audits.cfg-if]] +who = "Alex Crichton " +criteria = "safe-to-deploy" +version = "1.0.0" +notes = "I am the author of this crate." + [[audits.bytecode-alliance.audits.embedded-io]] who = "Alex Crichton " criteria = "safe-to-deploy" @@ -513,6 +525,18 @@ who = "Pat Hickey " criteria = "safe-to-deploy" delta = "0.3.28 -> 0.3.31" +[[audits.bytecode-alliance.audits.hashbrown]] +who = "Chris Fallin " +criteria = "safe-to-deploy" +delta = "0.12.3 -> 0.13.1" +notes = "The diff looks plausible. Much of it is low-level memory-layout code and I can't be 100% certain without a deeper dive into the implementation logic, but nothing looks actively malicious." + +[[audits.bytecode-alliance.audits.hashbrown]] +who = "Trevor Elliott " +criteria = "safe-to-deploy" +delta = "0.13.1 -> 0.13.2" +notes = "I read through the diff between v0.13.1 and v0.13.2, and verified that the changes made matched up with the changelog entries. There were very few changes between these two releases, and it was easy to verify what they did." + [[audits.bytecode-alliance.audits.hashbrown]] who = "Chris Fallin " criteria = "safe-to-deploy" @@ -671,6 +695,67 @@ Additional review comments can be found at https://crrev.com/c/4723145/31 """ aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" +[[audits.google.audits.bytemuck]] +who = "Lukasz Anforowicz " +criteria = "safe-to-deploy" +version = "1.16.3" +notes = """ +Review notes from the original audit (of 1.14.3) may be found in +https://crrev.com/c/5362675. Note that this audit has initially missed UB risk +that was fixed in 1.16.2 - see https://github.com/Lokathor/bytemuck/pull/258. +Because of this, the original audit has been edited to certify version `1.16.3` +instead (see also https://crrev.com/c/5771867). +""" +aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" + +[[audits.google.audits.bytemuck]] +who = "Lukasz Anforowicz " +criteria = "safe-to-deploy" +delta = "1.16.3 -> 1.17.1" +notes = "Unsafe review comments can be found in https://crrev.com/c/5813463" +aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" + +[[audits.google.audits.bytemuck]] +who = "Adrian Taylor " +criteria = "safe-to-deploy" +delta = "1.17.1 -> 1.18.0" +notes = "No code changes - just altering feature flag arrangements" +aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" + +[[audits.google.audits.bytemuck]] +who = "Adrian Taylor " +criteria = "safe-to-deploy" +delta = "1.18.0 -> 1.19.0" +notes = "No code changes - just comment changes and adding the track_caller attribute." +aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" + +[[audits.google.audits.bytemuck]] +who = "Lukasz Anforowicz " +criteria = "safe-to-deploy" +delta = "1.19.0 -> 1.20.0" +notes = "`unsafe` review can be found at https://crrev.com/c/6096767" +aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" + +[[audits.google.audits.bytemuck]] +who = "Adrian Taylor " +criteria = "safe-to-deploy" +delta = "1.20.0 -> 1.21.0" +notes = "Unsafe review at https://chromium-review.googlesource.com/c/chromium/src/+/6111154/" +aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" + +[[audits.google.audits.bytemuck]] +who = "Daniel Cheng " +criteria = "safe-to-deploy" +delta = "1.21.0 -> 1.22.0" +notes = """ +This adds new instances of unsafe, but the uses are justified: +- BoxBytes is essentially a Box<[u8], which is Send + Sync, so also marking BoxBytes as Send + Sync is justified. +- core::num::Saturating meets the criteria for Zeroable + Pod, so marking it as such is justified. + +See https://crrev.com/c/6321863 for more audit notes. +""" +aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" + [[audits.google.audits.byteorder]] who = "danakj " criteria = "safe-to-deploy" @@ -732,6 +817,37 @@ delta = "0.3.1 -> 0.3.2" notes = "Still no unsafe" aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" +[[audits.google.audits.indexmap]] +who = "Lukasz Anforowicz " +criteria = "safe-to-deploy" +version = "2.7.1" +notes = ''' +Grepped for `-i cipher`, `-i crypto`, `'\bfs\b'`, `'\bnet\b'` +and there were no hits. + +There is a little bit of `unsafe` Rust code - the audit can be found at +https://chromium-review.googlesource.com/c/chromium/src/+/6187726/2 +''' +aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" + +[[audits.google.audits.indexmap]] +who = "Lukasz Anforowicz " +criteria = "safe-to-deploy" +delta = "2.7.1 -> 2.8.0" +notes = """ +No `unsafe` introduced or affected in: +* `indexmap_with_default!` and `indexset_with_default!` macros +* New `PartialEq` implementations +* `fn slice_eq` in `util.rs` +""" +aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" + +[[audits.google.audits.io-uring]] +who = "George Burgess IV " +criteria = "safe-to-run" +version = "0.5.13" +aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT" + [[audits.google.audits.itoa]] who = "Lukasz Anforowicz " criteria = "safe-to-deploy" @@ -801,6 +917,12 @@ describe in the review doc. """ aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" +[[audits.google.audits.mio]] +who = "Vovo Yang " +criteria = "safe-to-run" +version = "0.8.8" +aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT" + [[audits.google.audits.nb]] who = "George Burgess IV " criteria = "safe-to-deploy" @@ -826,6 +948,12 @@ version = "0.1.46" notes = "Contains no unsafe" aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" +[[audits.google.audits.num-iter]] +who = "George Burgess IV " +criteria = "safe-to-deploy" +version = "0.1.43" +aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT" + [[audits.google.audits.num-rational]] who = "Manish Goregaokar " criteria = "safe-to-deploy" @@ -1235,6 +1363,12 @@ delta = "1.0.218 -> 1.0.219" notes = "Minor changes (clippy tweaks, using `mem::take` instead of `mem::replace`)." aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" +[[audits.google.audits.slab]] +who = "Android Legacy" +criteria = "safe-to-run" +version = "0.4.7" +aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT" + [[audits.google.audits.stable_deref_trait]] who = "Manish Goregaokar " criteria = "safe-to-deploy" @@ -1292,6 +1426,12 @@ delta = "1.0.16 -> 1.0.18" notes = "Only minor comment and documentation updates." aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" +[[audits.google.audits.version_check]] +who = "George Burgess IV " +criteria = "safe-to-deploy" +version = "0.9.4" +aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT" + [[audits.google.audits.void]] who = "George Burgess IV " criteria = "safe-to-deploy" @@ -1504,12 +1644,83 @@ criteria = "safe-to-deploy" delta = "1.8.3 -> 2.5.0" aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" +[[audits.mozilla.audits.hashbrown]] +who = "Mike Hommey " +criteria = "safe-to-deploy" +version = "0.12.3" +notes = "This version is used in rust's libstd, so effectively we're already trusting it" +aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" + [[audits.mozilla.audits.hashbrown]] who = "Erich Gubler " criteria = "safe-to-deploy" delta = "0.15.2 -> 0.15.5" aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" +[[audits.mozilla.audits.indexmap]] +who = "Erich Gubler " +criteria = "safe-to-deploy" +delta = "2.8.0 -> 2.11.4" +aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" + +[[audits.mozilla.audits.litrs]] +who = "Erich Gubler " +criteria = "safe-to-deploy" +version = "0.4.1" +aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" + +[[audits.mozilla.audits.mio]] +who = "Mike Hommey " +criteria = "safe-to-deploy" +delta = "0.8.8 -> 1.0.1" +aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" + +[[audits.mozilla.audits.num]] +who = "Josh Stone " +criteria = "safe-to-deploy" +version = "0.4.0" +notes = "All code written or reviewed by Josh Stone." +aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" + +[[audits.mozilla.audits.num-bigint]] +who = "Josh Stone " +criteria = "safe-to-deploy" +version = "0.4.3" +notes = "All code written or reviewed by Josh Stone." +aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" + +[[audits.mozilla.audits.num-complex]] +who = "Josh Stone " +criteria = "safe-to-deploy" +version = "0.4.2" +notes = "All code written or reviewed by Josh Stone." +aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" + +[[audits.mozilla.audits.once_cell]] +who = "Erich Gubler " +criteria = "safe-to-deploy" +delta = "1.20.1 -> 1.20.2" +notes = "This update works around a Cargo bug that forces the addition of `portable-atomic` into a lockfile, which we have never needed to use." +aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" + +[[audits.mozilla.audits.once_cell]] +who = "Erich Gubler " +criteria = "safe-to-deploy" +delta = "1.20.2 -> 1.20.3" +aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" + +[[audits.mozilla.audits.once_cell]] +who = "Erich Gubler " +criteria = "safe-to-deploy" +delta = "1.20.3 -> 1.21.1" +aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" + +[[audits.mozilla.audits.once_cell]] +who = "Erich Gubler " +criteria = "safe-to-deploy" +delta = "1.21.1 -> 1.21.3" +aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" + [[audits.mozilla.audits.percent-encoding]] who = "Valentin Gosu " criteria = "safe-to-deploy" @@ -1544,6 +1755,20 @@ Only functional change is to work around a bug in the negative_impls feature """ aggregated-from = "https://raw.githubusercontent.com/mozilla/cargo-vet/main/supply-chain/audits.toml" +[[audits.mozilla.audits.radium]] +who = "Nika Layzell " +criteria = "safe-to-deploy" +version = "0.5.3" +notes = """ +I am no longer the primary maintainer of `radium`, however I have audited the +code to ensure it is still correct. The implementation contains no `unsafe` +logic, and will not abstract away `Sync` trait bounds. + +The core logic is very simple, and acts as an abstraction trait for `Cell` +and `AtomicT`. +""" +aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" + [[audits.mozilla.audits.rustc-hash]] who = "Bobby Holley " criteria = "safe-to-deploy" @@ -1576,6 +1801,12 @@ criteria = "safe-to-deploy" delta = "1.1.0 -> 1.3.0" aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" +[[audits.mozilla.audits.slab]] +who = "Mike Hommey " +criteria = "safe-to-deploy" +delta = "0.4.7 -> 0.4.8" +aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" + [[audits.mozilla.audits.tracing]] who = "Alex Franchuk " criteria = "safe-to-deploy" @@ -1634,3 +1865,9 @@ who = "Mark Hammond " criteria = "safe-to-deploy" delta = "0.3.19 -> 0.3.20" aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" + +[[audits.mozilla.audits.yaml-rust2]] +who = "Lars Eggert " +criteria = "safe-to-deploy" +version = "0.10.3" +aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" From a30dc1dc04e3d40d06abb07f5bebb4a84c398997 Mon Sep 17 00:00:00 2001 From: Felipe Balbi Date: Wed, 29 Apr 2026 10:02:55 -0700 Subject: [PATCH 4/7] BREAKING CHANGE: bump heapless to 0.9.2 (#819) This bumps the workspace `heapless` dependency from `0.8.*` to a pinned `0.9.2` (heapless 0.9.0/0.9.1 were yanked). Because every public type that exposes heapless containers is now backed by a different major version, this is a breaking change for every downstream consumer of any `embedded-services` workspace crate (`embedded-service`, `cfu-service`, `thermal-service`, `type-c-service`, `power-policy-service`, `battery-service`, etc.). Downstream consumers MUST also bump their own `heapless` dependency to `0.9` or accept multi-major heapless in their lockfile. Direct users of the affected APIs will need to update calls/types per the heapless 0.9 migration notes (see below). Heapless 0.9 source migration applied here: - `heapless::FnvIndexSet` moved to `heapless::index_set::FnvIndexSet`. Fixed in `power-policy-service/src/lib.rs` (`connected_providers`) and `type-c-service/src/service/ucsi.rs` (`valid_battery_charging_capability`). - No use of `heapless::HistoryBuffer` / `MpMcQueue` / `Q*` aliases / `histbuf` module / `defmt-03` feature in this workspace, so no further source/feature edits were required. - `Vec::extend_from_slice`/`from_slice`/`resize` and `String::push`/`push_str` now return `CapacityError` instead of `()`; the workspace doesn't pattern-match these as `Err(())`, so no callsite updates were needed. Opportunistic version bumps applied alongside (kept embassy-time stack in sync so heapless 0.9 actually reaches the active workspace): - `embassy-time`: `0.5.0` -> `0.5.1` - `embassy-time-driver`: `0.2.1` -> `0.2.2` - `embassy-time-queue-utils` lockfile pin: `0.3.0` -> `0.3.2` (0.3.0 still pinned heapless 0.8 transitively) Also bumps `embassy-time` patch in the three example workspaces (`examples/rt633`, `examples/rt685s-evk`, `examples/std`). Final per-workspace heapless lockfile states (tracked for the org-wide audit): - root, examples/{rt633, rt685s-evk, std}: `0.8.0` + `0.9.2` - `embedded-service/Cargo.lock`, `power-policy-service/Cargo.lock`: unchanged (these subdir lockfiles are not part of any workspace -- `cargo locate-project --workspace` from those directories returns the root manifest, so cargo never touches them. They are stale orphans and retain `0.7.17` + `0.8.0`. Not deleted in this commit because they are still being touched by unrelated PRs; flag for separate cleanup.) Remaining heapless 0.8.0 in active lockfiles is held there by upstream deps that haven't bumped yet: - `tps6699x` (git, pins `heapless = "0.8.0"`) - `keyberon` (git master, pins heapless 0.8 -- via `keyboard-service`) - `usb-device 0.3.2` (latest crates.io -- via `keyberon`) cargo-deny: also adds `RUSTSEC-2026-0110` (bare-metal, unmaintained) to `deny.toml`'s `advisories.ignore` list, matching the precedent set for `RUSTSEC-2024-0370`. Local `cargo deny --all-features --locked check bans licenses sources` is green; the `advisories` sub-check is skipped locally only because cargo-deny 0.18.2 trips on the CVSS 4.0 advisory `RUSTSEC-2026-0066` (astral-tokio-tar) -- CI's `cargo-deny-action` wrapper uses a newer cargo-deny that handles it. cargo-vet: certifies `embassy-time-queue-utils 0.3.0 -> 0.3.2` as `safe-to-deploy` (only audit needed; other delta versions were already covered or matched existing audits). Local CI replicated and green: - `cargo fmt --all --check` - `cargo machete` - `cargo doc --no-deps -F log --locked` and `-F defmt --locked` - `cargo hack --feature-powerset --mutually-exclusive-features=log,defmt,defmt-timestamp-uptime clippy --locked --target x86_64-pc-windows-msvc` - `cargo +1.90 check -F log --locked` and `-F defmt --locked` - `cargo clippy --target thumbv8m.main-none-eabihf --locked` for both ARM examples; `cargo clippy --locked` for the std example - `cargo deny --all-features --locked check bans licenses sources` - `cargo vet` (`cargo test` skipped locally: the workspace's test build pulls defmt/cortex-m via `debug-service` and links unconditionally, which does not work on the Windows MSVC host even on `main`. CI runs it on Ubuntu where it does work.) Assisted-by: Claude:claude-opus-4.7 Co-authored-by: Felipe Balbi --- Cargo.lock | 16 ++++++++-------- Cargo.toml | 6 +++--- deny.toml | 1 + examples/rt633/Cargo.lock | 16 ++++++++-------- examples/rt633/Cargo.toml | 2 +- examples/rt685s-evk/Cargo.lock | 20 ++++++++++---------- examples/rt685s-evk/Cargo.toml | 2 +- examples/std/Cargo.lock | 24 ++++++++++++------------ examples/std/Cargo.toml | 2 +- power-policy-service/src/lib.rs | 2 +- supply-chain/audits.toml | 5 +++++ type-c-service/src/service/ucsi.rs | 2 +- 12 files changed, 52 insertions(+), 46 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6b268365d..d269e019f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -325,7 +325,7 @@ dependencies = [ "embassy-time", "embedded-cfu-protocol", "embedded-services", - "heapless 0.8.0", + "heapless 0.9.2", "log", ] @@ -667,12 +667,12 @@ dependencies = [ [[package]] name = "embassy-time-queue-utils" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e2ee86063bd028a420a5fb5898c18c87a8898026da1d4c852af2c443d0a454" +checksum = "168297bf80aaf114b3c9ad589bf38b01b3009b9af7f97cd18086c5bbf96f5693" dependencies = [ "embassy-executor-timer-queue", - "heapless 0.8.0", + "heapless 0.9.2", ] [[package]] @@ -850,7 +850,7 @@ dependencies = [ "embedded-batteries-async", "embedded-cfu-protocol", "embedded-usb-pd", - "heapless 0.8.0", + "heapless 0.9.2", "log", "mctp-rs", "num_enum", @@ -1611,7 +1611,7 @@ dependencies = [ "embassy-sync", "embassy-time", "embedded-services", - "heapless 0.8.0", + "heapless 0.9.2", "log", ] @@ -1986,7 +1986,7 @@ dependencies = [ "embedded-fans-async", "embedded-sensors-hal-async", "embedded-services", - "heapless 0.8.0", + "heapless 0.9.2", "log", "uuid", ] @@ -2198,7 +2198,7 @@ dependencies = [ "embedded-hal-async", "embedded-services", "embedded-usb-pd", - "heapless 0.8.0", + "heapless 0.9.2", "log", "static_cell", "tokio", diff --git a/Cargo.toml b/Cargo.toml index 91141b26c..0d445152f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -57,8 +57,8 @@ defmt = "0.3" embassy-futures = "0.1.2" embassy-imxrt = { git = "https://github.com/OpenDevicePartnership/embassy-imxrt" } embassy-sync = "0.8" -embassy-time = "0.5.0" -embassy-time-driver = "0.2.1" +embassy-time = "0.5.1" +embassy-time-driver = "0.2.2" embedded-batteries-async = "0.3" embedded-cfu-protocol = { git = "https://github.com/OpenDevicePartnership/embedded-cfu" } embedded-hal = "1.0" @@ -69,7 +69,7 @@ embedded-usb-pd = { git = "https://github.com/OpenDevicePartnership/embedded-usb mctp-rs = { git = "https://github.com/dymk/mctp-rs" } num_enum = { version = "0.7.5", default-features = false } portable-atomic = { version = "1.11", default-features = false } -heapless = "0.8.*" +heapless = "0.9.2" log = "0.4" proc-macro2 = "1.0" quote = "1.0" diff --git a/deny.toml b/deny.toml index d856b23a2..e4ce30f88 100644 --- a/deny.toml +++ b/deny.toml @@ -78,6 +78,7 @@ ignore = [ { id = "RUSTSEC-2024-0436", reason = "there are no suitable replacements for paste right now; paste has been archived as read-only. It only affects compile time concatenation in macros. We will allow it for now" }, { id = "RUSTSEC-2023-0089", reason = "this is a deprecation warning for a dependency of a dependency. https://github.com/jamesmunns/postcard/issues/223 tracks fixing the dependency; until that's resolved, we can accept the deprecated code as it has no known vulnerabilities." }, { id = "RUSTSEC-2025-0141", reason = "bincode is unmaintained, planning on migrating to an alternative." }, + { id = "RUSTSEC-2026-0110", reason = "bare-metal is unmaintained, no safe upgrade available, need upstream dependencies to migrate away from it." }, ] # If this is true, then cargo deny will use the git executable to fetch advisory database. # If this is false, then it uses a built-in git library. diff --git a/examples/rt633/Cargo.lock b/examples/rt633/Cargo.lock index ea5a74a7d..2396b7838 100644 --- a/examples/rt633/Cargo.lock +++ b/examples/rt633/Cargo.lock @@ -538,9 +538,9 @@ dependencies = [ [[package]] name = "embassy-time" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa65b9284d974dad7a23bb72835c4ec85c0b540d86af7fc4098c88cff51d65" +checksum = "592b0c143ec626e821d4d90da51a2bd91d559d6c442b7c74a47d368c9e23d97a" dependencies = [ "cfg-if", "critical-section", @@ -555,21 +555,21 @@ dependencies = [ [[package]] name = "embassy-time-driver" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0a244c7dc22c8d0289379c8d8830cae06bb93d8f990194d0de5efb3b5ae7ba6" +checksum = "6ee71af1b3a0deaa53eaf2d39252f83504c853646e472400b763060389b9fcc9" dependencies = [ "document-features", ] [[package]] name = "embassy-time-queue-utils" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e2ee86063bd028a420a5fb5898c18c87a8898026da1d4c852af2c443d0a454" +checksum = "168297bf80aaf114b3c9ad589bf38b01b3009b9af7f97cd18086c5bbf96f5693" dependencies = [ "embassy-executor-timer-queue", - "heapless 0.8.0", + "heapless 0.9.2", ] [[package]] @@ -713,7 +713,7 @@ dependencies = [ "embedded-batteries-async", "embedded-cfu-protocol", "embedded-usb-pd", - "heapless 0.8.0", + "heapless 0.9.2", "mctp-rs", "num_enum", "portable-atomic", diff --git a/examples/rt633/Cargo.toml b/examples/rt633/Cargo.toml index 74a946154..80b1d6b29 100644 --- a/examples/rt633/Cargo.toml +++ b/examples/rt633/Cargo.toml @@ -39,7 +39,7 @@ embassy-executor = { version = "0.10.0", features = [ "executor-interrupt", "defmt", ] } -embassy-time = { version = "0.5.0", features = [ +embassy-time = { version = "0.5.1", features = [ "defmt", "defmt-timestamp-uptime", ] } diff --git a/examples/rt685s-evk/Cargo.lock b/examples/rt685s-evk/Cargo.lock index 4d0891480..0f7446af1 100644 --- a/examples/rt685s-evk/Cargo.lock +++ b/examples/rt685s-evk/Cargo.lock @@ -649,9 +649,9 @@ dependencies = [ [[package]] name = "embassy-time" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa65b9284d974dad7a23bb72835c4ec85c0b540d86af7fc4098c88cff51d65" +checksum = "592b0c143ec626e821d4d90da51a2bd91d559d6c442b7c74a47d368c9e23d97a" dependencies = [ "cfg-if", "critical-section", @@ -666,21 +666,21 @@ dependencies = [ [[package]] name = "embassy-time-driver" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0a244c7dc22c8d0289379c8d8830cae06bb93d8f990194d0de5efb3b5ae7ba6" +checksum = "6ee71af1b3a0deaa53eaf2d39252f83504c853646e472400b763060389b9fcc9" dependencies = [ "document-features", ] [[package]] name = "embassy-time-queue-utils" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e2ee86063bd028a420a5fb5898c18c87a8898026da1d4c852af2c443d0a454" +checksum = "168297bf80aaf114b3c9ad589bf38b01b3009b9af7f97cd18086c5bbf96f5693" dependencies = [ "embassy-executor-timer-queue", - "heapless 0.8.0", + "heapless 0.9.2", ] [[package]] @@ -827,7 +827,7 @@ dependencies = [ "embedded-batteries-async", "embedded-cfu-protocol", "embedded-usb-pd", - "heapless 0.8.0", + "heapless 0.9.2", "mctp-rs", "num_enum", "portable-atomic", @@ -1396,7 +1396,7 @@ dependencies = [ "embassy-sync 0.8.0", "embassy-time", "embedded-services", - "heapless 0.8.0", + "heapless 0.9.2", ] [[package]] @@ -1821,7 +1821,7 @@ dependencies = [ "embedded-hal-async", "embedded-services", "embedded-usb-pd", - "heapless 0.8.0", + "heapless 0.9.2", "static_cell", "tps6699x", ] diff --git a/examples/rt685s-evk/Cargo.toml b/examples/rt685s-evk/Cargo.toml index 6d06f1c04..9206fc641 100644 --- a/examples/rt685s-evk/Cargo.toml +++ b/examples/rt685s-evk/Cargo.toml @@ -42,7 +42,7 @@ embassy-executor = { version = "0.10.0", features = [ "defmt", ] } embassy-futures = "0.1.2" -embassy-time = { version = "0.5.0", features = [ +embassy-time = { version = "0.5.1", features = [ "defmt", "defmt-timestamp-uptime", ] } diff --git a/examples/std/Cargo.lock b/examples/std/Cargo.lock index 3bf91ec45..7f94b690f 100644 --- a/examples/std/Cargo.lock +++ b/examples/std/Cargo.lock @@ -268,7 +268,7 @@ dependencies = [ "embassy-time", "embedded-cfu-protocol", "embedded-services", - "heapless 0.8.0", + "heapless 0.9.2", "log", ] @@ -543,9 +543,9 @@ dependencies = [ [[package]] name = "embassy-time" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa65b9284d974dad7a23bb72835c4ec85c0b540d86af7fc4098c88cff51d65" +checksum = "592b0c143ec626e821d4d90da51a2bd91d559d6c442b7c74a47d368c9e23d97a" dependencies = [ "cfg-if", "critical-section", @@ -561,21 +561,21 @@ dependencies = [ [[package]] name = "embassy-time-driver" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0a244c7dc22c8d0289379c8d8830cae06bb93d8f990194d0de5efb3b5ae7ba6" +checksum = "6ee71af1b3a0deaa53eaf2d39252f83504c853646e472400b763060389b9fcc9" dependencies = [ "document-features", ] [[package]] name = "embassy-time-queue-utils" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e2ee86063bd028a420a5fb5898c18c87a8898026da1d4c852af2c443d0a454" +checksum = "168297bf80aaf114b3c9ad589bf38b01b3009b9af7f97cd18086c5bbf96f5693" dependencies = [ "embassy-executor-timer-queue", - "heapless 0.8.0", + "heapless 0.9.2", ] [[package]] @@ -741,7 +741,7 @@ dependencies = [ "embedded-batteries-async", "embedded-cfu-protocol", "embedded-usb-pd", - "heapless 0.8.0", + "heapless 0.9.2", "log", "mctp-rs", "num_enum", @@ -1300,7 +1300,7 @@ dependencies = [ "embassy-sync", "embassy-time", "embedded-services", - "heapless 0.8.0", + "heapless 0.9.2", "log", ] @@ -1614,7 +1614,7 @@ dependencies = [ "embedded-fans-async", "embedded-sensors-hal-async", "embedded-services", - "heapless 0.8.0", + "heapless 0.9.2", "log", "uuid", ] @@ -1761,7 +1761,7 @@ dependencies = [ "embedded-hal-async", "embedded-services", "embedded-usb-pd", - "heapless 0.8.0", + "heapless 0.9.2", "log", "static_cell", "tps6699x", diff --git a/examples/std/Cargo.toml b/examples/std/Cargo.toml index d3904d747..b8b092ab2 100644 --- a/examples/std/Cargo.toml +++ b/examples/std/Cargo.toml @@ -16,7 +16,7 @@ workspace = true [dependencies] embassy-sync = { version = "0.8", features = ["log", "std"] } -embassy-time = { version = "0.5.0", features = ["log", "std"] } +embassy-time = { version = "0.5.1", features = ["log", "std"] } embassy-executor = { version = "0.10.0", features = [ "platform-std", "executor-thread", diff --git a/power-policy-service/src/lib.rs b/power-policy-service/src/lib.rs index edb205d9c..85c598ad7 100644 --- a/power-policy-service/src/lib.rs +++ b/power-policy-service/src/lib.rs @@ -27,7 +27,7 @@ struct InternalState { /// System unconstrained power unconstrained: UnconstrainedState, /// Connected providers - connected_providers: heapless::FnvIndexSet, + connected_providers: heapless::index_set::FnvIndexSet, } /// Power policy state diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml index c93b214e5..5bb38a458 100644 --- a/supply-chain/audits.toml +++ b/supply-chain/audits.toml @@ -270,6 +270,11 @@ criteria = "safe-to-deploy" delta = "0.2.1 -> 0.2.2" notes = "Rust 2024 edition update with 375kHz tick rate feature. Empty build.rs, no unsafe code, no powerful imports." +[[audits.embassy-time-queue-utils]] +who = "Felipe Balbi " +criteria = "safe-to-deploy" +delta = "0.3.0 -> 0.3.2" + [[audits.embedded-batteries]] who = "Felipe Balbi " criteria = "safe-to-deploy" diff --git a/type-c-service/src/service/ucsi.rs b/type-c-service/src/service/ucsi.rs index e11a16023..033fab414 100644 --- a/type-c-service/src/service/ucsi.rs +++ b/type-c-service/src/service/ucsi.rs @@ -23,7 +23,7 @@ pub(super) struct State { /// /// We provide a battery charging status only after the port has negotiated power. /// This prevents the port from temporarily reporting slow or no charging before the contract has finalized. - valid_battery_charging_capability: heapless::FnvIndexSet, + valid_battery_charging_capability: heapless::index_set::FnvIndexSet, /// PSU connected pub(super) psu_connected: bool, } From 5848b67d3120e557965b0a5d1c10fa6e53cab427 Mon Sep 17 00:00:00 2001 From: Adam Sasine Date: Mon, 4 May 2026 15:39:17 -0700 Subject: [PATCH 5/7] Add port commands for getting Discovered SVIDs, Discover Identity, executing Hard Reset (#820) --- Cargo.lock | 328 +--------------- embedded-service/src/type_c/controller.rs | 179 +++++++++ embedded-service/src/type_c/external.rs | 80 +++- examples/rt633/Cargo.lock | 2 +- examples/rt685s-evk/Cargo.lock | 351 +----------------- examples/std/Cargo.lock | 337 +---------------- .../std/src/lib/type_c/mock_controller.rs | 35 +- supply-chain/audits.toml | 6 + supply-chain/imports.lock | 41 +- type-c-service/src/driver/tps6699x.rs | 64 +++- type-c-service/src/service/port.rs | 52 +++ type-c-service/src/wrapper/pd.rs | 34 ++ 12 files changed, 474 insertions(+), 1035 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d269e019f..3e240778c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,18 +17,6 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" -[[package]] -name = "ahash" -version = "0.8.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - [[package]] name = "aho-corasick" version = "1.1.3" @@ -82,43 +70,6 @@ dependencies = [ "stable_deref_trait", ] -[[package]] -name = "askama" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f75363874b771be265f4ffe307ca705ef6f3baa19011c149da8674a87f1b75c4" -dependencies = [ - "askama_derive", - "itoa", - "percent-encoding", - "serde", - "serde_json", -] - -[[package]] -name = "askama_derive" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "129397200fe83088e8a68407a8e2b1f826cf0086b21ccdb866a722c8bcd3a94f" -dependencies = [ - "askama_parser", - "memchr", - "proc-macro2", - "quote", - "rustc-hash", - "syn 2.0.106", -] - -[[package]] -name = "askama_parser" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6ab5630b3d5eaf232620167977f95eb51f3432fc76852328774afbd242d4358" -dependencies = [ - "memchr", - "winnow 0.7.13", -] - [[package]] name = "autocfg" version = "1.5.0" @@ -335,15 +286,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4bd422bfb4f24a97243f60b6a4443e63d810c925d8da4bb2d8fde26a7c1d57ec" -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "cordyceps" version = "0.3.4" @@ -414,15 +356,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" -[[package]] -name = "dd-manifest-tree" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5793572036e0a6638977c7370c6afc423eac848ee8495f079b8fd3964de7b9f9" -dependencies = [ - "yaml-rust2", -] - [[package]] name = "debug-service" version = "0.1.0" @@ -474,50 +407,20 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" dependencies = [ - "thiserror 2.0.16", + "thiserror", ] [[package]] name = "device-driver" -version = "1.0.7" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af0e43acfcbb0bb3b7435cc1b1dbb33596cacfec1eb243336b74a398e0bd6cbf" +checksum = "c2e4547bd66511372d2a38ac3c1b2892c7ebf83cf0d5411c3406e496c85a1d96" dependencies = [ "defmt 0.3.100", - "device-driver-macros", "embedded-io 0.6.1", "embedded-io-async 0.6.1", ] -[[package]] -name = "device-driver-generation" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3935aec9cf5bb2ab927f59ca69faecf976190390b0ce34c6023889e9041040c0" -dependencies = [ - "anyhow", - "askama", - "bitvec", - "convert_case", - "dd-manifest-tree", - "itertools 0.14.0", - "kdl", - "proc-macro2", - "quote", - "syn 2.0.106", -] - -[[package]] -name = "device-driver-macros" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fdc68ed515c4eddff2e95371185b4becba066085bf36d50f07f09782af98e17" -dependencies = [ - "device-driver-generation", - "proc-macro2", - "syn 2.0.106", -] - [[package]] name = "document-features" version = "0.2.11" @@ -880,7 +783,7 @@ dependencies = [ [[package]] name = "embedded-usb-pd" version = "0.1.0" -source = "git+https://github.com/OpenDevicePartnership/embedded-usb-pd#1a8e79d3a2ac0d2837a34b045087cf0863146f7d" +source = "git+https://github.com/OpenDevicePartnership/embedded-usb-pd#21d0e228d21ddc6ccaeffc01d98ef9a5b87941ef" dependencies = [ "aquamarine", "bincode", @@ -889,15 +792,6 @@ dependencies = [ "embedded-hal-async", ] -[[package]] -name = "encoding_rs" -version = "0.8.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" -dependencies = [ - "cfg-if", -] - [[package]] name = "equivalent" version = "1.0.2" @@ -1007,30 +901,12 @@ dependencies = [ "byteorder", ] -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" -dependencies = [ - "ahash", -] - [[package]] name = "hashbrown" version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" -[[package]] -name = "hashlink" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" -dependencies = [ - "hashbrown 0.14.5", -] - [[package]] name = "heapless" version = "0.8.0" @@ -1096,7 +972,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2481980430f9f78649238835720ddccc57e52df14ffce1c6f37391d61b563e9" dependencies = [ "equivalent", - "hashbrown 0.15.5", + "hashbrown", ] [[package]] @@ -1137,24 +1013,6 @@ dependencies = [ "either", ] -[[package]] -name = "itoa" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" - -[[package]] -name = "kdl" -version = "6.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12661358400b02cbbf1fbd05f0a483335490e8a6bd1867620f2eeb78f304a22f" -dependencies = [ - "miette", - "num", - "thiserror 1.0.69", - "winnow 0.6.24", -] - [[package]] name = "keyberon" version = "0.2.0" @@ -1267,7 +1125,7 @@ dependencies = [ "espi-device", "num_enum", "smbus-pec", - "thiserror 2.0.16", + "thiserror", ] [[package]] @@ -1276,28 +1134,6 @@ version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" -[[package]] -name = "miette" -version = "7.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" -dependencies = [ - "cfg-if", - "miette-derive", - "unicode-width", -] - -[[package]] -name = "miette-derive" -version = "7.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db5b29714e950dbb20d5e6f74f9dcec4edbcc1067bb7f8ed198c097b8c1a818b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.106", -] - [[package]] name = "mimxrt600-fcb" version = "0.2.2" @@ -1389,70 +1225,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "num" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" -dependencies = [ - "num-bigint", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", -] - -[[package]] -name = "num-bigint" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" -dependencies = [ - "num-integer", - "num-traits", -] - -[[package]] -name = "num-complex" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" -dependencies = [ - "num-bigint", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1539,12 +1311,6 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" -[[package]] -name = "percent-encoding" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" - [[package]] name = "pin-project" version = "1.1.10" @@ -1769,12 +1535,6 @@ version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" -[[package]] -name = "rustc-hash" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" - [[package]] name = "rustc_version" version = "0.2.3" @@ -1799,12 +1559,6 @@ version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" -[[package]] -name = "ryu" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" - [[package]] name = "scoped-tls" version = "1.0.1" @@ -1852,18 +1606,6 @@ dependencies = [ "syn 2.0.106", ] -[[package]] -name = "serde_json" -version = "1.0.143" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a" -dependencies = [ - "itoa", - "memchr", - "ryu", - "serde", -] - [[package]] name = "serde_spanned" version = "0.6.9" @@ -1991,33 +1733,13 @@ dependencies = [ "uuid", ] -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl 1.0.69", -] - [[package]] name = "thiserror" version = "2.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3467d614147380f2e4e374161426ff399c91084acd2363eaf549172b3d5e60c0" dependencies = [ - "thiserror-impl 2.0.16", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.106", + "thiserror-impl", ] [[package]] @@ -2098,13 +1820,13 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow 0.7.13", + "winnow", ] [[package]] name = "tps6699x" version = "0.1.0" -source = "git+https://github.com/OpenDevicePartnership/tps6699x#aa3425136216dccfb107bff6b172a49b8972bb70" +source = "git+https://github.com/OpenDevicePartnership/tps6699x#ba1b3b17ebf048fc007eb2107a4d2ab8cb545adf" dependencies = [ "bincode", "bitfield 0.19.2", @@ -2223,18 +1945,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" -[[package]] -name = "unicode-segmentation" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" - -[[package]] -name = "unicode-width" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" - [[package]] name = "unty" version = "0.0.4" @@ -2495,15 +2205,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "winnow" -version = "0.6.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a" -dependencies = [ - "memchr", -] - [[package]] name = "winnow" version = "0.7.13" @@ -2522,17 +2223,6 @@ dependencies = [ "tap", ] -[[package]] -name = "yaml-rust2" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a1a1c0bc9823338a3bdf8c61f994f23ac004c6fa32c08cd152984499b445e8d" -dependencies = [ - "arraydeque", - "encoding_rs", - "hashlink", -] - [[package]] name = "zerocopy" version = "0.8.26" diff --git a/embedded-service/src/type_c/controller.rs b/embedded-service/src/type_c/controller.rs index b367b3473..9de50e2db 100644 --- a/embedded-service/src/type_c/controller.rs +++ b/embedded-service/src/type_c/controller.rs @@ -11,7 +11,9 @@ use embedded_usb_pd::{ ado::Ado, pdinfo::{AltMode, PowerPathStatus}, type_c::ConnectionState, + vdm::structured::Svid, }; +use heapless::Vec; use super::{ATTN_VDM_LEN, ControllerId, OTHER_VDM_LEN, external}; use crate::ipc::deferred; @@ -262,6 +264,66 @@ pub enum TypeCStateMachineState { Disabled, } +/// Response from the `Discover SVIDs REQ` message and the [`PortCommandData::GetDiscoveredSvids`] command. +// Could be changed to hold the heapless::Vec directly if they were Copy or if PortResponseData was not Copy +#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +pub struct DiscoveredSvids { + num_sop: usize, + sop: [Svid; Self::NUM_SVIDS], + + num_sop_prime: usize, + sop_prime: [Svid; Self::NUM_SVIDS], +} + +impl DiscoveredSvids { + /// The number of SVIDs that can be reported in a single [`PortResponseData::DiscoveredSvids`] response. + const NUM_SVIDS: usize = 8; + + /// Create a new response object from `sop` and `sop_prime`. + pub fn new(sop: Vec, sop_prime: Vec) -> Self { + let num_sop = sop.len(); + let num_sop_prime = sop_prime.len(); + + let mut sop_array = [Svid(0); _]; + for (svid, dest) in sop.into_iter().zip(sop_array.iter_mut()) { + *dest = svid; + } + + let mut sop_prime_array = [Svid(0); _]; + for (svid, dest) in sop_prime.into_iter().zip(sop_prime_array.iter_mut()) { + *dest = svid; + } + + Self { + num_sop, + sop: sop_array, + num_sop_prime, + sop_prime: sop_prime_array, + } + } + + /// Returns the number of SVIDs discovered on the SOP port partner. + pub fn number_sop_svids(&self) -> usize { + self.num_sop + } + + /// Returns an iterator over the SVIDs discovered on the SOP port partner. + pub fn svid_sop(&self) -> impl ExactSizeIterator { + self.sop.iter().copied().take(self.num_sop) + } + + /// Returns the number of SVIDs discovered on the SOP' cable plug. + pub fn number_sop_prime_svids(&self) -> usize { + self.num_sop_prime + } + + /// Returns an iterator over the SVIDs discovered on the SOP' cable plug. + pub fn svid_sop_prime(&self) -> impl ExactSizeIterator { + self.sop_prime.iter().copied().take(self.num_sop_prime) + } +} + /// Port-specific command data #[derive(Copy, Clone, Debug)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] @@ -319,6 +381,14 @@ pub enum PortCommandData { }, /// Set the system power state SetSystemPowerState(SystemPowerState), + /// Get the port's discovered SVIDs + GetDiscoveredSvids, + /// Trigger a hard reset on the given port. + HardReset, + /// Get the response to a Discover Identity command sent to the given port with SOP + GetDiscoverIdentitySop, + /// Get the response to a Discover Identity command sent to the given port with SOP' + GetDiscoverIdentitySopPrime, } /// Port-specific commands @@ -363,6 +433,12 @@ pub enum PortResponseData { DpStatus(DpStatus), /// UCSI response UcsiResponse(Result, PdError>), + /// Discovered SVIDs + DiscoveredSvids(DiscoveredSvids), + /// Discover Identity SOP response + DiscoverIdentitySop(embedded_usb_pd::vdm::structured::command::discover_identity::sop::ResponseVdos), + /// Discover Identity SOP' response + DiscoverIdentitySopPrime(embedded_usb_pd::vdm::structured::command::discover_identity::sop_prime::ResponseVdos), } impl PortResponseData { @@ -711,6 +787,37 @@ pub trait Controller { port: LocalPortId, state: SystemPowerState, ) -> impl Future>>; + + /// Get the discovered SVIDs for the given port. + fn get_discovered_svids( + &mut self, + port: LocalPortId, + ) -> impl Future>>; + + /// Trigger a hard reset on the given port. + fn hard_reset(&mut self, port: LocalPortId) -> impl Future>>; + + /// Get the latest response from the Discover Identity command targeting SOP. + fn get_discover_identity_sop_response( + &mut self, + port: LocalPortId, + ) -> impl Future< + Output = Result< + embedded_usb_pd::vdm::structured::command::discover_identity::sop::ResponseVdos, + Error, + >, + >; + + /// Get the latest response from the Discover Identity command targeting SOP'. + fn get_discover_identity_sop_prime_response( + &mut self, + port: LocalPortId, + ) -> impl Future< + Output = Result< + embedded_usb_pd::vdm::structured::command::discover_identity::sop_prime::ResponseVdos, + Error, + >, + >; } /// Internal context for managing PD controllers @@ -771,6 +878,19 @@ pub(super) async fn lookup_controller(controller_id: ControllerId) -> Result<&'s .ok_or(PdError::InvalidController) } +/// Lookup the controller and local port ID for a given global port ID. +pub(super) async fn lookup_global_port( + port_id: GlobalPortId, +) -> Result<(&'static Device<'static>, LocalPortId), PdError> { + for controller in CONTEXT.controllers.iter_only::() { + if let Ok(local_port) = controller.lookup_local_port(port_id) { + return Ok((controller, local_port)); + } + } + + Err(PdError::InvalidPort) +} + /// Get total number of ports on the system pub(super) fn get_num_ports() -> usize { CONTEXT @@ -1285,6 +1405,65 @@ impl ContextToken { } } + /// Get the discovered SVIDs for the given port. + pub async fn get_discovered_svids(&self, port: GlobalPortId) -> Result { + match self + .send_port_command(port, PortCommandData::GetDiscoveredSvids) + .await? + { + PortResponseData::DiscoveredSvids(svids) => Ok(svids), + r => { + error!("Invalid response: expected discovered SVIDs, got {:?}", r); + Err(PdError::InvalidResponse) + } + } + } + + /// Trigger a hard reset on the given port. + pub async fn hard_reset(&self, port: GlobalPortId) -> Result<(), PdError> { + match self.send_port_command(port, PortCommandData::HardReset).await? { + PortResponseData::Complete => Ok(()), + _ => Err(PdError::InvalidResponse), + } + } + + /// Get the latest response from the Discover Identity command targeting SOP. + pub async fn get_discover_identity_sop_response( + &self, + port: GlobalPortId, + ) -> Result { + match self + .send_port_command(port, PortCommandData::GetDiscoverIdentitySop) + .await? + { + PortResponseData::DiscoverIdentitySop(response) => Ok(response), + r => { + error!("Invalid response: expected Discover Identity SOP response, got {:?}", r); + Err(PdError::InvalidResponse) + } + } + } + + /// Get the latest response from the Discover Identity command targeting SOP'. + pub async fn get_discover_identity_sop_prime_response( + &self, + port: GlobalPortId, + ) -> Result { + match self + .send_port_command(port, PortCommandData::GetDiscoverIdentitySopPrime) + .await? + { + PortResponseData::DiscoverIdentitySopPrime(response) => Ok(response), + r => { + error!( + "Invalid response: expected Discover Identity SOP' response, got {:?}", + r + ); + Err(PdError::InvalidResponse) + } + } + } + /// Broadcast a type-C message to all subscribers pub async fn broadcast_message(&self, message: CommsMessage) { CONTEXT.broadcaster.broadcast(message).await; diff --git a/embedded-service/src/type_c/external.rs b/embedded-service/src/type_c/external.rs index 7ebfc0bc0..b86650d1f 100644 --- a/embedded-service/src/type_c/external.rs +++ b/embedded-service/src/type_c/external.rs @@ -6,7 +6,7 @@ use embedded_usb_pd::{GlobalPortId, LocalPortId, PdError, ucsi}; use crate::type_c::{ Cached, controller::{ - PdStateMachineConfig, SystemPowerState, TbtConfig, TypeCStateMachineState, UsbControlConfig, + DiscoveredSvids, PdStateMachineConfig, SystemPowerState, TbtConfig, TypeCStateMachineState, UsbControlConfig, execute_external_ucsi_command, }, }; @@ -15,7 +15,7 @@ use super::{ ControllerId, controller::{ ControllerStatus, DpConfig, DpStatus, PortStatus, RetimerFwUpdateState, SendVdm, - execute_external_controller_command, execute_external_port_command, lookup_controller, + execute_external_controller_command, execute_external_port_command, lookup_controller, lookup_global_port, }, }; @@ -103,6 +103,14 @@ pub enum PortCommandData { }, /// Set the system power state SetSystemPowerState(SystemPowerState), + /// Get the port's discovered SVIDs + GetDiscoveredSvids, + /// Trigger a hard reset on the given port. + HardReset, + /// Get the response to a Discover Identity command sent to the given port with SOP + GetDiscoverIdentitySop, + /// Get the response to a Discover Identity command sent to the given port with SOP' + GetDiscoverIdentitySopPrime, } /// Port-specific commands @@ -127,6 +135,12 @@ pub enum PortResponseData { RetimerFwUpdateGetState(RetimerFwUpdateState), /// Get DisplayPort status GetDpStatus(DpStatus), + /// Get the port's discovered SVIDs + DiscoveredSvids(DiscoveredSvids), + /// Discover Identity response data for SOP + DiscoverIdentitySop(embedded_usb_pd::vdm::structured::command::discover_identity::sop::ResponseVdos), + /// Discover Identity response data for SOP' + DiscoverIdentitySopPrime(embedded_usb_pd::vdm::structured::command::discover_identity::sop_prime::ResponseVdos), } /// Port-specific command response @@ -247,6 +261,12 @@ pub async fn controller_port_to_global_id( lookup_controller(controller_id).await?.lookup_global_port(port_id) } +/// Convert a global port ID to a (controller ID, local port ID) +pub async fn global_port_to_controller_port(global_port: GlobalPortId) -> Result<(ControllerId, LocalPortId), PdError> { + let (controller, local_port) = lookup_global_port(global_port).await?; + Ok((controller.id(), local_port)) +} + /// Get the retimer fw update status of the given port pub async fn port_get_rt_fw_update_status(port: GlobalPortId) -> Result { match execute_external_port_command(Command::Port(PortCommand { @@ -501,3 +521,59 @@ pub async fn set_type_c_state_machine_config(port: GlobalPortId, state: TypeCSta _ => Err(PdError::InvalidResponse), } } + +/// Get the port's discovered SVIDs +pub async fn get_discovered_svids(port: GlobalPortId) -> Result { + match execute_external_port_command(Command::Port(PortCommand { + port, + data: PortCommandData::GetDiscoveredSvids, + })) + .await? + { + PortResponseData::DiscoveredSvids(svids) => Ok(svids), + _ => Err(PdError::InvalidResponse), + } +} + +/// Trigger a hard reset on the given port +pub async fn hard_reset(port: GlobalPortId) -> Result<(), PdError> { + match execute_external_port_command(Command::Port(PortCommand { + port, + data: PortCommandData::HardReset, + })) + .await? + { + PortResponseData::Complete => Ok(()), + _ => Err(PdError::InvalidResponse), + } +} + +/// Get the response to a Discover Identity command sent to the given port with SOP. +pub async fn get_discover_identity_sop_response( + port: GlobalPortId, +) -> Result { + match execute_external_port_command(Command::Port(PortCommand { + port, + data: PortCommandData::GetDiscoverIdentitySop, + })) + .await? + { + PortResponseData::DiscoverIdentitySop(vdos) => Ok(vdos), + _ => Err(PdError::InvalidResponse), + } +} + +/// Get the response to a Discover Identity command sent to the given port with SOP'. +pub async fn get_discover_identity_sop_prime_response( + port: GlobalPortId, +) -> Result { + match execute_external_port_command(Command::Port(PortCommand { + port, + data: PortCommandData::GetDiscoverIdentitySopPrime, + })) + .await? + { + PortResponseData::DiscoverIdentitySopPrime(vdos) => Ok(vdos), + _ => Err(PdError::InvalidResponse), + } +} diff --git a/examples/rt633/Cargo.lock b/examples/rt633/Cargo.lock index 2396b7838..48a8c9fab 100644 --- a/examples/rt633/Cargo.lock +++ b/examples/rt633/Cargo.lock @@ -739,7 +739,7 @@ dependencies = [ [[package]] name = "embedded-usb-pd" version = "0.1.0" -source = "git+https://github.com/OpenDevicePartnership/embedded-usb-pd#9a42f07ce99a6d91032d7c9792fd87d4b4f49b6f" +source = "git+https://github.com/OpenDevicePartnership/embedded-usb-pd#21d0e228d21ddc6ccaeffc01d98ef9a5b87941ef" dependencies = [ "aquamarine", "bincode", diff --git a/examples/rt685s-evk/Cargo.lock b/examples/rt685s-evk/Cargo.lock index 0f7446af1..6117376a2 100644 --- a/examples/rt685s-evk/Cargo.lock +++ b/examples/rt685s-evk/Cargo.lock @@ -2,18 +2,6 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "ahash" -version = "0.8.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - [[package]] name = "aho-corasick" version = "1.1.4" @@ -23,12 +11,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "anyhow" -version = "1.0.99" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0674a1ddeecb70197781e945de4b3b8ffb61fa939a5597bcf48503737663100" - [[package]] name = "aquamarine" version = "0.6.0" @@ -43,49 +25,6 @@ dependencies = [ "syn 2.0.106", ] -[[package]] -name = "arraydeque" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d902e3d592a523def97af8f317b08ce16b7ab854c1985a0c671e6f15cebc236" - -[[package]] -name = "askama" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f75363874b771be265f4ffe307ca705ef6f3baa19011c149da8674a87f1b75c4" -dependencies = [ - "askama_derive", - "itoa", - "percent-encoding", - "serde", - "serde_json", -] - -[[package]] -name = "askama_derive" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "129397200fe83088e8a68407a8e2b1f826cf0086b21ccdb866a722c8bcd3a94f" -dependencies = [ - "askama_parser", - "memchr", - "proc-macro2", - "quote", - "rustc-hash", - "syn 2.0.106", -] - -[[package]] -name = "askama_parser" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6ab5630b3d5eaf232620167977f95eb51f3432fc76852328774afbd242d4358" -dependencies = [ - "memchr", - "winnow 0.7.13", -] - [[package]] name = "autocfg" version = "1.5.0" @@ -254,15 +193,6 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "cordyceps" version = "0.3.4" @@ -368,15 +298,6 @@ dependencies = [ "syn 2.0.106", ] -[[package]] -name = "dd-manifest-tree" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5793572036e0a6638977c7370c6afc423eac848ee8495f079b8fd3964de7b9f9" -dependencies = [ - "yaml-rust2", -] - [[package]] name = "defmt" version = "0.3.100" @@ -415,7 +336,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" dependencies = [ - "thiserror 2.0.16", + "thiserror", ] [[package]] @@ -430,45 +351,15 @@ dependencies = [ [[package]] name = "device-driver" -version = "1.0.7" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af0e43acfcbb0bb3b7435cc1b1dbb33596cacfec1eb243336b74a398e0bd6cbf" +checksum = "c2e4547bd66511372d2a38ac3c1b2892c7ebf83cf0d5411c3406e496c85a1d96" dependencies = [ "defmt 0.3.100", - "device-driver-macros", "embedded-io 0.6.1", "embedded-io-async 0.6.1", ] -[[package]] -name = "device-driver-generation" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3935aec9cf5bb2ab927f59ca69faecf976190390b0ce34c6023889e9041040c0" -dependencies = [ - "anyhow", - "askama", - "bitvec", - "convert_case", - "dd-manifest-tree", - "itertools 0.14.0", - "kdl", - "proc-macro2", - "quote", - "syn 2.0.106", -] - -[[package]] -name = "device-driver-macros" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fdc68ed515c4eddff2e95371185b4becba066085bf36d50f07f09782af98e17" -dependencies = [ - "device-driver-generation", - "proc-macro2", - "syn 2.0.106", -] - [[package]] name = "document-features" version = "0.2.11" @@ -853,7 +744,7 @@ dependencies = [ [[package]] name = "embedded-usb-pd" version = "0.1.0" -source = "git+https://github.com/OpenDevicePartnership/embedded-usb-pd#1a8e79d3a2ac0d2837a34b045087cf0863146f7d" +source = "git+https://github.com/OpenDevicePartnership/embedded-usb-pd#21d0e228d21ddc6ccaeffc01d98ef9a5b87941ef" dependencies = [ "aquamarine", "bincode", @@ -862,15 +753,6 @@ dependencies = [ "embedded-hal-async", ] -[[package]] -name = "encoding_rs" -version = "0.8.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" -dependencies = [ - "cfg-if", -] - [[package]] name = "espi-device" version = "0.1.0" @@ -960,24 +842,6 @@ dependencies = [ "byteorder", ] -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" -dependencies = [ - "ahash", -] - -[[package]] -name = "hashlink" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" -dependencies = [ - "hashbrown", -] - [[package]] name = "heapless" version = "0.8.0" @@ -1056,24 +920,6 @@ dependencies = [ "either", ] -[[package]] -name = "itoa" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" - -[[package]] -name = "kdl" -version = "6.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12661358400b02cbbf1fbd05f0a483335490e8a6bd1867620f2eeb78f304a22f" -dependencies = [ - "miette", - "num", - "thiserror 1.0.69", - "winnow 0.6.24", -] - [[package]] name = "lazy_static" version = "1.5.0" @@ -1131,7 +977,7 @@ dependencies = [ "espi-device", "num_enum", "smbus-pec", - "thiserror 2.0.16", + "thiserror", ] [[package]] @@ -1140,28 +986,6 @@ version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" -[[package]] -name = "miette" -version = "7.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" -dependencies = [ - "cfg-if", - "miette-derive", - "unicode-width", -] - -[[package]] -name = "miette-derive" -version = "7.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db5b29714e950dbb20d5e6f74f9dcec4edbcc1067bb7f8ed198c097b8c1a818b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.106", -] - [[package]] name = "mimxrt600-fcb" version = "0.1.0" @@ -1230,70 +1054,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "num" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" -dependencies = [ - "num-bigint", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", -] - -[[package]] -name = "num-bigint" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" -dependencies = [ - "num-integer", - "num-traits", -] - -[[package]] -name = "num-complex" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" -dependencies = [ - "num-bigint", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1346,12 +1106,6 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" -[[package]] -name = "percent-encoding" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" - [[package]] name = "pin-project-lite" version = "0.2.17" @@ -1496,12 +1250,6 @@ dependencies = [ "type-c-service", ] -[[package]] -name = "rustc-hash" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" - [[package]] name = "rustc_version" version = "0.2.3" @@ -1517,12 +1265,6 @@ version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" -[[package]] -name = "ryu" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" - [[package]] name = "scoped-tls" version = "1.0.1" @@ -1564,18 +1306,6 @@ dependencies = [ "syn 2.0.106", ] -[[package]] -name = "serde_json" -version = "1.0.143" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a" -dependencies = [ - "itoa", - "memchr", - "ryu", - "serde", -] - [[package]] name = "sharded-slab" version = "0.1.7" @@ -1678,33 +1408,13 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl 1.0.69", -] - [[package]] name = "thiserror" version = "2.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3467d614147380f2e4e374161426ff399c91084acd2363eaf549172b3d5e60c0" dependencies = [ - "thiserror-impl 2.0.16", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.106", + "thiserror-impl", ] [[package]] @@ -1730,7 +1440,7 @@ dependencies = [ [[package]] name = "tps6699x" version = "0.1.0" -source = "git+https://github.com/OpenDevicePartnership/tps6699x#aa3425136216dccfb107bff6b172a49b8972bb70" +source = "git+https://github.com/OpenDevicePartnership/tps6699x#ba1b3b17ebf048fc007eb2107a4d2ab8cb545adf" dependencies = [ "bincode", "bitfield 0.19.2", @@ -1838,18 +1548,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" -[[package]] -name = "unicode-segmentation" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" - -[[package]] -name = "unicode-width" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" - [[package]] name = "unty" version = "0.0.4" @@ -1874,12 +1572,6 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002" -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - [[package]] name = "virtue" version = "0.0.18" @@ -1925,24 +1617,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "winnow" -version = "0.6.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a" -dependencies = [ - "memchr", -] - -[[package]] -name = "winnow" -version = "0.7.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" -dependencies = [ - "memchr", -] - [[package]] name = "wyz" version = "0.5.1" @@ -1952,17 +1626,6 @@ dependencies = [ "tap", ] -[[package]] -name = "yaml-rust2" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a1a1c0bc9823338a3bdf8c61f994f23ac004c6fa32c08cd152984499b445e8d" -dependencies = [ - "arraydeque", - "encoding_rs", - "hashlink", -] - [[package]] name = "zerocopy" version = "0.8.26" diff --git a/examples/std/Cargo.lock b/examples/std/Cargo.lock index 7f94b690f..0bdc0a366 100644 --- a/examples/std/Cargo.lock +++ b/examples/std/Cargo.lock @@ -2,18 +2,6 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "ahash" -version = "0.8.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - [[package]] name = "aho-corasick" version = "1.1.3" @@ -23,12 +11,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "anyhow" -version = "1.0.99" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0674a1ddeecb70197781e945de4b3b8ffb61fa939a5597bcf48503737663100" - [[package]] name = "aquamarine" version = "0.6.0" @@ -43,49 +25,6 @@ dependencies = [ "syn 2.0.106", ] -[[package]] -name = "arraydeque" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d902e3d592a523def97af8f317b08ce16b7ab854c1985a0c671e6f15cebc236" - -[[package]] -name = "askama" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f75363874b771be265f4ffe307ca705ef6f3baa19011c149da8674a87f1b75c4" -dependencies = [ - "askama_derive", - "itoa", - "percent-encoding", - "serde", - "serde_json", -] - -[[package]] -name = "askama_derive" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "129397200fe83088e8a68407a8e2b1f826cf0086b21ccdb866a722c8bcd3a94f" -dependencies = [ - "askama_parser", - "memchr", - "proc-macro2", - "quote", - "rustc-hash", - "syn 2.0.106", -] - -[[package]] -name = "askama_parser" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6ab5630b3d5eaf232620167977f95eb51f3432fc76852328774afbd242d4358" -dependencies = [ - "memchr", - "winnow 0.7.13", -] - [[package]] name = "atty" version = "0.2.14" @@ -278,15 +217,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4bd422bfb4f24a97243f60b6a4443e63d810c925d8da4bb2d8fde26a7c1d57ec" -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "cordyceps" version = "0.3.4" @@ -370,15 +300,6 @@ dependencies = [ "syn 2.0.106", ] -[[package]] -name = "dd-manifest-tree" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5793572036e0a6638977c7370c6afc423eac848ee8495f079b8fd3964de7b9f9" -dependencies = [ - "yaml-rust2", -] - [[package]] name = "debug-service" version = "0.1.0" @@ -430,49 +351,19 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" dependencies = [ - "thiserror 2.0.16", + "thiserror", ] [[package]] name = "device-driver" -version = "1.0.7" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af0e43acfcbb0bb3b7435cc1b1dbb33596cacfec1eb243336b74a398e0bd6cbf" +checksum = "c2e4547bd66511372d2a38ac3c1b2892c7ebf83cf0d5411c3406e496c85a1d96" dependencies = [ - "device-driver-macros", "embedded-io 0.6.1", "embedded-io-async 0.6.1", ] -[[package]] -name = "device-driver-generation" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3935aec9cf5bb2ab927f59ca69faecf976190390b0ce34c6023889e9041040c0" -dependencies = [ - "anyhow", - "askama", - "bitvec", - "convert_case", - "dd-manifest-tree", - "itertools 0.14.0", - "kdl", - "proc-macro2", - "quote", - "syn 2.0.106", -] - -[[package]] -name = "device-driver-macros" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fdc68ed515c4eddff2e95371185b4becba066085bf36d50f07f09782af98e17" -dependencies = [ - "device-driver-generation", - "proc-macro2", - "syn 2.0.106", -] - [[package]] name = "document-features" version = "0.2.11" @@ -756,13 +647,13 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7a4b4d10ac48d08bfe3db7688c402baadb244721f30a77ce360bd24c3dffe58" dependencies = [ - "num 0.3.1", + "num", ] [[package]] name = "embedded-usb-pd" version = "0.1.0" -source = "git+https://github.com/OpenDevicePartnership/embedded-usb-pd#1a8e79d3a2ac0d2837a34b045087cf0863146f7d" +source = "git+https://github.com/OpenDevicePartnership/embedded-usb-pd#21d0e228d21ddc6ccaeffc01d98ef9a5b87941ef" dependencies = [ "aquamarine", "bincode", @@ -770,15 +661,6 @@ dependencies = [ "embedded-hal-async", ] -[[package]] -name = "encoding_rs" -version = "0.8.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" -dependencies = [ - "cfg-if", -] - [[package]] name = "env_logger" version = "0.9.3" @@ -858,24 +740,6 @@ dependencies = [ "byteorder", ] -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" -dependencies = [ - "ahash", -] - -[[package]] -name = "hashlink" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" -dependencies = [ - "hashbrown", -] - [[package]] name = "heapless" version = "0.8.0" @@ -960,24 +824,6 @@ dependencies = [ "either", ] -[[package]] -name = "itoa" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" - -[[package]] -name = "kdl" -version = "6.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12661358400b02cbbf1fbd05f0a483335490e8a6bd1867620f2eeb78f304a22f" -dependencies = [ - "miette", - "num 0.4.3", - "thiserror 1.0.69", - "winnow 0.6.24", -] - [[package]] name = "lazy_static" version = "1.5.0" @@ -1048,7 +894,7 @@ dependencies = [ "espi-device", "num_enum", "smbus-pec", - "thiserror 2.0.16", + "thiserror", ] [[package]] @@ -1057,28 +903,6 @@ version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" -[[package]] -name = "miette" -version = "7.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" -dependencies = [ - "cfg-if", - "miette-derive", - "unicode-width", -] - -[[package]] -name = "miette-derive" -version = "7.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db5b29714e950dbb20d5e6f74f9dcec4edbcc1067bb7f8ed198c097b8c1a818b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.106", -] - [[package]] name = "mutex-traits" version = "1.0.1" @@ -1121,34 +945,10 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b7a8e9be5e039e2ff869df49155f1c06bd01ade2117ec783e56ab0932b67a8f" dependencies = [ - "num-complex 0.3.1", + "num-complex", "num-integer", "num-iter", - "num-rational 0.3.2", - "num-traits", -] - -[[package]] -name = "num" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" -dependencies = [ - "num-bigint", - "num-complex 0.4.6", - "num-integer", - "num-iter", - "num-rational 0.4.2", - "num-traits", -] - -[[package]] -name = "num-bigint" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" -dependencies = [ - "num-integer", + "num-rational", "num-traits", ] @@ -1161,15 +961,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-complex" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" -dependencies = [ - "num-traits", -] - [[package]] name = "num-integer" version = "0.1.46" @@ -1201,17 +992,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-rational" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" -dependencies = [ - "num-bigint", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1254,12 +1034,6 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" -[[package]] -name = "percent-encoding" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" - [[package]] name = "pin-project" version = "1.1.10" @@ -1390,12 +1164,6 @@ dependencies = [ "ufmt-write", ] -[[package]] -name = "rustc-hash" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" - [[package]] name = "rustc_version" version = "0.2.3" @@ -1411,12 +1179,6 @@ version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" -[[package]] -name = "ryu" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" - [[package]] name = "scoped-tls" version = "1.0.1" @@ -1458,18 +1220,6 @@ dependencies = [ "syn 2.0.106", ] -[[package]] -name = "serde_json" -version = "1.0.143" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a" -dependencies = [ - "itoa", - "memchr", - "ryu", - "serde", -] - [[package]] name = "sharded-slab" version = "0.1.7" @@ -1619,33 +1369,13 @@ dependencies = [ "uuid", ] -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl 1.0.69", -] - [[package]] name = "thiserror" version = "2.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3467d614147380f2e4e374161426ff399c91084acd2363eaf549172b3d5e60c0" dependencies = [ - "thiserror-impl 2.0.16", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.106", + "thiserror-impl", ] [[package]] @@ -1671,7 +1401,7 @@ dependencies = [ [[package]] name = "tps6699x" version = "0.1.0" -source = "git+https://github.com/OpenDevicePartnership/tps6699x#aa3425136216dccfb107bff6b172a49b8972bb70" +source = "git+https://github.com/OpenDevicePartnership/tps6699x#ba1b3b17ebf048fc007eb2107a4d2ab8cb545adf" dependencies = [ "bincode", "bitfield 0.19.2", @@ -1779,18 +1509,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" -[[package]] -name = "unicode-segmentation" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" - -[[package]] -name = "unicode-width" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" - [[package]] name = "unty" version = "0.0.4" @@ -1815,12 +1533,6 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77439c1b53d2303b20d9459b1ade71a83c716e3f9c34f3228c00e6f185d6c002" -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - [[package]] name = "virtue" version = "0.0.18" @@ -2131,24 +1843,6 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" -[[package]] -name = "winnow" -version = "0.6.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a" -dependencies = [ - "memchr", -] - -[[package]] -name = "winnow" -version = "0.7.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" -dependencies = [ - "memchr", -] - [[package]] name = "wyz" version = "0.5.1" @@ -2158,17 +1852,6 @@ dependencies = [ "tap", ] -[[package]] -name = "yaml-rust2" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a1a1c0bc9823338a3bdf8c61f994f23ac004c6fa32c08cd152984499b445e8d" -dependencies = [ - "arraydeque", - "encoding_rs", - "hashlink", -] - [[package]] name = "zerocopy" version = "0.8.26" diff --git a/examples/std/src/lib/type_c/mock_controller.rs b/examples/std/src/lib/type_c/mock_controller.rs index 0ddecd56f..2c6764897 100644 --- a/examples/std/src/lib/type_c/mock_controller.rs +++ b/examples/std/src/lib/type_c/mock_controller.rs @@ -6,8 +6,9 @@ use embedded_services::{ power::policy::PowerCapability, type_c::{ controller::{ - AttnVdm, ControllerStatus, DpConfig, DpPinConfig, DpStatus, OtherVdm, PdStateMachineConfig, PortStatus, - RetimerFwUpdateState, SendVdm, SystemPowerState, TbtConfig, TypeCStateMachineState, UsbControlConfig, + AttnVdm, ControllerStatus, DiscoveredSvids, DpConfig, DpPinConfig, DpStatus, OtherVdm, + PdStateMachineConfig, PortStatus, RetimerFwUpdateState, SendVdm, SystemPowerState, TbtConfig, + TypeCStateMachineState, UsbControlConfig, }, event::PortEvent, }, @@ -340,6 +341,36 @@ impl embedded_services::type_c::controller::Controller for Controller<'_> { debug!("Set power state for port {port:?}: {state:?}"); Ok(()) } + + async fn get_discovered_svids(&mut self, port: LocalPortId) -> Result> { + debug!("Get discovered SVIDs for port {port:?}"); + Ok(DiscoveredSvids::default()) + } + + async fn hard_reset(&mut self, port: LocalPortId) -> Result<(), Error> { + debug!("Hard reset for port {port:?}"); + Ok(()) + } + + async fn get_discover_identity_sop_response( + &mut self, + port: LocalPortId, + ) -> Result> + { + debug!("Get Discover Identity SOP response for port {port:?}"); + Err(Error::Pd(PdError::Failed)) + } + + async fn get_discover_identity_sop_prime_response( + &mut self, + port: LocalPortId, + ) -> Result< + embedded_usb_pd::vdm::structured::command::discover_identity::sop_prime::ResponseVdos, + Error, + > { + debug!("Get Discover Identity SOP' response for port {port:?}"); + Err(Error::Pd(PdError::Failed)) + } } pub struct Validator; diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml index 5bb38a458..a13008070 100644 --- a/supply-chain/audits.toml +++ b/supply-chain/audits.toml @@ -204,6 +204,12 @@ criteria = "safe-to-deploy" version = "1.0.7" notes = "no_std device driver toolkit. Unsafe limited to ops.rs bitfield load/store using get_unchecked with documented invariants; fuzz-tested against bitvec. No build script, no proc macros, no filesystem/network/process access. Assisted-by: copilot-chat:claude-opus-4.6 cargo-vet" +[[audits.device-driver]] +who = "Adam Sasine " +criteria = "safe-to-deploy" +delta = "1.0.7 -> 1.0.9" +notes = "Fixes compilation bugs for large registers but does not change invariants or testing strategy." + [[audits.device-driver-generation]] who = "Jerry Xie " criteria = "safe-to-deploy" diff --git a/supply-chain/imports.lock b/supply-chain/imports.lock index edf4c338a..9d90c2088 100644 --- a/supply-chain/imports.lock +++ b/supply-chain/imports.lock @@ -21,13 +21,6 @@ when = "2025-08-16" user-id = 55123 user-login = "rust-lang-owner" -[[publisher.encoding_rs]] -version = "0.8.35" -when = "2024-10-24" -user-id = 4484 -user-login = "hsivonen" -user-name = "Henri Sivonen" - [[publisher.libc]] version = "0.2.175" when = "2025-08-11" @@ -82,13 +75,6 @@ user-id = 3618 user-login = "dtolnay" user-name = "David Tolnay" -[[publisher.ryu]] -version = "1.0.20" -when = "2025-03-04" -user-id = 3618 -user-login = "dtolnay" -user-name = "David Tolnay" - [[publisher.scoped-tls]] version = "1.0.1" when = "2022-10-31" @@ -96,13 +82,6 @@ user-id = 1 user-login = "alexcrichton" user-name = "Alex Crichton" -[[publisher.serde_json]] -version = "1.0.143" -when = "2025-08-19" -user-id = 3618 -user-login = "dtolnay" -user-name = "David Tolnay" - [[publisher.smallvec]] version = "1.15.1" when = "2025-06-06" @@ -152,20 +131,6 @@ user-id = 3618 user-login = "dtolnay" user-name = "David Tolnay" -[[publisher.unicode-segmentation]] -version = "1.12.0" -when = "2024-09-13" -user-id = 1139 -user-login = "Manishearth" -user-name = "Manish Goregaokar" - -[[publisher.unicode-width]] -version = "0.1.14" -when = "2024-09-19" -user-id = 1139 -user-login = "Manishearth" -user-name = "Manish Goregaokar" - [[publisher.windows]] version = "0.61.3" when = "2025-06-12" @@ -1441,7 +1406,7 @@ aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust [[audits.mozilla.wildcard-audits.encoding_rs]] who = "Henri Sivonen " criteria = "safe-to-deploy" -user-id = 4484 # Henri Sivonen (hsivonen) +user-id = 4484 start = "2019-02-26" end = "2025-10-23" notes = "I, Henri Sivonen, wrote encoding_rs for Gecko and have reviewed contributions by others. There are two caveats to the certification: 1) The crate does things that are documented to be UB but that do not appear to actually be UB due to integer types differing from the general rule; https://github.com/hsivonen/encoding_rs/issues/79 . 2) It would be prudent to re-review the code that reinterprets buffers of integers as SIMD vectors; see https://github.com/hsivonen/encoding_rs/issues/87 ." @@ -1450,7 +1415,7 @@ aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-ch [[audits.mozilla.wildcard-audits.unicode-segmentation]] who = "Manish Goregaokar " criteria = "safe-to-deploy" -user-id = 1139 # Manish Goregaokar (Manishearth) +user-id = 1139 start = "2019-05-15" end = "2026-02-01" notes = "All code written or reviewed by Manish" @@ -1459,7 +1424,7 @@ aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-ch [[audits.mozilla.wildcard-audits.unicode-width]] who = "Manish Goregaokar " criteria = "safe-to-deploy" -user-id = 1139 # Manish Goregaokar (Manishearth) +user-id = 1139 start = "2019-12-05" end = "2026-02-01" notes = "All code written or reviewed by Manish" diff --git a/type-c-service/src/driver/tps6699x.rs b/type-c-service/src/driver/tps6699x.rs index b2a1375f2..8f1830eac 100644 --- a/type-c-service/src/driver/tps6699x.rs +++ b/type-c-service/src/driver/tps6699x.rs @@ -13,8 +13,8 @@ use embedded_hal_async::i2c::I2c; use embedded_services::power::policy::PowerCapability; use embedded_services::type_c::ATTN_VDM_LEN; use embedded_services::type_c::controller::{ - self, AttnVdm, Controller, ControllerStatus, DpPinConfig, OtherVdm, PortStatus, SendVdm, TbtConfig, - TypeCStateMachineState, UsbControlConfig, + self, AttnVdm, Controller, ControllerStatus, DiscoveredSvids, DpPinConfig, OtherVdm, PortStatus, SendVdm, + TbtConfig, TypeCStateMachineState, UsbControlConfig, }; use embedded_services::type_c::event::PortEvent; use embedded_services::{debug, error, trace, type_c, warn}; @@ -24,6 +24,7 @@ use embedded_usb_pd::pdo::{Common, Contract, Rdo, sink, source}; use embedded_usb_pd::type_c::Current as TypecCurrent; use embedded_usb_pd::ucsi::lpm; use embedded_usb_pd::{DataRole, Error, LocalPortId, PdError, PlugOrientation, PowerRole}; +use heapless::Vec; use tps6699x::MAX_SUPPORTED_PORTS; use tps6699x::asynchronous::embassy as tps6699x_drv; use tps6699x::asynchronous::fw_update::UpdateTarget; @@ -844,6 +845,65 @@ impl Controller for Tps6699x<'_, M, B> { self.tps6699x.set_sx_app_config(port, driver_state).await } + + async fn get_discovered_svids(&mut self, port: LocalPortId) -> Result> { + let svids = self.tps6699x.get_discovered_svids(port).await?; + debug!("{:?} discovered SVIDs: {:?}", port, svids); + let mut sop = Vec::new(); + for svid in svids.svid_sop().take(sop.capacity()) { + let _ = sop.push(svid); + } + + let mut sop_prime = Vec::new(); + for svid in svids.svid_sop_prime().take(sop_prime.capacity()) { + let _ = sop_prime.push(svid); + } + + let svids = DiscoveredSvids::new(sop, sop_prime); + Ok(svids) + } + + async fn hard_reset(&mut self, port: LocalPortId) -> Result<(), Error> { + match self.tps6699x.execute_hrst(port).await? { + ReturnValue::Success => Ok(()), + r => { + debug!("Error executing hard reset on port {}: {:#?}", port.0, r); + Err(Error::Pd(PdError::InvalidResponse)) + } + } + } + + async fn get_discover_identity_sop_response( + &mut self, + port: LocalPortId, + ) -> Result> + { + let data = self.tps6699x.get_received_sop_identity_data(port).await?; + match data.try_into() { + Ok(vdos) => Ok(vdos), + Err(e) => { + debug!("Error deserializing Received SOP Identity Data: {:?}", e); + Err(Error::Pd(PdError::Serialize)) + } + } + } + + async fn get_discover_identity_sop_prime_response( + &mut self, + port: LocalPortId, + ) -> Result< + embedded_usb_pd::vdm::structured::command::discover_identity::sop_prime::ResponseVdos, + Error, + > { + let data = self.tps6699x.get_received_sop_prime_identity_data(port).await?; + match data.try_into() { + Ok(vdos) => Ok(vdos), + Err(e) => { + debug!("Error deserializing Received SOP Prime Identity Data: {:?}", e); + Err(Error::Pd(PdError::Serialize)) + } + } + } } impl<'a, M: RawMutex, BUS: I2c> AsRef> for Tps6699x<'a, M, BUS> { diff --git a/type-c-service/src/service/port.rs b/type-c-service/src/service/port.rs index 0a7bdf9a5..199d95b9f 100644 --- a/type-c-service/src/service/port.rs +++ b/type-c-service/src/service/port.rs @@ -74,6 +74,15 @@ impl<'a> Service<'a> { external::PortCommandData::SetSystemPowerState(state) => { self.process_set_power_state(command.port, state).await } + external::PortCommandData::GetDiscoveredSvids => self.process_get_discovered_svids(command.port).await, + external::PortCommandData::HardReset => self.process_hard_reset(command.port).await, + external::PortCommandData::GetDiscoverIdentitySop => { + self.process_get_discover_identity_sop_response(command.port).await + } + external::PortCommandData::GetDiscoverIdentitySopPrime => { + self.process_get_discover_identity_sop_prime_response(command.port) + .await + } } } @@ -286,4 +295,47 @@ impl<'a> Service<'a> { external::Response::Port(status.map(|_| external::PortResponseData::Complete)) } + + /// Process [`external::PortCommandData::GetDiscoveredSvids`] command + async fn process_get_discovered_svids(&self, port_id: GlobalPortId) -> external::Response<'static> { + let status = self.context.get_discovered_svids(port_id).await; + if let Err(e) = status { + error!("Error getting discovered SVIDs: {:#?}", e); + } + + external::Response::Port(status.map(external::PortResponseData::DiscoveredSvids)) + } + + /// Process [`external::PortCommandData::HardReset`] command + async fn process_hard_reset(&self, port_id: GlobalPortId) -> external::Response<'static> { + let status = self.context.hard_reset(port_id).await; + if let Err(e) = status { + error!("Error executing hard reset: {:#?}", e); + } + + external::Response::Port(status.map(|_| external::PortResponseData::Complete)) + } + + /// Process [`external::PortCommandData::GetDiscoverIdentitySop`] command + async fn process_get_discover_identity_sop_response(&self, port_id: GlobalPortId) -> external::Response<'static> { + let status = self.context.get_discover_identity_sop_response(port_id).await; + if let Err(e) = status { + error!("Error getting Discover Identity SOP response: {:#?}", e); + } + + external::Response::Port(status.map(external::PortResponseData::DiscoverIdentitySop)) + } + + /// Process [`external::PortCommandData::GetDiscoverIdentitySopPrime`] command + async fn process_get_discover_identity_sop_prime_response( + &self, + port_id: GlobalPortId, + ) -> external::Response<'static> { + let status = self.context.get_discover_identity_sop_prime_response(port_id).await; + if let Err(e) = status { + error!("Error getting Discover Identity SOP' response: {:#?}", e); + } + + external::Response::Port(status.map(external::PortResponseData::DiscoverIdentitySopPrime)) + } } diff --git a/type-c-service/src/wrapper/pd.rs b/type-c-service/src/wrapper/pd.rs index ebde3e802..a9b233c98 100644 --- a/type-c-service/src/wrapper/pd.rs +++ b/type-c-service/src/wrapper/pd.rs @@ -424,6 +424,40 @@ where }, } } + controller::PortCommandData::GetDiscoveredSvids => { + match controller.get_discovered_svids(local_port).await { + Ok(svids) => Ok(controller::PortResponseData::DiscoveredSvids(svids)), + Err(e) => match e { + Error::Bus(_) => Err(PdError::Failed), + Error::Pd(e) => Err(e), + }, + } + } + controller::PortCommandData::HardReset => match controller.hard_reset(local_port).await { + Ok(()) => Ok(controller::PortResponseData::Complete), + Err(e) => match e { + Error::Bus(_) => Err(PdError::Failed), + Error::Pd(e) => Err(e), + }, + }, + controller::PortCommandData::GetDiscoverIdentitySop => { + match controller.get_discover_identity_sop_response(local_port).await { + Ok(vdos) => Ok(controller::PortResponseData::DiscoverIdentitySop(vdos)), + Err(e) => match e { + Error::Bus(_) => Err(PdError::Failed), + Error::Pd(e) => Err(e), + }, + } + } + controller::PortCommandData::GetDiscoverIdentitySopPrime => { + match controller.get_discover_identity_sop_prime_response(local_port).await { + Ok(vdos) => Ok(controller::PortResponseData::DiscoverIdentitySopPrime(vdos)), + Err(e) => match e { + Error::Bus(_) => Err(PdError::Failed), + Error::Pd(e) => Err(e), + }, + } + } }) } From 49e7e2e9c788d430f0ea6da01d0637417d2094ce Mon Sep 17 00:00:00 2001 From: Jerry Xie <139205137+jerrysxie@users.noreply.github.com> Date: Wed, 6 May 2026 11:38:33 -0500 Subject: [PATCH 6/7] Add AI attribution requirements to copilot instructions (#822) Every commit with AI-assisted work must include an Assisted-by trailer. AI agents must verify their own identity before composing the trailer and must not add Signed-off-by tags. Assisted-by: GitHub Copilot:claude-opus-4.6 --- .github/copilot-instructions.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 94a4a40af..f105dcfc1 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -176,3 +176,23 @@ Follow the [standard Git commit message conventions](https://tbaggery.com/2008/0 - Separate subject from body with a blank line - Wrap body text at 72 characters - Use the body to explain *what* and *why*, not *how* + +### AI Attribution + +Every commit that includes AI-generated or AI-assisted work **must** contain an `Assisted-by` trailer in the commit message: + +``` +Assisted-by: AGENT_NAME:MODEL_VERSION [TOOL1] [TOOL2] +``` + +Where: + +- `AGENT_NAME` is the name of the AI tool or framework (e.g., `GitHub Copilot`) +- `MODEL_VERSION` is the specific model version used (e.g., `claude-opus-4.6`) +- `[TOOL1] [TOOL2]` are optional specialized analysis tools used (e.g., `coccinelle`, `sparse`, `smatch`, `clang-tidy`) + +Basic development tools (git, cargo, editors) should not be listed. + +AI agents **must** verify their own identity (agent name and model version) before composing the `Assisted-by` trailer — do not assume or hard-code a model name from a previous session. + +AI agents **MUST NOT** add `Signed-off-by` tags. Only humans can certify the Developer Certificate of Origin. From a47293c5eebf70e24777cdc1eef3de12ad6b9763 Mon Sep 17 00:00:00 2001 From: Jerry Xie <139205137+jerrysxie@users.noreply.github.com> Date: Wed, 6 May 2026 18:33:33 -0500 Subject: [PATCH 7/7] Update LICENSE copyright and add AI attribution instructions (#834) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR applies two org-wide standardisation changes (ref: OpenDevicePartnership/embedded-rust-template#20): 1. **LICENSE** – normalise the copyright line to: `Copyright (c) Open Device Partnership and Contributors` --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 609bd42da..6d14cbb42 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2025 Open Device Partnership +Copyright (c) Open Device Partnership and Contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal