-
Notifications
You must be signed in to change notification settings - Fork 0
[wip] fd commands #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: leongross <[email protected]>
Signed-off-by: leongross <[email protected]>
Signed-off-by: leongross <[email protected]>
Signed-off-by: leongross <[email protected]>
Signed-off-by: leongross <[email protected]>
Signed-off-by: leongross <[email protected]>
The results for the corresponding pldm requests have an u8 field called CompletionCode. These completion codes are typically a set of PLDM_BASE_CODES and a selection of FW_UPDATE codes. To pass these return codes in a generic and type safe way, we want to define enums that implement the `From` trait for u8, individually for each response. Signed-off-by: leongross <[email protected]>
c42fcbe to
a8594d2
Compare
Signed-off-by: leongross <[email protected]>
9c5914d to
ecd1727
Compare
Signed-off-by: leongross <[email protected]>
18eb056 to
bcf45fe
Compare
| assert!(dsd_iter.is_some()); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking that we actually get the correct descriptors would be nice.
A few more asserts to check the first descriptor field for every descriptor should be enough.
a652e60 to
b225fbe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This WIP PR adds support for firmware device (FD) commands as defined in DSP0267, implementing several downstream device management commands for the PLDM firmware update protocol. The implementation includes new command structures, a reusable completion code macro, and comprehensive test coverage.
Key Changes:
- Introduces 7 new FD commands: QueryDownstreamDevices, QueryDownstreamIdentifiers, GetDownstreamFirmwareParameters, RequestDownstreamDeviceUpdate, GetPackageData, GetDeviceMetaData, and GetMetaData
- Adds
pldm_completion_code!macro for type-safe completion code handling with base and custom codes - Implements
PldmCodecWithLifetimetrait for structures that need to borrow from decode buffers
Reviewed Changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 20 comments.
Show a summary per file
| File | Description |
|---|---|
src/protocol/firmware_update.rs |
Adds new command enums, completion codes, KnownLayout trait to Descriptor, custom PldmCodec for PldmFirmwareString, and updates FirmwareDeviceCapability bitfield |
src/protocol/base.rs |
Introduces pldm_completion_code! macro for creating type-safe completion code enums and adds PartialEq to PldmBaseCompletionCode |
src/message/firmware_update/query_downstream.rs |
New module implementing downstream device query commands with iterators for parsing variable-length response data |
src/message/firmware_update/get_package_data.rs |
New module implementing package data and metadata retrieval commands |
src/message/firmware_update/mod.rs |
Registers new query_downstream and get_package_data modules |
src/message/firmware_update/request_fw_data.rs |
Migrates to PldmCodecWithLifetime trait and implements decode functionality |
src/message/firmware_update/*.rs |
Standardizes test naming convention with _codec suffix across multiple test files |
src/codec.rs |
Adds PldmCodecWithLifetime trait for lifetime-aware codec operations and InvalidData error variant |
Cargo.toml / Cargo.lock |
Adds bytemuck dependency (appears unused) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| self._iter_offset += descriptor_size; | ||
| self._iter_dev_count += 1; | ||
|
|
||
| // println!("{descriptor:?}"); |
Copilot
AI
Nov 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented-out code at line 441 (// println!("{descriptor:?}")) should be removed before merging.
| // println!("{descriptor:?}"); |
Signed-off-by: leongross <[email protected]>
b225fbe to
0bd97de
Compare
d0bb060 to
8d1b62f
Compare
Roadmap
67.67% coverage, 1080/1596 lines covered