From owner-freebsd-usb@freebsd.org Mon Feb 18 09:29:01 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 47FD314F8BF0 for ; Mon, 18 Feb 2019 09:29:01 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDE5785C71 for ; Mon, 18 Feb 2019 09:28:59 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [176.74.212.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id CFC932602C5; Mon, 18 Feb 2019 10:28:51 +0100 (CET) Subject: Re: Questions about the USB HID device drivers To: "Apollo D. Sharpe, Sr." , 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> <3724cc29-b682-2395-bd95-cbfa418ad9f2@netscape.net> From: Hans Petter Selasky Message-ID: <0cbc66cd-9007-878e-8bc3-f623364729d4@selasky.org> Date: Mon, 18 Feb 2019 10:26:26 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <3724cc29-b682-2395-bd95-cbfa418ad9f2@netscape.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: EDE5785C71 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 88.99.82.50 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-6.54 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[mail.turbocat.net]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; IP_SCORE(-3.28)[ip: (-9.48), ipnet: 88.99.0.0/16(-4.66), asn: 24940(-2.25), country: DE(-0.01)]; FREEMAIL_TO(0.00)[netscape.net]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] 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: Mon, 18 Feb 2019 09:29:01 -0000 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