xref: /titanic_44/usr/src/lib/libtsalarm/common/tsalarm.h (revision 4a6822d07d6d3f9ffe6907ef5f10d11dcadd75c6)
1*4a6822d0Swillard /*
2*4a6822d0Swillard  * CDDL HEADER START
3*4a6822d0Swillard  *
4*4a6822d0Swillard  * The contents of this file are subject to the terms of the
5*4a6822d0Swillard  * Common Development and Distribution License (the "License").
6*4a6822d0Swillard  * You may not use this file except in compliance with the License.
7*4a6822d0Swillard  *
8*4a6822d0Swillard  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*4a6822d0Swillard  * or http://www.opensolaris.org/os/licensing.
10*4a6822d0Swillard  * See the License for the specific language governing permissions
11*4a6822d0Swillard  * and limitations under the License.
12*4a6822d0Swillard  *
13*4a6822d0Swillard  * When distributing Covered Code, include this CDDL HEADER in each
14*4a6822d0Swillard  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*4a6822d0Swillard  * If applicable, add the following below this CDDL HEADER, with the
16*4a6822d0Swillard  * fields enclosed by brackets "[]" replaced with your own identifying
17*4a6822d0Swillard  * information: Portions Copyright [yyyy] [name of copyright owner]
18*4a6822d0Swillard  *
19*4a6822d0Swillard  * CDDL HEADER END
20*4a6822d0Swillard  */
21*4a6822d0Swillard /*
22*4a6822d0Swillard  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23*4a6822d0Swillard  * Use is subject to license terms.
24*4a6822d0Swillard  */
25*4a6822d0Swillard 
26*4a6822d0Swillard #ifndef	_TSALARM_H
27*4a6822d0Swillard #define	_TSALARM_H
28*4a6822d0Swillard 
29*4a6822d0Swillard #pragma ident	"%Z%%M%	%I%	%E% SMI"
30*4a6822d0Swillard 
31*4a6822d0Swillard #ifdef	__cplusplus
32*4a6822d0Swillard extern "C" {
33*4a6822d0Swillard #endif
34*4a6822d0Swillard 
35*4a6822d0Swillard /* alarm_action */
36*4a6822d0Swillard #define	TSALARM_ENABLE		1
37*4a6822d0Swillard #define	TSALARM_DISABLE		2
38*4a6822d0Swillard #define	TSALARM_STATUS		3
39*4a6822d0Swillard 
40*4a6822d0Swillard /* alarm_id */
41*4a6822d0Swillard #define	TSALARM_CRITICAL	0
42*4a6822d0Swillard #define	TSALARM_MAJOR		1
43*4a6822d0Swillard #define	TSALARM_MINOR		2
44*4a6822d0Swillard #define	TSALARM_USER		3
45*4a6822d0Swillard 
46*4a6822d0Swillard /* alarm_state */
47*4a6822d0Swillard #define	TSALARM_STATE_ON	1
48*4a6822d0Swillard #define	TSALARM_STATE_OFF	2
49*4a6822d0Swillard #define	TSALARM_STATE_UNKNOWN	3
50*4a6822d0Swillard 
51*4a6822d0Swillard /* Status Types */
52*4a6822d0Swillard #define	TSALARM_OK		1
53*4a6822d0Swillard #define	TSALARM_ERROR		2
54*4a6822d0Swillard 
55*4a6822d0Swillard /* Error codes */
56*4a6822d0Swillard #define	TSALARM_SUCCESS			0
57*4a6822d0Swillard #define	TSALARM_CHANNEL_INIT_FAILURE	-1
58*4a6822d0Swillard #define	TSALARM_NULL_REQ_DATA		-2
59*4a6822d0Swillard #define	TSALARM_COMM_FAILURE		-3
60*4a6822d0Swillard #define	TSALARM_UNBOUND_PACKET_RECVD	-4
61*4a6822d0Swillard #define	TSALARM_GET_ERROR		-5
62*4a6822d0Swillard #define	TSALARM_SET_ERROR		-6
63*4a6822d0Swillard 
64*4a6822d0Swillard /*
65*4a6822d0Swillard  * alarm set/get request message
66*4a6822d0Swillard  */
67*4a6822d0Swillard typedef struct tsalarm_req {
68*4a6822d0Swillard 	uint32_t	alarm_id;
69*4a6822d0Swillard 	uint32_t	alarm_action;
70*4a6822d0Swillard } tsalarm_req_t;
71*4a6822d0Swillard 
72*4a6822d0Swillard /*
73*4a6822d0Swillard  * alarm set/get response message
74*4a6822d0Swillard  */
75*4a6822d0Swillard typedef struct tsalarm_resp {
76*4a6822d0Swillard 	uint32_t	status;
77*4a6822d0Swillard 	uint32_t	alarm_id;
78*4a6822d0Swillard 	uint32_t	alarm_state;
79*4a6822d0Swillard } tsalarm_resp_t;
80*4a6822d0Swillard 
81*4a6822d0Swillard int tsalarm_get(uint32_t alarm_type, uint32_t *alarm_state);
82*4a6822d0Swillard int tsalarm_set(uint32_t alarm_type, uint32_t alarm_state);
83*4a6822d0Swillard 
84*4a6822d0Swillard #ifdef	__cplusplus
85*4a6822d0Swillard }
86*4a6822d0Swillard #endif
87*4a6822d0Swillard 
88*4a6822d0Swillard #endif /* _TSALARM_H */
89