From owner-freebsd-usb@freebsd.org Sun Feb 17 22:00:52 2019 Return-Path: Delivered-To: freebsd-usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6425D14E1C3E for ; Sun, 17 Feb 2019 22:00:52 +0000 (UTC) (envelope-from demetrioussharpe@netscape.net) Received: from sonic307-12.consmr.mail.ne1.yahoo.com (sonic307-12.consmr.mail.ne1.yahoo.com [66.163.190.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47DF88B3ED for ; Sun, 17 Feb 2019 22:00:48 +0000 (UTC) (envelope-from demetrioussharpe@netscape.net) X-YMail-OSG: F3jmtbgVM1kBl08ZFT0EkmhwZJu9EwnkRWy8W8CsnjfR_a5cAJ05KfNiP9ZYVT4 vEbXilTYNuS1nxUVjRaBhb.ooRDPjvr5cbP_LKdxEN8Xv2g_fX8ZdYTEIDltlVDlQD.IfGX1P2bW J6cZosvVPMLMKcjx6YK.beSVwACRPexCucuDhSF1A0KbqFJtBa8Gd4es3rr2eC0Kz0bk2N.HK4_N 5YOJhwl_XmWynPJECE0EQJ23PSz2rJZPdb_9VyyJRwjkNtflUNebP.HPkqpUBfEg7idYKt4mW9LM Faai5z7x91iU0UD_QwleTwXZ0d2ovrLRsSKI6EMJbWTal67gEuR6gISCwxYwJbmXAhdjNEX8yeVa m0WlXXPJM_ENEUE_9uYGlhUKG1diM92K_pwGuzcebYPdo7LW78q.ECWPRWUh9NHoI7dPoNTj.TEF LULNMPXZVDbdEb4t4BW1VWcb8_N1kuTMKm3kWLDosSRfxwAtpBoj4tD87PMDfCEU6q55yUn369vI ldfkeDHn6FjKIJJNBGbH1sih4Q9q5bOJr2QNCg5Gq3lDsJLkwkUmE0SCUvX5y5er_LXSlDdU6_Ag rBqRVfGjp3Dg.PtbBpPnlgo_C2OyweF.VkbNhi7KWcqp3WaywF64IYh6dtkWdrj_4G5RvJTatQyU RZK1rzQRl28_5jtaSRCbQqc.JsUjOQoyj6cc3gaCc7UppNNfBIpR_2Dw8N0aOPLOliRajSmcp4AY 7vX_Jg.9dAWKvSN.o0YzkdYKkEbSmETHEmIuZhEoQjJXsC_vdyyp1tToCeb4BrC8cNpQWHS40tlI 0lbdyZYS4_Dhf1_2kLpJZ67EAFDyAI36pw9MVKDT6UjSD0mOl3BbYYAirJcdyVjm3WcC2kxlw2NX 6b7DlIETNIPoAIHQogk2ccaqWzkGMvdv7D1GTQdMWor6ceLUJ8WDEBZZLtmNzcMIh1xpZ43WR_79 nT.3bKHI30Ccon0iP9GKi_M9VF9k_1ADTQl.JeZULG45WVXQ.9RDi5dV95aXGeiNUSo3KStJcEHv 9B_mvGMdbVFjF0ziBoew4XVd9SUkKv7p2XAChCqGnHt2.OgkLtg-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.ne1.yahoo.com with HTTP; Sun, 17 Feb 2019 22:00:46 +0000 Received: from 75.3.110.170 (EHLO [192.168.10.101]) ([75.3.110.170]) by smtp424.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 93dd9591533d49cf6f11d50d0ee3bbc0; Sun, 17 Feb 2019 22:00:44 +0000 (UTC) Subject: Re: Questions about the USB HID device drivers To: Hans Petter Selasky , freebsd-usb@freebsd.org References: <9c6a87dd-cf7c-d0eb-82f1-5e904baaf05f@selasky.org> <325834a2-d9f1-a1f4-dff1-7f724aeb4907@netscape.net> <6762c7c9-f9dc-f7d2-0b1f-c2f6e2816cd7@selasky.org> From: "Apollo D. Sharpe, Sr." Message-ID: <3724cc29-b682-2395-bd95-cbfa418ad9f2@netscape.net> Date: Sun, 17 Feb 2019 16:00:32 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <6762c7c9-f9dc-f7d2-0b1f-c2f6e2816cd7@selasky.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: 47DF88B3ED X-Spamd-Bar: / X-Spamd-Result: default: False [-0.69 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[netscape.net:s=a2048]; NEURAL_HAM_MEDIUM(-0.56)[-0.564,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:66.163.184.0/21]; FREEMAIL_FROM(0.00)[netscape.net]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; NEURAL_HAM_LONG(-0.79)[-0.790,0]; NEURAL_SPAM_SHORT(0.86)[0.860,0]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[mx-aol.mail.gm0.yahoodns.net,mx-aol.mail.gm0.yahoodns.net,mx-aol.mail.gm0.yahoodns.net,mx-aol.mail.gm0.yahoodns.net,mx-aol.mail.gm0.yahoodns.net,mx-aol.mail.gm0.yahoodns.net]; DKIM_TRACE(0.00)[netscape.net:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[35.190.163.66.list.dnswl.org : 127.0.5.0]; DMARC_POLICY_ALLOW(-0.50)[netscape.net,reject]; IP_SCORE(0.81)[ip: (2.15), ipnet: 66.163.184.0/21(1.10), asn: 36646(0.88), country: US(-0.07)]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[netscape.net]; ASN(0.00)[asn:36646, ipnet:66.163.184.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Feb 2019 22:00:52 -0000 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.