2 .\" Copyright (c) 2004, Sun Microsystems, Inc.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH TSALARM 7D "Sep 10, 2013"
8 tsalarm \- Alarm device driver
18 The \fBtsalarm\fR driver is a Multi-threaded, loadable non-STREAMS pseudo
19 driver that manages ALOM alarms. The \fBtsalarm\fR driver provides an interface
20 through which alarm relays can be controlled on SUNW,Netra-240 and
21 SUNW,Netra-440 platforms.
22 .SH HARDWARE INTERFACE
25 The alarm hardware differs depending on platform. The Netra 240 and 440
26 platforms features four dry contact alarm relays which are controlled by
27 ALOM. You can set each alarm to "on" or "off" by using ioctl interfaces
28 provided from the host. The four alarms are labeled as "critical," "major,"
29 "minor," and "user." The user alarm is set by a user application depending on
30 system condition. LED's in front of the box provide a visual indication of the
31 four alarms. The number of alarms and their meanings/labels may vary across
36 The interface provided by the \fBtsalarm\fR driver comprises ioctls that enable
37 applications to manipulate the alarm module. The alarm module is accessed via
38 two device nodes: i) \fB/dev/lom\fR and \fB/dev/tsalarm:ctl\fR.
41 The following ioctls are supported by the \fB/dev/lom\fR and
42 \fB/dev/tsalarm:ctl\fR devices:
46 \fB\fBTSIOCALCTL - Turn an alarm on or off.\fR\fR
50 The argument is a pointer to the \fBts_aldata_t/lom_aldata_t\fR structure. This
51 structure is described below. \fBalarm_no member\fR is an integer which
52 specifies the alarm to which the command is to be applied. The
53 \fBalarm_state/state\fR structure member indicates the state to which the alarm
54 should be set (where 0 == off). An error (\fBEINVAL\fR) is returned if either
55 an invalid alarm_no or invalid alarm_state is provided.
61 \fB\fBTSIOCALSTATE - Get the state of the alarms.\fR\fR
65 The argument is a pointer to the \fBts_aldata_t/lom_aldata_t\fR structure. This
66 structure is described below. \fBalarm_no member\fR is an integer which
67 indicates the alarm to which the command will be applied. The
68 \fBalarm_state\fR member holds the alarm's current state and is filled in by
69 the driver. A zero indicates that the alarm is off. An error (\fBEINVAL\fR) is
70 returned if an invalid alarm_no is provided. The structures and definitions for
71 the values are defined below.
80 The following old style values are defined in <lom.io.h>
82 #define ALARM_NUM_0 0 /* number of zero'th alarm */
84 #define ALARM_NUM_1 1 /* number of first alarm */
86 #define ALARM_NUM_2 2 /* number of second alarm */
88 #define ALARM_NUM_3 3 /* number of third alarm */
90 Alarm values defined in <lom.io.h>
92 #define ALARM_OFF 0 /* Turn off alarm */
94 #define ALARM_ON 1 /* Turn on alarm */
100 Alarm Data Structure:
104 This structure is defined in <lom.io.h>
108 int alarm_no; /* alarm to apply command to */
110 int alarm_state; /* state of alarm (0 == off) */
118 Use the following LOM interfaces to get and set the alarms. These definitions
119 are included in <lom_io.h>
123 #define ALARM_CRITICAL 0 /* number of critical alarm */
125 #define ALARM_MAJOR 1 /* number of major alarm */
127 #define ALARM_MINOR 2 /* number of minor alarm */
129 #define ALARM_USER 3 /* number of user alarm */
135 The following alarm data structure is provided in <lom_io.h>:
152 An \fBopen()\fR will fail if:
159 The driver is not installed in the system.
164 An \fBioctl()\fR will fail if:
171 There was a hardware failure during the specified operation.
180 The alarm number specified is not valid or an invalid value was supplied.
189 The driver is not installed in the system or the monitor callback routine could
199 #include <sys/unistd.h>
204 #define LOM_DEVICE "/dev/lom"
210 int fd = open(LOM_DEVICE, O_RDWR);
213 printf("Error opening device: %s\en", LOM_DEVICE);
217 lld.alarm_no = ALARM_CRITICAL; /* Set the critical alarm */
218 lld.state = ALARM_ON; /* Set the alarm */
220 if (ioctl(fd, LOMIOCALCTL, (char *)&lld) != 0)
221 printf("Setting alarm failed");
223 printf("Alarm set successfully");
245 \fB\fB/dev/tsalarm:ctl\fR\fR
249 Alarm control device.
255 \fB\fB/platform/platform/kernel/drv/sparcv9/tsalarm\fR\fR
259 Device driver module.
265 \fB\fB/platform/SUNW,Netra-240/kernel/drv/tsalarm.conf\fR\fR
269 Driver configuration file.
275 See \fBattributes\fR(5) for descriptions of the following attributes:
283 ATTRIBUTE TYPE ATTRIBUTE VALUE
294 \fIWriting Device Drivers\fR