Print this page
7127 remove -Wno-missing-braces from Makefile.uts
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/xen/io/xnbe.c
+++ new/usr/src/uts/common/xen/io/xnbe.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 /*
29 29 * Xen network backend - ioemu version.
30 30 *
31 31 * HVM guest domains use an emulated network device (typically the
32 32 * rtl8139) to access the physical network via IO emulation running in
33 33 * a backend domain (generally domain 0).
34 34 *
35 35 * The IO emulation code sends and receives packets using DLPI, usually
36 36 * through a virtual NIC (vnic).
37 37 *
38 38 * The creation of the relevant vnic to correspond to the network interface
39 39 * in the guest domain requires the use of 'hotplug' scripts in the backend
40 40 * domain. This driver ensures that the hotplug scripts are run when
41 41 * such guest domains are created.
42 42 *
43 43 * It is used as a result of the 'compatible' property associated with
44 44 * IO emulated devices. See /etc/driver_aliases and common/xen/os/xvdi.c.
45 45 */
46 46
47 47 #ifdef DEBUG
48 48 #define XNBE_DEBUG 1
49 49 #endif /* DEBUG */
50 50
51 51 #include <sys/types.h>
52 52 #include <sys/conf.h>
53 53 #include <sys/sunddi.h>
54 54 #include <sys/modctl.h>
55 55 #include <xen/sys/xendev.h>
56 56 #ifdef XNBE_DEBUG
57 57 #include <sys/cmn_err.h>
58 58 #endif /* XNBE_DEBUG */
59 59
60 60 #ifdef XNBE_DEBUG
61 61 int xnbe_debug = 0;
62 62 #endif /* XNBE_DEBUG */
63 63
64 64 static int
65 65 xnbe_attach(dev_info_t *dip, ddi_attach_cmd_t cmd)
66 66 {
67 67 #ifdef XNBE_DEBUG
68 68 if (xnbe_debug > 0)
69 69 cmn_err(CE_NOTE, "xnbe_attach: dip 0x%p, cmd %d",
70 70 (void *)dip, cmd);
71 71 #endif /* XNBE_DEBUG */
72 72
73 73 switch (cmd) {
74 74 case DDI_ATTACH:
75 75 break;
76 76 case DDI_RESUME:
77 77 return (DDI_SUCCESS);
78 78 default:
79 79 return (DDI_FAILURE);
80 80 }
81 81
82 82 (void) xvdi_post_event(dip, XEN_HP_ADD);
83 83
84 84 return (DDI_SUCCESS);
85 85 }
86 86
87 87 static int
88 88 xnbe_detach(dev_info_t *dip, ddi_detach_cmd_t cmd)
89 89 {
90 90 #ifdef XNBE_DEBUG
91 91 if (xnbe_debug > 0)
92 92 cmn_err(CE_NOTE, "detach: dip 0x%p, cmd %d",
93 93 (void *)dip, cmd);
94 94 #endif /* XNBE_DEBUG */
95 95
96 96 switch (cmd) {
97 97 case DDI_DETACH:
98 98 return (DDI_SUCCESS);
99 99 case DDI_SUSPEND:
100 100 return (DDI_SUCCESS);
101 101 default:
102 102 return (DDI_FAILURE);
103 103 }
104 104 }
105 105
106 106 static struct cb_ops cb_ops = {
107 107 nulldev, /* open */
108 108 nulldev, /* close */
109 109 nodev, /* strategy */
110 110 nodev, /* print */
111 111 nodev, /* dump */
112 112 nodev, /* read */
113 113 nodev, /* write */
114 114 nodev, /* ioctl */
115 115 nodev, /* devmap */
116 116 nodev, /* mmap */
117 117 nodev, /* segmap */
118 118 nochpoll, /* poll */
119 119 ddi_prop_op, /* cb_prop_op */
120 120 0, /* streamtab */
121 121 D_NEW | D_MP | D_64BIT /* Driver compatibility flag */
122 122 };
123 123
124 124 static struct dev_ops ops = {
125 125 DEVO_REV, /* devo_rev */
126 126 0, /* devo_refcnt */
127 127 nulldev, /* devo_getinfo */
128 128 nulldev, /* devo_identify */
129 129 nulldev, /* devo_probe */
130 130 xnbe_attach, /* devo_attach */
131 131 xnbe_detach, /* devo_detach */
132 132 nodev, /* devo_reset */
133 133 &cb_ops, /* devo_cb_ops */
↓ open down ↓ |
133 lines elided |
↑ open up ↑ |
134 134 (struct bus_ops *)0, /* devo_bus_ops */
135 135 NULL, /* devo_power */
136 136 ddi_quiesce_not_needed, /* devo_quiesce */
137 137 };
138 138
139 139 static struct modldrv modldrv = {
140 140 &mod_driverops, "xnbe driver", &ops,
141 141 };
142 142
143 143 static struct modlinkage modlinkage = {
144 - MODREV_1, &modldrv, NULL
144 + MODREV_1, { &modldrv, NULL }
145 145 };
146 146
147 147 int
148 148 _init(void)
149 149 {
150 150 return (mod_install(&modlinkage));
151 151 }
152 152
153 153 int
154 154 _info(struct modinfo *modinfop)
155 155 {
156 156 return (mod_info(&modlinkage, modinfop));
157 157 }
158 158
159 159 int
160 160 _fini(void)
161 161 {
162 162 return (mod_remove(&modlinkage));
163 163 }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX