Lines Matching refs:dip

84 typedef int	(*ddi_cb_func_t)(dev_info_t *dip, ddi_cb_action_t action,
253 /* For device contracts that have this dip's minor node as resource */
257 int devi_ct_neg; /* neg. occurred on dip */
361 #define DEVI_IS_DEVICE_OFFLINE(dip) \
362 ((DEVI(dip)->devi_state & DEVI_DEVICE_OFFLINE) == DEVI_DEVICE_OFFLINE)
364 #define DEVI_SET_DEVICE_ONLINE(dip) { \
365 ASSERT(mutex_owned(&DEVI(dip)->devi_lock)); \
366 if (DEVI(dip)->devi_state & DEVI_DEVICE_DEGRADED) { \
367 mutex_exit(&DEVI(dip)->devi_lock); \
368 e_ddi_undegrade_finalize(dip); \
369 mutex_enter(&DEVI(dip)->devi_lock); \
372 DEVI(dip)->devi_state &= ~(DEVI_DEVICE_DOWN | \
376 #define DEVI_SET_DEVICE_OFFLINE(dip) { \
377 ASSERT(mutex_owned(&DEVI(dip)->devi_lock)); \
378 DEVI(dip)->devi_state |= (DEVI_DEVICE_OFFLINE | DEVI_S_REPORT); \
381 #define DEVI_IS_DEVICE_DOWN(dip) \
382 ((DEVI(dip)->devi_state & DEVI_DEVICE_DOWN) == DEVI_DEVICE_DOWN)
384 #define DEVI_SET_DEVICE_DOWN(dip) { \
385 ASSERT(mutex_owned(&DEVI(dip)->devi_lock)); \
386 ASSERT(!DEVI_IS_DEVICE_OFFLINE(dip)); \
387 DEVI(dip)->devi_state |= (DEVI_DEVICE_DOWN | DEVI_S_REPORT); \
390 #define DEVI_IS_DEVICE_DEGRADED(dip) \
391 ((DEVI(dip)->devi_state & \
394 #define DEVI_SET_DEVICE_DEGRADED(dip) { \
395 ASSERT(mutex_owned(&DEVI(dip)->devi_lock)); \
396 ASSERT(!DEVI_IS_DEVICE_OFFLINE(dip)); \
397 mutex_exit(&DEVI(dip)->devi_lock); \
398 e_ddi_degrade_finalize(dip); \
399 mutex_enter(&DEVI(dip)->devi_lock); \
400 DEVI(dip)->devi_state |= (DEVI_DEVICE_DEGRADED | DEVI_S_REPORT); \
403 #define DEVI_SET_DEVICE_UP(dip) { \
404 ASSERT(mutex_owned(&DEVI(dip)->devi_lock)); \
405 ASSERT(!DEVI_IS_DEVICE_OFFLINE(dip)); \
406 if (DEVI(dip)->devi_state & DEVI_DEVICE_DEGRADED) { \
407 mutex_exit(&DEVI(dip)->devi_lock); \
408 e_ddi_undegrade_finalize(dip); \
409 mutex_enter(&DEVI(dip)->devi_lock); \
411 DEVI(dip)->devi_state &= ~(DEVI_DEVICE_DEGRADED | DEVI_DEVICE_DOWN); \
412 DEVI(dip)->devi_state |= DEVI_S_REPORT; \
416 #define DEVI_IS_DEVICE_REMOVED(dip) \
417 ((DEVI(dip)->devi_state & DEVI_DEVICE_REMOVED) == DEVI_DEVICE_REMOVED)
419 #define DEVI_SET_DEVICE_REMOVED(dip) { \
420 ASSERT(mutex_owned(&DEVI(dip)->devi_lock)); \
421 DEVI(dip)->devi_state |= DEVI_DEVICE_REMOVED | DEVI_S_REPORT; \
424 #define DEVI_SET_DEVICE_REINSERTED(dip) { \
425 ASSERT(mutex_owned(&DEVI(dip)->devi_lock)); \
426 DEVI(dip)->devi_state &= ~DEVI_DEVICE_REMOVED; \
427 DEVI(dip)->devi_state |= DEVI_S_REPORT; \
431 #define DEVI_IS_BUS_QUIESCED(dip) \
432 ((DEVI(dip)->devi_state & DEVI_BUS_QUIESCED) == DEVI_BUS_QUIESCED)
434 #define DEVI_SET_BUS_ACTIVE(dip) { \
435 ASSERT(mutex_owned(&DEVI(dip)->devi_lock)); \
436 DEVI(dip)->devi_state &= ~DEVI_BUS_QUIESCED; \
437 DEVI(dip)->devi_state |= DEVI_S_REPORT; \
440 #define DEVI_SET_BUS_QUIESCE(dip) { \
441 ASSERT(mutex_owned(&DEVI(dip)->devi_lock)); \
442 DEVI(dip)->devi_state |= (DEVI_BUS_QUIESCED | DEVI_S_REPORT); \
445 #define DEVI_IS_BUS_DOWN(dip) \
446 ((DEVI(dip)->devi_state & DEVI_BUS_DOWN) == DEVI_BUS_DOWN)
448 #define DEVI_SET_BUS_UP(dip) { \
449 ASSERT(mutex_owned(&DEVI(dip)->devi_lock)); \
450 DEVI(dip)->devi_state &= ~DEVI_BUS_DOWN; \
451 DEVI(dip)->devi_state |= DEVI_S_REPORT; \
454 #define DEVI_SET_BUS_DOWN(dip) { \
455 ASSERT(mutex_owned(&DEVI(dip)->devi_lock)); \
456 DEVI(dip)->devi_state |= (DEVI_BUS_DOWN | DEVI_S_REPORT); \
460 #define DEVI_NEED_REPORT(dip) \
461 ((DEVI(dip)->devi_state & DEVI_S_REPORT) == DEVI_S_REPORT)
463 #define DEVI_SET_REPORT(dip) { \
464 ASSERT(mutex_owned(&DEVI(dip)->devi_lock)); \
465 DEVI(dip)->devi_state |= DEVI_S_REPORT; \
468 #define DEVI_REPORT_DONE(dip) { \
469 ASSERT(mutex_owned(&DEVI(dip)->devi_lock)); \
470 DEVI(dip)->devi_state &= ~DEVI_S_REPORT; \
474 #define DEVI_NEED_NDI_CONFIG(dip) \
475 ((DEVI(dip)->devi_state & DEVI_NDI_CONFIG) == DEVI_NDI_CONFIG)
477 #define DEVI_SET_NDI_CONFIG(dip) { \
478 ASSERT(mutex_owned(&DEVI(dip)->devi_lock)); \
479 DEVI(dip)->devi_state |= DEVI_NDI_CONFIG; \
482 #define DEVI_CLR_NDI_CONFIG(dip) { \
483 ASSERT(mutex_owned(&DEVI(dip)->devi_lock)); \
484 DEVI(dip)->devi_state &= ~DEVI_NDI_CONFIG; \
488 #define DEVI_IS_ATTACHING(dip) \
489 ((DEVI(dip)->devi_state & DEVI_S_ATTACHING) == DEVI_S_ATTACHING)
491 #define DEVI_SET_ATTACHING(dip) { \
492 ASSERT(mutex_owned(&DEVI(dip)->devi_lock)); \
493 DEVI(dip)->devi_state |= DEVI_S_ATTACHING; \
496 #define DEVI_CLR_ATTACHING(dip) { \
497 ASSERT(mutex_owned(&DEVI(dip)->devi_lock)); \
498 DEVI(dip)->devi_state &= ~DEVI_S_ATTACHING; \
501 #define DEVI_IS_DETACHING(dip) \
502 ((DEVI(dip)->devi_state & DEVI_S_DETACHING) == DEVI_S_DETACHING)
504 #define DEVI_SET_DETACHING(dip) { \
505 ASSERT(mutex_owned(&DEVI(dip)->devi_lock)); \
506 DEVI(dip)->devi_state |= DEVI_S_DETACHING; \
509 #define DEVI_CLR_DETACHING(dip) { \
510 ASSERT(mutex_owned(&DEVI(dip)->devi_lock)); \
511 DEVI(dip)->devi_state &= ~DEVI_S_DETACHING; \
515 #define DEVI_IS_ONLINING(dip) \
516 ((DEVI(dip)->devi_state & DEVI_S_ONLINING) == DEVI_S_ONLINING)
518 #define DEVI_SET_ONLINING(dip) { \
519 ASSERT(mutex_owned(&DEVI(dip)->devi_lock)); \
520 DEVI(dip)->devi_state |= DEVI_S_ONLINING; \
523 #define DEVI_CLR_ONLINING(dip) { \
524 ASSERT(mutex_owned(&DEVI(dip)->devi_lock)); \
525 DEVI(dip)->devi_state &= ~DEVI_S_ONLINING; \
528 #define DEVI_IS_OFFLINING(dip) \
529 ((DEVI(dip)->devi_state & DEVI_S_OFFLINING) == DEVI_S_OFFLINING)
531 #define DEVI_SET_OFFLINING(dip) { \
532 ASSERT(mutex_owned(&DEVI(dip)->devi_lock)); \
533 DEVI(dip)->devi_state |= DEVI_S_OFFLINING; \
536 #define DEVI_CLR_OFFLINING(dip) { \
537 ASSERT(mutex_owned(&DEVI(dip)->devi_lock)); \
538 DEVI(dip)->devi_state &= ~DEVI_S_OFFLINING; \
541 #define DEVI_IS_IN_RECONFIG(dip) \
542 (DEVI(dip)->devi_state & (DEVI_S_OFFLINING | DEVI_S_ONLINING))
545 #define DEVI_IS_INVOKING_DACF(dip) \
546 ((DEVI(dip)->devi_state & DEVI_S_INVOKING_DACF) == DEVI_S_INVOKING_DACF)
548 #define DEVI_SET_INVOKING_DACF(dip) { \
549 ASSERT(mutex_owned(&DEVI(dip)->devi_lock)); \
550 DEVI(dip)->devi_state |= DEVI_S_INVOKING_DACF; \
553 #define DEVI_CLR_INVOKING_DACF(dip) { \
554 ASSERT(mutex_owned(&DEVI(dip)->devi_lock)); \
555 DEVI(dip)->devi_state &= ~DEVI_S_INVOKING_DACF; \
559 #define DEVI_EVADD(dip) \
560 ((DEVI(dip)->devi_state & DEVI_S_EVADD) == DEVI_S_EVADD)
562 #define DEVI_SET_EVADD(dip) { \
563 ASSERT(mutex_owned(&DEVI(dip)->devi_lock)); \
564 DEVI(dip)->devi_state &= ~DEVI_S_EVREMOVE; \
565 DEVI(dip)->devi_state |= DEVI_S_EVADD; \
568 #define DEVI_EVREMOVE(dip) \
569 ((DEVI(dip)->devi_state & DEVI_S_EVREMOVE) == DEVI_S_EVREMOVE)
571 #define DEVI_SET_EVREMOVE(dip) { \
572 ASSERT(mutex_owned(&DEVI(dip)->devi_lock)); \
573 DEVI(dip)->devi_state &= ~DEVI_S_EVADD; \
574 DEVI(dip)->devi_state |= DEVI_S_EVREMOVE; \
577 #define DEVI_SET_EVUNINIT(dip) { \
578 ASSERT(mutex_owned(&DEVI(dip)->devi_lock)); \
579 DEVI(dip)->devi_state &= ~(DEVI_S_EVADD | DEVI_S_EVREMOVE); \
583 #define DEVI_NEED_RESET(dip) \
584 ((DEVI(dip)->devi_state & DEVI_S_NEED_RESET) == DEVI_S_NEED_RESET)
586 #define DEVI_SET_NEED_RESET(dip) { \
587 ASSERT(mutex_owned(&DEVI(dip)->devi_lock)); \
588 DEVI(dip)->devi_state |= DEVI_S_NEED_RESET; \
591 #define DEVI_CLR_NEED_RESET(dip) { \
592 ASSERT(mutex_owned(&DEVI(dip)->devi_lock)); \
593 DEVI(dip)->devi_state &= ~DEVI_S_NEED_RESET; \
604 #define DEVI_BRANCH_HELD 0x00000008 /* branch rooted at this dip held */
614 #define DEVI_PCI_DEVICE 0x00002000 /* dip is PCI */
616 #define DEVI_BUSY_CHANGING(dip) (DEVI(dip)->devi_flags & DEVI_BUSY)
617 #define DEVI_BUSY_OWNED(dip) (DEVI_BUSY_CHANGING(dip) && \
618 ((DEVI(dip))->devi_busy_thread == curthread))
620 #define DEVI_IS_PCI(dip) (DEVI(dip)->devi_flags & DEVI_PCI_DEVICE)
621 #define DEVI_SET_PCI(dip) (DEVI(dip)->devi_flags |= (DEVI_PCI_DEVICE))
660 * Note that the target dip is passed as an arg already.
671 * Note that the target dip is passed as an arg already.
731 #define DEVI_VHCI_NODE(dip) \
732 (DEVI(dip)->devi_node_attributes & DDI_VHCI_NODE)
740 dev_info_t *dip; /* pointer to devinfo node */