diff options
Diffstat (limited to 'hald/freebsd/hf-devtree.c')
-rw-r--r-- | hald/freebsd/hf-devtree.c | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/hald/freebsd/hf-devtree.c b/hald/freebsd/hf-devtree.c index 01203f05..7a54feb5 100644 --- a/hald/freebsd/hf-devtree.c +++ b/hald/freebsd/hf-devtree.c @@ -86,7 +86,11 @@ hf_devtree_cpu_can_throttle (int cpu) gboolean can = FALSE; char *levels; +#ifdef notyet levels = hf_get_string_sysctl(NULL, "dev.cpu.%i.freq_levels", cpu); +#else + levels = hf_get_string_sysctl(NULL, "dev.cpu.0.freq_levels"); +#endif if (levels) { char **toks; @@ -109,7 +113,11 @@ hf_devtree_cpu_get_maxfreq (int cpu) char *levels; int freq = -1; +#ifdef notyet levels = hf_get_string_sysctl(NULL, "dev.cpu.%i.freq_levels", cpu); +#else + levels = hf_get_string_sysctl(NULL, "dev.cpu.0.freq_levels"); +#endif if (levels) { sscanf(levels, "%i/", &freq); @@ -186,7 +194,7 @@ hf_devtree_fd_set_properties (HalDevice *device) static void hf_devtree_atkbd_set_properties (HalDevice *device) { - hf_device_set_input(device, "keyboard", NULL); + hf_device_set_input(device, "keyboard", "keys", NULL); } static void @@ -195,7 +203,7 @@ hf_devtree_psm_set_properties (HalDevice *device) char *devname; devname = hf_devtree_device_get_name(device); - hf_device_set_input(device, "mouse", devname); + hf_device_set_input(device, "mouse", NULL, devname); g_free(devname); } @@ -205,7 +213,7 @@ hf_devtree_joy_set_properties (HalDevice *device) char *devname; devname = hf_devtree_device_get_name(device); - hf_device_set_input(device, "joystick", devname); + hf_device_set_input(device, "joystick", NULL, devname); g_free(devname); if (! hal_device_has_property(device, "info.product")) @@ -379,7 +387,8 @@ static Handler handlers[] = { { "pcm", NULL }, { "psm", hf_devtree_psm_set_properties }, { "sio", NULL }, - { "speaker", NULL } + { "speaker", NULL }, + { "usbus", NULL } }; static void @@ -426,7 +435,13 @@ hf_devtree_probe (void) HalDevice *device; device = hf_devtree_device_new(parent, info->handler, info->unit); - hf_device_preprobe_and_add(device); + if (hf_device_preprobe(device)) + { + if (hal_device_has_capability(device, "input.mouse")) + hf_runner_run_sync(device, 0, "hald-probe-mouse", NULL); + + hf_device_add(device); + } } devices = g_slist_delete_link(devices, root); @@ -434,6 +449,17 @@ hf_devtree_probe (void) } } +static gboolean +hf_devtree_rescan (HalDevice *device) +{ + if (hal_device_has_capability(device, "input.mouse")) + { + hf_runner_run_sync(device, 0, "hald-probe-mouse", NULL); + return TRUE; + } + return FALSE; +} + HalDevice * hf_devtree_find_from_name (HalDeviceStore *store, const char *name) { @@ -597,5 +623,6 @@ hf_devtree_is_driver (const char *name, const char *driver) } HFHandler hf_devtree_handler = { - .probe = hf_devtree_probe + .probe = hf_devtree_probe, + .device_rescan = hf_devtree_rescan }; |