From: Greg KH <greg@kroah.com>
To: Christopher Friesen <cfriesen@nortel.com>
Cc: Kyle Moffett <mrmacman_g4@mac.com>, Rick Niles <fniles@mitre.org>,
linux-kernel@vger.kernel.org
Subject: Re: 26 ways to set a device driver variable from userland
Date: Wed, 19 Oct 2005 21:04:19 -0700 [thread overview]
Message-ID: <20051020040419.GA9179@kroah.com> (raw)
In-Reply-To: <435691EF.8070406@nortel.com>
On Wed, Oct 19, 2005 at 12:35:27PM -0600, Christopher Friesen wrote:
> Kyle Moffett wrote:
>
> >>(4) sysfs
>
> >This is ideal for almost all device driver purposes.
>
> The one thing that I have yet to see a good solution for is
> transaction-based operations, where userspace passes in something (could
> be a command, a new value, a query, etc.) and expects some data in return.
>
> The ioctl() method is ideal for this, passing down a binary struct with
> a command/query member, and the driver fills in the rest of the struct
> based on the commnd.
>
> How do you do this cleanly via sysfs? It seems like you either double
> the number of syscalls (write to one file, read from another) or else
> you need to have sysfs files for every possible query/command, so that
> the input becomes implicitly encoded in the file that you are reading.
> This could end up creating a large number of files depending on the
> range of inputs.
>
> Are there any other standard ways to do this?
Take a look at configfs, as part of the ocfs2 patches in the -mm tree.
It is set up to help solve this using a filesystem much like sysfs.
thanks,
greg k-h
next prev parent reply other threads:[~2005-10-20 4:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-19 17:00 26 ways to set a device driver variable from userland Rick Niles
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 [this message]
[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=20051020040419.GA9179@kroah.com \
--to=greg@kroah.com \
--cc=cfriesen@nortel.com \
--cc=fniles@mitre.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mrmacman_g4@mac.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.