tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Set USB device ownership based on vedorid/productid

On Mon, Feb 15, 2021 at 12:15:28PM -0500, Mouse wrote:
> > Does NetBSD provide any framework that allows USB device
> > ownership/permissions to be autmatically set on USB
> > VendorId/DeviceId?
> As far as I know it doesn't; a quick look at 8.0's manpages didn't show
> me anything.  (9.1 is not easy for me to check right now; today I'm on
> the wrong job for that.)

I don't think so, because these IDs aren't exposed to the right layer
of the autoconf machinery.  They're used internally in the driver match
routines.  Hoisting them up to the config file seems like a big task and
in some ways a regression.

But I wonder if, for the "generic" drivers like ugen, they could be
added as optional locators, passed down into ugen's match/attach so
a specific ugen instance could be pinned down to a specific vendor and
device ID.  Then you'd get, let's say, ugen9 whenever you had vid 0x5150
did 0x1337, and you could adjust the permissions on /dev/ugen9 accordingly
in /dev and away you'd go.

I can see how this would work for static config but I am not really
up to date enough on the modern world of NetBSD kernel modules and boot
time configuration to understand how or even whether it could work well


Home | Main Index | Thread Index | Old Index