sysfs read access on attribute -> output buffer
hallo,
i created 3 attributes for a device:
static char *ubergabeName = "omg";
...
...
.....
DEVICE_ATTR(name,0644,NULL,NULL);
DEVICE_ATTR(pid,0644,NULL,NULL);
DEVICE_ATTR(pgdir,0644,NULL,NULL);
device_create_file(husoDevice,&dev_attr_name);
device_create_file(husoDevice,&dev_attr_pid);
device_create_file(husoDevice,&dev_attr_pgdir);
now, if in usermode, a reading access on "name" is noticed, the value of ubergabeName (== omg) must be copied to the output puffer.
i think it has something to do with sysfs_ops but i dont know how to write that,
if anyone can help, could you please write a small sourcecode?
thanks
|