Skip to content

richcomm_usb: fix common USB matching flow (#1768)#3477

Open
mbv06 wants to merge 3 commits into
networkupstools:masterfrom
mbv06:fix/richcomm-usb-matching-options
Open

richcomm_usb: fix common USB matching flow (#1768)#3477
mbv06 wants to merge 3 commits into
networkupstools:masterfrom
mbv06:fix/richcomm-usb-matching-options

Conversation

@mbv06

@mbv06 mbv06 commented Jun 10, 2026

Copy link
Copy Markdown

Summary

Fixes #1768.

This change completes the common USB matching support in richcomm_usb. The driver now exposes the standard USB matching options and actually uses them during device selection, so the configuration generated by nut-scanner can be used directly.
// Used existing patterns from blazer_usb and riello_usb

It also fixes the USB scan cleanup path. (1st commit)
Previously, probing a candidate USB device could cause the driver to take the close path and unload libusb while the scan was still in progress. The scan then continued with libusb already torn down, which could lead to access violations or crashes on Windows.

The descriptor-based VID:PID check is kept as an early guard before opening candidate devices. This avoids opening unrelated USB devices during scan, which also reduces exposure to the problematic path and is especially useful on Windows.

Testing

Built and tested on Windows 11 and an Ubuntu 24.04 LTS VM with my UPS.

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown

A ZIP file with standard source tarball and another tarball with pre-built docs for commit ee6b2b0 is temporarily available: NUT-tarballs-PR-3477.zip.

mbv06 added 2 commits June 10, 2026 23:18
Signed-off-by: mbv06 <mbv06.dev@gmail.com>
@mbv06 mbv06 force-pushed the fix/richcomm-usb-matching-options branch from 62521fa to 25b8187 Compare June 10, 2026 20:18
@AppVeyorBot

Copy link
Copy Markdown

Build nut 2.8.5.4818-master completed (commit 34584702a8 by @mbv06)

@AppVeyorBot

Copy link
Copy Markdown

@AppVeyorBot

Copy link
Copy Markdown

Build nut 2.8.5.4819-master completed (commit a42d620755 by @mbv06)

@jimklimov jimklimov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks quite right. I hope CI will soon come to its senses too, it's in the midst of agent OS upgrades last week so is acting up; I'll schedule re-runs when that quiets down.

Adding a NEWS.adoc entry would be useful, but I can do it to trigger the CI rebuild when the farm is readier than it is today :)

@mbv06

mbv06 commented Jun 10, 2026

Copy link
Copy Markdown
Author

Sure, I can add a small NEWS.adoc entry if that helps.

I also noticed I forgot to bump the richcomm_usb driver version. I can send a follow-up commit with both the NEWS entry and the version bump, unless you prefer to handle those when re-triggering CI.

…he improvements [networkupstools#1768, networkupstools#3477]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov

Copy link
Copy Markdown
Member

Updated, hopefully CI feels better now :D

@AppVeyorBot

Copy link
Copy Markdown

Build nut 2.8.5.4820-master completed (commit 947fa6aa95 by @jimklimov)

@jimklimov

jimklimov commented Jun 11, 2026

Copy link
Copy Markdown
Member

mingw faults seem to be due to OOM on builder :\

UPDATE: Raised its RAM/Swap allowance, hope that would help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Complete the fix of common USB matching options for richcomm_usb

3 participants