File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed
Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ use crate::chromium_ec::{EcError, EcResult};
4747#[ cfg( target_os = "linux" ) ]
4848use crate :: csme;
4949use crate :: ec_binary;
50- use crate :: esrt;
50+ use crate :: esrt:: { self , ResourceType } ;
5151#[ cfg( feature = "rusb" ) ]
5252use crate :: inputmodule:: check_inputmodule_version;
5353#[ cfg( target_os = "linux" ) ]
@@ -708,6 +708,23 @@ fn print_versions(ec: &CrosEc) {
708708 // This means there's a bug, we should've found one but didn't
709709 println ! ( " Unknown" ) ;
710710 }
711+ } else {
712+ // If we don't know the GUID, print all the device firmwares in ESRT
713+ println ! ( "Intel Retimers (Potential)" ) ;
714+ if let Some ( esrt) = esrt:: get_esrt ( ) {
715+ for entry in esrt. entries . iter ( ) {
716+ if ResourceType :: from_int ( entry. fw_type ) != ResourceType :: DeviceFirmware {
717+ continue ;
718+ }
719+ println ! ( " GUID: {}" , entry. fw_class) ;
720+ println ! (
721+ " Version: 0x{:X} ({})" ,
722+ entry. fw_version, entry. fw_version
723+ ) ;
724+ }
725+ } else {
726+ println ! ( "Could not find and parse ESRT table." ) ;
727+ }
711728 }
712729 match parade_retimer:: get_version ( ec) {
713730 // Does not exist
Original file line number Diff line number Diff line change @@ -251,7 +251,7 @@ pub struct Esrt {
251251// Current Entry Version
252252pub const ESRT_FIRMWARE_RESOURCE_VERSION : u64 = 1 ;
253253
254- #[ derive( Debug ) ]
254+ #[ derive( Debug , PartialEq ) ]
255255pub enum ResourceType {
256256 Unknown = 0 ,
257257 SystemFirmware = 1 ,
@@ -262,7 +262,7 @@ pub enum ResourceType {
262262}
263263
264264impl ResourceType {
265- fn from_int ( i : u32 ) -> Self {
265+ pub fn from_int ( i : u32 ) -> Self {
266266 match i {
267267 1 => Self :: SystemFirmware ,
268268 2 => Self :: DeviceFirmware ,
You can’t perform that action at this time.
0 commit comments