-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Full descriptor dumps for lsusb verbose output #23
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mostly a port of the desc-defs.c and desc-dumps.c, trying to make more Rust like but some C style lingering. Should probably refactor all descriptors into specific structs, so they are useful as a module not just for lsusb dumps. Need to finish UAC descriptors, dump then maybe take it from there. Also left is do_hub, superspeed etc.
just audio controls to finish. It's not pretty and not Rusty but works for consistency with `--lsusb --verbose` mode. In future the descriptor structs could probably have traits/impl/more enum for getting the String placeholders
mirrors updates to lsusb: * gregkh/usbutils@e41b08f * gregkh/usbutils@db6b20a
matching lsusb update: gregkh/usbutils@8a80f70
file size was getting too large. Sub-modules for descriptors makes sense with intention to add more; video, hub, otg, dfu etc.
Allows storage in ClassDescriptor::Audio rather than storing GenericDescriptor and converting on demand. Also allows profiler to grab strings at defined index. Need to convert remaining Audio Streaming descriptors to use custom types rather than raw decode in lsusb.rs. Intend to use same style for UvcDescriptor in a video.rs file.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Provides full functionality of the
--lsusb --verbose
mode, closing #15:A lot of work reviewing and porting lsusb.c, desc-defs.c and desc-dumps.c, plus grunt work creating all the types. I'm not entirely happy with all the types but they enable the
--verbose
dump and can expand as the crate develops. For example, It would be good to add extra enum/impl helpers for some of the in-dump decoding still done in lsusb.rs.There are quite possibly still some bugs in the formatting of some of the descriptor dumps and perhaps parsing; it's so comprehensive and scope so large I can't test it all - I've done my best to avoid any panics though; it should be more robust than the lsusb code.