Print this page
fixup .text where possible
7127 remove -Wno-missing-braces from Makefile.uts
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/io/ib/mgt/ibmf/ibmf_mod.c
+++ new/usr/src/uts/common/io/ib/mgt/ibmf/ibmf_mod.c
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
12 12 * and limitations under the License.
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
↓ open down ↓ |
16 lines elided |
↑ open up ↑ |
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
21 21 */
22 22 /*
23 23 * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 */
26 26
27 -#pragma ident "%Z%%M% %I% %E% SMI"
28 27
28 +
29 29 /*
30 30 * This file implements the _init(9e), _info(9e) and _fini(9e) functions.
31 31 */
32 32
33 33 #include <sys/ib/mgt/ibmf/ibmf_impl.h>
34 34
35 35 /* Module Info */
36 36 static struct modlmisc ibmf_modlmisc = {
37 37 &mod_miscops,
38 38 "IB Agent Interfaces 2.0"
39 39 };
40 40
41 41 /* Module linkage */
42 42 static struct modlinkage ibmf_modlinkage = {
43 43 MODREV_1,
44 - &ibmf_modlmisc,
45 - NULL
44 + { &ibmf_modlmisc,
45 + NULL }
46 46 };
47 47
48 48 static ibmf_state_t ibmf_state;
49 49 ibmf_state_t *ibmf_statep;
50 50
51 51 extern int ibmf_init();
52 52 extern int ibmf_fini();
53 53 extern int ibmf_saa_impl_init();
54 54 extern int ibmf_saa_impl_fini();
55 55
56 56 #ifndef NPROBE
57 57 extern int tnf_mod_load(void);
58 58 extern int tnf_mod_unload(struct modlinkage *mlp);
59 59 #endif
60 60
61 61 int
62 62 _init()
63 63 {
64 64 int status;
65 65
66 66 /* CONSTCOND */
67 67 ASSERT(NO_COMPETING_THREADS);
68 68
69 69 #ifndef NPROBE
70 70 (void) tnf_mod_load();
71 71 #endif
72 72 ibmf_statep = &ibmf_state;
73 73
74 74 /*
75 75 * call ibmf_saa_init first so it can set up subnet list before being
76 76 * contacted with ibt_async events
77 77 */
78 78 status = ibmf_saa_impl_init();
79 79 if (status != IBMF_SUCCESS) {
80 80 TNF_PROBE_1(_init_error, IBMF_TNF_ERROR, "", tnf_string, msg,
81 81 "ibmf_saa_impl_init failed");
82 82
83 83 #ifndef NPROBE
84 84 (void) tnf_mod_unload(&ibmf_modlinkage);
85 85 #endif
86 86 return (EACCES);
87 87 }
88 88
89 89
90 90
91 91 status = ibmf_init();
92 92 if (status != 0) {
93 93 TNF_PROBE_1(_init_error, IBMF_TNF_ERROR, "", tnf_string, msg,
94 94 "ibmf_init failed");
95 95
96 96 (void) ibmf_saa_impl_fini();
97 97
98 98 #ifndef NPROBE
99 99 (void) tnf_mod_unload(&ibmf_modlinkage);
100 100 #endif
101 101 return (EACCES);
102 102 }
103 103
104 104 status = mod_install(&ibmf_modlinkage);
105 105 if (status != 0) {
106 106 TNF_PROBE_2(_init_error, IBMF_TNF_ERROR, "", tnf_string, msg,
107 107 "mod_install failed", tnf_uint, status, status);
108 108 #ifndef NPROBE
109 109 (void) tnf_mod_unload(&ibmf_modlinkage);
110 110 #endif
111 111 (void) ibmf_fini();
112 112 ibmf_statep = (ibmf_state_t *)NULL;
113 113 }
114 114
115 115 return (status);
116 116 }
117 117
118 118 int
119 119 _info(struct modinfo *modinfop)
120 120 {
121 121 return (mod_info(&ibmf_modlinkage, modinfop));
122 122 }
123 123
124 124 int
125 125 _fini()
126 126 {
127 127 int status;
128 128 status = mod_remove(&ibmf_modlinkage);
129 129 if (status != 0) {
130 130 TNF_PROBE_2(_fini_error, IBMF_TNF_ERROR, "", tnf_string, msg,
131 131 "mod_remove failed", tnf_uint, status, status);
132 132 return (status);
133 133 }
134 134
135 135 status = ibmf_saa_impl_fini();
136 136 if (status != 0) {
137 137
138 138 TNF_PROBE_2(_fini_error, IBMF_TNF_ERROR, "", tnf_string, msg,
139 139 "ibmf_saa fini failed", tnf_uint, status, status);
140 140 return (status);
141 141 }
142 142
143 143 (void) ibmf_fini();
144 144 ibmf_statep = (ibmf_state_t *)NULL;
145 145 #ifndef NPROBE
146 146 (void) tnf_mod_unload(&ibmf_modlinkage);
147 147 #endif
148 148 return (status);
149 149 }
↓ open down ↓ |
94 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX