Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 06 Jun 2016 05:59:32 +0000
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        Warner Losh <wlosh@bsdimp.com>
Cc:        KILOREUX Emperex <kiloreux@gmail.com>, Koop Mast <kwm@freebsd.org>, eadler@freebsd.org, =?utf-8?Q?Jean-S=C3=A9bastien_P=C3=A9dron?= <dumbbell@freebsd.org>, freebsd-arch@freebsd.org
Subject:   Re: API to link sysctl nodes to devices
Message-ID:  <22384.1465192772@critter.freebsd.dk>
In-Reply-To: <070D3C32-9631-49AD-85FB-53A4865AFA08@bsdimp.com>
References:  <CAN1JrQ2dd0WZi0_aaNdqH9xdy292tP2DYLxvKV9bfK93vYFLXw@mail.gmail.com> <13621.1465030369@critter.freebsd.dk> <CAN1JrQ1eSr3%2BrPuF5d6USX=V_cTjzuAG=VXd7pFphO%2BEk2gE%2BQ@mail.gmail.com> <070D3C32-9631-49AD-85FB-53A4865AFA08@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--------
In message <070D3C32-9631-49AD-85FB-53A4865AFA08@bsdimp.com>, Warner Losh =
write
s:

>One way to do this would be dev.uftdi.0.%devnodes: ttyU2 ttyU3,
>which would require some new APIs for adding a dev_t to a device_t.
>But that might be backwards.

Many years ago I hacked up a "newbusfs" prototype, which cdevs under
a device_t named tree in /device, sort of like what Sun did:

   /device/nexus0/acpi0/pcib1/xhci0/usbus0/uhub0/uhub3/ucom0 -> /dev/ucom0

I didn't particularly like it, and it doesn't solve the problem IMO,
but it could be one way of doing it.

The opposite would be plan-9 inspiration:  Pair all cdevs with a
partner offering the information: /dev/cuaU0 has /dev/cuaU0.info
containing some lines of text with device_t linkage, serial numbers
etc.

>Of course, having a stronger coupling between device_t and dev_t would =

>allow us to detect when /dev/foo isn't destroyed when the =

>device_t created it gets detached.

The device_t:dev_t mapping is [0...N]:[0...M], (people tend to forget
things like multihomed disks) so that doesn't really work.

>As for sysctl, there's already a sysctl tree that's =

>tightly coupled to a device instance that any device can take advantage =

>of. I'm not sure what you need here, unless it's what I =

>described in the last paragraph.

I think sysctl needs backpressure, it has exploded from a specialized
place for "root only handles" to a general dumping ground.  In
particular it has a useless "all or nothing" attitude to jails.

-- =

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?22384.1465192772>