Skip to content

Conversation

@BenReed161
Copy link
Collaborator

Added the minor version number to the info command through reading the GAS address for Firmware Version. Add additional version info to the HW Revision section.

@BenReed161 BenReed161 force-pushed the hw-rev-include-minor-ver branch 2 times, most recently from d91971e to f6567a5 Compare June 25, 2025 23:24
@BenReed161 BenReed161 force-pushed the hw-rev-include-minor-ver branch from f6567a5 to fa98033 Compare June 30, 2025 18:27
@BenReed161 BenReed161 force-pushed the hw-rev-include-minor-ver branch 3 times, most recently from 1a0ca93 to 086a770 Compare July 10, 2025 23:42
@BenReed161
Copy link
Collaborator Author

@lsgunth I refactored my code to use sysfs to access the device_version attribute, which contains the same version data as what is returned from reading the gas. I think this is a better solution to my understanding, although in the current state would only work on linux platform? Would the other platforms then rely on gas read?

@BenReed161 BenReed161 requested a review from lsgunth July 14, 2025 16:39
* @param[in] dev Switchtec device handle
* @param[in] res Int to put the version in
*/
int switchtec_get_minor_version(struct switchtec_dev *dev, int *res)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This makes so much more sense, thanks.

However, my one thought is that maybe the new interface should just get the whole version in one way or another. Seems weird to have a function that only returns the minor portion. Why not return the whole version? So we don't need to change things if we ever have the need to get more than the minor portion?

@BenReed161 BenReed161 force-pushed the hw-rev-include-minor-ver branch from 086a770 to 1e10916 Compare July 16, 2025 19:40
Copy link
Collaborator

@lsgunth lsgunth left a comment

Choose a reason for hiding this comment

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

This looks good to me, thanks.

The one thing I'm unclear on is whether the op implemented is only for Linux? Am I missing the gasop implementation?

@BenReed161
Copy link
Collaborator Author

I can create a gas op version of the command as well. Using gasop_get_device_id as an example this command is gasop for all platforms besides linux. Something like this?

@lsgunth
Copy link
Collaborator

lsgunth commented Jul 16, 2025

Yes, that sounds correct.

@BenReed161 BenReed161 requested a review from lsgunth July 17, 2025 18:45
Copy link
Collaborator

@lsgunth lsgunth left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks!

@BenReed161 BenReed161 requested a review from kelvin-cao July 17, 2025 22:22
@BenReed161 BenReed161 force-pushed the hw-rev-include-minor-ver branch from 9c4173b to ecdbbd7 Compare July 18, 2025 17:15
@BenReed161 BenReed161 force-pushed the hw-rev-include-minor-ver branch from ecdbbd7 to cb2eab2 Compare July 18, 2025 17:40
@BenReed161 BenReed161 requested a review from kelvin-cao July 18, 2025 17:56
@BenReed161 BenReed161 force-pushed the hw-rev-include-minor-ver branch from cb2eab2 to d7163ea Compare July 18, 2025 18:05
Add the minor version number to the info command through reading the
sysfs device version attribute in linux, all other platforms use
gas_read of device_version in sys_info register.
Info adding the resulting device version coverted to minor ver and
added to HW revision section of the print device info cmd.
@BenReed161 BenReed161 force-pushed the hw-rev-include-minor-ver branch from d7163ea to 2b5bfeb Compare July 18, 2025 18:05
@kelvin-cao kelvin-cao merged commit 45f195c into Microsemi:master Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants