Questions about the USB HID device drivers
Hans Petter Selasky
hps at selasky.org
Mon Feb 18 09:29:01 UTC 2019
On 2/17/19 11:00 PM, Apollo D. Sharpe, Sr. wrote:
> On 2/15/19 7:46 AM, Hans Petter Selasky wrote:
>> On 2/15/19 2:22 PM, A. D. Sharpe wrote:
>>> On 2/15/2019 3:30 AM, Hans Petter Selasky wrote:
>>>>
>>>> Did you have a look at the code?
>>>>
>>>> sys/dev/usb/input/ums.c and sys/dev/usb/input/ukbd.c
>>> I think I have a decent understanding of USB devices under FreeBSD.
>>> However, two things are tripping me up: a) the fact that the ums &
>>> ukbd drivers don't have "make_dev()" calls in them; and b) I can't
>>> seem to find an overall keyboard system or overall mouse system.
>>>
>>
>> Events are delivered from the USB INTERRUPT endpoint's completion
>> handler to various places. At the moment events can end up via EVDEV
>> or simply sysmouse or the regular keyboard API depending on the system
>> configuration.
>>
>> At the moment, only for EVDEVS's /dev/input/xxxx, there is a
>> per-device character device handle, I think.
>
>
> I think I've gotten a pretty good understanding of what's going on now,
> based on the answers that I've gotten from the developers part of the
> FreeBSD forums(*). The USB keyboard and mouse paths seems to go like this:
>
> ums->usb_hid->/dev/ums0->sysmouse
>
> ukbd->usb_hid->/dev/ukbd0->kbdmux
>
>
> If this is correct, then the majority of my inquiry has been satisfied.
> My next questions are more centered around /dev as it relates to device
> drivers in general:
>
Hi,
> 1. Is there a published standard of how device drivers should publish
> themselves in /dev? From what I can tell, they seem to be thrown into
> /dev without any sort of hierarchy to organize the nodes into what type
> of device they represent.
Each devicename has a uniq prefix followed by a uniq unit number.
>
> 2. Does usb_hid automatically dump device nodes into /dev, or is there a
> way for hid drivers to specify specifically where their nodes should be
> publish -such as: /dev/input/somehiddevice0 ?
>
Character device nodes are automatically created. However it is possible
for user-space applications to create symbolic links afterwards in /dev .
>
> (*)
> https://forums.freebsd.org/threads/questions-about-the-usb-hid-device-drivers.69604/
>
--HPS
More information about the freebsd-usb
mailing list