Skip to content

tcpm-service/ucsi: Fix GET_CAM_SUPPORTED data len - #982

Draft
RobertZ2011 wants to merge 5 commits into
OpenDevicePartnership:mainfrom
RobertZ2011:ucsi-alternate-modes-length
Draft

RobertZ2011 wants to merge 5 commits into
OpenDevicePartnership:mainfrom
RobertZ2011:ucsi-alternate-modes-length

Conversation

@RobertZ2011

Copy link
Copy Markdown
Contributor

No description provided.

@RobertZ2011 RobertZ2011 self-assigned this Nov 11, 2026
@RobertZ2011 RobertZ2011 added this to EC Nov 11, 2026
@RobertZ2011 RobertZ2011 moved this to In Progress in EC Nov 11, 2026
@RobertZ2011
RobertZ2011 force-pushed the ucsi-alternate-modes-length branch 2 times, most recently from 9beba08 to 5f12b88 Compare November 12, 2026 18:01
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Cargo Vet Audit Passed

cargo vet has passed in this PR. No new unvetted dependencies were found.

@github-actions github-actions Bot added the cargo vet PRs pending auditor review label Nov 12, 2026
@RobertZ2011
RobertZ2011 force-pushed the ucsi-alternate-modes-length branch 2 times, most recently from 2edfdc7 to 9f14787 Compare November 17, 2026 18:03
Cover GET_CAM_SUPPORTED pagination and bitmap byte boundaries on a
single port. Assert connector capability and status response lengths
in the basic UCSI integration test.

Assisted-by: GitHub Copilot:gpt-6.1-sol

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: e1157c04-c885-431f-8db1-29fb9f614dc4
@RobertZ2011
RobertZ2011 force-pushed the ucsi-alternate-modes-length branch from 9f14787 to 9b83df0 Compare November 17, 2026 18:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Failed LPM commands clear the CCI error bit because they reach the command-complete branch, suppressing required error reporting.

1 open issue
What changed in this PR

This PR corrects GET_CAM_SUPPORTED response lengths in the TCPM service’s UCSI handling by counting connector alternate modes and calculating the bitmap’s byte length.

Changes:

  • Add alternate-mode enumeration and response-length overrides, and populate lengths for other LPM responses.
  • Add integration tests for empty lists, pagination, and bitmap byte boundaries; update existing length assertions.
  • Update the pinned embedded-usb-pd revision in both lockfiles.
File Description
tcpm-service/​tests/​ucsi_get_cam_supported.rs Adds response-length and pagination regression tests.
tcpm-service/​tests/​ucsi_basic.rs Checks capability and connector-status response lengths.
tcpm-service/​src/​service/​ucsi.rs Calculates response lengths and separates completion/error handling.
examples/​std/​Cargo.lock Updates the example’s USB-PD dependency revision.
Cargo.lock Updates the workspace’s USB-PD dependency revision.

Review effort: Balanced

Comment thread tcpm-service/src/service/ucsi.rs Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cargo vet PRs pending auditor review

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants