From owner-freebsd-arch@freebsd.org Sat Jun 4 08:52:58 2016 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58C53B689C8 for ; Sat, 4 Jun 2016 08:52:58 +0000 (UTC) (envelope-from phk@phk.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 250E7197F; Sat, 4 Jun 2016 08:52:57 +0000 (UTC) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.55.3]) by phk.freebsd.dk (Postfix) with ESMTP id 4F1294F57A; Sat, 4 Jun 2016 08:52:50 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTP id u548qncE013622; Sat, 4 Jun 2016 08:52:49 GMT (envelope-from phk@phk.freebsd.dk) To: KILOREUX Emperex cc: freebsd-arch@freebsd.org, Koop Mast , eadler@freebsd.org, =?UTF-8?B?SmVhbi1Tw6liYXN0aWVuIFDDqWRyb24=?= Subject: Re: API to link sysctl nodes to devices In-reply-to: From: "Poul-Henning Kamp" References: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <13620.1465030369.1@critter.freebsd.dk> Content-Transfer-Encoding: quoted-printable Date: Sat, 04 Jun 2016 08:52:49 +0000 Message-ID: <13621.1465030369@critter.freebsd.dk> X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Jun 2016 08:52:58 -0000 -------- In message , KILOREUX Emperex writes: >As part of my participation GSOC, I have been working on an API spec to >link sysctl nodes to devices. It's not really the sysctl nodes as such you should focus on, but rather on the gap between (the increasingly inaccurately named) newbus and devfs. The poster-boy example is how you get from USB bus coordinates to /dev/da* or /dev/{tty|cua}U* devices. devd(8) seems to know the linkage and usually I resort to /etc/devd entries like this to make it liveable: attach 1000 { match "device-name" "uftdi[0-9]*"; match "vendor" "0x0403"; match "product" "0x6001"; match "sernum" "FTHAV9UU"; action "ln -s /dev/cua$ttyname /dev/bbb1"; }; notify 1000 { match "system" "USB"; match "subsystem" "DEVICE"; match "type" "DETACH"; match "vendor" "0x0403"; match "product" "0x6001"; match "sernum" "FTHAV9UU"; action "rm -f /dev/bbb1"; }; -- = Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe = Never attribute to malice what can adequately be explained by incompetence= .