librtas_src/procfs_calls.c File Reference

#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include "common.h"
#include "procfs.h"
#include "librtas.h"

Defines

#define CFG_CONN_FILE   "cfg_connector"
#define GET_POWER_FILE   "get_power"
#define GET_SENSOR_FILE   "get_sensor"
#define GET_SYSPARM_FILE   "get_sysparm"
#define SET_INDICATOR_FILE   "set_indicator"
#define SET_POWER_FILE   "set_power"

Functions

int pfs_cfg_connector (int token, char *workarea)
 Set up arguments for procfs cfg-connector rtas call.
int pfs_get_power (int token, int domain, int *level)
 Set up args for procfs get-power-level rtas call.
int pfs_get_sensor (int token, int sensor, int index, int *state)
 Set up args for procfs get-sensor-state rtas call.
int pfs_get_sysparm (int token, unsigned int parameter, unsigned int length, char *data)
 Set up call to procfs get-system-parameter rtas call.
int pfs_set_indicator (int token, int indicator, int index, int new_value)
 Set up call to procfs set-indicator rtas call.
int pfs_set_power (int token, int domain, int level, int *setlevel)
int procfs_interface_exists ()
 VAlidate that the procfs interface to rtas exists.
static int do_rtas_op (const char *proc_filename, void *buf, size_t buf_size)
 Perform the actual rtas call via the supplied procfs file.

Variables

struct rtas_operations procfs_rtas_ops

Detailed Description

Copyright (C) 2005 IBM Corporation Common Public License Version 1.0 (see COPYRIGHT)

Author:
John Rose <johnrose@us.ibm.com>

Define Documentation

#define CFG_CONN_FILE   "cfg_connector"

#define GET_POWER_FILE   "get_power"

#define GET_SENSOR_FILE   "get_sensor"

#define GET_SYSPARM_FILE   "get_sysparm"

#define SET_INDICATOR_FILE   "set_indicator"

#define SET_POWER_FILE   "set_power"


Function Documentation

static int do_rtas_op ( const char *  proc_filename,
void *  buf,
size_t  buf_size 
) [static]

do_rtas_op

Parameters:
proc_filename procfs filename for the rtas call
buf buffer to read rtas call results into
buf_size size of the buf
Returns:
0 on success, !0 otherwise

int pfs_cfg_connector ( int  token,
char *  workarea 
)

pfs_cfg_connector

Parameters:
token 
workarea 
Returns:
0 on success, !0 otherwise

int pfs_get_power ( int  token,
int  domain,
int *  level 
)

pfs_get_power

Parameters:
token 
domain 
level 
Returns:
0 on success, !0 otherwise

int pfs_get_sensor ( int  token,
int  sensor,
int  index,
int *  state 
)

pfs_get_sensor

Parameters:
token 
sensor 
index 
state 
Returns:
0 on success, !0 otherwise

int pfs_get_sysparm ( int  token,
unsigned int  parameter,
unsigned int  length,
char *  data 
)

pfs_get_sysparm

Parameters:
token 
parameter 
length 
data 
Returns:
0 on success, !0 otherwise

int pfs_set_indicator ( int  token,
int  indicator,
int  index,
int  new_value 
)

pfs_set_indicator

Parameters:
token 
indicator 
index 
new_value 
Returns:
0 on success, !0 otherwise

int pfs_set_power ( int  token,
int  domain,
int  level,
int *  setlevel 
)

pfs_set_power

Parameters:
token 
domain 
level 
setlevel 
Returns:
0 on success, !0 otherwise

int procfs_interface_exists (  ) 

procfs_interfac_exists

Returns:
0 on success, !0 otherwise


Variable Documentation

struct rtas_operations procfs_rtas_ops

Initial value:

 {
        .cfg_connector = pfs_cfg_connector,
        .get_power_level = pfs_get_power,
        .get_sensor = pfs_get_sensor,
        .get_sysparm = pfs_get_sysparm,
        .set_indicator = pfs_set_indicator,
        .set_power_level = pfs_set_power,
        .interface_exists = procfs_interface_exists,
}


Generated on Sat Sep 22 08:52:51 2007 for librtas by  doxygen 1.5.3