lkml.org 
[lkml]   [2000]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: /proc guidelines and sysctl
    Date
    In article <8725685E.007519CF.00@d53mta03h.boulder.ibm.com>,
    <breed@almaden.ibm.com> wrote:
    >
    >I wrote an wireless ethernet driver awhile ago
    >(http://www.cse.ucsc.edu/~breed/airo.html) and found the /proc interface to
    >be an extremely useful interface to the many knobs in the card. I am a bit
    >uncomfortable defining my own namespace in the /proc file system (did it
    >anyway:) and I've been wondering for a while if there are guidelines
    >somewhere on where things should go. I would really like to tap into an
    >existing directory for ethX for example...

    The thing to do is to create a

    /proc/drivers/<drivername>/

    directory. The /proc/drivers/ directory is already there, so you'd
    basically do something like

    create_proc_info_entry("driver/mydriver/status", 0, NULL, mydriver_status_read);

    to create a "status" file (etc etc).

    >And finally, what's up with sysctl? Are driver writers recommended to use
    >that over extending /proc or is it deprecated? Again guide lines would be
    >nice.

    sysctl is deprecated. It's useful in one way only: it has some nice
    functions that can be used to add a block of /proc names. However, it
    has other downsides (allocating silly numbers etc - there should be no
    need for that, considering that the /proc namespace is alreayd a
    perfectly good namespace).

    Linus

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.rutgers.edu
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 13:55    [W:2.198 / U:0.716 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site