Print this page
NEX-15925 pseudonex, rootnex, and friends don't need to log useless device announcements
Reviewed by: Dan Fields <dan.fields@nexenta.com>
Reviewed by: Roman Strashkin <roman.strashkin@nexenta.com>
| 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 */
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 162 (void *)&modldrv,
163 163 NULL
164 164 };
165 165
166 166 /*
167 167 * Module initialization routines.
168 168 */
169 169 int
170 170 _init(void)
171 171 {
172 172 int error;
173 173
174 174 /* Initialize soft state pointer. */
175 175 if ((error = ddi_soft_state_init(&acpinex_softstates,
176 176 sizeof (acpinex_softstate_t), 8)) != 0) {
177 177 cmn_err(CE_WARN,
178 178 "acpinex: failed to initialize soft state structure.");
179 179 return (error);
180 180 }
181 181
182 182 /* Initialize event subsystem. */
183 183 acpinex_event_init();
184 184
185 185 /* Install the module. */
186 186 if ((error = mod_install(&modlinkage)) != 0) {
187 187 cmn_err(CE_WARN, "acpinex: failed to install module.");
188 188 ddi_soft_state_fini(&acpinex_softstates);
189 189 return (error);
190 190 }
191 191
192 192 mutex_init(&acpinex_lock, NULL, MUTEX_DRIVER, NULL);
193 193
194 194 return (0);
195 195 }
196 196
197 197 int
198 198 _fini(void)
199 199 {
200 200 int error;
201 201
202 202 /* Remove the module. */
203 203 if ((error = mod_remove(&modlinkage)) != 0) {
204 204 return (error);
205 205 }
206 206
207 207 /* Shut down event subsystem. */
208 208 acpinex_event_fini();
209 209
210 210 /* Free the soft state info. */
211 211 ddi_soft_state_fini(&acpinex_softstates);
212 212
213 213 mutex_destroy(&acpinex_lock);
214 214
215 215 return (0);
216 216 }
217 217
218 218 int
219 219 _info(struct modinfo *modinfop)
220 220 {
221 221 return (mod_info(&modlinkage, modinfop));
222 222 }
223 223
224 224 static int
225 225 acpinex_info(dev_info_t *dip, ddi_info_cmd_t infocmd, void *arg, void **result)
226 226 {
227 227 _NOTE(ARGUNUSED(dip));
228 228
229 229 dev_t dev;
230 230 int instance;
231 231
232 232 if (infocmd == DDI_INFO_DEVT2INSTANCE) {
233 233 dev = (dev_t)arg;
234 234 instance = ACPINEX_GET_INSTANCE(getminor(dev));
235 235 *result = (void *)(uintptr_t)instance;
236 236 return (DDI_SUCCESS);
237 237 }
238 238
239 239 return (DDI_FAILURE);
240 240 }
241 241
242 242 static int
243 243 acpinex_attach(dev_info_t *devi, ddi_attach_cmd_t cmd)
244 244 {
245 245 int instance;
246 246 acpinex_softstate_t *softsp;
247 247
248 248 switch (cmd) {
249 249 case DDI_ATTACH:
250 250 break;
251 251
252 252 case DDI_RESUME:
253 253 return (DDI_SUCCESS);
254 254
255 255 default:
256 256 return (DDI_FAILURE);
257 257 }
258 258
259 259 /* Get and check instance number. */
260 260 instance = ddi_get_instance(devi);
261 261 if (instance >= ACPINEX_INSTANCE_MAX) {
262 262 cmn_err(CE_WARN, "acpinex: instance number %d is out of range "
263 263 "in acpinex_attach(), max %d.",
264 264 instance, ACPINEX_INSTANCE_MAX - 1);
265 265 return (DDI_FAILURE);
266 266 }
267 267
268 268 /* Get soft state structure. */
269 269 if (ddi_soft_state_zalloc(acpinex_softstates, instance)
270 270 != DDI_SUCCESS) {
271 271 cmn_err(CE_WARN, "!acpinex: failed to allocate soft state "
272 272 "object in acpinex_attach().");
273 273 return (DDI_FAILURE);
274 274 }
275 275 softsp = ddi_get_soft_state(acpinex_softstates, instance);
276 276
277 277 /* Initialize soft state structure */
278 278 softsp->ans_dip = devi;
279 279 (void) ddi_pathname(devi, softsp->ans_path);
280 280 if (ACPI_FAILURE(acpica_get_handle(devi, &softsp->ans_hdl))) {
281 281 ACPINEX_DEBUG(CE_WARN,
282 282 "!acpinex: failed to get ACPI handle for %s.",
283 283 softsp->ans_path);
284 284 ddi_soft_state_free(acpinex_softstates, instance);
285 285 return (DDI_FAILURE);
286 286 }
287 287 mutex_init(&softsp->ans_lock, NULL, MUTEX_DRIVER, NULL);
288 288
289 289 /* Install event handler for child/descendant objects. */
290 290 if (acpinex_event_scan(softsp, B_TRUE) != DDI_SUCCESS) {
291 291 cmn_err(CE_WARN, "!acpinex: failed to install event handler "
292 292 "for children of %s.", softsp->ans_path);
293 293 }
294 294
295 295 /* nothing to suspend/resume here */
296 296 (void) ddi_prop_update_string(DDI_DEV_T_NONE, devi,
297 297 "pm-hardware-state", "no-suspend-resume");
298 298 (void) ddi_prop_update_int(DDI_DEV_T_NONE, devi,
299 299 DDI_NO_AUTODETACH, 1);
300 300
301 301 acpinex_fm_init(softsp);
302 302 ddi_report_dev(devi);
303 303
304 304 return (DDI_SUCCESS);
305 305 }
306 306
307 307 static int
308 308 acpinex_detach(dev_info_t *devi, ddi_detach_cmd_t cmd)
309 309 {
310 310 int instance;
311 311 acpinex_softstate_t *softsp;
312 312
313 313 instance = ddi_get_instance(devi);
314 314 if (instance >= ACPINEX_INSTANCE_MAX) {
315 315 cmn_err(CE_WARN, "acpinex: instance number %d is out of range "
316 316 "in acpinex_detach(), max %d.",
317 317 instance, ACPINEX_INSTANCE_MAX - 1);
318 318 return (DDI_FAILURE);
319 319 }
320 320
321 321 softsp = ddi_get_soft_state(acpinex_softstates, instance);
322 322 if (softsp == NULL) {
323 323 ACPINEX_DEBUG(CE_WARN, "!acpinex: failed to get soft state "
324 324 "object for instance %d in acpinex_detach()", instance);
325 325 return (DDI_FAILURE);
326 326 }
327 327
328 328 switch (cmd) {
329 329 case DDI_DETACH:
330 330 if (acpinex_event_scan(softsp, B_FALSE) != DDI_SUCCESS) {
331 331 cmn_err(CE_WARN, "!acpinex: failed to uninstall event "
332 332 "handler for children of %s.", softsp->ans_path);
333 333 return (DDI_FAILURE);
334 334 }
335 335 ddi_remove_minor_node(devi, NULL);
336 336 acpinex_fm_fini(softsp);
337 337 mutex_destroy(&softsp->ans_lock);
338 338 ddi_soft_state_free(acpinex_softstates, instance);
339 339 (void) ddi_prop_update_int(DDI_DEV_T_NONE, devi,
340 340 DDI_NO_AUTODETACH, 0);
341 341 return (DDI_SUCCESS);
342 342
343 343 case DDI_SUSPEND:
344 344 return (DDI_SUCCESS);
345 345
346 346 default:
347 347 return (DDI_FAILURE);
348 348 }
349 349 }
350 350
351 351 static int
352 352 name_child(dev_info_t *child, char *name, int namelen)
353 353 {
354 354 char *unitaddr;
355 355
356 356 ddi_set_parent_data(child, NULL);
357 357
358 358 name[0] = '\0';
359 359 if (ddi_prop_lookup_string(DDI_DEV_T_ANY, child, DDI_PROP_DONTPASS,
360 360 ACPIDEV_PROP_NAME_UNIT_ADDR, &unitaddr) == DDI_SUCCESS) {
361 361 (void) strlcpy(name, unitaddr, namelen);
362 362 ddi_prop_free(unitaddr);
363 363 } else {
364 364 ACPINEX_DEBUG(CE_NOTE, "!acpinex: failed to lookup child "
365 365 "unit-address prop for %p.", (void *)child);
366 366 }
367 367
368 368 return (DDI_SUCCESS);
369 369 }
370 370
371 371 static int
372 372 init_child(dev_info_t *child)
373 373 {
374 374 char name[MAXNAMELEN];
375 375
376 376 (void) name_child(child, name, MAXNAMELEN);
377 377 ddi_set_name_addr(child, name);
378 378 if ((ndi_dev_is_persistent_node(child) == 0) &&
379 379 (ndi_merge_node(child, name_child) == DDI_SUCCESS)) {
380 380 impl_ddi_sunbus_removechild(child);
381 381 return (DDI_FAILURE);
382 382 }
383 383
384 384 return (DDI_SUCCESS);
385 385 }
386 386
387 387 /*
388 388 * Control ops entry point:
389 389 *
390 390 * Requests handled completely:
391 391 * DDI_CTLOPS_INITCHILD
392 392 * DDI_CTLOPS_UNINITCHILD
393 393 * All others are passed to the parent.
394 394 */
395 395 static int
396 396 acpinex_ctlops(dev_info_t *dip, dev_info_t *rdip, ddi_ctl_enum_t op, void *arg,
397 397 void *result)
398 398 {
399 399 int rval = DDI_SUCCESS;
400 400
|
↓ open down ↓ |
400 lines elided |
↑ open up ↑ |
401 401 switch (op) {
402 402 case DDI_CTLOPS_INITCHILD:
403 403 rval = init_child((dev_info_t *)arg);
404 404 break;
405 405
406 406 case DDI_CTLOPS_UNINITCHILD:
407 407 impl_ddi_sunbus_removechild((dev_info_t *)arg);
408 408 break;
409 409
410 410 case DDI_CTLOPS_REPORTDEV: {
411 - if (rdip == (dev_info_t *)0)
411 + if (rdip == NULL)
412 412 return (DDI_FAILURE);
413 - cmn_err(CE_CONT, "?acpinex: %s@%s, %s%d\n",
414 - ddi_node_name(rdip), ddi_get_name_addr(rdip),
415 - ddi_driver_name(rdip), ddi_get_instance(rdip));
416 413 break;
417 414 }
418 415
419 416 default:
420 417 rval = ddi_ctlops(dip, rdip, op, arg, result);
421 418 break;
422 419 }
423 420
424 421 return (rval);
425 422 }
426 423
427 424 /* ARGSUSED */
428 425 static int
429 426 acpinex_bus_map(dev_info_t *dip, dev_info_t *rdip, ddi_map_req_t *mp,
430 427 off_t offset, off_t len, caddr_t *vaddrp)
431 428 {
432 429 ACPINEX_DEBUG(CE_WARN,
433 430 "!acpinex: acpinex_bus_map called and it's unimplemented.");
434 431 return (DDI_ME_UNIMPLEMENTED);
435 432 }
436 433
437 434 static int
438 435 acpinex_open(dev_t *devi, int flags, int otyp, cred_t *credp)
439 436 {
440 437 _NOTE(ARGUNUSED(flags, otyp, credp));
441 438
442 439 minor_t minor, instance;
443 440 acpinex_softstate_t *softsp;
444 441
445 442 minor = getminor(*devi);
446 443 instance = ACPINEX_GET_INSTANCE(minor);
447 444 if (instance >= ACPINEX_INSTANCE_MAX) {
448 445 ACPINEX_DEBUG(CE_WARN, "!acpinex: instance number %d out of "
449 446 "range in acpinex_open, max %d.",
450 447 instance, ACPINEX_INSTANCE_MAX - 1);
451 448 return (EINVAL);
452 449 }
453 450
454 451 softsp = ddi_get_soft_state(acpinex_softstates, instance);
455 452 if (softsp == NULL) {
456 453 ACPINEX_DEBUG(CE_WARN, "!acpinex: failed to get soft state "
457 454 "object for instance %d in acpinex_open().", instance);
458 455 return (EINVAL);
459 456 }
460 457
461 458 if (ACPINEX_IS_DEVCTL(minor)) {
462 459 return (0);
463 460 } else {
464 461 ACPINEX_DEBUG(CE_WARN,
465 462 "!acpinex: invalid minor number %d in acpinex_open().",
466 463 minor);
467 464 return (EINVAL);
468 465 }
469 466 }
470 467
471 468 static int
472 469 acpinex_close(dev_t dev, int flags, int otyp, cred_t *credp)
473 470 {
474 471 _NOTE(ARGUNUSED(flags, otyp, credp));
475 472
476 473 minor_t minor, instance;
477 474 acpinex_softstate_t *softsp;
478 475
479 476 minor = getminor(dev);
480 477 instance = ACPINEX_GET_INSTANCE(minor);
481 478 if (instance >= ACPINEX_INSTANCE_MAX) {
482 479 ACPINEX_DEBUG(CE_WARN, "!acpinex: instance number %d out of "
483 480 "range in acpinex_close(), max %d.",
484 481 instance, ACPINEX_INSTANCE_MAX - 1);
485 482 return (EINVAL);
486 483 }
487 484
488 485 softsp = ddi_get_soft_state(acpinex_softstates, instance);
489 486 if (softsp == NULL) {
490 487 ACPINEX_DEBUG(CE_WARN, "!acpinex: failed to get soft state "
491 488 "object for instance %d in acpinex_close().", instance);
492 489 return (EINVAL);
493 490 }
494 491
495 492 if (ACPINEX_IS_DEVCTL(minor)) {
496 493 return (0);
497 494 } else {
498 495 ACPINEX_DEBUG(CE_WARN,
499 496 "!acpinex: invalid minor number %d in acpinex_close().",
500 497 minor);
501 498 return (EINVAL);
502 499 }
503 500 }
504 501
505 502 static int
506 503 acpinex_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp,
507 504 int *rvalp)
508 505 {
509 506 _NOTE(ARGUNUSED(cmd, arg, mode, credp, rvalp));
510 507
511 508 int rv = 0;
512 509 minor_t minor, instance;
513 510 acpinex_softstate_t *softsp;
514 511
515 512 minor = getminor(dev);
516 513 instance = ACPINEX_GET_INSTANCE(minor);
517 514 if (instance >= ACPINEX_INSTANCE_MAX) {
518 515 ACPINEX_DEBUG(CE_NOTE, "!acpinex: instance number %d out of "
519 516 "range in acpinex_ioctl(), max %d.",
520 517 instance, ACPINEX_INSTANCE_MAX - 1);
521 518 return (EINVAL);
522 519 }
523 520 softsp = ddi_get_soft_state(acpinex_softstates, instance);
524 521 if (softsp == NULL) {
525 522 ACPINEX_DEBUG(CE_WARN, "!acpinex: failed to get soft state "
526 523 "object for instance %d in acpinex_ioctl().", instance);
527 524 return (EINVAL);
528 525 }
529 526
530 527 rv = ENOTSUP;
531 528 ACPINEX_DEBUG(CE_WARN,
532 529 "!acpinex: invalid minor number %d in acpinex_ioctl().", minor);
533 530
534 531 return (rv);
535 532 }
536 533
537 534 /*
538 535 * FMA error callback.
539 536 * Register error handling callback with our parent. We will just call
540 537 * our children's error callbacks and return their status.
541 538 */
542 539 static int
543 540 acpinex_err_callback(dev_info_t *dip, ddi_fm_error_t *derr,
544 541 const void *impl_data)
545 542 {
546 543 _NOTE(ARGUNUSED(impl_data));
547 544
548 545 /* Call our childrens error handlers */
549 546 return (ndi_fm_handler_dispatch(dip, NULL, derr));
550 547 }
551 548
552 549 /*
553 550 * Initialize our FMA resources
554 551 */
555 552 static void
556 553 acpinex_fm_init(acpinex_softstate_t *softsp)
557 554 {
558 555 softsp->ans_fm_cap = DDI_FM_EREPORT_CAPABLE | DDI_FM_ERRCB_CAPABLE |
559 556 DDI_FM_ACCCHK_CAPABLE | DDI_FM_DMACHK_CAPABLE;
560 557
561 558 /*
562 559 * Request our capability level and get our parent's capability and ibc.
563 560 */
564 561 ddi_fm_init(softsp->ans_dip, &softsp->ans_fm_cap, &softsp->ans_fm_ibc);
565 562 if (softsp->ans_fm_cap & DDI_FM_ERRCB_CAPABLE) {
566 563 /*
567 564 * Register error callback with our parent if supported.
568 565 */
569 566 ddi_fm_handler_register(softsp->ans_dip, acpinex_err_callback,
570 567 softsp);
571 568 }
572 569 }
573 570
574 571 /*
575 572 * Breakdown our FMA resources
576 573 */
577 574 static void
578 575 acpinex_fm_fini(acpinex_softstate_t *softsp)
579 576 {
580 577 /* Clean up allocated fm structures */
581 578 if (softsp->ans_fm_cap & DDI_FM_ERRCB_CAPABLE) {
582 579 ddi_fm_handler_unregister(softsp->ans_dip);
583 580 }
584 581 ddi_fm_fini(softsp->ans_dip);
585 582 }
586 583
587 584 /*
588 585 * Initialize FMA resources for child devices.
589 586 * Called when child calls ddi_fm_init().
590 587 */
591 588 static int
592 589 acpinex_fm_init_child(dev_info_t *dip, dev_info_t *tdip, int cap,
593 590 ddi_iblock_cookie_t *ibc)
594 591 {
595 592 _NOTE(ARGUNUSED(tdip, cap));
596 593
597 594 acpinex_softstate_t *softsp = ddi_get_soft_state(acpinex_softstates,
598 595 ddi_get_instance(dip));
599 596
600 597 *ibc = softsp->ans_fm_ibc;
601 598
602 599 return (softsp->ans_fm_cap);
603 600 }
|
↓ open down ↓ |
178 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX