Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Jun 2016 04:02:00 +0100
From:      KILOREUX Emperex <kiloreux@gmail.com>
To:        Hans Petter Selasky <hps@selasky.org>
Cc:        freebsd-arch@freebsd.org, Koop Mast <kwm@freebsd.org>, eadler@freebsd.org,  =?UTF-8?B?SmVhbi1Tw6liYXN0aWVuIFDDqWRyb24=?= <dumbbell@freebsd.org>
Subject:   Re: API to link sysctl nodes to devices
Message-ID:  <CAN1JrQ1pmiDaR9Hw-TZBe5R0%2BtAsncXRy%2BGKGXOe_VpMEiDKAA@mail.gmail.com>
In-Reply-To: <6b21329d-33ea-e628-b06c-27a744c9ec09@selasky.org>
References:  <CAN1JrQ2dd0WZi0_aaNdqH9xdy292tP2DYLxvKV9bfK93vYFLXw@mail.gmail.com> <6b21329d-33ea-e628-b06c-27a744c9ec09@selasky.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hey,

A lot of properties can be easier for other drivers if accessed through
sysctl nodes in a way relate to the device itself, for example, the PCI id
for the device that could be a bit more complex to obtain otherwise.

And for the ID, yeah that seems fine, but what do you think about the
concept in general, got any other way to think about it ? Or do you think I
should approach it any differently ?

On Fri, Jun 3, 2016 at 9:24 PM, Hans Petter Selasky <hps@selasky.org> wrote:

> 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
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAN1JrQ1pmiDaR9Hw-TZBe5R0%2BtAsncXRy%2BGKGXOe_VpMEiDKAA>