Re: New IOCTLs

From: Enrico Weigelt
Date: Mon Dec 01 2008 - 16:17:34 EST

* Singaravelan Nallasellan <singaravelann@xxxxxxxxx> 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:
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at