Re: autoloading module when matching device

From: Hans Petter Selasky <hps_at_selasky.org>
Date: Sat, 10 Dec 2022 20:15:19 UTC
On 12/10/22 20:22, Fernando Apesteguía wrote:
> On Sat, Dec 10, 2022 at 6:32 AM Warner Losh <imp@bsdimp.com> wrote:
>>
>>
>>
>> On Fri, Dec 9, 2022 at 12:50 PM Fernando Apesteguía <fernape@freebsd.org> wrote:
>>>
>>> Forwarding from developers@ by indication of Hans,
>>>
>>> Maybe a devd(8) can do this?
>>>
>>> Just to be clear, the keyboard works nicely, but it would be better if
>>> it was detected during the hotplug :-)
>>
>>
>> Usually the USB devices that are keyboards autoload the right driver(s).
>>
>> So, sure, you could use a hack in devd to do this (it was how we did all
>> the matching before devmatch harvested the matches from the .ko files),
>> but maybe a better question is why aren't the driver(s) automatically loaded
>> when the NOMATCH event gets generated when the device is plugged in?
> 
> OK, I did some digging.
> 
> First some info. This[1] is the keyboard I'm using. It is one of those
> to be used with a media center. It is smaller than usual and it
> incorporates a touchpad.
> The media center (an old Zotac Nvidia Ion) is running FreeBSD 13.1
> (FreeBSD zbox 13.1-RELEASE-p3 FreeBSD 13.1-RELEASE-p3 GENERIC amd64)
> 

Hi,

The ums and ukbd drivers do not allow a mouse and keyboard on the same 
so-called USB interface with a shared USB endpoint, because there can 
only be one driver attached per so-called USB interface.

There is a chance that the newer so-called /dev/event/inputX support 
will do that. I'm CC'ing wulf@ . He's the expert there.

--HPS