[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1


pm_control_parameter System Call

Purpose

Controls and queries the PM parameters.

Syntax

#include <pm.h>

int pm_control_parameter (ctrl, arg);
int ctrl;
caddr_t arg;

Description

The pm_control_parameter system call controls and queries the PM parameters.

Parameters


ctrl Specifies the function to be performed. It is one of the following values:

PM_CTRL_SET_PARAMETERS
Sets the PM parameters.

PM_CTRL_QUERY_DEVICE_NUMBER
Queries the number of PM aware devices.

PM_CTRL_QUERY_DEVICE_LIST
Gets all of PM aware device information.

PM_CTRL_QUERY_DEVICE_INFO
Queries PM aware device information.

PM_CTRL_SET_DEVICE_INFO
Sets PM aware device information.

PM_CTRL_SET_HIBERNATION_VOLUME
Tells PM hibernation volume information to PM core.
arg Specifies a pointer to a structure that depends on the function specified by the ctrl parameter.

When the ctrl parameter is PM_CTRL_SET_PARAMETERS, arg is a pointer to the following pm_parameters_t structure:

typedef struct _pm_parameters {
   Simple_lock lock; /*lock data to serialize access*/
   core_data_t core_data;
   daemon_data_t daemon_data;
} pm_parameters_t;

where,

typedef struct _daemon_data{
   int system_idle_action; /*system idle action*/
   int lid_close_action;   /*lid close action*/
   int main_switch_action; /*main power switch action*/
   int low_battery_action; /*low battery action*/
   int specified_time_action; /*action at specified time*/
   int resume_passwd;      /*enable/disable resume password*/
   int kill_lft_session;   /*continue/kill LFT session*/
   int kill_tty_session;   /*continue/kill TTY session*/
   int permission;         /*permitted state by superuser*/
} daemon_data_t;
typedef struct _core_data{
   int system_idle_time;   /*system idle time in seconds*/
   int pm_beep;            /*enable/disable beep*/
   int ringing_resume;     /*enable/disable ringing resume*/
   time_t resume_time;     /*specified time to resume*/
   time_t specified_time;  /*specified time to sus or hiber*/
   int sus_to_hiber;       /*duration from suspend to hibernation*/
   int kill_syncd;	   /*if syncd has been killed*/
   char reserve[4];        /*reserved*/
} core_data_t;

When the ctrl parameter is PM_CTRL_QUERY_DEVICE_NUMBER, arg is a pointer to an integer where the number of PM aware device drivers is returned.

When the ctrl parameter is PM_CTRL_QUERY_DEVICE_LIST, arg is a pointer to an array of device logical names.

When the ctrl parameter is PM_CTRL_QUERY_DEVICE_INFO, or PM_CTRL_SET_DEVICE_INFO, arg is a pointer to the following pm_device_info_t structure:

struct _pm_device_info {
   char name[16];          /*device logical name*/
   int mode;               /*current device PM mode*/
   int attribute;          /*PM attribute*/
   int idle_time;          /*device idle time*/ 
   int standby_time;       /*device standby time*/
   int idle_time1;         /*idle time 1 for DPMS */
   int idle_time2;         /*idle time 2 for DPMS */
   char reserve[24];       /*reserved*/
} pm_device_info_t;

When the ctrl parameter is PM_CTRL_SET_HIBERNATION_VOLUME, arg is a pointer to the following pm_hibernation_t structure:

typedef struct _pm_hibernation {
   dev_t devno;            /*major/minor device number*/
   long ppnum;             /*physical partition number*/
   long ppsize;            /*physical partition size*/
   long snum;              /*valid sector list item number*/
   pm_sector_t *slist;     /*sector list*/
 pm_hibernation_t;

Where,

typedef struct _pm_sector {
   long start;             /*RBA(Relative Block Address) in sectors*/
   long size;              /*sector size in sectors(512 bytes)*/
} pm_sector_t;

Note: The functions in AIX 4.1.1 still remain as they were. But they are left only for backward compatibility and may be deleted in the future. New programs should not use them.

Return Values


PM_SUCCESS Indicates successful completion.
PM_ERROR Indicates an error condition. The variable errno is set to identify the error.

Error Codes


EINVAL Invalid argument.

Implementation Specifics

The pm_control_parameter system call is part of the Base Operation System (BOS) Runtime.

Related Information

The pm_battery_control (pm_battery_control Subroutine) subroutine.

The pm_control_state (pm_control_state System Call) system call, pm_system_event_query (pm_system_event_query System Call) system call.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]