Print this page
7127 remove -Wno-missing-braces from Makefile.uts
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/i86pc/io/acpi/acpinex/acpinex_drv.c
+++ new/usr/src/uts/i86pc/io/acpi/acpinex/acpinex_drv.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 2009 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 */
26 26 /*
27 27 * Copyright (c) 2009-2010, Intel Corporation.
28 28 * All rights reserved.
29 29 */
30 30 /*
31 31 * Copyright 2012 Garrett D'Amore <garrett@damore.org>. All rights reserved.
32 32 */
33 33 /*
34 34 * This module implements a nexus driver for the ACPI virtual bus.
35 35 * It does not handle any of the DDI functions passed up to it by the child
36 36 * drivers, but instead allows them to bubble up to the root node.
37 37 */
38 38
39 39 #include <sys/types.h>
40 40 #include <sys/cmn_err.h>
41 41 #include <sys/conf.h>
42 42 #include <sys/modctl.h>
43 43 #include <sys/ddi.h>
44 44 #include <sys/ddi_impldefs.h>
45 45 #include <sys/ddifm.h>
46 46 #include <sys/note.h>
47 47 #include <sys/ndifm.h>
48 48 #include <sys/sunddi.h>
49 49 #include <sys/sunndi.h>
50 50 #include <sys/acpidev.h>
51 51 #include <sys/acpinex.h>
52 52
53 53 /* Patchable through /etc/system. */
54 54 #ifdef DEBUG
55 55 int acpinex_debug = 1;
56 56 #else
57 57 int acpinex_debug = 0;
58 58 #endif
59 59
60 60 /*
61 61 * Driver globals
62 62 */
63 63 static kmutex_t acpinex_lock;
64 64 static void *acpinex_softstates;
65 65
66 66 static int acpinex_info(dev_info_t *, ddi_info_cmd_t, void *, void **);
67 67 static int acpinex_attach(dev_info_t *, ddi_attach_cmd_t);
68 68 static int acpinex_detach(dev_info_t *, ddi_detach_cmd_t);
69 69 static int acpinex_open(dev_t *, int, int, cred_t *);
70 70 static int acpinex_close(dev_t, int, int, cred_t *);
71 71 static int acpinex_ioctl(dev_t, int, intptr_t, int, cred_t *, int *);
72 72 static int acpinex_bus_map(dev_info_t *dip, dev_info_t *rdip, ddi_map_req_t *mp,
73 73 off_t offset, off_t len, caddr_t *vaddrp);
74 74 static int acpinex_ctlops(dev_info_t *, dev_info_t *, ddi_ctl_enum_t, void *,
75 75 void *);
76 76 static int acpinex_fm_init_child(dev_info_t *, dev_info_t *, int,
77 77 ddi_iblock_cookie_t *);
78 78 static void acpinex_fm_init(acpinex_softstate_t *softsp);
79 79 static void acpinex_fm_fini(acpinex_softstate_t *softsp);
80 80
81 81 extern void make_ddi_ppd(dev_info_t *, struct ddi_parent_private_data **);
82 82
83 83 /*
84 84 * Configuration data structures
85 85 */
86 86 static struct bus_ops acpinex_bus_ops = {
87 87 BUSO_REV, /* busops_rev */
88 88 acpinex_bus_map, /* bus_map */
89 89 NULL, /* bus_get_intrspec */
90 90 NULL, /* bus_add_intrspec */
91 91 NULL, /* bus_remove_intrspec */
92 92 i_ddi_map_fault, /* bus_map_fault */
93 93 NULL, /* bus_dma_map */
94 94 ddi_dma_allochdl, /* bus_dma_allochdl */
95 95 ddi_dma_freehdl, /* bus_dma_freehdl */
96 96 ddi_dma_bindhdl, /* bus_dma_bindhdl */
97 97 ddi_dma_unbindhdl, /* bus_dma_unbindhdl */
98 98 ddi_dma_flush, /* bus_dma_flush */
99 99 ddi_dma_win, /* bus_dma_win */
100 100 ddi_dma_mctl, /* bus_dma_ctl */
101 101 acpinex_ctlops, /* bus_ctl */
102 102 ddi_bus_prop_op, /* bus_prop_op */
103 103 ndi_busop_get_eventcookie, /* bus_get_eventcookie */
104 104 ndi_busop_add_eventcall, /* bus_add_eventcall */
105 105 ndi_busop_remove_eventcall, /* bus_remove_eventcall */
106 106 ndi_post_event, /* bus_post_event */
107 107 NULL, /* bus_intr_ctl */
108 108 NULL, /* bus_config */
109 109 NULL, /* bus_unconfig */
110 110 acpinex_fm_init_child, /* bus_fm_init */
111 111 NULL, /* bus_fm_fini */
112 112 NULL, /* bus_fm_access_enter */
113 113 NULL, /* bus_fm_access_exit */
114 114 NULL, /* bus_power */
115 115 i_ddi_intr_ops /* bus_intr_op */
116 116 };
117 117
118 118 static struct cb_ops acpinex_cb_ops = {
119 119 acpinex_open, /* cb_open */
120 120 acpinex_close, /* cb_close */
121 121 nodev, /* cb_strategy */
122 122 nodev, /* cb_print */
123 123 nodev, /* cb_dump */
124 124 nodev, /* cb_read */
125 125 nodev, /* cb_write */
126 126 acpinex_ioctl, /* cb_ioctl */
127 127 nodev, /* cb_devmap */
128 128 nodev, /* cb_mmap */
129 129 nodev, /* cb_segmap */
130 130 nochpoll, /* cb_poll */
131 131 ddi_prop_op, /* cb_prop_op */
132 132 NULL, /* cb_str */
133 133 D_NEW | D_MP | D_HOTPLUG, /* Driver compatibility flag */
134 134 CB_REV, /* rev */
135 135 nodev, /* int (*cb_aread)() */
136 136 nodev /* int (*cb_awrite)() */
137 137 };
138 138
139 139 static struct dev_ops acpinex_ops = {
140 140 DEVO_REV, /* devo_rev, */
141 141 0, /* devo_refcnt */
142 142 acpinex_info, /* devo_getinfo */
143 143 nulldev, /* devo_identify */
144 144 nulldev, /* devo_probe */
145 145 acpinex_attach, /* devo_attach */
146 146 acpinex_detach, /* devo_detach */
147 147 nulldev, /* devo_reset */
148 148 &acpinex_cb_ops, /* devo_cb_ops */
149 149 &acpinex_bus_ops, /* devo_bus_ops */
150 150 nulldev, /* devo_power */
151 151 ddi_quiesce_not_needed /* devo_quiesce */
↓ open down ↓ |
151 lines elided |
↑ open up ↑ |
152 152 };
153 153
154 154 static struct modldrv modldrv = {
155 155 &mod_driverops, /* Type of module */
156 156 "ACPI virtual bus driver", /* name of module */
157 157 &acpinex_ops, /* driver ops */
158 158 };
159 159
160 160 static struct modlinkage modlinkage = {
161 161 MODREV_1, /* rev */
162 - (void *)&modldrv,
163 - NULL
162 + { (void *)&modldrv, NULL }
164 163 };
165 164
166 165 /*
167 166 * Module initialization routines.
168 167 */
169 168 int
170 169 _init(void)
171 170 {
172 171 int error;
173 172
174 173 /* Initialize soft state pointer. */
175 174 if ((error = ddi_soft_state_init(&acpinex_softstates,
176 175 sizeof (acpinex_softstate_t), 8)) != 0) {
177 176 cmn_err(CE_WARN,
178 177 "acpinex: failed to initialize soft state structure.");
179 178 return (error);
180 179 }
181 180
182 181 /* Initialize event subsystem. */
183 182 acpinex_event_init();
184 183
185 184 /* Install the module. */
186 185 if ((error = mod_install(&modlinkage)) != 0) {
187 186 cmn_err(CE_WARN, "acpinex: failed to install module.");
188 187 ddi_soft_state_fini(&acpinex_softstates);
189 188 return (error);
190 189 }
191 190
192 191 mutex_init(&acpinex_lock, NULL, MUTEX_DRIVER, NULL);
193 192
194 193 return (0);
195 194 }
196 195
197 196 int
198 197 _fini(void)
199 198 {
200 199 int error;
201 200
202 201 /* Remove the module. */
203 202 if ((error = mod_remove(&modlinkage)) != 0) {
204 203 return (error);
205 204 }
206 205
207 206 /* Shut down event subsystem. */
208 207 acpinex_event_fini();
209 208
210 209 /* Free the soft state info. */
211 210 ddi_soft_state_fini(&acpinex_softstates);
212 211
213 212 mutex_destroy(&acpinex_lock);
214 213
215 214 return (0);
216 215 }
217 216
218 217 int
219 218 _info(struct modinfo *modinfop)
220 219 {
221 220 return (mod_info(&modlinkage, modinfop));
222 221 }
223 222
224 223 static int
225 224 acpinex_info(dev_info_t *dip, ddi_info_cmd_t infocmd, void *arg, void **result)
226 225 {
227 226 _NOTE(ARGUNUSED(dip));
228 227
229 228 dev_t dev;
230 229 int instance;
231 230
232 231 if (infocmd == DDI_INFO_DEVT2INSTANCE) {
233 232 dev = (dev_t)arg;
234 233 instance = ACPINEX_GET_INSTANCE(getminor(dev));
235 234 *result = (void *)(uintptr_t)instance;
236 235 return (DDI_SUCCESS);
237 236 }
238 237
239 238 return (DDI_FAILURE);
240 239 }
241 240
242 241 static int
243 242 acpinex_attach(dev_info_t *devi, ddi_attach_cmd_t cmd)
244 243 {
245 244 int instance;
246 245 acpinex_softstate_t *softsp;
247 246
248 247 switch (cmd) {
249 248 case DDI_ATTACH:
250 249 break;
251 250
252 251 case DDI_RESUME:
253 252 return (DDI_SUCCESS);
254 253
255 254 default:
256 255 return (DDI_FAILURE);
257 256 }
258 257
259 258 /* Get and check instance number. */
260 259 instance = ddi_get_instance(devi);
261 260 if (instance >= ACPINEX_INSTANCE_MAX) {
262 261 cmn_err(CE_WARN, "acpinex: instance number %d is out of range "
263 262 "in acpinex_attach(), max %d.",
264 263 instance, ACPINEX_INSTANCE_MAX - 1);
265 264 return (DDI_FAILURE);
266 265 }
267 266
268 267 /* Get soft state structure. */
269 268 if (ddi_soft_state_zalloc(acpinex_softstates, instance)
270 269 != DDI_SUCCESS) {
271 270 cmn_err(CE_WARN, "!acpinex: failed to allocate soft state "
272 271 "object in acpinex_attach().");
273 272 return (DDI_FAILURE);
274 273 }
275 274 softsp = ddi_get_soft_state(acpinex_softstates, instance);
276 275
277 276 /* Initialize soft state structure */
278 277 softsp->ans_dip = devi;
279 278 (void) ddi_pathname(devi, softsp->ans_path);
280 279 if (ACPI_FAILURE(acpica_get_handle(devi, &softsp->ans_hdl))) {
281 280 ACPINEX_DEBUG(CE_WARN,
282 281 "!acpinex: failed to get ACPI handle for %s.",
283 282 softsp->ans_path);
284 283 ddi_soft_state_free(acpinex_softstates, instance);
285 284 return (DDI_FAILURE);
286 285 }
287 286 mutex_init(&softsp->ans_lock, NULL, MUTEX_DRIVER, NULL);
288 287
289 288 /* Install event handler for child/descendant objects. */
290 289 if (acpinex_event_scan(softsp, B_TRUE) != DDI_SUCCESS) {
291 290 cmn_err(CE_WARN, "!acpinex: failed to install event handler "
292 291 "for children of %s.", softsp->ans_path);
293 292 }
294 293
295 294 /* nothing to suspend/resume here */
296 295 (void) ddi_prop_update_string(DDI_DEV_T_NONE, devi,
297 296 "pm-hardware-state", "no-suspend-resume");
298 297 (void) ddi_prop_update_int(DDI_DEV_T_NONE, devi,
299 298 DDI_NO_AUTODETACH, 1);
300 299
301 300 acpinex_fm_init(softsp);
302 301 ddi_report_dev(devi);
303 302
304 303 return (DDI_SUCCESS);
305 304 }
306 305
307 306 static int
308 307 acpinex_detach(dev_info_t *devi, ddi_detach_cmd_t cmd)
309 308 {
310 309 int instance;
311 310 acpinex_softstate_t *softsp;
312 311
313 312 instance = ddi_get_instance(devi);
314 313 if (instance >= ACPINEX_INSTANCE_MAX) {
315 314 cmn_err(CE_WARN, "acpinex: instance number %d is out of range "
316 315 "in acpinex_detach(), max %d.",
317 316 instance, ACPINEX_INSTANCE_MAX - 1);
318 317 return (DDI_FAILURE);
319 318 }
320 319
321 320 softsp = ddi_get_soft_state(acpinex_softstates, instance);
322 321 if (softsp == NULL) {
323 322 ACPINEX_DEBUG(CE_WARN, "!acpinex: failed to get soft state "
324 323 "object for instance %d in acpinex_detach()", instance);
325 324 return (DDI_FAILURE);
326 325 }
327 326
328 327 switch (cmd) {
329 328 case DDI_DETACH:
330 329 if (acpinex_event_scan(softsp, B_FALSE) != DDI_SUCCESS) {
331 330 cmn_err(CE_WARN, "!acpinex: failed to uninstall event "
332 331 "handler for children of %s.", softsp->ans_path);
333 332 return (DDI_FAILURE);
334 333 }
335 334 ddi_remove_minor_node(devi, NULL);
336 335 acpinex_fm_fini(softsp);
337 336 mutex_destroy(&softsp->ans_lock);
338 337 ddi_soft_state_free(acpinex_softstates, instance);
339 338 (void) ddi_prop_update_int(DDI_DEV_T_NONE, devi,
340 339 DDI_NO_AUTODETACH, 0);
341 340 return (DDI_SUCCESS);
342 341
343 342 case DDI_SUSPEND:
344 343 return (DDI_SUCCESS);
345 344
346 345 default:
347 346 return (DDI_FAILURE);
348 347 }
349 348 }
350 349
351 350 static int
352 351 name_child(dev_info_t *child, char *name, int namelen)
353 352 {
354 353 char *unitaddr;
355 354
356 355 ddi_set_parent_data(child, NULL);
357 356
358 357 name[0] = '\0';
359 358 if (ddi_prop_lookup_string(DDI_DEV_T_ANY, child, DDI_PROP_DONTPASS,
360 359 ACPIDEV_PROP_NAME_UNIT_ADDR, &unitaddr) == DDI_SUCCESS) {
361 360 (void) strlcpy(name, unitaddr, namelen);
362 361 ddi_prop_free(unitaddr);
363 362 } else {
364 363 ACPINEX_DEBUG(CE_NOTE, "!acpinex: failed to lookup child "
365 364 "unit-address prop for %p.", (void *)child);
366 365 }
367 366
368 367 return (DDI_SUCCESS);
369 368 }
370 369
371 370 static int
372 371 init_child(dev_info_t *child)
373 372 {
374 373 char name[MAXNAMELEN];
375 374
376 375 (void) name_child(child, name, MAXNAMELEN);
377 376 ddi_set_name_addr(child, name);
378 377 if ((ndi_dev_is_persistent_node(child) == 0) &&
379 378 (ndi_merge_node(child, name_child) == DDI_SUCCESS)) {
380 379 impl_ddi_sunbus_removechild(child);
381 380 return (DDI_FAILURE);
382 381 }
383 382
384 383 return (DDI_SUCCESS);
385 384 }
386 385
387 386 /*
388 387 * Control ops entry point:
389 388 *
390 389 * Requests handled completely:
391 390 * DDI_CTLOPS_INITCHILD
392 391 * DDI_CTLOPS_UNINITCHILD
393 392 * All others are passed to the parent.
394 393 */
395 394 static int
396 395 acpinex_ctlops(dev_info_t *dip, dev_info_t *rdip, ddi_ctl_enum_t op, void *arg,
397 396 void *result)
398 397 {
399 398 int rval = DDI_SUCCESS;
400 399
401 400 switch (op) {
402 401 case DDI_CTLOPS_INITCHILD:
403 402 rval = init_child((dev_info_t *)arg);
404 403 break;
405 404
406 405 case DDI_CTLOPS_UNINITCHILD:
407 406 impl_ddi_sunbus_removechild((dev_info_t *)arg);
408 407 break;
409 408
410 409 case DDI_CTLOPS_REPORTDEV: {
411 410 if (rdip == (dev_info_t *)0)
412 411 return (DDI_FAILURE);
413 412 cmn_err(CE_CONT, "?acpinex: %s@%s, %s%d\n",
414 413 ddi_node_name(rdip), ddi_get_name_addr(rdip),
415 414 ddi_driver_name(rdip), ddi_get_instance(rdip));
416 415 break;
417 416 }
418 417
419 418 default:
420 419 rval = ddi_ctlops(dip, rdip, op, arg, result);
421 420 break;
422 421 }
423 422
424 423 return (rval);
425 424 }
426 425
427 426 /* ARGSUSED */
428 427 static int
429 428 acpinex_bus_map(dev_info_t *dip, dev_info_t *rdip, ddi_map_req_t *mp,
430 429 off_t offset, off_t len, caddr_t *vaddrp)
431 430 {
432 431 ACPINEX_DEBUG(CE_WARN,
433 432 "!acpinex: acpinex_bus_map called and it's unimplemented.");
434 433 return (DDI_ME_UNIMPLEMENTED);
435 434 }
436 435
437 436 static int
438 437 acpinex_open(dev_t *devi, int flags, int otyp, cred_t *credp)
439 438 {
440 439 _NOTE(ARGUNUSED(flags, otyp, credp));
441 440
442 441 minor_t minor, instance;
443 442 acpinex_softstate_t *softsp;
444 443
445 444 minor = getminor(*devi);
446 445 instance = ACPINEX_GET_INSTANCE(minor);
447 446 if (instance >= ACPINEX_INSTANCE_MAX) {
448 447 ACPINEX_DEBUG(CE_WARN, "!acpinex: instance number %d out of "
449 448 "range in acpinex_open, max %d.",
450 449 instance, ACPINEX_INSTANCE_MAX - 1);
451 450 return (EINVAL);
452 451 }
453 452
454 453 softsp = ddi_get_soft_state(acpinex_softstates, instance);
455 454 if (softsp == NULL) {
456 455 ACPINEX_DEBUG(CE_WARN, "!acpinex: failed to get soft state "
457 456 "object for instance %d in acpinex_open().", instance);
458 457 return (EINVAL);
459 458 }
460 459
461 460 if (ACPINEX_IS_DEVCTL(minor)) {
462 461 return (0);
463 462 } else {
464 463 ACPINEX_DEBUG(CE_WARN,
465 464 "!acpinex: invalid minor number %d in acpinex_open().",
466 465 minor);
467 466 return (EINVAL);
468 467 }
469 468 }
470 469
471 470 static int
472 471 acpinex_close(dev_t dev, int flags, int otyp, cred_t *credp)
473 472 {
474 473 _NOTE(ARGUNUSED(flags, otyp, credp));
475 474
476 475 minor_t minor, instance;
477 476 acpinex_softstate_t *softsp;
478 477
479 478 minor = getminor(dev);
480 479 instance = ACPINEX_GET_INSTANCE(minor);
481 480 if (instance >= ACPINEX_INSTANCE_MAX) {
482 481 ACPINEX_DEBUG(CE_WARN, "!acpinex: instance number %d out of "
483 482 "range in acpinex_close(), max %d.",
484 483 instance, ACPINEX_INSTANCE_MAX - 1);
485 484 return (EINVAL);
486 485 }
487 486
488 487 softsp = ddi_get_soft_state(acpinex_softstates, instance);
489 488 if (softsp == NULL) {
490 489 ACPINEX_DEBUG(CE_WARN, "!acpinex: failed to get soft state "
491 490 "object for instance %d in acpinex_close().", instance);
492 491 return (EINVAL);
493 492 }
494 493
495 494 if (ACPINEX_IS_DEVCTL(minor)) {
496 495 return (0);
497 496 } else {
498 497 ACPINEX_DEBUG(CE_WARN,
499 498 "!acpinex: invalid minor number %d in acpinex_close().",
500 499 minor);
501 500 return (EINVAL);
502 501 }
503 502 }
504 503
505 504 static int
506 505 acpinex_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp,
507 506 int *rvalp)
508 507 {
509 508 _NOTE(ARGUNUSED(cmd, arg, mode, credp, rvalp));
510 509
511 510 int rv = 0;
512 511 minor_t minor, instance;
513 512 acpinex_softstate_t *softsp;
514 513
515 514 minor = getminor(dev);
516 515 instance = ACPINEX_GET_INSTANCE(minor);
517 516 if (instance >= ACPINEX_INSTANCE_MAX) {
518 517 ACPINEX_DEBUG(CE_NOTE, "!acpinex: instance number %d out of "
519 518 "range in acpinex_ioctl(), max %d.",
520 519 instance, ACPINEX_INSTANCE_MAX - 1);
521 520 return (EINVAL);
522 521 }
523 522 softsp = ddi_get_soft_state(acpinex_softstates, instance);
524 523 if (softsp == NULL) {
525 524 ACPINEX_DEBUG(CE_WARN, "!acpinex: failed to get soft state "
526 525 "object for instance %d in acpinex_ioctl().", instance);
527 526 return (EINVAL);
528 527 }
529 528
530 529 rv = ENOTSUP;
531 530 ACPINEX_DEBUG(CE_WARN,
532 531 "!acpinex: invalid minor number %d in acpinex_ioctl().", minor);
533 532
534 533 return (rv);
535 534 }
536 535
537 536 /*
538 537 * FMA error callback.
539 538 * Register error handling callback with our parent. We will just call
540 539 * our children's error callbacks and return their status.
541 540 */
542 541 static int
543 542 acpinex_err_callback(dev_info_t *dip, ddi_fm_error_t *derr,
544 543 const void *impl_data)
545 544 {
546 545 _NOTE(ARGUNUSED(impl_data));
547 546
548 547 /* Call our childrens error handlers */
549 548 return (ndi_fm_handler_dispatch(dip, NULL, derr));
550 549 }
551 550
552 551 /*
553 552 * Initialize our FMA resources
554 553 */
555 554 static void
556 555 acpinex_fm_init(acpinex_softstate_t *softsp)
557 556 {
558 557 softsp->ans_fm_cap = DDI_FM_EREPORT_CAPABLE | DDI_FM_ERRCB_CAPABLE |
559 558 DDI_FM_ACCCHK_CAPABLE | DDI_FM_DMACHK_CAPABLE;
560 559
561 560 /*
562 561 * Request our capability level and get our parent's capability and ibc.
563 562 */
564 563 ddi_fm_init(softsp->ans_dip, &softsp->ans_fm_cap, &softsp->ans_fm_ibc);
565 564 if (softsp->ans_fm_cap & DDI_FM_ERRCB_CAPABLE) {
566 565 /*
567 566 * Register error callback with our parent if supported.
568 567 */
569 568 ddi_fm_handler_register(softsp->ans_dip, acpinex_err_callback,
570 569 softsp);
571 570 }
572 571 }
573 572
574 573 /*
575 574 * Breakdown our FMA resources
576 575 */
577 576 static void
578 577 acpinex_fm_fini(acpinex_softstate_t *softsp)
579 578 {
580 579 /* Clean up allocated fm structures */
581 580 if (softsp->ans_fm_cap & DDI_FM_ERRCB_CAPABLE) {
582 581 ddi_fm_handler_unregister(softsp->ans_dip);
583 582 }
584 583 ddi_fm_fini(softsp->ans_dip);
585 584 }
586 585
587 586 /*
588 587 * Initialize FMA resources for child devices.
589 588 * Called when child calls ddi_fm_init().
590 589 */
591 590 static int
592 591 acpinex_fm_init_child(dev_info_t *dip, dev_info_t *tdip, int cap,
593 592 ddi_iblock_cookie_t *ibc)
594 593 {
595 594 _NOTE(ARGUNUSED(tdip, cap));
596 595
597 596 acpinex_softstate_t *softsp = ddi_get_soft_state(acpinex_softstates,
598 597 ddi_get_instance(dip));
599 598
600 599 *ibc = softsp->ans_fm_ibc;
601 600
602 601 return (softsp->ans_fm_cap);
603 602 }
↓ open down ↓ |
430 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX