diff -Nur -x '*.orig' -x '*~' hal-0.5.11~rc2/hald/linux/addons/addon-dell-backlight.cpp hal-0.5.11~rc2.new/hald/linux/addons/addon-dell-backlight.cpp --- hal-0.5.11~rc2/hald/linux/addons/addon-dell-backlight.cpp 2008-03-17 16:25:13.000000000 -0500 +++ hal-0.5.11~rc2.new/hald/linux/addons/addon-dell-backlight.cpp 2008-07-18 13:24:16.000000000 -0500 @@ -48,6 +48,8 @@ static u32 minValue = 0; static u32 maxValue = 0; +static bool hasPass = false; + using namespace std; using namespace smi; @@ -89,6 +91,13 @@ 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 @@ 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 @@ 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;