tsalarm.h revision 4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard/*
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard * CDDL HEADER START
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard *
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard * The contents of this file are subject to the terms of the
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard * Common Development and Distribution License (the "License").
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard * You may not use this file except in compliance with the License.
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard *
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard * or http://www.opensolaris.org/os/licensing.
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard * See the License for the specific language governing permissions
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard * and limitations under the License.
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard *
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard * When distributing Covered Code, include this CDDL HEADER in each
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard * If applicable, add the following below this CDDL HEADER, with the
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard * fields enclosed by brackets "[]" replaced with your own identifying
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard * information: Portions Copyright [yyyy] [name of copyright owner]
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard *
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard * CDDL HEADER END
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard */
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard/*
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard * Use is subject to license terms.
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard */
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard#ifndef _TSALARM_H
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard#define _TSALARM_H
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard#pragma ident "%Z%%M% %I% %E% SMI"
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard#ifdef __cplusplus
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willardextern "C" {
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard#endif
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard/* alarm_action */
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard#define TSALARM_ENABLE 1
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard#define TSALARM_DISABLE 2
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard#define TSALARM_STATUS 3
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard/* alarm_id */
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard#define TSALARM_CRITICAL 0
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard#define TSALARM_MAJOR 1
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard#define TSALARM_MINOR 2
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard#define TSALARM_USER 3
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard/* alarm_state */
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard#define TSALARM_STATE_ON 1
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard#define TSALARM_STATE_OFF 2
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard#define TSALARM_STATE_UNKNOWN 3
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard/* Status Types */
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard#define TSALARM_OK 1
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard#define TSALARM_ERROR 2
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard/* Error codes */
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard#define TSALARM_SUCCESS 0
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard#define TSALARM_CHANNEL_INIT_FAILURE -1
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard#define TSALARM_NULL_REQ_DATA -2
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard#define TSALARM_COMM_FAILURE -3
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard#define TSALARM_UNBOUND_PACKET_RECVD -4
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard#define TSALARM_GET_ERROR -5
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard#define TSALARM_SET_ERROR -6
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard/*
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard * alarm set/get request message
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard */
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willardtypedef struct tsalarm_req {
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard uint32_t alarm_id;
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard uint32_t alarm_action;
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard} tsalarm_req_t;
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard/*
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard * alarm set/get response message
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard */
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willardtypedef struct tsalarm_resp {
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard uint32_t status;
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard uint32_t alarm_id;
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard uint32_t alarm_state;
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard} tsalarm_resp_t;
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willardint tsalarm_get(uint32_t alarm_type, uint32_t *alarm_state);
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willardint tsalarm_set(uint32_t alarm_type, uint32_t alarm_state);
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard#ifdef __cplusplus
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard}
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard#endif
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard
4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6willard#endif /* _TSALARM_H */