From owner-freebsd-arch@freebsd.org Fri Jun 3 20:20:42 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 03B6CB6800E for ; Fri, 3 Jun 2016 20:20:42 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (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 C02B01B8D; Fri, 3 Jun 2016 20:20:41 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (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 14BBA1FE024; Fri, 3 Jun 2016 22:20:37 +0200 (CEST) Subject: Re: API to link sysctl nodes to devices To: KILOREUX Emperex , freebsd-arch@freebsd.org References: Cc: Koop Mast , eadler@freebsd.org, =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= From: Hans Petter Selasky Message-ID: <6b21329d-33ea-e628-b06c-27a744c9ec09@selasky.org> Date: Fri, 3 Jun 2016 22:24:00 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit 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: Fri, 03 Jun 2016 20:20:42 -0000 Hi, On 06/03/16 19:14, KILOREUX Emperex wrote: > Hey, > > As part of my participation GSOC, I have been working on an API spec to > link sysctl nodes to devices. > Can you clarify a bit what you mean by "device". The term "device" was a bit too generic for me :-) I suppose you mean a "character device", right? Can you give some examples of properties for a character device, which can be exposed trough these sysctls you propose ? > And I cam up with few ideas that I need some feedback on before proceeding > to the implementation on the kernel. > > - We need devices to have their propoer sysctl trees, and thus every device > linked will have its own id as the head of its syctl tree. > > For example a device with id 0x94, would have it's sysctl root look like > dev.fs.0x94 where the below parameters can be accessed after that. Would it be better to have a direct mapping between character device name, including directories and dev.fs.xxx , like /dev/cuaU0 maps to dev.fs.cuaU0.xxx ? > > - We want to give device drivers the ability to create and delete sysctl > nodes as they want, thus proposing a proper interface for it. > > > So I have been thinking so far to enable the creation of the root for those > sysctl nodes on the system initialization, to allow existing device drivers > to link their device on the tree. > > Also we want to propose a new function similar to make_dev, supposed we > name it make_dev_sys, that gets the device id and links it on the tree of > existing sysctl nodes, and for the purpose of keeping track of the > available sysctl nodes for each device, I thought of proposing a change to > the device switching table "cdevsw" to keep systcl context tracked for the > device. > > Would any modification to cdevsw break backward compatibility ? > Please provide us with any feedback you have on this proposition and any > defects you seeing in the logic. > > Your help is much appreciated. --HPS