Skip to content
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

drivers/libusb{0,1}.c: reset driver parameters while enumerating #2611

Merged
merged 3 commits into from
Sep 11, 2024

Commits on Sep 6, 2024

  1. drivers/libusb{0,1}.c: reset driver parameters while enumerating

    With an Arduino Leonardo compatible board attached alongside a
    CyberPower CP1500PFCLCD, usbhid-ups would incorrectly conclude that
    there was no kernel driver attached to the UPS and then fail subsequent
    steps accordingly.
    
    The cause is the global usb_communication_subdriver_t struct; when a
    subdriver (e.g. arduino-hid) sets different values during the
    enumeration loop, they're not set back to defaults afterwards, causing
    issues with other subdrivers (e.g. cps-hid).
    
    So, if a subdriver doesn't match, set a selection of fields back to
    their default values using the newly added nut_usb_subdriver_defaults()
    before the next attempt.
    
    Signed-off-by: Matt Merhar <[email protected]>
    tofurky committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    fc7ffa7 View commit details
    Browse the repository at this point in the history

Commits on Sep 7, 2024

  1. NEWS.adoc: explain USB enumeration fix [networkupstools#2611]

    With an Arduino Leonardo compatible board attached alongside a CyberPower CP1500PFCLCD, usbhid-ups would incorrectly conclude that there was no kernel driver attached to the UPS and then fail subsequent steps accordingly.
    
    The cause is the global usb_communication_subdriver_t struct; when a subdriver (e.g. arduino-hid) sets different values during the enumeration loop, they're not set back to defaults afterwards, causing issues with other subdrivers (e.g. cps-hid).
    
    So, if a subdriver doesn't match, set a selection of fields back to their default values using the newly added nut_usb_subdriver_defaults() before the next attempt.
    
    // tofurky
    
    Signed-off-by: Jim Klimov <[email protected]>
    jimklimov committed Sep 7, 2024
    Configuration menu
    Copy the full SHA
    959c8cb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6da2fd9 View commit details
    Browse the repository at this point in the history