Print this page
7127 remove -Wno-missing-braces from Makefile.uts
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/io/net_dacf.c
+++ new/usr/src/uts/common/io/net_dacf.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 (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 */
26 26
27 27 /*
28 28 * This module provides the dacf functions to be called after a device
29 29 * of "ddi_network" node type has attached and before it detaches.
30 30 * Specifically, net_postattach() will be called during the post-attach
31 31 * process of each "ddi_network" device, and net_predetach() will be
32 32 * called during the pre-detach process of each device.
33 33 */
34 34 #include <sys/modctl.h>
35 35 #include <sys/sunddi.h>
36 36 #include <sys/ddi.h>
37 37 #include <sys/dacf.h>
38 38 #include <sys/softmac.h>
39 39
40 40 /*
41 41 * DACF entry points
42 42 */
43 43 static int net_postattach(dacf_infohdl_t, dacf_arghdl_t, int);
44 44 static int net_predetach(dacf_infohdl_t, dacf_arghdl_t, int);
45 45
46 46 static dacf_op_t net_config_op[] = {
47 47 { DACF_OPID_POSTATTACH, net_postattach },
48 48 { DACF_OPID_PREDETACH, net_predetach },
49 49 { DACF_OPID_END, NULL },
50 50 };
51 51
52 52 static dacf_opset_t opsets[] = {
53 53 { "net_config", net_config_op },
54 54 { NULL, NULL }
55 55 };
56 56
57 57 static struct dacfsw dacfsw = {
58 58 DACF_MODREV_1,
↓ open down ↓ |
58 lines elided |
↑ open up ↑ |
59 59 opsets
60 60 };
61 61
62 62 static struct modldacf modldacf = {
63 63 &mod_dacfops,
64 64 "net DACF",
65 65 &dacfsw
66 66 };
67 67
68 68 static struct modlinkage modlinkage = {
69 - MODREV_1, &modldacf, NULL
69 + MODREV_1, { &modldacf, NULL }
70 70 };
71 71
72 72 int
73 73 _init(void)
74 74 {
75 75 return (mod_install(&modlinkage));
76 76 }
77 77
78 78 int
79 79 _fini(void)
80 80 {
81 81 return (mod_remove(&modlinkage));
82 82 }
83 83
84 84 int
85 85 _info(struct modinfo *modinfop)
86 86 {
87 87 return (mod_info(&modlinkage, modinfop));
88 88 }
89 89
90 90 /*
91 91 * Post-attach routine invoked for DDI_NT_NET drivers by DACF framework
92 92 */
93 93 /* ARGSUSED */
94 94 static int
95 95 net_postattach(dacf_infohdl_t info_hdl, dacf_arghdl_t arg_hdl, int flags)
96 96 {
97 97 dev_info_t *dip;
98 98 dev_t dev;
99 99 int err;
100 100
101 101 dip = dacf_devinfo_node(info_hdl);
102 102 dev = dacf_get_dev(info_hdl);
103 103
104 104 if ((err = softmac_create(dip, dev)) != 0) {
105 105 const char *drvname;
106 106 int ppa;
107 107
108 108 drvname = ddi_driver_name(dip);
109 109 ppa = i_ddi_devi_get_ppa(dip);
110 110 cmn_err(CE_WARN, "net_postattach: cannot create softmac "
111 111 "for device %s%d (%d)", drvname, ppa, err);
112 112 return (DACF_FAILURE);
113 113 }
114 114
115 115 return (DACF_SUCCESS);
116 116 }
117 117
118 118 /*
119 119 * Pre-detach routine invoked for DDI_NT_NET drivers by DACF framework
120 120 */
121 121 /* ARGSUSED */
122 122 static int
123 123 net_predetach(dacf_infohdl_t info_hdl, dacf_arghdl_t arg_hdl, int flags)
124 124 {
125 125 dev_info_t *dip;
126 126 dev_t dev;
127 127
128 128 dip = dacf_devinfo_node(info_hdl);
129 129 dev = dacf_get_dev(info_hdl);
130 130
131 131 if (softmac_destroy(dip, dev) != 0)
132 132 return (DACF_FAILURE);
133 133
134 134 return (DACF_SUCCESS);
135 135 }
↓ open down ↓ |
56 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX