From: Chris Snook <csnook@redhat.com>
To: Singaravelan Nallasellan <singaravelann@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: New IOCTLs
Date: Fri, 19 Sep 2008 15:22:31 -0400 [thread overview]
Message-ID: <48D3FBF7.4000106@redhat.com> (raw)
In-Reply-To: <3baf3d760809172123q5445780dldaaa51d59c0b688a@mail.gmail.com>
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.
If you really need for each file descriptor that opens your device to have a
unique context and set of properties that may be different from the rest, then
an IOCTL might be legitimate here. If the device behaves the same way
independent of context, then it's really just a locking issue, sysfs is the way
to go.
-- Chris
> 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/
next prev parent reply other threads:[~2008-09-19 19:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-17 16:55 New IOCTLs 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
2008-09-19 19:22 ` Chris Snook [this message]
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=48D3FBF7.4000106@redhat.com \
--to=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