8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / cmd / scadm / sparc / mpxu / common / reset.c
blobb7c3a6b01cf030f2f7d081003d2bed956980e132
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
23 * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #pragma ident "%Z%%M% %I% %E% SMI"
30 * to support the scadm rscreset option (reset the service processor)
33 #include <libintl.h>
34 #include <stdio.h>
35 #include <string.h>
36 #include <time.h> /* required by rsc.h */
38 #include "librsc.h"
39 #include "adm.h"
42 static void usage();
45 void
46 ADM_Process_reset(int argc, char *argv[])
48 rscp_msg_t Message;
50 if ((argc != 2) && (argc != 3)) {
51 usage();
52 exit(-1);
54 if (argc == 3) {
55 if (strcasecmp(argv[2], "-s") != 0) {
56 usage();
57 exit(-1);
61 /* If hard reset, reset rsc */
62 if (argc == 2) {
63 if (rsc_nmi() != 0) {
64 (void) fprintf(stderr, "\n%s\n\n",
65 gettext("scadm: Unable to reset SC hardware"));
66 exit(-1);
68 } else {
69 /* Soft Reset */
70 ADM_Start();
71 Message.type = DP_RESET_RSC;
72 Message.len = 0;
73 Message.data = 0x0;
74 ADM_Send(&Message);
79 static void
80 usage()
82 (void) fprintf(stderr,
83 "\n%s\n\n", gettext("USAGE: scadm resetrsc [-s]"));