filling in ACPI method access via sysfs namespace
Quoted 11 lines · Alex Williamson
Quoted 7 lines · Matthew Wilcox
It seems unintuitive that you have to read the file for the method to take effect. How about having the write function invoke the method and (if there is a result) store it for later read-back via the read function? It should be discarded on close, of course. A
read()on a file with no stored result should invoke the ACPI method (on the assumption this is a parameter-less method) and return the result directly. Closing a file should discard any result from the method.
Quoted 6 lines
How's this? It behaves the way you described, but might be doing
some questionable things with the buffer to get there. Is there a better place to store the return data than back into the buf passed towrite()(akafile->private_data)? Without adding callbacks to open/close, I'm not sure how else we can dispose of the results on close. Thanks,
Is there any reason this shouldn't be an ioctl?
--Andy
Quoted 2 lines · Andy Lutomirski
Is there any reason this shouldn't be an ioctl?
See the thread John pointed me to on Friday:
http://sourceforge.net/mailarchive/message.php?msg_id=7455349
Matthew ended it with "sysfs does not support ioctls. case closed." I'm rather fond of the methods living in the sysfs directory structure...
Alex
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click