-
Notifications
You must be signed in to change notification settings - Fork 195
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
[WIP] Add support for UAC3 descriptors #61
Conversation
I would be really grateful for any feedback on this. For the descriptor definitions stuff, my aim was to make the definitions as readable as possible, and make them easy to write from the tables in the USB specifications. I have not moved all the the descriptor dumping over to the new mechanism, just the ones where I've added support for UAC3 variants. For UAC3, the changes here give much more useful output, however there are more parts of UAC3 that I have not yet added support for. |
I've tweaked desc_dump(). Previously it took an buffer, |
UAC1 and UAC2 have different different meanings for the same subtype value. This splits the subtype mapping out.
These descriptor definitions descibe how raw descriptor data should be interpreted.
Added support for dumping the USB3 BOS Configuration Summary Descriptor and improved the comment for get_uac_interface_subtype(). |
This adds a new way of dumping descriptors. It takes the descriptor data to be dumped, and a descriptor definition as input. The descriptor definition takes the form of a NULL terminated array of descriptor field definitions. These definitions describe how the raw descriptor data buffer should be interpreted. Thus the knowledge of how to interpret a descriptor buffer is separate from the shared code that renders the descriptor dump. This has two advantages: 1. The code for dumping descriptors is common, so the output is easy to keep consistent. It is also consistent and thorough in its handling of insufficient descriptor data buffer, and junk data at the end of a descriptor. 2. It is easy to add support for new descriptors, since they are now simple definitions that resemble the tables in the USB specifications.
This gives us more consistency in handling of incorrect descriptor buffer lengths, and improves whitespace/alignment consistency.
Added the option to tell the descriptor dumper to read the buffer length from the first field in the descriptor definition, and made the Configuration Summary use that. This will be simpler going forwards with USB Audio Class 3 high capability descriptors, which have a two byte |
This series is getting long, how about just posting it on the linux-usb mailing list and we can review it and iterate there? That should be easier overall, as I have a lot of individual code comments which is a pain to do in github :) |
OK, I've subscribed to the list. It seems git send-email is currently not configured right, so I'll post my series there once I've worked out this config issue. |
On Tue, Dec 05, 2017 at 03:38:02PM +0000, Michael Drake wrote:
OK, I've subscribed to the list. It seems git send-email is currently
not configured right, so I'll post my series there once I've worked
out this config issue.
No need to subscribe if you don't want to, it takes anyones emails, as
long as it isn't in html :)
|
Ah, thanks! I'll unsubscribe if I find it too high-volume then. :) |
Looks like I found the right runes. :) Sent to the linux-usb list. |
I sent v2 to the list. Should I close this merge request, or update it with what I sent to the list? |
On Thu, Dec 07, 2017 at 10:30:41AM +0000, Michael Drake wrote:
I sent v2 to the list. Should I close this merge request, or update it with what I sent to the list?
Yeah, let's just close this, I can take the patches from the list
easier, thanks!
greg k-h
|
OK, suits me too. :) Closing: Discussion has moved to linux-usb mailing list. |
This adds a new way of dumping descriptors, which splits the knowledge of how to interpret descriptor data from the actual dumping. This has two advantages:
UAC1 and UAC2 are converted to use the new mechanism, and finally initial support for UAC3 is added.