int _init(void) { int ret; ret = ddi_soft_state_init(&emul64_state, sizeof (struct emul64), EMUL64_INITIAL_SOFT_SPACE); if (ret != 0) return (ret); if ((ret = scsi_hba_init(&modlinkage)) != 0) { ddi_soft_state_fini(&emul64_state); return (ret); } /* Set the number of task threads to the number of CPUs */ if (boot_max_ncpus == -1) { emul64_task_nthreads = max_ncpus; } else { emul64_task_nthreads = boot_max_ncpus; } emul64_bsd_init(); ret = mod_install(&modlinkage); if (ret != 0) { emul64_bsd_fini(); scsi_hba_fini(&modlinkage); ddi_soft_state_fini(&emul64_state); } return (ret); }
/* * * --- DDI/DKI entry points * */ int _init(void) { int error; #ifndef NPROBE (void) tnf_mod_load(); #endif error = ddi_soft_state_init(&av1394_statep, sizeof (av1394_inst_t), 1); if (error != 0) { #ifndef NPROBE (void) tnf_mod_unload(&av1394_modlinkage); #endif return (error); } if ((error = mod_install(&av1394_modlinkage)) != 0) { ddi_soft_state_fini(&av1394_statep); #ifndef NPROBE (void) tnf_mod_unload(&av1394_modlinkage); #endif } return (error); }
/** * Initializes a loadable module. It calls `mod_install' to install the * `modlinkage' and `modldrv' structures. */ int _init(void) { int error; error = ddi_soft_state_init(&quantis_soft_state_p, sizeof(quantis_soft_state_t), 0); if (error != 0) { QUANTIS_ERROR("Could not initialize the soft state tree.\n"); return error; } error = mod_install(&modlinkage); if (error != 0) { QUANTIS_ERROR("Could not install the modlinkage structure.\n"); ddi_soft_state_fini(&quantis_soft_state_p); return error; } mutex_init(&quantis_mutex, NULL, MUTEX_DRIVER, NULL); card_count = 0; LOG_DEBUG0("Initialized the quantis driver\n"); return error; }
int _init(void) { int error; if (strcmp(tod_module_name, "todds1307") == 0) { if ((error = ddi_soft_state_init(&ds1307_statep, sizeof (ds1307_state_t), 0)) != DDI_SUCCESS) { return (error); } tod_ops.tod_get = todds1307_get; tod_ops.tod_set = todds1307_set; tod_ops.tod_set_watchdog_timer = todds1307_set_watchdog_timer; tod_ops.tod_clear_watchdog_timer = todds1307_clear_watchdog_timer; tod_ops.tod_set_power_alarm = todds1307_set_power_alarm; tod_ops.tod_clear_power_alarm = todds1307_clear_power_alarm; } (void) todds1307_setup_prom(); /* * Install the module */ if ((error = mod_install(&todds1307_modlinkage)) != 0) { ddi_soft_state_fini(&ds1307_statep); return (error); } mutex_init(&todds1307_rd_lock, NULL, MUTEX_DEFAULT, NULL); return (0); }
int _init(void) { int error; if ((error = ddi_soft_state_init(&sbbcp, sizeof (sbbc_softstate_t), 1)) != 0) return (error); if ((error = mod_install(&modlinkage)) != 0) { ddi_soft_state_fini(&sbbcp); return (error); } /* * Initialise the global 'chosen' IOSRAM mutex */ mutex_init(&chosen_lock, NULL, MUTEX_DEFAULT, NULL); /* * Initialise the iosram driver */ iosram_init(); /* * Initialize the mailbox */ sbbc_mbox_init(); return (error); }
/* * Module initialization routines. */ int _init(void) { int error; /* Initialize soft state pointer. */ if ((error = ddi_soft_state_init(&acpinex_softstates, sizeof (acpinex_softstate_t), 8)) != 0) { cmn_err(CE_WARN, "acpinex: failed to initialize soft state structure."); return (error); } /* Initialize event subsystem. */ acpinex_event_init(); /* Install the module. */ if ((error = mod_install(&modlinkage)) != 0) { cmn_err(CE_WARN, "acpinex: failed to install module."); ddi_soft_state_fini(&acpinex_softstates); return (error); } mutex_init(&acpinex_lock, NULL, MUTEX_DRIVER, NULL); return (0); }
int _init(void) { int err; uint64_t majornum; uint64_t minornum; /* * Check HV intr group api versioning. * Note that cnex assumes interrupt cookies is * in version 1.0 of the intr group api. */ if ((err = hsvc_version(HSVC_GROUP_INTR, &majornum, &minornum)) != 0) { cmn_err(CE_WARN, "cnex: failed to get intr api " "group versioning errno=%d", err); return (err); } else if ((majornum != 1) && (majornum != 2)) { cmn_err(CE_WARN, "cnex: unsupported intr api group: " "maj:0x%lx, min:0x%lx", majornum, minornum); return (ENOTSUP); } if ((err = ddi_soft_state_init(&cnex_state, sizeof (cnex_soft_state_t), 0)) != 0) { return (err); } if ((err = mod_install(&modlinkage)) != 0) { ddi_soft_state_fini(&cnex_state); return (err); } return (0); }
/************************************************************************* * _init(9e), _info(9e), _fini(9e) * * ローダブルカーネルモジュールのエントリーポイント *************************************************************************/ int _init() { int err; cmn_err(CE_CONT, "%s Filesystem Ver %s \n", PACKAGE_NAME, PACKAGE_VERSION); /* * デバイス管理構造体の管理用の iumfscntl_soft_root を初期化 * iumfscntl のデバイス管理構造体は iumfscntl_soft_t として定義されている。 */ if (ddi_soft_state_init(&iumfscntl_soft_root, sizeof (iumfscntl_soft_t), 1) != 0) { return (DDI_FAILURE); } err = mod_install(&modlinkage); if (err != 0) { ddi_soft_state_fini(&iumfscntl_soft_root); cmn_err(CE_CONT, "_init: mod_install returned with error %d", err); } /* * グローバルロックを初期化 */ mutex_init(&iumfs_global_lock, NULL, MUTEX_DEFAULT, NULL); return (err); }
int _init(void) { int e; if ((e = ddi_soft_state_init(&ppb_state, sizeof (ppb_devstate_t), 1)) == 0 && (e = mod_install(&modlinkage)) != 0) ddi_soft_state_fini(&ppb_state); return (e); }
int _init(void) { int error; if ((error = ddi_soft_state_init(&simmstatp, sizeof (struct simmstat_soft_state), 1)) != 0) return (error); return (mod_install(&modlinkage)); }
/** * Kernel entry points */ int _init(void) { int rc; LogFunc((DEVICE_NAME ":_init\n")); g_pDip = NULL; /* * Prevent module autounloading. */ modctl_t *pModCtl = mod_getctl(&g_VBoxUSBMonSolarisModLinkage); if (pModCtl) pModCtl->mod_loadflags |= MOD_NOAUTOUNLOAD; else LogRel((DEVICE_NAME ":failed to disable autounloading!\n")); /* * Initialize IPRT R0 driver, which internally calls OS-specific r0 init. */ rc = RTR0Init(0); if (RT_SUCCESS(rc)) { /* * Initialize global mutex. */ mutex_init(&g_VBoxUSBMonSolarisMtx, NULL, MUTEX_DRIVER, NULL); rc = VBoxUSBFilterInit(); if (RT_SUCCESS(rc)) { rc = ddi_soft_state_init(&g_pVBoxUSBMonSolarisState, sizeof(vboxusbmon_state_t), 1); if (!rc) { rc = mod_install(&g_VBoxUSBMonSolarisModLinkage); if (!rc) return rc; LogRel((DEVICE_NAME ":mod_install failed! rc=%d\n", rc)); ddi_soft_state_fini(&g_pVBoxUSBMonSolarisState); } else LogRel((DEVICE_NAME ":ddi_soft_state_init failed! rc=%d\n", rc)); } else LogRel((DEVICE_NAME ":VBoxUSBFilterInit failed! rc=%d\n", rc)); mutex_destroy(&g_VBoxUSBMonSolarisMtx); RTR0Term(); } else LogRel((DEVICE_NAME ":RTR0Init failed! rc=%d\n", rc)); return -1; }
int _init(void) { int err; err = mod_install(&pca9556_modlinkage); if (err == 0) { (void) ddi_soft_state_init(&pca9556_soft_statep, sizeof (pca9556_unit_t), PCA9556_MAX_SIZE); } return (err); }
/* * entry points * ------------ * */ int _init(void) { int error; if ((error = mod_install(&modlinkage)) == 0) { error = ddi_soft_state_init(&usbser_pl2303_statep, usbser_soft_state_size(), 1); } return (error); }
int _init(void) { int err; err = mod_install(&ics951601_modlinkage); if (err == 0) { (void) ddi_soft_state_init(&ics951601_soft_statep, sizeof (ics951601_unit_t), 1); } return (err); }
/** * Kernel entry points */ int _init(void) { LogFlow((DEVICE_NAME ":_init flow\n")); cmn_err(CE_NOTE, DEVICE_NAME ":_init\n"); vboxVideoSolarisConfigure(&g_VBoxVideoSolarisDRMDriver); int rc = ddi_soft_state_init(&g_pVBoxVideoSolarisState, sizeof(drm_device_t), DRM_MAX_INSTANCES); if (!rc) return mod_install(&g_VBoxVideoSolarisModLinkage); else LogRel((DEVICE_NAME ":_init: ddi_soft_state_init failed. rc=%d\n", rc)); }
int _init(void) { int error; error = mod_install(<c1427_modlinkage); if (!error) (void) ddi_soft_state_init(<c1427soft_statep, sizeof (struct ltc1427_unit), 1); return (error); }
int _init(void) { int error; error = mod_install(&pcf8574_modlinkage); if (!error) (void) ddi_soft_state_init(&pcf8574soft_statep, sizeof (struct pcf8574_unit), 1); return (error); }
/* * configuration entry points * -------------------------- */ int _init(void) { int error; if ((error = mod_install(&modlinkage)) == 0) { error = ddi_soft_state_init(&usbser_keyspan_statep, max(usbser_soft_state_size(), sizeof (keyspan_pre_state_t)), 1); } return (error); }
int _init(void) { int error; error = ddi_soft_state_init(&ii_statep, sizeof (struct ii_state), 1); if (!error) { error = mod_install(&ii_modlinkage); if (error) ddi_soft_state_fini(&ii_statep); } return (error); }
int _init(void) { int e; if (e = ddi_soft_state_init(&statep, sizeof (struct gpio_softc), 1)) { return (e); } if ((e = mod_install(&modlinkage)) != 0) { ddi_soft_state_fini(&statep); } return (e); }
int _init(void) { int error; if ((error = ddi_soft_state_init(&sbusmem_state_head, sizeof (struct sbusmem_unit), 1)) != 0) { return (error); } if ((error = mod_install(&modlinkage)) != 0) { ddi_soft_state_fini(&sbusmem_state_head); } return (error); }
int _init(void) { int retval; if ((retval = ddi_soft_state_init(&qotd_state_head, sizeof (struct qotd_state), 1)) != 0) { return retval; } if((retval = mod_install(&modlinkage)) != 0) { ddi_soft_state_fini(&qotd_state_head); return retval; } }
int _init(void) { int err; if ((err = ddi_soft_state_init(&pseudonex_state, sizeof (pseudonex_state_t), 0)) != 0) { return (err); } if ((err = mod_install(&modlinkage)) != 0) { ddi_soft_state_fini(&pseudonex_state); return (err); } return (0); }
/* * DDI entry points */ int _init(void) { int rc; if ((rc = ddi_soft_state_init(&pcn_ssp, sizeof (pcn_t), 1)) != 0) return (rc); mac_init_ops(&pcn_devops, "pcn"); if ((rc = mod_install(&pcn_modlinkage)) != DDI_SUCCESS) { mac_fini_ops(&pcn_devops); ddi_soft_state_fini(&pcn_ssp); } return (rc); }
/* * _init - Module's init routine. */ int _init(void) { int ret; if (ddi_soft_state_init(&dm2s_softstate, sizeof (dm2s_t), 1) != 0) { cmn_err(CE_WARN, "softstate initialization failed\n"); return (DDI_FAILURE); } if ((ret = mod_install(&modlinkage)) != 0) { cmn_err(CE_WARN, "mod_install failed, error = %d", ret); ddi_soft_state_fini(&dm2s_softstate); } return (ret); }
int _init(void) { int rval; if ((rval = ddi_soft_state_init(&tvhci_state, sizeof (struct tvhci_state), 2)) != 0) { return (rval); } if ((rval = mod_install(&modlinkage)) != 0) { ddi_soft_state_fini(&tvhci_state); } return (rval); }
int _init(void) { int err; if ((err = ddi_soft_state_init(&zc_soft_state, sizeof (zc_state_t), 0)) != 0) { return (err); } if ((err = mod_install(&modlinkage)) != 0) ddi_soft_state_fini(zc_soft_state); return (err); }
int _init(void) { int error; (void) ddi_soft_state_init(&statep, sizeof (smb_dev_t), 1); /* Can initialize some mutexes also. */ mutex_init(&dev_lck, NULL, MUTEX_DRIVER, NULL); /* * Create a major name and number. */ nsmb_major = ddi_name_to_major(NSMB_NAME); nsmb_minor = 0; /* Connection data structures. */ (void) smb_sm_init(); /* Initialize password Key chain DB. */ smb_pkey_init(); /* Time conversion stuff. */ smb_time_init(); /* Initialize crypto mechanisms. */ smb_crypto_mech_init(); zone_key_create(&nsmb_zone_key, NULL, nsmb_zone_shutdown, nsmb_zone_destroy); /* * Install the module. Do this after other init, * to prevent entrances before we're ready. */ if ((error = mod_install((&nsmb_modlinkage))) != 0) { /* Same as 2nd half of _fini */ (void) zone_key_delete(nsmb_zone_key); smb_pkey_fini(); smb_sm_done(); mutex_destroy(&dev_lck); ddi_soft_state_fini(&statep); return (error); } return (0); }
int _init(void) { int e; if ((e = ddi_soft_state_init(&kbad_state, sizeof (kbad_devstate_t), 1)) != 0) { return (e); } if ((e = mod_install(&modlinkage)) != 0) { ddi_soft_state_fini(&kbad_state); } return (e); }
int _init(void) { int e; if ((e = ddi_soft_state_init(&dstates, sizeof (struct dstate), 0)) != 0) { return (e); } if ((e = mod_install(&modlinkage)) != 0) { ddi_soft_state_fini(&dstates); } return (e); }