mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Louis Rilling <Louis.Rilling@kerlabs.com>
To: Singaravelan Nallasellan <singaravelann@gmail.com>
Cc: Chris Snook <csnook@redhat.com>, linux-kernel@vger.kernel.org
Subject: Re: New IOCTLs
Date: Thu, 18 Sep 2008 11:11:07 +0200	[thread overview]
Message-ID: <20080918091107.GE20061@hawkmoon.kerlabs.com> (raw)
In-Reply-To: <3baf3d760809172123q5445780dldaaa51d59c0b688a@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2561 bytes --]

On Thu, Sep 18, 2008 at 09:53:51AM +0530, Singaravelan Nallasellan wrote:
> Thank you for your response.
> 
> The driver needs to assign an id for each open and create a sysfs
> entry based on that id and expose some properties.
> 
> For example, if the driver assigns an id 2, the sysfs entry will be as below:
> /sys/class/xxx/<drivername>/2/version
> 
> When the driver close is invoked, it will have to remove the entry.
> 
> The issue here is that the application needs:
> 1. To know the id it should use to access properties after the open.
> 2. To have exclusive access to the sysfs entries. No other application
> should and open the entry and use it. There is a chance the the other
> application could open the entries before this application opens it.
> 
> The driver allows multiple opens and assigns any random id.
> 
> I appreciate your suggestion on alternate ways to implement the functionality.

What about using configfs? A user could create an id using mkdir in the driver's
configfs subsystem, and this would make the driver create the matching sysfs
entry.

# mkdir /sys/kernel/config/<driver_subsys>/2
-> reserve id 2 for the caller, and create /sys/class/xxx/<drivername>/2

You could even put whatever configuration items inside configfs instead of
sysfs.

Louis

> 
> 
> On Thu, Sep 18, 2008 at 1:42 AM, Chris Snook <csnook@redhat.com> wrote:
> > Singaravelan Nallasellan wrote:
> >>
> >> I need to send device control messages to the driver. I am planning to
> >> use the IOCTLs. But I came to know that Linux community does not
> >> accept any new IOCTLs anymore.
> >> Can somebody provide the reason behind the decision? Are there any
> >> better approach to implement the device control interface other than
> >> sysfs interface. I have some issues in using the sysfs interface.
> >> Thanks in advance.
> >
> > IOCTLs are discouraged, but not strictly forbidden.  Is there something
> > about sysfs that would make it an unsuitable interface, or are you just
> > having trouble finding good documentation on using it?
> >
> > -- Chris
> >
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
Dr Louis Rilling			Kerlabs
Skype: louis.rilling			Batiment Germanium
Phone: (+33|0) 6 80 89 08 23		80 avenue des Buttes de Coesmes
http://www.kerlabs.com/			35700 Rennes

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2008-09-18  9:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-17 16:55 Singaravelan Nallasellan
2008-09-17 17:08 ` Alan Cox
2008-09-17 17:45 ` Valdis.Kletnieks
2008-09-17 20:12 ` Chris Snook
2008-09-18  4:23   ` Singaravelan Nallasellan
2008-09-18  9:11     ` Louis Rilling [this message]
2008-09-19 19:22     ` Chris Snook
2008-12-01 21:14     ` Enrico Weigelt
     [not found] <bd8Hz-6QR-17@gated-at.bofh.it>
     [not found] ` <bdbFu-2cb-23@gated-at.bofh.it>
     [not found]   ` <bdjjC-3tt-7@gated-at.bofh.it>
     [not found]     ` <bdnQd-13j-17@gated-at.bofh.it>
2008-09-18 14:54       ` Bodo Eggert

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=20080918091107.GE20061@hawkmoon.kerlabs.com \
    --to=louis.rilling@kerlabs.com \
    --cc=csnook@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=singaravelann@gmail.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 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®