atom feed6 messages in org.freebsd.freebsd-acpino way to force AC state if current o...
FromSent OnAttachments
Andriy GaponFeb 1, 2008 8:13 am 
Andriy GaponFeb 11, 2008 1:29 pm 
Nate LawsonFeb 12, 2008 12:28 am 
Nate LawsonFeb 15, 2008 3:34 pm 
Rui PauloFeb 15, 2008 6:09 pm 
Andriy GaponFeb 16, 2008 1:41 am 
Subject:no way to force AC state if current one is none
From:Andriy Gapon (av@icyb.net.ua)
Date:Feb 1, 2008 8:13:02 am
List:org.freebsd.freebsd-acpi

I noticed that I can force AC state change via sysctl if current state is none/-1.

acpi_tz_monitor() has the following lines:

/* Handle user override of active mode */ if (sc->tz_requested != TZ_ACTIVE_NONE && sc->tz_requested < newactive) newactive = sc->tz_requested;

If say tz_requested is 1, but auto-calculated newactive is -1 (none), then this check fails and tz_requested is ignored. It seems there should be a check that newactive is not -1: if (sc->tz_requested != TZ_ACTIVE_NONE && (newactive == TZ_ACTIVE_NONE || sc->tz_requested < newactive))

What do you think ?