mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rick Niles <fniles@mitre.org>
To: linux-kernel@vger.kernel.org
Subject: 26 ways to set a device driver variable from userland
Date: Wed, 19 Oct 2005 13:00:45 -0400	[thread overview]
Message-ID: <1129741246.25383.23.camel@gnupooh.mitre.org> (raw)

There are so many ways to set a configuration value in a device driver. I'm wondering
which are "recommended" methods. I'm looking for some sort of guidance when writing a
new driver.  I kinda assume this is a FAQ, but I didn't see it anyway, maybe it should
be added to the FAQ.

OK there might not be 26 ways, but there's a few major ones. I'm thinking in term of
char devices so some of these might not apply to block and network drivers.

(1) ioctl, probably the oldest.
(2) use read/write to a special configuration-only /dev file (e.g. /dev/dvb)
(3) /proc filesystem
(4) sysfs
(5) module load-time command line options.

I understand that flexibility is a good thing, but some guidance would be helpful.

I sorta got the idea that /proc is "out" this year and sysfs is the "in" thing, but
what about the others?  Would you say that (2) should be be discouraged?  Did anyone
tell the DVB people that? Or maybe more is better, that is, a good driver should
allow for ALL of the above! (OK, yeah that was flame bait.)  Should EVERY variable
that can be modified by say sysfs also be settable by insmod command line?

Any guidance would be greatly appreciated,
Rick Niles.







             reply	other threads:[~2005-10-19 17:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-19 17:00 Rick Niles [this message]
2005-10-19 17:34 ` Kyle Moffett
2005-10-19 18:35   ` Christopher Friesen
2005-10-19 23:32     ` Matt Helsley
2005-10-19 23:50     ` Neil Brown
2005-10-20  4:04     ` Greg KH
     [not found]   ` <1129745264.25383.36.camel@gnupooh.mitre.org>
2005-10-19 18:36     ` Kyle Moffett
2005-10-19 20:09 ` linux-os (Dick Johnson)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1129741246.25383.23.camel@gnupooh.mitre.org \
    --to=fniles@mitre.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®