hal: Branch 'master'

Danny Kukawka dkukawka at kemper.freedesktop.org
Wed Aug 27 11:57:22 PDT 2008


 hald/linux/addons/addon-dell-backlight.cpp |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

New commits:
commit 6018eef72cd4395a22f35a01c6d7d6e23ec65471
Author: Mario Limonciello <mario_limonciello at dell.com>
Date:   Wed Aug 27 20:55:46 2008 +0200

    check if BIOS password is present prior to use libsmbios commands
    
    Check if BIOS password is present prior to use libsmbios commands.
    
    From ML:
    > I was made aware of a bug that was present in HAL causing users to get
    > frequent lockups from their systems when a BIOS password was set.  In
    > order to work around the issue, I added two patches to libsmbios
    > which is present in the latest libsmbios release (2.0.3).  I
    > also produced a patch for HAL that uses this added libsmbios support.

diff --git a/hald/linux/addons/addon-dell-backlight.cpp b/hald/linux/addons/addon-dell-backlight.cpp
index f6ee582..ab5db9f 100644
--- a/hald/linux/addons/addon-dell-backlight.cpp
+++ b/hald/linux/addons/addon-dell-backlight.cpp
@@ -48,6 +48,8 @@ static const int DELL_LCD_BRIGHTNESS_TOKEN = 0x007d;
 static u32 minValue = 0;
 static u32 maxValue = 0;
 
+static bool hasPass = false;
+
 using namespace std;
 using namespace smi;
 
@@ -89,6 +91,13 @@ read_backlight (dbus_bool_t onAC)
 	return curValue;
 }
 
+static void
+check_bios_password()
+{
+	if (smi::getPasswordStatus((u16)9) || smi::getPasswordStatus((u16)10))
+		hasPass=true;
+}
+
 static void 
 write_backlight (u32 newBacklightValue, dbus_bool_t onAC) 
 {	
@@ -96,6 +105,11 @@ write_backlight (u32 newBacklightValue, dbus_bool_t onAC)
 	u32 curValue;
 	writefn writeFunction;
 	string password(""); /* FIXME: Implement password support */
+
+	if (hasPass) {
+		HAL_WARNING(("Setting brightness via SMI is not supported with a BIOS password"));
+		return;
+	}
 	
 	if (onAC) 
                 writeFunction = &smi::writeACModeSetting;
@@ -309,6 +323,8 @@ main (int argc, char *argv[])
 
 	read_backlight (TRUE); /* Fill min- & maxValue with the correct values */
 
+	check_bios_password(); /* Find out about our BIOS pass capabilities */
+
 	if (maxValue == 0) {
 		HAL_ERROR (("This machine don't support set brightness."));
 		return -5;


More information about the hal-commit mailing list