Skip to content

Commit f872ddf

Browse files
committed
--versions: Add support for Genesys GL3590 Hub Firmware Version
- Framework Laptop 16 7040 - Version 34.0.4 - Framework Desktop AI 300 - Version 10.0.2 ``` > framework_tool --versions [...] USB Hub GL3590 Firmware Version: 34.0.4 [...] ``` This hub handles USB 2.0 and USB 3.1Gen2 for the Middle Right, Lower Right and Lower Left ports. Signed-off-by: Daniel Schaefer <[email protected]>
1 parent 97b0708 commit f872ddf

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

framework_lib/src/usbhub.rs

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,33 @@ pub const REALTEK_VID: u16 = 0x0BDA;
22
pub const RTL5432_PID: u16 = 0x5432;
33
pub const RTL5424_PID: u16 = 0x5424;
44

5+
pub const GENESYS_VID: u16 = 0x05E3;
6+
pub const GL3590_PID: u16 = 0x0625;
7+
58
/// Get and print the firmware version of the usbhub
69
pub fn check_usbhub_version() -> Result<(), rusb::Error> {
710
for dev in rusb::devices().unwrap().iter() {
811
let dev_descriptor = dev.device_descriptor().unwrap();
9-
if dev_descriptor.vendor_id() != REALTEK_VID
10-
|| (dev_descriptor.product_id() != RTL5432_PID
11-
&& dev_descriptor.product_id() != RTL5424_PID)
12+
13+
if dev_descriptor.vendor_id() == REALTEK_VID
14+
&& [RTL5432_PID, RTL5424_PID].contains(&dev_descriptor.product_id())
1215
{
13-
debug!(
14-
"Skipping {:04X}:{:04X}",
15-
dev_descriptor.vendor_id(),
16-
dev_descriptor.product_id()
17-
);
18-
continue;
16+
let dev_descriptor = dev.device_descriptor()?;
17+
println!("USB Hub RTL{:04X}", dev_descriptor.product_id());
18+
println!(" Firmware Version: {}", dev_descriptor.device_version());
1919
}
2020

21-
let dev_descriptor = dev.device_descriptor()?;
22-
println!("USB Hub RTL{:04X}", dev_descriptor.product_id());
23-
println!(" Firmware Version: {}", dev_descriptor.device_version());
21+
if dev_descriptor.vendor_id() == GENESYS_VID
22+
&& [GL3590_PID].contains(&dev_descriptor.product_id())
23+
{
24+
let dev_descriptor = dev.device_descriptor()?;
25+
if GL3590_PID == dev_descriptor.product_id() {
26+
println!("USB Hub GL3590");
27+
} else {
28+
println!("USB Hub GL????");
29+
}
30+
println!(" Firmware Version: {}", dev_descriptor.device_version());
31+
}
2432
}
2533
Ok(())
2634
}

0 commit comments

Comments
 (0)