Print this page
4023 - Typo in file(1) manpage and various others
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man7d/tsalarm.7d
+++ new/usr/src/man/man7d/tsalarm.7d
1 1 '\" te
2 2 .\" Copyright (c) 2004, Sun Microsystems, Inc.
3 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 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 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 "Mar 16, 2004"
6 +.TH TSALARM 7D "Sep 10, 2013"
7 7 .SH NAME
8 8 tsalarm \- Alarm device driver
9 9 .SH SYNOPSIS
10 10 .LP
11 11 .nf
12 12 tsalarm@0:ctl
13 13 .fi
14 14
15 15 .SH DESCRIPTION
16 16 .sp
17 17 .LP
18 18 The \fBtsalarm\fR driver is a Multi-threaded, loadable non-STREAMS pseudo
19 19 driver that manages ALOM alarms. The \fBtsalarm\fR driver provides an interface
20 20 through which alarm relays can be controlled on SUNW,Netra-240 and
21 21 SUNW,Netra-440 platforms.
22 22 .SH HARDWARE INTERFACE
23 23 .sp
24 24 .LP
25 25 The alarm hardware differs depending on platform. The Netra 240 and 440
26 26 platforms features four dry contact alarm relays which are controlled by
27 27 ALOM. You can set each alarm to "on" or "off" by using ioctl interfaces
28 28 provided from the host. The four alarms are labeled as "critical," "major,"
29 29 "minor," and "user." The user alarm is set by a user application depending on
30 30 system condition. LED's in front of the box provide a visual indication of the
31 31 four alarms. The number of alarms and their meanings/labels may vary across
32 32 platforms.
33 33 .SH IOCTLS
34 34 .sp
35 35 .LP
36 36 The interface provided by the \fBtsalarm\fR driver comprises ioctls that enable
37 37 applications to manipulate the alarm module. The alarm module is accessed via
38 38 two device nodes: i) \fB/dev/lom\fR and \fB/dev/tsalarm:ctl\fR.
39 39 .sp
40 40 .LP
41 41 The following ioctls are supported by the \fB/dev/lom\fR and
42 42 \fB/dev/tsalarm:ctl\fR devices:
43 43 .sp
44 44 .ne 2
45 45 .na
46 46 \fB\fBTSIOCALCTL - Turn an alarm on or off.\fR\fR
47 47 .ad
48 48 .sp .6
49 49 .RS 4n
50 50 The argument is a pointer to the \fBts_aldata_t/lom_aldata_t\fR structure. This
51 51 structure is described below. \fBalarm_no member\fR is an integer which
52 52 specifies the alarm to which the command is to be applied. The
53 53 \fBalarm_state/state\fR structure member indicates the state to which the alarm
54 54 should be set (where 0 == off). An error (\fBEINVAL\fR) is returned if either
55 55 an invalid alarm_no or invalid alarm_state is provided.
56 56 .RE
57 57
58 58 .sp
59 59 .ne 2
60 60 .na
61 61 \fB\fBTSIOCALSTATE - Get the state of the alarms.\fR\fR
62 62 .ad
63 63 .sp .6
64 64 .RS 4n
65 65 The argument is a pointer to the \fBts_aldata_t/lom_aldata_t\fR structure. This
66 66 structure is described below. \fBalarm_no member\fR is an integer which
67 67 indicates the alarm to which the command will be applied. The
68 68 \fBalarm_state\fR member holds the alarm's current state and is filled in by
69 69 the driver. A zero indicates that the alarm is off. An error (\fBEINVAL\fR) is
70 70 returned if an invalid alarm_no is provided. The structures and definitions for
71 71 the values are defined below.
72 72 .RE
73 73
74 74 .sp
75 75 .LP
76 76 Alarm values:
77 77 .sp
78 78 .in +2
79 79 .nf
80 80 The following old style values are defined in <lom.io.h>
81 81
82 82 #define ALARM_NUM_0 0 /* number of zero'th alarm */
83 83
84 84 #define ALARM_NUM_1 1 /* number of first alarm */
85 85
86 86 #define ALARM_NUM_2 2 /* number of second alarm */
87 87
88 88 #define ALARM_NUM_3 3 /* number of third alarm */
89 89
90 90 Alarm values defined in <lom.io.h>
91 91
92 92 #define ALARM_OFF 0 /* Turn off alarm */
93 93
94 94 #define ALARM_ON 1 /* Turn on alarm */
95 95 .fi
96 96 .in -2
97 97
98 98 .sp
99 99 .LP
100 100 Alarm Data Structure:
101 101 .sp
102 102 .in +2
103 103 .nf
104 104 This structure is defined in <lom.io.h>
105 105
106 106 typedef struct {
107 107
108 108 int alarm_no; /* alarm to apply command to */
109 109
110 110 int alarm_state; /* state of alarm (0 == off) */
111 111
112 112 } ts_aldata_t;
113 113 .fi
114 114 .in -2
115 115
116 116 .sp
117 117 .LP
118 118 Use the following LOM interfaces to get and set the alarms. These definitions
119 119 are included in <lom_io.h>
120 120 .sp
121 121 .in +2
122 122 .nf
123 123 #define ALARM_CRITICAL 0 /* number of critical alarm */
124 124
125 125 #define ALARM_MAJOR 1 /* number of major alarm */
126 126
127 127 #define ALARM_MINOR 2 /* number of minor alarm */
128 128
129 129 #define ALARM_USER 3 /* number of user alarm */
130 130 .fi
131 131 .in -2
132 132
133 133 .sp
134 134 .LP
135 135 The following alarm data structure is provided in <lom_io.h>:
136 136 .sp
137 137 .in +2
138 138 .nf
139 139 typedef struct {
140 140
141 141 int alarm_no;
142 142
143 143 int state;
144 144
145 145 } lom_aldata_t;
146 146 .fi
147 147 .in -2
148 148
149 149 .SH ERRORS
150 150 .sp
151 151 .LP
152 152 An \fBopen()\fR will fail if:
153 153 .sp
154 154 .ne 2
155 155 .na
156 156 \fBENXIO\fR
157 157 .ad
158 158 .RS 9n
159 159 The driver is not installed in the system.
160 160 .RE
161 161
162 162 .sp
163 163 .LP
164 164 An \fBioctl()\fR will fail if:
165 165 .sp
166 166 .ne 2
167 167 .na
168 168 \fBEFAULT\fR
169 169 .ad
170 170 .RS 10n
171 171 There was a hardware failure during the specified operation.
172 172 .RE
173 173
174 174 .sp
175 175 .ne 2
176 176 .na
177 177 \fBEINVAL\fR
178 178 .ad
179 179 .RS 10n
180 180 The alarm number specified is not valid or an invalid value was supplied.
181 181 .RE
182 182
183 183 .sp
184 184 .ne 2
185 185 .na
186 186 \fBENXIO\fR
187 187 .ad
188 188 .RS 10n
189 189 The driver is not installed in the system or the monitor callback routine could
190 190 not be scheduled.
191 191 .RE
192 192
193 193 .SH EXAMPLES
194 194 .sp
195 195 .in +2
196 196 .nf
197 197 How to set an alarm:
198 198
199 199 #include <sys/unistd.h>
200 200 #include <fcntl.h>
201 201 #include <stdio.h>
202 202 #include <lom_io.h>
↓ open down ↓ |
186 lines elided |
↑ open up ↑ |
203 203
204 204 #define LOM_DEVICE "/dev/lom"
205 205
206 206 int
207 207 main()
208 208 {
209 209 lom_aldata_t lld;
210 210 int fd = open(LOM_DEVICE, O_RDWR);
211 211
212 212 if (fd == -1) {
213 - printf("Error opening device: %s\n", LOM_DEVICE);
213 + printf("Error opening device: %s\en", LOM_DEVICE);
214 214 exit (1);
215 215 }
216 216
217 217 lld.alarm_no = ALARM_CRITICAL; /* Set the critical alarm */
218 218 lld.state = ALARM_ON; /* Set the alarm */
219 219
220 220 if (ioctl(fd, LOMIOCALCTL, (char *)&lld) != 0)
221 221 printf("Setting alarm failed");
222 222 else
223 223 printf("Alarm set successfully");
224 224
225 225 close(fd);
226 226
227 227 }
228 228 .fi
229 229 .in -2
230 230
231 231 .SH FILES
232 232 .sp
233 233 .ne 2
234 234 .na
235 235 \fB\fB/dev/lom\fR\fR
236 236 .ad
237 237 .sp .6
238 238 .RS 4n
239 239 LOM device.
240 240 .RE
241 241
242 242 .sp
243 243 .ne 2
244 244 .na
245 245 \fB\fB/dev/tsalarm:ctl\fR\fR
246 246 .ad
247 247 .sp .6
248 248 .RS 4n
249 249 Alarm control device.
250 250 .RE
251 251
252 252 .sp
253 253 .ne 2
254 254 .na
255 255 \fB\fB/platform/platform/kernel/drv/sparcv9/tsalarm\fR\fR
256 256 .ad
257 257 .sp .6
258 258 .RS 4n
259 259 Device driver module.
260 260 .RE
261 261
262 262 .sp
263 263 .ne 2
264 264 .na
265 265 \fB\fB/platform/SUNW,Netra-240/kernel/drv/tsalarm.conf\fR\fR
266 266 .ad
267 267 .sp .6
268 268 .RS 4n
269 269 Driver configuration file.
270 270 .RE
271 271
272 272 .SH ATTRIBUTES
273 273 .sp
274 274 .LP
275 275 See \fBattributes\fR(5) for descriptions of the following attributes:
276 276 .sp
277 277
278 278 .sp
279 279 .TS
280 280 box;
281 281 c | c
282 282 l | l .
283 283 ATTRIBUTE TYPE ATTRIBUTE VALUE
284 284 _
285 285 Architecture SPARC
286 286 .TE
287 287
288 288 .SH SEE ALSO
289 289 .sp
290 290 .LP
291 291 \fBattributes\fR(5)
292 292 .sp
293 293 .LP
294 294 \fIWriting Device Drivers\fR
↓ open down ↓ |
71 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX