[lkml]   [2008]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: New IOCTLs
* Singaravelan Nallasellan <> wrote:


> 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.

Simply add an clone file, reading from it creates new context and
sends back its ID.

box:/ # cat /sys/class/xxx/foodriver/clone

box:/ # cat /sys/class/xxx/foodriver/3/version


To destroy the context:
box:/ # echo "release" > /sys/class/xxx/foodriver/3/ctl

Enrico Weigelt == metux IT service -
Please visit the OpenSource QM Taskforce:
Patches / Fixes for a lot dozens of packages in dozens of versions:

 \ /
  Last update: 2008-12-01 22:19    [from the cache]
©2003-2014 Jasper Spaans. hosted at Digital Ocean