rmc_comm_hproto.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* Copyright 2001-2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_RMC_COMM_HPROTO_H
#define _SYS_RMC_COMM_HPROTO_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* data types used in the data protocol fields
*/
typedef unsigned char rsci8;
typedef unsigned short rsci16;
typedef short rscis16;
#ifdef _LP64
typedef unsigned int rsci32;
typedef unsigned long rsci64;
#else
typedef unsigned long rsci32;
typedef unsigned long long rsci64;
#endif
/*
* handle definition. Handles are used in the high-level data protocol
* to identify FRU, sensors (temperature, voltage), and so on.
*/
typedef rsci16 dp_handle_t;
#define DP_NULL_HANDLE 0xffff
#define DP_MAX_HANDLE_NAME 32
#define DP_NULL_MSG 0x00
/*
* Supported message types and associated data types:
*/
#define DP_RESET_RSC 0x7A
#define DP_RESET_RSC_R 0x5A
#define DP_UPDATE_FLASH 0x66
#define DP_UPDATE_FLASH_R 0x46
typedef struct dp_update_flash_r {
#define DP_RUN_TEST 0x74
typedef struct dp_run_test {
/* followed by test parameters; see individual tests below. */
#define DP_RUN_TEST_R 0x54
typedef struct dp_run_test_r {
/* codes below. */
#define RSC_TEST_PASSED 0
#define RSC_TEST_SW_FAILURE 1
#define RSC_TEST_BAD_DATA 2
#define RSC_TEST_NO_RESPONSE 3
#define RSC_TEST_BAD_CRC 4
#define RSC_TEST_BAD_PARAMS 5
#define RSC_TEST_NO_DEVICE 6
#define RSC_TEST_DEV_SETUP_FAIL 7
#define RSC_TEST_MEM_ALLOC_FAIL 8
#define RSC_TEST_ENET_ADDR_FAIL 9
#define RSC_TEST_DEV_INFO_FAIL 10
#define RSC_TEST_NYI 255
#define DP_RSC_STATUS 0x73
#define DP_RSC_STATUS_R 0x53
typedef struct dp_rsc_status_r {
/* The first six fields here must not be changed to ensure that they */
/* are the same in all versions of RSC, most notably when compared to */
/* 1.x. New fields must be added to the end of the structure. */
/* CLI. */
/* Any new fields in the structure may be added after this point ONLY! */
char creationDate[256];
#define DP_SET_CFGVAR 0x76
typedef struct dp_set_cfgvar {
/* Data is variable name & new value as zero-terminated ascii strings. */
#define DP_SET_CFGVAR_R 0x56
typedef struct dp_set_cfgvar_r {
#define DP_GET_CFGVAR 0x67
/* Data is variable name as zero-terminated ascii string. */
#define DP_GET_CFGVAR_R 0x47
typedef struct dp_get_cfgvar_r {
/* followed by value of variable as a zero-terminated ascii string. */
#define DP_GET_CFGVAR_NAME 0x6E
/*
* Data is variable name as zero-terminated ascii string. A zero-length
* string means 'return the name of the "first" variable.'
*/
#define DP_GET_CFGVAR_NAME_R 0x4E
typedef struct dp_get_cfgvar_name_r {
/* followed by name of "next" variable as a zero-terminated ascii string. */
#define DP_SET_DATE_TIME 0x64
#define DP_SET_DATE_TIME_IGNORE_FIELD 0xFFFF
typedef struct dp_set_date_time {
#define DP_SET_DATE_TIME_R 0x44
typedef struct dp_set_date_time_r {
#define DP_GET_DATE_TIME 0x65
#define DP_GET_DATE_TIME_R 0x45
typedef struct dp_get_date_time_r {
/* followed by the date represented as a zero-terminated ascii string. */
#define DP_SEND_ALERT 0x61
typedef struct dp_send_alert {
#define DP_SEND_ALERT_R 0x41
typedef struct dp_send_alert_r {
#define DP_GET_TEMP 0x78
#define DP_GET_TEMP_R 0x58
typedef struct dp_get_temp_r {
#define DP_GET_SDP_VERSION 0x7B
#define DP_GET_SDP_VERSION_R 0x5B
typedef struct dp_get_sdp_version_r {
#define DP_GET_TOD_CLOCK 0x7C
#define DP_GET_TOD_CLOCK_R 0x5C
typedef struct dp_get_tod_clock_r {
#define DP_GET_EVENT_LOG 0x7D
#define DP_GET_EVENT_LOG_R 0x5D
typedef struct dp_get_event_log_r {
typedef struct dp_event_log_entry {
char param[256];
#define DP_GET_PCMCIA_INFO 0x7E
#define DP_GET_PCMCIA_INFO_R 0x5E
typedef struct dp_get_pcmcia_info_r {
#define DP_USER_MAX 16
#define DP_USER_NAME_SIZE 16
/* User sub-commands */
#define DP_USER_CMD_ADD 0x1
#define DP_USER_CMD_DEL 0x2
#define DP_USER_CMD_SHOW 0x3
#define DP_USER_CMD_PASSWORD 0x4
#define DP_USER_CMD_PERM 0x5
/*
* The following fields are used to set the user permissions.
* Each must be represented as a single bit in the parm field.
*/
#define DP_USER_PERM_C 0x1
#define DP_USER_PERM_U 0x2
#define DP_USER_PERM_A 0x4
#define DP_USER_PERM_R 0x8
/*
* values for parm for CMD_SHOW. Anything other than 0 will show
* the user # up to and including DP_USER_MAX
*/
#define DP_USER_SHOW_USERNAME 0x0
/* Error values for status */
#define DP_USER_ADM 0x50
/*
* The parm field is used by the permission command to set specific
* permissions. The parm field is also used by the show command to
* indicate if the user name is specified or not.
*/
typedef struct dp_user_adm {
/*
* followed by zero-terminated ascii strings. All user commands
* are followed by the username. The password command is also
* followed by the password.
*/
#define DP_USER_ADM_R 0x51
/*
* the response field is used to return the user permissions
* for the user permissions command. The response is also used
* to echo back the user selection for the show command.
*/
typedef struct dp_user_adm_r {
/* followed by a zero-terminated ascii string for the show command. */
#define DP_MODEM_PASS 0
#define DP_MODEM_FAIL -1
/* Commands used for rscadm modem_setup */
#define DP_MODEM_CONNECT 0x30
#define DP_MODEM_CONNECT_R 0x31
typedef struct dp_modem_connect_r {
/* There is no reponse to a modem_data command */
/* The modem data command goes in both directions */
#define DP_MODEM_DATA 0x32
/* followed by a zero-terminated ascii string */
#define DP_MODEM_DISCONNECT 0x34
#define DP_MODEM_DISCONNECT_R 0x35
typedef struct dp_modem_disconnect_r {
#define DP_GET_TICKCNT 0x22
#define DP_GET_TICKCNT_R 0x23
typedef struct dp_get_tickcnt_r {
#define DP_SET_DEFAULT_CFG 0x72
#define DP_SET_DEFAULT_CFG_R 0x52
typedef struct dp_set_default_cfg_r {
#define DP_GET_NETWORK_CFG 0x59
#define DP_GET_NETWORK_CFG_R 0x79
typedef struct dp_get_network_cfg_r {
char ipMode[7];
char ipAddr[16];
char ipMask[16];
char ipGateway[16];
char ethAddr[18];
char ipDHCPServer[16];
/*
* Parameters for DP_RUN_TEST message:
*/
/*
* Test routines need to know what the low-level protocol sync
* character is.
*/
#define RSC_TEST_SERIAL 0
typedef struct rsc_serial_test {
#define RSC_SERIAL_TTYC_LB 0
#define RSC_SERIAL_TTYC_LB_OFF 1
#define RSC_SERIAL_TTYD_LB 2
#define RSC_SERIAL_TTYD_LB_OFF 3
#define RSC_SERIAL_TTYCD_LB 4
#define RSC_SERIAL_TTYCD_LB_OFF 5
#define RSC_SERIAL_TTYU_INT_LB 6
#define RSC_SERIAL_TTYU_EXT_LB 7
#define RSC_TEST_ENET 1
typedef struct rsc_enet_test {
#define RSC_ENET_INT_LB 0
#define RSC_ENET_EXT_LB 1
#define RSC_ENET_PING 2
#define RSC_ENET_INT_PHY_LB 3
#define RSC_TEST_FLASH_CRC 2
typedef struct rsc_flash_crcs_r {
#define RSC_TEST_SEEPROM_CRC 3
typedef struct rsc_seeprom_crcs_r {
#define RSC_TEST_FRU_SEEPROM_CRC 4
typedef struct rsc_fru_crcs_r {
/*
* new commands definitions
*/
#define DP_GET_SYSINFO 0x20
#define DP_GET_SYSINFO_R 0x21
typedef struct dp_get_sysinfo_r {
#define DP_GET_TEMPERATURES 0x24
typedef struct dp_get_temperatures {
/* or <null handle> (0xffff) */
/* Data is variable name & new value as zero-terminated ascii strings. */
#define DP_GET_TEMPERATURES_R 0x25
typedef rscis16 dp_tempr_t;
enum sensor_status {
};
typedef struct dp_tempr_status {
/* available or not */
typedef struct dp_get_temperatures_r {
#define DP_GET_FAN_STATUS 0x26
typedef struct dp_get_fan_status {
/* or <null handle> (0xffff) */
#define DP_GET_FAN_STATUS_R 0x27
typedef struct dp_fan_status {
/* available or not */
/* bit clear=RPM) */
typedef struct dp_get_fan_status_r {
#define DP_GET_PSU_STATUS 0x28
typedef struct dp_get_psu_status {
/* or <null handle> (0xffff) */
#define DP_GET_PSU_STATUS_R 0x29
typedef struct dp_psu_status {
/* available or not */
/* presence: bit clear=not present */
/* bit set=present */
/* status: bit clear=ok */
/* bit set=generic fault */
typedef struct dp_get_psu_status_r {
#define DP_GET_FRU_STATUS 0x2A
typedef struct dp_get_fru_status {
/* or <null handle> (0xffff) */
#define DP_GET_FRU_STATUS_R 0x2B
typedef struct dp_fru_status {
/* available or not */
enum dp_fru_status_type {
DP_FRU_STATUS_OK = 1,
};
typedef struct dp_get_fru_status_r {
/*
* DP_GET_DEVICE(_R) command is used to discover I2C devices dynamically
* (used by SunVTS)
*/
#define DP_GET_DEVICE 0x2C
typedef struct dp_get_device {
/* <null handle>(0xffff) */
#define DP_GET_DEVICE_R 0x2D
#define DP_MAX_DEVICE_TYPE_NAME 32
typedef struct dp_device {
} dp_device_t;
typedef struct dp_get_device_r {
#define DP_SET_CPU_SIGNATURE 0x33
typedef struct dp_set_cpu_signature {
int cpu_id; /* see PSARC 2000/205 for more */
#define DP_SET_CPU_NODENAME 0x38
#define DP_MAX_NODENAME 256
typedef struct dp_set_nodename {
char nodename[DP_MAX_NODENAME];
#define DP_GET_LED_STATE 0x3C
typedef struct dp_get_led_state {
/* or <null handle> (0xffff) */
#define DP_GET_LED_STATE_R 0x3D
typedef struct dp_led_state {
/* available or not */
typedef struct dp_get_led_state_r {
/* LED states */
enum dp_led_states {
DP_LED_OFF = 0,
};
enum dp_led_colours {
DP_LED_COLOUR_NONE = -1,
};
#define DP_SET_LED_STATE 0x3E
typedef struct dp_set_led_state {
#define DP_SET_LED_STATE_R 0x3F
typedef struct dp_set_led_state_r {
enum dp_set_led_status {
DP_SET_LED_OK = 0,
};
#define DP_GET_ALARM_STATE 0x68
typedef struct dp_get_alarm_state {
/* or <null handle> (0xffff) */
#define DP_GET_ALARM_STATE_R 0x69
typedef struct dp_alarm_state {
/* available or not */
typedef struct dp_get_alarm_state_r {
/* ALARM states */
enum dp_alarm_states {
DP_ALARM_OFF = 0,
};
#define DP_SET_ALARM_STATE 0x6A
typedef struct dp_set_alarm_state {
#define DP_SET_ALARM_STATE_R 0x6B
typedef struct dp_set_alarm_state_r {
enum dp_set_alarm_status {
DP_SET_ALARM_OK = 0,
};
#define DP_GET_VOLTS 0x42
typedef struct dp_get_volts {
#define DP_GET_VOLTS_R 0x43
typedef struct dp_volt_status {
/* is available or not */
typedef struct dp_get_volts_r {
#define DP_GET_CIRCUIT_BRKS 0x62
typedef struct dp_get_circuit_brks {
/* or <null handle> (0xffff) */
#define DP_GET_CIRCUIT_BRKS_R 0x63
typedef struct dp_circuit_brk_status {
/* available or not */
typedef struct dp_get_circuit_brks_r {
#define DP_SET_HOST_WATCHDOG 0x48
typedef struct dp_set_host_watchdog {
#define DP_GET_HANDLE_NAME 0x4A
typedef struct dp_get_handle_name {
#define DP_GET_HANDLE_NAME_R 0x4B
typedef struct dp_get_handle_name_r {
char name[DP_MAX_HANDLE_NAME];
#define DP_GET_HANDLE 0x4C
typedef struct dp_get_handle {
char name[DP_MAX_HANDLE_NAME];
#define DP_GET_HANDLE_R 0x4D
typedef struct dp_get_handle_r {
#define DP_RMC_EVENTS 0x57
typedef rsci16 dp_event_t;
/*
* list of events
*/
enum rmc_events {
RMC_INIT_EVENT = 0x01,
};
/*
* event data structures
*/
enum rmc_hpu_events {
RMC_HPU_INSERT_EVENT = 0x20,
};
typedef struct dp_hpu_event {
enum rmc_env_events {
RMC_ENV_WARNING_THRESHOLD_EVENT = 0x31,
};
typedef struct dp_env_event {
enum rmc_keyswitch_pos {
RMC_KEYSWITCH_POS_UNKNOWN = 0x00,
};
typedef struct dp_keyswitch_event {
typedef struct dp_rmclog_event {
int log_record_size;
typedef union dp_event_info {
typedef struct dp_event_notification {
#define DP_RMC_EVENTS_R 0x5F
typedef struct dp_event_notification_r {
#ifdef __cplusplus
}
#endif
#endif /* _SYS_RMC_COMM_HPROTO_H */