-
Notifications
You must be signed in to change notification settings - Fork 126
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
Fixes the PCI-port bug on Raspberry Pi 4 #113
Conversation
The Bug is caused by the Fact that the USB controller is connected to the CPU via PCI, which was not the case on the Raspberry Pi 3. Because of this, the BUS_ID reported by libudev is PCI. However, if it is an actual USB device, there will be fields containing the neccessary information to generate a UsbPortInfo. This patch checks whether all those fields are available, if the BUS_ID is Pci, and if so uses them to populate an UsbPortInfo and return a SerialPortType::UsbPort
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.
Seems fine to me, thank you!
Could you look into the CI failures?
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.
Thanks! Could you add an entry to the changelog as well?
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.
Thank you for your work!
No problem, I actually need it myself ^^. The sooner it's on crates.io the happier I am :) |
The Bug is caused by the Fact that the USB controller is connected to
the CPU via PCI, which was not the case on the Raspberry Pi 3.
Because of this, the BUS_ID reported by libudev is PCI. However, if it
is an actual USB device, there will be fields containing the neccessary
information to generate a UsbPortInfo. This patch checks whether all
those fields are available, if the BUS_ID is Pci, and if so uses them to
populate an UsbPortInfo and return a SerialPortType::UsbPort
Fixes #110