Questions about the USB HID device drivers

Apollo D. Sharpe, Sr. demetrioussharpe at netscape.net
Sun Feb 17 22:00:52 UTC 2019


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:

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.

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 ?


(*) 
https://forums.freebsd.org/threads/questions-about-the-usb-hid-device-drivers.69604/


-- 
Regards,

Apollo D. Sharpe, Sr.



More information about the freebsd-usb mailing list