Page MenuHomeFreeBSD

libusb: hotplug, use events instead of a timer when possible
Needs ReviewPublic

Authored by bapt on Fri, Jan 3, 1:34 PM.
Tags
None
Referenced Files
F106862536: D48300.diff
Mon, Jan 6, 2:20 PM
F106852889: D48300.id148720.diff
Mon, Jan 6, 10:59 AM
F106848392: D48300.id148722.diff
Mon, Jan 6, 9:17 AM
F106848249: D48300.id.diff
Mon, Jan 6, 9:14 AM
F106843940: D48300.id148721.diff
Mon, Jan 6, 7:46 AM
F106843228: D48300.id148763.diff
Mon, Jan 6, 7:41 AM
F106831505: D48300.diff
Mon, Jan 6, 3:12 AM
F106828666: D48300.id.diff
Mon, Jan 6, 2:01 AM

Details

Reviewers
emaste
kevans
Group Reviewers
USB
Summary

Try to fetch events from nlsysevent or devd to determine when
to scan the usb bus for devices addition or removal.
if none are available fallback on the regular timer based (4s)
scanner

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 61499
Build 58383: arc lint + arc unit

Event Timeline

bapt requested review of this revision.Fri, Jan 3, 1:34 PM
lib/libusb/libusb10_hotplug.c
57

Hi @bapt,

According to devd(8) '/var/run/devd.pipe' is deprecated in favor for '/var/run/devd.seqpacket.pipe', any reason for still using it here ?

Looks fine in principle

lib/libusb/libusb10_hotplug.c
176

This doesn't seem like it would work?

192

IMO "ignore any error" should just be a (void) cast for the return vaule, but I don't feel strongly about it.

192

Where is timeout coming from here? With this and the above, kinda seems like something went wrong with the patch.

lib/libusb/libusb10_hotplug.c
192

Yeah not a huge issue but I agree (void)poll(...) is both a programmer-readable and machine-readable way to indicate that errors are intentionally ignored.