From owner-freebsd-gnome@FreeBSD.ORG Mon Feb 2 18:34:51 2009 Return-Path: Delivered-To: freebsd-gnome@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 722F2106573B for ; Mon, 2 Feb 2009 18:34:50 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: freebsd-gnome@FreeBSD.org Date: Mon, 2 Feb 2009 13:34:32 -0500 User-Agent: KMail/1.6.2 MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_6yzhJ2Gk4+365H/" Message-Id: <200902021334.34173.jkim@FreeBSD.org> Cc: Subject: [PATCH] sysutils/hal X-BeenThere: freebsd-gnome@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GNOME for FreeBSD -- porting and maintaining List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Feb 2009 18:34:51 -0000 --Boundary-00=_6yzhJ2Gk4+365H/ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Please review the attached patch: - Do not search for Linux-specific hald-addon-acpi module. - Remove unnecessary ioctl calls for battery on non-laptops. - Do not use model-specific sysctl if it is not available. - Always provide frequencies of BSP as we do not export APs' yet. Thanks, Jung-uk Kim --Boundary-00=_6yzhJ2Gk4+365H/ Content-Type: text/plain; charset="iso-8859-1"; name="hal.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="hal.diff" Index: sysutils/hal/Makefile =================================================================== RCS file: /home/pcvs/ports/sysutils/hal/Makefile,v retrieving revision 1.46 diff -u -r1.46 Makefile --- sysutils/hal/Makefile 31 Jan 2009 21:49:13 -0000 1.46 +++ sysutils/hal/Makefile 2 Feb 2009 18:00:37 -0000 @@ -8,7 +8,7 @@ PORTNAME= hal DISTVERSION= 0.5.11 -PORTREVISION= 15 +PORTREVISION= 16 CATEGORIES= sysutils MASTER_SITES= http://hal.freedesktop.org/releases/ Index: sysutils/hal/files/patch-fdi_policy_10osvendor_10-power-mgmt-policy.fdi =================================================================== RCS file: sysutils/hal/files/patch-fdi_policy_10osvendor_10-power-mgmt-policy.fdi diff -N sysutils/hal/files/patch-fdi_policy_10osvendor_10-power-mgmt-policy.fdi --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sysutils/hal/files/patch-fdi_policy_10osvendor_10-power-mgmt-policy.fdi 2 Feb 2009 18:00:37 -0000 @@ -0,0 +1,13 @@ +--- fdi/policy/10osvendor/10-power-mgmt-policy.fdi.orig 2008-05-07 19:21:15.000000000 -0400 ++++ fdi/policy/10osvendor/10-power-mgmt-policy.fdi 2009-01-30 17:41:05.000000000 -0500 +@@ -10,7 +10,9 @@ + + + +- hald-addon-acpi ++ ++ hald-addon-acpi ++ + + + Index: sysutils/hal/files/patch-hald_freebsd_hf-acpi.c =================================================================== RCS file: sysutils/hal/files/patch-hald_freebsd_hf-acpi.c diff -N sysutils/hal/files/patch-hald_freebsd_hf-acpi.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sysutils/hal/files/patch-hald_freebsd_hf-acpi.c 2 Feb 2009 18:00:37 -0000 @@ -0,0 +1,31 @@ +--- hald/freebsd/hf-acpi.c.orig 2008-05-07 19:23:59.000000000 -0400 ++++ hald/freebsd/hf-acpi.c 2009-01-30 15:53:14.000000000 -0500 +@@ -105,6 +105,9 @@ hf_acpi_poll_batt (HalDevice *device) + gboolean ispresent; + union acpi_battery_ioctl_arg battif, battst, battinfo; + ++ if (! hf_has_sysctl("hw.acpi.battery")) ++ return; ++ + battif.unit = battst.unit = battinfo.unit = + hal_device_property_get_int(device, "freebsd.unit"); + +@@ -504,6 +507,8 @@ hf_acpi_laptop_panel_new (HalDevice *par + + g_return_val_if_fail(HAL_IS_DEVICE(parent), NULL); + ++ if (! hf_has_sysctl("hw.acpi.%s", access)) ++ return NULL; + device = hf_device_new(parent); + + hf_device_property_set_string_printf(device, "info.product", "Laptop Panel (%s)", name); +@@ -597,7 +602,8 @@ hf_acpi_probe (void) + laptop_panel_types[i].max_sysctl, + laptop_panel_types[i].access, + laptop_panel_types[i].name); +- hf_device_preprobe_and_add(panel_device); ++ if (panel_device) ++ hf_device_preprobe_and_add(panel_device); + } + } + } Index: sysutils/hal/files/patch-hald_freebsd_hf-devtree.c =================================================================== RCS file: /home/pcvs/ports/sysutils/hal/files/patch-hald_freebsd_hf-devtree.c,v retrieving revision 1.1 diff -u -r1.1 patch-hald_freebsd_hf-devtree.c --- sysutils/hal/files/patch-hald_freebsd_hf-devtree.c 26 Jan 2009 17:55:44 -0000 1.1 +++ sysutils/hal/files/patch-hald_freebsd_hf-devtree.c 2 Feb 2009 18:00:37 -0000 @@ -1,6 +1,30 @@ --- hald/freebsd/hf-devtree.c.orig 2008-05-07 19:24:03.000000000 -0400 -+++ hald/freebsd/hf-devtree.c 2009-01-25 17:17:02.000000000 -0500 -@@ -426,7 +426,13 @@ hf_devtree_probe (void) ++++ hald/freebsd/hf-devtree.c 2009-01-30 14:30:57.000000000 -0500 +@@ -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); +@@ -426,7 +434,13 @@ hf_devtree_probe (void) HalDevice *device; device = hf_devtree_device_new(parent, info->handler, info->unit); @@ -15,7 +39,7 @@ } devices = g_slist_delete_link(devices, root); -@@ -434,6 +440,17 @@ hf_devtree_probe (void) +@@ -434,6 +448,17 @@ hf_devtree_probe (void) } } @@ -33,7 +57,7 @@ HalDevice * hf_devtree_find_from_name (HalDeviceStore *store, const char *name) { -@@ -597,5 +614,6 @@ hf_devtree_is_driver (const char *name, +@@ -597,5 +622,6 @@ hf_devtree_is_driver (const char *name, } HFHandler hf_devtree_handler = { --Boundary-00=_6yzhJ2Gk4+365H/--