tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: sysctl question



On Thu, 19 Jun 2008, Quentin Garnier wrote:

On Thu, Jun 19, 2008 at 07:58:22AM -0700, Paul Goyette wrote:
As I indicated yesterday, I'm writing a device driver for on-DIMM memory
temp sensors (such as those on DDR2 FB-DIMM, some DDR2 SORDIMM, and all
DDR3).  The sensors have hardware limit registers for lower, upper, and
critical temp limits.

sysmon_envsys(9) doesn't seem to provide a mechanism for the limits to be
set from userland, so I need some other way to get values into the
registers.  I've thought of three ways to do this:

        1. Hardcode the limits in the driver, and don't provide any way
           to change them.

        2. Modify sysmon_envsys to add a new mechanism

        3. Add a sysctl to the driver for specifying the limits

#1 seems rather restrictive and makes it difficult to adjust the limits
for testing the driver.

#2 is a whole lot more work than I'm ready to sign up for at this time!

I really thought 2 was possible through the envsysd config.  But maybe
I'm wrong...

Christoff Egger and I had this discussion yesterday. Basically, there is a mechanism for a user-specified critical-level monitoring event, but that's in addition to (and separate from) the "built-in" events. And there's no mechanism for more than one such level, whereas the sensors I'm dealing with have three temp-zone boundary points and therefore four states:

        WARN_UNDER                  temp < low_lim
        NORMAL          low_lim  <= temp <= high_lim
        WARN_OVER       high_lim <  temp <= crit_lim
        CRIT_OVER       crit_lim <= temp

So that leaves #3.

Actually, there's a 4th option I just thought of:

        4. Make it a real driver and use IOCTL's

but that means burning a device major for something that you'll never touch after booting the system.

<snip>
Any suggestions on an acceptable mechanism for associating the sysctl node with the device's dev_t ?

See for instance the handler in sys/net/if_tap.c.

Thanks for the pointer!


----------------------------------------------------------------------
|   Paul Goyette   | PGP DSS Key fingerprint: |  E-mail addresses:   |
| Customer Service | FA29 0E3B 35AF E8AE 6651 |  paul%whooppee.com@localhost   |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette%juniper.net@localhost |
----------------------------------------------------------------------


Home | Main Index | Thread Index | Old Index