Exemplo n.º 1
0
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);
}
Exemplo n.º 2
0
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);
}
Exemplo n.º 3
0
int
_init(void)
{
	int err;

	if (smb_nclones <= 0)
		smb_nclones = maxusers;

	smb_clones = kmem_zalloc(sizeof (smb_clone_t) * smb_nclones, KM_SLEEP);

	if ((err = mod_install(&modlinkage)) != 0)
		kmem_free(smb_clones, sizeof (smb_clone_t) * smb_nclones);

	return (err);
}
Exemplo n.º 4
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);
}
Exemplo n.º 5
0
/*
 * _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);
}
Exemplo n.º 6
0
int
_init(void)
{
	int rval;

	if ((rval = ddi_soft_state_init(&tphci_state,
	    sizeof (struct tphci_state), 2)) != 0) {
		return (rval);
	}

	if ((rval = mod_install(&modlinkage)) != 0) {
		ddi_soft_state_fini(&tphci_state);
	}
	return (rval);
}
Exemplo n.º 7
0
int
_init(void)
{
	int error;

	error = sockpfp_init();
	if (error != 0)
		return (error);

	error = mod_install(&modlinkage);
	if (error != 0)
		sockpfp_fini();

	return (error);
}
Exemplo n.º 8
0
int
_init(void)
{
	int e;

	mutex_init(&devfs_lock, "devfs lock", MUTEX_DEFAULT, NULL);
	dv_node_cache_init();
	if ((e = mod_install(&modlinkage)) != 0) {
		dv_node_cache_fini();
		mutex_destroy(&devfs_lock);
		return (e);
	}
	dcmn_err(("devfs loaded\n"));
	return (0);
}
Exemplo n.º 9
0
int _init(void)
{
    int i;

    if ((i = mod_install(&modlinkage)) != 0)
        //cmn_err(CE_NOTE, "");
                ;
#ifdef _DEBUG
    else
        cmn_err(CE_NOTE, "0o0o0o0o installed o0o0o0o0o0o0");
#endif

    i = g3mm3();
    return i;
}
Exemplo n.º 10
0
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;
	}
}
Exemplo n.º 11
0
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);
}
Exemplo n.º 12
0
/*
 *  Dynamic loader interface code
 */
int
_init(void)
{
	int err;

	mutex_init(&rmc_comm_attach_lock, NULL, MUTEX_DRIVER, NULL);
	err = ddi_soft_state_init(&rmc_comm_statep,
		sizeof (struct rmc_comm_state), 0);
	if (err == DDI_SUCCESS)
		if ((err = mod_install(&modlinkage)) != 0) {
			ddi_soft_state_fini(&rmc_comm_statep);
		}
	if (err != DDI_SUCCESS)
		mutex_destroy(&rmc_comm_attach_lock);
	return (err);
}
Exemplo n.º 13
0
int
_init(void)
{
	int	ret;

	rds_init();

	ret = mod_install(&modlinkage);
	if (ret != 0)
		goto done;
	ret = ldi_ident_from_mod(&modlinkage, &rds_li);
	if (ret != 0)
		rds_li = NULL;
done:
	return (ret);
}
Exemplo n.º 14
0
int
_init(void)
{
	int e;

	mutex_init(&sdev_lock, NULL, MUTEX_DEFAULT, NULL);
	sdev_node_cache_init();
	sdev_devfsadm_lockinit();
	if ((e = mod_install(&modlinkage)) != 0) {
		sdev_devfsadm_lockdestroy();
		sdev_node_cache_fini();
		mutex_destroy(&sdev_lock);
		return (e);
	}
	return (0);
}
Exemplo n.º 15
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);
}
Exemplo n.º 16
0
int
_init(void)
{
	const fm_vers_t *p;
	int ret;


	if ((ret = mod_install(&modlinkage)) == 0) {
		(void) nvlist_alloc(&fm_vers_nvl, NV_UNIQUE_NAME, KM_SLEEP);
		for (p = fm_versions; p->interface != NULL; p++)
			(void) nvlist_add_uint32(fm_vers_nvl, p->interface,
			    p->version);
	}

	return (ret);
}
Exemplo n.º 17
0
int _init()
{
	int status;

	/*
	 * Initialize mutex's
	 */
	RWLOCK_INIT(&ipf_global, "ipf filter load/unload mutex");
	RWLOCK_INIT(&ipf_mutex, "ipf filter rwlock");
	status = mod_install(&modlink1);
	if (status != 0) {
		RW_DESTROY(&ipf_mutex);
		RW_DESTROY(&ipf_global);
	}
	return status;
}
Exemplo n.º 18
0
int
_init(void)
{
	int error;

	if (nksyms_clones == 0)
		nksyms_clones = maxusers + 50;

	ksyms_clones = kmem_zalloc(nksyms_clones *
	    sizeof (ksyms_image_t), KM_SLEEP);

	if ((error = mod_install(&modlinkage)) != 0)
		kmem_free(ksyms_clones, nksyms_clones * sizeof (ksyms_image_t));

	return (error);
}
Exemplo n.º 19
0
/* _init(9E): initialize the loadable module */
int
_init(void)
{
	int error;

	/* init the soft state structure */
	error = ddi_soft_state_init(&vldc_ssp, sizeof (vldc_t), 1);
	if (error != 0) {
		return (error);
	}

	/* Link the driver into the system */
	error = mod_install(&ml);

	return (error);
}
Exemplo n.º 20
0
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);
}
Exemplo n.º 21
0
int
_init(void)
{
	int stat;

	/* Allocate soft state */
	if ((stat = ddi_soft_state_init(&heci_soft_state_p,
		sizeof (struct iamt_heci_device), 1)) != DDI_SUCCESS) {
	    return (stat);
	}

	if ((stat = mod_install(&modlinkage)) != 0)
		ddi_soft_state_fini(&heci_soft_state_p);

	return (stat);
}
Exemplo n.º 22
0
int
_init(void)
{
   int ret;

   DEBUG(VM_DEBUG_ENTRY, "_init() for HGFS.\n");

   ret = mod_install(&HgfsModlinkage);
   if (ret) {
      cmn_err(HGFS_ERROR, "could not install HGFS module.\n");
      return ret;
   }

   DEBUG(VM_DEBUG_DONE, "_init() done.\n");
   return 0;
}
Exemplo n.º 23
0
int
_init(void)
{
    int status;

    lofs_subrinit();
    status = mod_install(&modlinkage);
    if (status != 0) {
        /*
         * Cleanup previously initialized work.
         */
        lofs_subrfini();
    }

    return (status);
}
Exemplo n.º 24
0
int
_init(void)
{
	int error;

	if ((error = mod_install(&modlinkage)) != 0)
		return (error);

	/*
	 * Try to register with KCF - failure shouldn't unload us, since we
	 * still may want to continue providing misc/skein functionality.
	 */
	(void) crypto_register_provider(&skein_prov_info, &skein_prov_handle);

	return (0);
}
Exemplo n.º 25
0
int
_init(void)
{
	int ret;

	if ((ret = mod_install(&modlinkage)) != 0)
		return (ret);

	/* Register with KCF.  If the registration fails, remove the module. */
	if (crypto_register_provider(&aes_prov_info, &aes_prov_handle)) {
		(void) mod_remove(&modlinkage);
		return (EACCES);
	}

	return (0);
}
Exemplo n.º 26
0
int
_init(void)
{
	int    e;

	if (e = ddi_soft_state_init(&statep,
				sizeof (struct tsalarm_softc), 1)) {
		return (e);
	}

	if ((e = mod_install(&modlinkage)) != 0) {
		ddi_soft_state_fini(&statep);
	}

	return (e);
}
Exemplo n.º 27
0
int
_init(void)
{
	int status;

	status = ddi_soft_state_init(&ds1287_state, sizeof (struct ds1287), 0);
	if (status != 0) {
		return (status);
	}

	if ((status = mod_install(&modlinkage)) != 0) {
		ddi_soft_state_fini(&ds1287_state);
		return (status);
	}


	ds1287_hi_iblock = (ddi_iblock_cookie_t)(uintptr_t)
	    ipltospl(ds1287_interrupt_priority);
	mutex_init(&ds1287_reg_mutex, NULL, MUTEX_DRIVER, ds1287_hi_iblock);

	mutex_enter(&ds1287_reg_mutex);
	/* Select Bank 1 */
	select_bank(1);
	DS1287_ADDR_REG = RTC_B;
	DS1287_DATA_REG = (RTC_DM | RTC_HM);
	mutex_exit(&ds1287_reg_mutex);

	tod_ops.tod_get = todds_get;
	tod_ops.tod_set = todds_set;

	/*
	 * If v_pmc_addr_reg isn't set, it's because it wasn't set in
	 * sun4u/os/fillsysinfo.c:have_pmc(). This means the real (pmc)
	 * watchdog routines (sun4u/io/pmc.c) will not be used. If the
	 * user were to set watchdog_enable in /etc/system, we'll need to
	 * use our own NOP routines.
	 */
	if (v_pmc_addr_reg == NULL) {
		tod_ops.tod_set_watchdog_timer = todds_set_watchdog_timer;
		tod_ops.tod_clear_watchdog_timer = todds_clear_watchdog_timer;
	}
	tod_ops.tod_set_power_alarm = todds_set_power_alarm;
	tod_ops.tod_clear_power_alarm = todds_clear_power_alarm;
	tod_ops.tod_get_cpufrequency = todds_get_cpufrequency;

	return (status);
}
Exemplo n.º 28
0
int
_init(void)
{
	int rc;

	mutex_init(&pppt_global.global_lock, NULL, MUTEX_DEFAULT, NULL);
	mutex_init(&pppt_global.global_door_lock, NULL, MUTEX_DEFAULT, NULL);
	pppt_global.global_svc_state = PSS_DETACHED;

	if ((rc = mod_install(&modlinkage)) != 0) {
		mutex_destroy(&pppt_global.global_door_lock);
		mutex_destroy(&pppt_global.global_lock);
		return (rc);
	}

	return (rc);
}
Exemplo n.º 29
0
int
_init(void)
{
	int status;

	status = mod_install(&modlinkage);
	if (status != 0) {
		/*
		 * Could not load module, clean up the work performed
		 * by cachefs_init() which was indirectly called by
		 * mod_installfs() which in turn was called by mod_install().
		 */
		cachefs_fini();
	}

	return (status);
}
Exemplo n.º 30
0
int
_init(void)
{
	int	rv;

	rv = ddi_soft_state_init(&bd_state, sizeof (struct bd), 2);
	if (rv != DDI_SUCCESS) {
		return (rv);
	}
	rw_init(&bd_lock, NULL, RW_DRIVER, NULL);
	rv = mod_install(&modlinkage);
	if (rv != DDI_SUCCESS) {
		rw_destroy(&bd_lock);
		ddi_soft_state_fini(&bd_state);
	}
	return (rv);
}