ACPI/PMU procfs HAL test program. Version 002.

Paul Ionescu i_p_a_u_l at yahoo.com
Sun Jan 23 15:47:02 PST 2005


On Mon, 24 Jan 2005 01:33:13 +0200, Paul Ionescu wrote:

> Hi,
> 
> On Sun, 23 Jan 2005 20:23:15 +0000, Richard Hughes wrote:
> 
>> Could you please comment on the code, compile it, run it, before I send
>> any patches for HEAD. It's a lot simpler to change and debug a 10k .c
>> file than the whole of haldaemon.
> 
> You should check for /proc/acpi/ibm/driver not /proc/acpi/ibm/version.

Here is a patch to procfs.c to add version of ibm-acpi driver:

--- procfs.c    2005-01-23 22:11:07.000000000 +0200
+++ procfs-new.c        2005-01-24 01:44:25.717583573 +0200
@@ -395,7 +395,24 @@
 */
 void procfs_acpi_extra_ibm(int d, char* procfspath)
 {
-       return;
+       char* path;
+       char* buffer;
+
+       /* Create procfs string */
+       path = g_strjoin("/", procfspath, "driver", NULL);
+
+       /* create temporary buffer */
+       buffer = g_strnfill (MAX_PROCFS_DATAVAL, (gchar) NULL);
+
+       /* Parse information */
+       if ( procfs_getvalue(path, "version:", buffer) )
+               hal_device_property_set_string(d, "linux.acpi.ibm.version", buffer);
+       /* we need the root UDI somehow */
+
+       /* Free allocated buffers */
+       g_free(path);
+       g_free(buffer);
+
 }
 
 /*
@@ -484,7 +501,7 @@
        /* use kernel extensions if present */
        if ( g_file_test("/proc/acpi/toshiba/version", G_FILE_TEST_EXISTS) )
                procfs_acpi_extra_toshiba(d, "/proc/acpi/toshiba");
-       if ( g_file_test("/proc/acpi/ibm/version", G_FILE_TEST_EXISTS) )
+       if ( g_file_test("/proc/acpi/ibm/driver", G_FILE_TEST_EXISTS) )
                procfs_acpi_extra_ibm(d, "/proc/acpi/ibm");
        if ( g_file_test("/proc/acpi/asus/version", G_FILE_TEST_EXISTS) )
                procfs_acpi_extra_asus(d, "/proc/acpi/asus");


_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list