Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Dec 2022 22:31:50 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        =?UTF-8?Q?Fernando_Apestegu=C3=ADa?= <fernape@freebsd.org>
Cc:        freebsd-usb@freebsd.org, Hans Petter Selasky <hps@selasky.org>
Subject:   Re: autoloading module when matching device
Message-ID:  <CANCZdfoOrUr3usmHSwXhJ0CpPQZEct2nUguCVzKV_0ut6PYiqw@mail.gmail.com>
In-Reply-To: <CAGwOe2bA6kYs3dDR7y-3M5xooswLz_vbqe%2BzcyKjiSd6Et1bkA@mail.gmail.com>
References:  <CAGwOe2bYAFW-Dwy34g6QuB1JEJjMqgoA-gsJByBqTjHLgFczNA@mail.gmail.com> <75ddc208-5bf1-7c9c-4d57-057a2058cc26@selasky.org> <CAGwOe2bA6kYs3dDR7y-3M5xooswLz_vbqe%2BzcyKjiSd6Et1bkA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000ef35f005ef72967e
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Fri, Dec 9, 2022 at 12:50 PM Fernando Apestegu=C3=ADa <fernape@freebsd.o=
rg>
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 loade=
d
when the NOMATCH event gets generated when the device is plugged in?

Warner


> Thanks!
> ---------- Forwarded message ---------
> From: Hans Petter Selasky <hps@selasky.org>
> Date: Fri, Dec 9, 2022 at 8:34 PM
> Subject: Re: autoloading module when matching device
> To: Fernando Apestegu=C3=ADa <fernape@freebsd.org>, developers
> <developers@freebsd.org>
>
>
> On 12/9/22 19:57, Fernando Apestegu=C3=ADa wrote:
> > Hi all,
> >
> > I have a new usb keyboard that uses the ums(4) driver. However I need
> > to add it to kld_list to preload it since the module is not autoloaded
> > when the keyboard is plugged in. The keyboard I want to replace is
> > properly detected when plugged in, though. I thought there would be
> > some place where I could add some device id and map it to ums(4), but
> > I can't find it. I've had a look at devmatch(8) but I can't find any
> > related config files.
> >
> > Where do I need to look?
> >
> > Thanks!
>
> Hi Fernando,
>
> There is no such quirk yet. There are only quirks via usbconfig to
> prevent attach of ums or ukbd.
>
> However, this is a perfect question for freebsd-usb@freebsd.org . Let's
> continue there!
>
> --HPS
>
>

--000000000000ef35f005ef72967e
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Fri, Dec 9, 2022 at 12:50 PM Ferna=
ndo Apestegu=C3=ADa &lt;<a href=3D"mailto:fernape@freebsd.org">fernape@free=
bsd.org</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"=
margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-lef=
t:1ex">Forwarding from developers@ by indication of Hans,<br>
<br>
Maybe a devd(8) can do this?<br>
<br>
Just to be clear, the keyboard works nicely, but it would be better if<br>
it was detected during the hotplug :-)<br></blockquote><div><br></div><div>=
Usually the USB devices that are keyboards autoload the right driver(s).</d=
iv><div><br></div><div>So, sure, you could use a hack in devd to do this (i=
t was how we did all</div><div>the matching before devmatch harvested the m=
atches from the .ko files),</div><div>but maybe a better question is why ar=
en&#39;t the driver(s) automatically loaded</div><div>when the NOMATCH even=
t gets generated when the device is plugged in?</div><div><br></div><div>Wa=
rner</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margi=
n:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex=
">
Thanks!<br>
---------- Forwarded message ---------<br>
From: Hans Petter Selasky &lt;<a href=3D"mailto:hps@selasky.org" target=3D"=
_blank">hps@selasky.org</a>&gt;<br>
Date: Fri, Dec 9, 2022 at 8:34 PM<br>
Subject: Re: autoloading module when matching device<br>
To: Fernando Apestegu=C3=ADa &lt;<a href=3D"mailto:fernape@freebsd.org" tar=
get=3D"_blank">fernape@freebsd.org</a>&gt;, developers<br>
&lt;<a href=3D"mailto:developers@freebsd.org" target=3D"_blank">developers@=
freebsd.org</a>&gt;<br>
<br>
<br>
On 12/9/22 19:57, Fernando Apestegu=C3=ADa wrote:<br>
&gt; Hi all,<br>
&gt;<br>
&gt; I have a new usb keyboard that uses the ums(4) driver. However I need<=
br>
&gt; to add it to kld_list to preload it since the module is not autoloaded=
<br>
&gt; when the keyboard is plugged in. The keyboard I want to replace is<br>
&gt; properly detected when plugged in, though. I thought there would be<br=
>
&gt; some place where I could add some device id and map it to ums(4), but<=
br>
&gt; I can&#39;t find it. I&#39;ve had a look at devmatch(8) but I can&#39;=
t find any<br>
&gt; related config files.<br>
&gt;<br>
&gt; Where do I need to look?<br>
&gt;<br>
&gt; Thanks!<br>
<br>
Hi Fernando,<br>
<br>
There is no such quirk yet. There are only quirks via usbconfig to<br>
prevent attach of ums or ukbd.<br>
<br>
However, this is a perfect question for <a href=3D"mailto:freebsd-usb@freeb=
sd.org" target=3D"_blank">freebsd-usb@freebsd.org</a> . Let&#39;s<br>
continue there!<br>
<br>
--HPS<br>
<br>
</blockquote></div></div>

--000000000000ef35f005ef72967e--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfoOrUr3usmHSwXhJ0CpPQZEct2nUguCVzKV_0ut6PYiqw>