usbhidd: reset global endpoint counter per candidate configuration
usbhidd already accumulated prior interfaces' endpoint counts (global enumeration index, matching xhcid's PortState::get_endp_desc), but the counter was never reset between candidate configurations — a HID device whose usable config is not the first would get endpoint numbers offset by the first config's endpoints. xhcid indexes within the selected configuration only, so reset per config.
This commit is contained in:
@@ -242,6 +242,9 @@ fn main() -> Result<()> {
|
||||
.config_descs
|
||||
.iter()
|
||||
.find_map(|conf_desc| {
|
||||
// xhcid indexes endpoints within the selected configuration
|
||||
// only; reset the global counter for each candidate config.
|
||||
endp_count = 0;
|
||||
let if_desc = conf_desc.interface_descs.iter().find_map(|if_desc| {
|
||||
if if_desc.number == interface_num {
|
||||
let endp_desc_opt = if_desc.endpoints.iter().find_map(|endp_desc| {
|
||||
|
||||
Reference in New Issue
Block a user