hal/hald/linux2 Makefile.am, 1.10, 1.11 pcmcia_cs.h, 1.4,
NONE pcmcia_utils.c, 1.4, NONE pcmcia_utils.h, 1.4,
NONE physdev.c, 1.24, 1.25
David Zeuthen
david at freedesktop.org
Sat Jan 21 11:51:20 PST 2006
Update of /cvs/hal/hal/hald/linux2
In directory gabe:/tmp/cvs-serv14434/hald/linux2
Modified Files:
Makefile.am physdev.c
Removed Files:
pcmcia_cs.h pcmcia_utils.c pcmcia_utils.h
Log Message:
2006-01-21 David Zeuthen <davidz at redhat.com>
* configure.in: Remove options for pcmcia as we now rely on sysfs on
Linux
* hald/linux2/Makefile.am (libhald_linux2_la_SOURCES): Remove
pcmcia_cs.h and pcmcia.utils.[ch]
* hald/linux2/pcmcia_cs.h, hald/linux2/pcmcia_utils.[ch]: Removed
* hald/linux2/physdev.c (pcmcia_add): Read properties from sysfs
instead of relying on e.g. /var/pcmcia/stab
Index: Makefile.am
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/Makefile.am,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- Makefile.am 23 Jun 2005 14:50:04 -0000 1.10
+++ Makefile.am 21 Jan 2006 19:51:18 -0000 1.11
@@ -26,9 +26,7 @@
acpi.h acpi.c \
apm.h apm.c \
pmu.h pmu.c \
- ids.h ids.c \
- pcmcia_utils.h pcmcia_utils.c \
- pcmcia_cs.h
+ ids.h ids.c
--- pcmcia_cs.h DELETED ---
--- pcmcia_utils.c DELETED ---
--- pcmcia_utils.h DELETED ---
Index: physdev.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/physdev.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- physdev.c 20 Jan 2006 15:40:03 -0000 1.24
+++ physdev.c 21 Jan 2006 19:51:18 -0000 1.25
@@ -56,8 +56,6 @@
#include "ids.h"
-#include "pcmcia_utils.h"
-
#include "osspec_linux.h"
/*--------------------------------------------------------------------------------------------------------------*/
@@ -580,6 +578,8 @@
HalDevice *d;
const gchar *bus_id;
guint socket, function;
+ const char *prod_id1;
+ const char *prod_id2;
d = hal_device_new ();
hal_device_property_set_string (d, "linux.sysfs_path", sysfs_path);
@@ -599,61 +599,35 @@
sscanf (bus_id, "%d.%d", &socket, &function);
hal_device_property_set_int (d, "pcmcia.socket_number", socket);
- /* TODO: need to read this from sysfs instead of relying on stab */
- {
- pcmcia_card_info *info;
-
- info = pcmcia_card_info_get (socket);
- if (info != NULL) {
- const char *type;
-
- if (info->productid_1 != NULL && strlen (info->productid_1) > 0)
- hal_device_property_set_string (d, "pcmcia.productid_1", info->productid_1);
- else
- hal_device_property_set_string (d, "pcmcia.productid_1", "");
- if (info->productid_2 != NULL && strlen (info->productid_2) > 0)
- hal_device_property_set_string (d, "pcmcia.productid_2", info->productid_2);
- else
- hal_device_property_set_string (d, "pcmcia.productid_2", "");
- if (info->productid_3 != NULL && strlen (info->productid_3) > 0)
- hal_device_property_set_string (d, "pcmcia.productid_3", info->productid_3);
- else
- hal_device_property_set_string (d, "pcmcia.productid_3", "");
- if (info->productid_4 != NULL && strlen (info->productid_4) > 0)
- hal_device_property_set_string (d, "pcmcia.productid_4", info->productid_4);
- else
- hal_device_property_set_string (d, "pcmcia.productid_4", "");
-
- if ((type = pcmcia_card_type_string_from_type (info->type)))
- hal_device_property_set_string (d, "pcmcia.function", type);
- else
- hal_device_property_set_string (d, "pcmcia.function", "");
-
- hal_device_property_set_int (d, "pcmcia.manfid1", info->manfid_1);
- hal_device_property_set_int (d, "pcmcia.manfid2", info->manfid_2);
+ hal_util_set_string_from_file (d, "pcmcia.prod_id1", sysfs_path, "prod_id1");
+ hal_util_set_string_from_file (d, "pcmcia.prod_id2", sysfs_path, "prod_id2");
+ hal_util_set_string_from_file (d, "pcmcia.prod_id3", sysfs_path, "prod_id3");
+ hal_util_set_string_from_file (d, "pcmcia.prod_id4", sysfs_path, "prod_id4");
- /* Provide best-guess of vendor, goes in Vendor property */
- if (info->productid_1 != NULL) {
- hal_device_property_set_string (d, "info.vendor", info->productid_1);
- } else {
- gchar buf[50];
- g_snprintf (buf, sizeof(buf), "Unknown (0x%04x)", info->manfid_1);
- hal_device_property_set_string (d, "info.vendor", buf);
- }
+ hal_util_set_int_from_file (d, "pcmcia.manf_id", sysfs_path, "manf_id", 16);
+ hal_util_set_int_from_file (d, "pcmcia.card_id", sysfs_path, "card_id", 16);
+ hal_util_set_int_from_file (d, "pcmcia.func_id", sysfs_path, "func_id", 16);
- /* Provide best-guess of name, goes in Product property */
- if (info->productid_2 != NULL) {
- hal_device_property_set_string (d, "info.product", info->productid_2);
- } else {
- gchar buf[50];
- g_snprintf (buf, sizeof(buf), "Unknown (0x%04x)", info->manfid_2);
- hal_device_property_set_string (d, "info.product", buf);
- }
+ prod_id1 = hal_device_property_get_string (d, "pcmcia.prod_id1");
+ prod_id2 = hal_device_property_get_string (d, "pcmcia.prod_id2");
- pcmcia_card_info_free (info);
- }
+ /* Provide best-guess of vendor, goes in Vendor property */
+ if (prod_id1 != NULL) {
+ hal_device_property_set_string (d, "info.vendor", prod_id1);
+ } else {
+ char buf[50];
+ g_snprintf (buf, sizeof(buf), "Unknown (0x%04x)", hal_device_property_get_int (d, "pcmcia.manf_id"));
+ hal_device_property_set_string (d, "info.vendor", buf);
}
+ /* Provide best-guess of name, goes in Product property */
+ if (prod_id2 != NULL) {
+ hal_device_property_set_string (d, "info.product", prod_id2);
+ } else {
+ char buf[50];
+ g_snprintf (buf, sizeof(buf), "Unknown (0x%04x)", hal_device_property_get_int (d, "pcmcia.card_id"));
+ hal_device_property_set_string (d, "info.product", buf);
+ }
return d;
}
More information about the hal-commit
mailing list