void load_platform_drivers(void) { /* load the NGDR driver */ if (i_ddi_attach_pseudo_node("ngdr") == NULL) { cmn_err(CE_WARN, "ngdr failed to load"); } }
/* * Init and attach the root node. root node is the first one to be * attached, so the process is somewhat "handcrafted". */ void i_ddi_init_root() { #ifdef DDI_PROP_DEBUG (void) ddi_prop_debug(1); /* Enable property debugging */ #endif /* DDI_PROP_DEBUG */ /* * Initialize root node */ if (impl_ddi_sunbus_initchild(top_devinfo) != DDI_SUCCESS) panic("Could not initialize root nexus"); /* * Attach root node (no need to probe) * Hold both devinfo and rootnex driver so they can't go away. */ DEVI(top_devinfo)->devi_ops = ndi_hold_driver(top_devinfo); ASSERT(DEV_OPS_HELD(DEVI(top_devinfo)->devi_ops)); DEVI(top_devinfo)->devi_instance = e_ddi_assign_instance(top_devinfo); (void) i_ddi_load_drvconf(DEVI(top_devinfo)->devi_major); mutex_enter(&(DEVI(top_devinfo)->devi_lock)); DEVI_SET_ATTACHING(top_devinfo); mutex_exit(&(DEVI(top_devinfo)->devi_lock)); if (devi_attach(top_devinfo, DDI_ATTACH) != DDI_SUCCESS) panic("Could not attach root nexus"); mutex_enter(&(DEVI(top_devinfo)->devi_lock)); DEVI_CLR_ATTACHING(top_devinfo); mutex_exit(&(DEVI(top_devinfo)->devi_lock)); mutex_init(&global_vhci_lock, NULL, MUTEX_DEFAULT, NULL); ndi_hold_devi(top_devinfo); /* hold it forever */ i_ddi_set_node_state(top_devinfo, DS_READY); /* * Now, expand .conf children of root */ (void) i_ndi_make_spec_children(top_devinfo, 0); /* * Must be set up before attaching root or pseudo drivers */ pm_init_locks(); /* * Attach options dip */ options_dip = i_ddi_attach_pseudo_node("options"); /* * Attach pseudo nexus and enumerate its children */ pseudo_dip = i_ddi_attach_pseudo_node(DEVI_PSEUDO_NEXNAME); (void) i_ndi_make_spec_children(pseudo_dip, 0); /* * Attach and hold clone dip */ clone_dip = i_ddi_attach_pseudo_node("clone"); clone_major = ddi_driver_major(clone_dip); mm_major = ddi_name_to_major("mm"); nulldriver_major = ddi_name_to_major("nulldriver"); /* * Attach scsi_vhci for MPXIO, this registers scsi vhci class * with the MPXIO framework. */ scsi_vhci_dip = i_ddi_attach_pseudo_node("scsi_vhci"); }