CMSIS-Driver: Add Gigabit Ethernet support to the Ethernet driver API - #321
Conversation
|
@RobertRostohar could you please review this PR. |
There was a problem hiding this comment.
🟡 Changes recommended
ARM.CMSIS.pdsc leaves the Ethernet PHY Capiversion at 2.2.0 while related Ethernet entries are bumped to 2.3.0, creating inconsistent API metadata.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR extends the CMSIS-Driver Ethernet API surface to describe Gigabit-capable media interfaces (GMII/RGMII/SGMII) and updates the associated documentation and package metadata to reflect the new capability.
Changes:
- Added new
ARM_ETH_INTERFACE_*constants for gigabit media interface variants in the common Ethernet driver definitions. - Expanded
ARM_ETH_MAC_CAPABILITIES.media_interfacebitfield to represent the larger interface enum range. - Updated CMSIS-Driver Doxygen docs/versioning and
ARM.CMSIS.pdscmetadata for the Ethernet driver API update.
File summaries
| File | Description |
|---|---|
| CMSIS/Driver/Include/Driver_ETH.h | Adds Gigabit interface type constants and updates header revision/history. |
| CMSIS/Driver/Include/Driver_ETH_MAC.h | Expands media_interface capability bitfield and updates header revision/history. |
| CMSIS/Documentation/Doxygen/Driver/src/history.md | Adds a 2.12.0 documentation history entry for the Ethernet API update. |
| CMSIS/Documentation/Doxygen/Driver/src/Driver_ETH.c | Documents the new Gigabit interface constants in the Ethernet driver Doxygen. |
| CMSIS/Documentation/Doxygen/Driver/src/Driver_ETH_PHY.c | Updates PHY interface parameter documentation to include new Gigabit interface types. |
| CMSIS/Documentation/Doxygen/Driver/Driver.dxy.in | Bumps Doxygen PROJECT_NUMBER to 2.12.0. |
| ARM.CMSIS.pdsc | Updates Ethernet/Ethernet MAC Capiversion metadata and release notes for the change. |
Review details
Suppressed comments (1)
ARM.CMSIS.pdsc:785
- ARM.CMSIS.pdsc bumps the custom components for Ethernet and Ethernet MAC to Capiversion 2.3.0, but the adjacent custom component "Ethernet PHY" remains at 2.2.0; update it to keep the driver family consistent.
<component Cclass="CMSIS Driver" Cgroup="Ethernet" Csub="Custom" Cversion="1.0.0" Capiversion="2.3.0" custom="1">
- Files reviewed: 7/7 changed files
- Comments generated: 4
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🟡 Changes recommended
The Ethernet Capiversion was bumped to 2.3.0 but the corresponding ARM_ETH_{MAC,PHY}_API_VERSION header macros still indicate 2.2, creating an API versioning mismatch for consumers.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 8/8 changed files
- Comments generated: 2
- Review effort level: Lite
There was a problem hiding this comment.
🟡 Changes recommended
The updated Ethernet driver templates introduce incorrect/insufficient argument validation and a missing return path in ARM_ETH_PHY_SetMode, and the PR also surfaces a CMSIS-Core version-sync inconsistency that should be reconciled when modifying ARM.CMSIS.pdsc.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (6)
Previously missed (1) — in code that hasn't changed since the last review.
ARM.CMSIS.pdsc:20
- CMSIS-Core version metadata appears inconsistent:
ARM.CMSIS.pdscdeclares CORECversion6.2.0 for M/A and 6.1.0 for R (e.g., lines ~675/688/697), butCMSIS/Core/Include/cmsis_version.hdefines__CM_CMSIS_VERSION_MAIN/SUB= 6.1,__CA_*= 6.1, and__CR_*= 6.0. SinceARM.CMSIS.pdscis modified in this PR, please align these version sources per the repo's version-sync rules.
CMSIS/Driver/DriverTemplates/Driver_ETH_PHY.c:92
- In
ARM_ETH_PHY_SetMode, the speed switch compares againstARM_ETH_SPEED_1Ginstead of the PHY-mode value (ARM_ETH_PHY_SPEED_1G) and also lacks adefault:path; this can silently accept invalid speed encodings.
case ARM_ETH_PHY_SPEED_100M:
break;
case ARM_ETH_SPEED_1G:
break;
}
CMSIS/Driver/DriverTemplates/Driver_ETH_MAC.c:142
- The duplex switch in
ARM_ETH_MAC_Controlhas nodefault:case, so invalid duplex encodings will be treated as success instead ofARM_DRIVER_ERROR_UNSUPPORTED.
case ARM_ETH_MAC_DUPLEX_HALF:
break;
}
CMSIS/Driver/DriverTemplates/Driver_ETH_MAC.c:152
- The template currently accepts
ARM_ETH_MAC_CHECKSUM_OFFLOAD_RX/TXconfiguration flags but performs no action and returns OK. Since the template capabilities are all-zero by default, it is safer for the template to returnARM_DRIVER_ERROR_UNSUPPORTEDwhen checksum-offload is requested (until an implementation adds support).
if (arg & ARM_ETH_MAC_CHECKSUM_OFFLOAD_RX)
{
}
if (arg & ARM_ETH_MAC_CHECKSUM_OFFLOAD_TX)
CMSIS/Driver/DriverTemplates/Driver_ETH_PHY.c:94
ARM_ETH_PHY_SetMode's duplex switch has nodefault:case, so invalid duplex encodings will be treated as success rather thanARM_DRIVER_ERROR_UNSUPPORTED.
switch (mode & ARM_ETH_PHY_DUPLEX_Msk)
CMSIS/Driver/DriverTemplates/Driver_ETH_PHY.c:94
ARM_ETH_PHY_SetMode(returnsint32_t) has no return statement at the end of the function, which is a compile-time error / undefined behavior depending on toolchain settings.
switch (mode & ARM_ETH_PHY_DUPLEX_Msk)
- Files reviewed: 10/10 changed files
- Comments generated: 2
- Review effort level: Lite
There was a problem hiding this comment.
🔵 Needs a closer look
The manifest and synchronized Core version definitions report inconsistent versions.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
ARM.CMSIS.pdsc:20
- The manifest now declares CMSIS-Core(M/A) 6.2.0 and Core(R) 6.1.0, but the synchronized version definitions remain at 6.1/6.1/6.0 in
CMSIS/Core/Include/cmsis_version.h; the Cortex-M history also still starts at V6.1.1. Please update the corresponding synchronized Core version locations so the manifest and headers/documentation cannot report different versions.
- Files reviewed: 10/10 changed files
- Comments generated: 0 new
- Review effort level: Lite
27c9edf to
462240d
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The capability bit-field layout breaks compatibility with 2.2 drivers and needs append-only or explicit versioned handling.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 10/10 changed files
- Comments generated: 1
- Review effort level: Lite
No description provided.