From owner-freebsd-arch@freebsd.org Mon Jun 6 03:07:19 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 1E1D6B6AA38 for ; Mon, 6 Jun 2016 03:07:19 +0000 (UTC) (envelope-from kiloreux@gmail.com) Received: from mail-lf0-x236.google.com (mail-lf0-x236.google.com [IPv6:2a00:1450:4010:c07::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 95E181B25; Mon, 6 Jun 2016 03:07:18 +0000 (UTC) (envelope-from kiloreux@gmail.com) Received: by mail-lf0-x236.google.com with SMTP id s64so86131093lfe.0; Sun, 05 Jun 2016 20:07:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=hBJIwfQTZQ39asciDCwI1XMckybRQPZFiBMgBmPJhsQ=; b=QVVQhJKCAijoG1/NANiapugG9it/mkEIV0xW+VL9zzghJapVdEOCuS5THrt1rw5tif Kmh35nH0C5xpucCePccvF9qdX7u5Gz10rrTJlP42V5m2jtx57NI2H2y3gYGqWY5a2cEp XqWX5NraUIVrCRnmRd6QAbTW9lTFwSC8h3McXo6sQnKmgMsCBxDrxgupFuCTw/C7Qv93 /dM/rywAApDF9jtU67hTEniEMuE2CDbZA7AfdaiZgz5IG0w4jo0vcnE4NYogUkXEszz6 M98WqEr5KledOhiUK5ddDUGpB8RmBvs9k57TX38oCZU3sMenUS7y2EmU6nRW1AKgQboc EbDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=hBJIwfQTZQ39asciDCwI1XMckybRQPZFiBMgBmPJhsQ=; b=AG99rcbnYtQ68Qj2LrD2ANFQlGpMBUNFB0AKDjOiBpln0SxgXYoCw3oJlwg1flzCK5 rLi0lFtv0sJfjjWDeHOGOVHx9jMhJKbZIxk/9Ajjd1bSlOseSrv+3w/DAfiqN9eHdEpD hVoZHEO5a6Lec8F8968Au1MfGAVUk83dbzk+A1qxJ+ySb6mtLzFU90p0bd2BPvOjWPR1 jjSPlwJaSOfLu7vgBMOLuIj9KRmTNbL+D88xt3so/NrPSkSuvE5D9LCZtgrGaHbWGIhP 1fBubbioIf34dt0mlKIAW3xmpz27QC5zvhEL0YyLzAloqzhmozeF3lpw8+7DJ4vHb6Wy yi1w== X-Gm-Message-State: ALyK8tI46y7z6K/gGtwH7p8uAJ3JUhT7fQAJ4cRG/++Yk51GZq6+S4WJzyDeLjGpf0vOLxXNjg6USNxhivQ41A== X-Received: by 10.25.30.213 with SMTP id e204mr536779lfe.71.1465182436850; Sun, 05 Jun 2016 20:07:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.16.166 with HTTP; Sun, 5 Jun 2016 20:07:16 -0700 (PDT) In-Reply-To: <13621.1465030369@critter.freebsd.dk> References: <13621.1465030369@critter.freebsd.dk> From: KILOREUX Emperex Date: Mon, 6 Jun 2016 04:07:16 +0100 Message-ID: Subject: Re: API to link sysctl nodes to devices To: Poul-Henning Kamp Cc: freebsd-arch@freebsd.org, Koop Mast , eadler@freebsd.org, =?UTF-8?B?SmVhbi1Tw6liYXN0aWVuIFDDqWRyb24=?= Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 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: Mon, 06 Jun 2016 03:07:19 -0000 Hey, Thanks for your feedback, but we have been over this and what you are proposing seems pretty interesting, can you please elaborate on how that could be implemented inside the kernel, or give more details about it, also it seems a bit cool if we could do both of them together, so what do you think about sysctl nodes, is there any disadvantages for the implementation of such API ? On Sat, Jun 4, 2016 at 9:52 AM, Poul-Henning Kamp wrote: > -------- > In message < > CAN1JrQ2dd0WZi0_aaNdqH9xdy292tP2DYLxvKV9bfK93vYFLXw@mail.gmail.com> > , 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. >