diff options
author | Steven Selph <steven.selph@gmail.com> | 2014-10-05 18:35:08 -0400 |
---|---|---|
committer | Steven Selph <steven.selph@gmail.com> | 2014-10-05 18:35:08 -0400 |
commit | 3d77cc359fdd79daf9799fa90ae18379bdabe9bf (patch) | |
tree | 269c6b1382ad3af27e7ee72684186f0b1cebd03f | |
parent | 4665dbdd51ea845a4b84d5068b4ecf31cd9dce4b (diff) | |
download | pfsense-3d77cc359fdd79daf9799fa90ae18379bdabe9bf.zip pfsense-3d77cc359fdd79daf9799fa90ae18379bdabe9bf.tar.gz |
Add powerd normal mode flag (-n)
-rw-r--r-- | conf.default/config.xml | 1 | ||||
-rw-r--r-- | etc/inc/system.inc | 6 | ||||
-rw-r--r-- | usr/local/www/system_advanced_misc.php | 13 |
3 files changed, 19 insertions, 1 deletions
diff --git a/conf.default/config.xml b/conf.default/config.xml index e8fd2b2..a0cabd5 100644 --- a/conf.default/config.xml +++ b/conf.default/config.xml @@ -200,6 +200,7 @@ <ipv6allow/> <powerd_ac_mode>hadp</powerd_ac_mode> <powerd_battery_mode>hadp</powerd_battery_mode> + <powerd_normal_mode>hadp</powerd_normal_mode> <bogons> <interval>monthly</interval> </bogons> diff --git a/etc/inc/system.inc b/etc/inc/system.inc index 9bb32ee..3dead28 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -57,7 +57,11 @@ function activate_powerd() { if (!empty($config['system']['powerd_battery_mode'])) $battery_mode = $config['system']['powerd_battery_mode']; - mwexec("/usr/sbin/powerd -b $battery_mode -a $ac_mode"); + $normal_mode = "hadp"; + if (!empty($config['system']['powerd_normal_mode'])) + $normal_mode = $config['system']['powerd_normal_mode']; + + mwexec("/usr/sbin/powerd -b $battery_mode -a $ac_mode -n $normal_mode"); } } diff --git a/usr/local/www/system_advanced_misc.php b/usr/local/www/system_advanced_misc.php index a224ffb..abfdda5 100644 --- a/usr/local/www/system_advanced_misc.php +++ b/usr/local/www/system_advanced_misc.php @@ -78,6 +78,10 @@ $pconfig['powerd_battery_mode'] = "hadp"; if (!empty($config['system']['powerd_battery_mode'])) $pconfig['powerd_battery_mode'] = $config['system']['powerd_battery_mode']; +$pconfig['powerd_normal_mode'] = "hadp"; +if (!empty($config['system']['powerd_normal_mode'])) + $pconfig['powerd_normal_mode'] = $config['system']['powerd_normal_mode']; + $crypto_modules = array('glxsb' => gettext("AMD Geode LX Security Block"), 'aesni' => gettext("AES-NI CPU-based Acceleration")); @@ -163,6 +167,7 @@ if ($_POST) { $config['system']['powerd_ac_mode'] = $_POST['powerd_ac_mode']; $config['system']['powerd_battery_mode'] = $_POST['powerd_battery_mode']; + $config['system']['powerd_normal_mode'] = $_POST['powerd_normal_mode']; if($_POST['crypto_hardware']) $config['system']['crypto_hardware'] = $_POST['crypto_hardware']; @@ -396,6 +401,14 @@ function tmpvar_checked(obj) { <option value="min"<?php if($pconfig['powerd_battery_mode']=="min") echo " selected=\"selected\""; ?>><?=gettext("Minimum");?></option> <option value="max"<?php if($pconfig['powerd_battery_mode']=="max") echo " selected=\"selected\""; ?>><?=gettext("Maximum");?></option> </select> + <br /> + <?=gettext("On Unknown Power Mode"); ?> : + <select name="powerd_normal_mode" id="powerd_normal_mode"> + <option value="hadp"<?php if($pconfig['powerd_normal_mode']=="hadp") echo " selected=\"selected\""; ?>><?=gettext("Hiadaptive");?></option> + <option value="adp"<?php if($pconfig['powerd_normal_mode']=="adp") echo " selected=\"selected\""; ?>><?=gettext("Adaptive");?></option> + <option value="min"<?php if($pconfig['powerd_normal_mode']=="min") echo " selected=\"selected\""; ?>><?=gettext("Minimum");?></option> + <option value="max"<?php if($pconfig['powerd_normal_mode']=="max") echo " selected=\"selected\""; ?>><?=gettext("Maximum");?></option> + </select> <br /><br /> <?=gettext("The powerd utility monitors the system state and sets various power control " . "options accordingly. It offers four modes (maximum, minimum, adaptive " . |