Example #1
0
int
_topo_init(topo_mod_t *mod, topo_version_t version)
{
	dladm_handle_t handle;

	if (getenv("TOPONICDEBUG") != NULL)
		topo_mod_setdebug(mod);

	topo_mod_dprintf(mod, "_mod_init: "
	    "initializing %s enumerator\n", NIC);

	if (version != NIC_VERSION) {
		return (-1);
	}

	if (dladm_open(&handle) != 0)
		return (-1);

	if (topo_mod_register(mod, &nic_mod, TOPO_VERSION) != 0) {
		dladm_close(handle);
		return (-1);
	}

	topo_mod_setspecific(mod, handle);

	return (0);
}
Example #2
0
/*ARGSUSED*/
int
_topo_init(topo_mod_t *mod, topo_version_t version)
{
	if (getenv("TOPOFACMPTSASDEBUG") != NULL)
		topo_mod_setdebug(mod);

	return (topo_mod_register(mod, &mptsas_info, TOPO_VERSION));
}
Example #3
0
void
_topo_init(topo_mod_t *modhdl)
{
	/*
	 * Turn on module debugging output
	 */
	if (getenv("TOPOIOBDBG") != NULL)
		topo_mod_setdebug(modhdl, TOPO_DBG_ALL);
	topo_mod_dprintf(modhdl, "initializing ioboard enumerator\n");

	topo_mod_register(modhdl, &Iob_info, NULL);
	topo_mod_dprintf(modhdl, "Ioboard enumr initd\n");
}
Example #4
0
int
_topo_init(topo_mod_t *mod)
{
	if (getenv("TOPOCHIPDBG"))
		topo_mod_setdebug(mod);
	topo_mod_dprintf(mod, "initializing chip enumerator\n");

	if (topo_mod_register(mod, &chip_info, TOPO_VERSION) != 0) {
		whinge(mod, NULL, "failed to register hc: "
		    "%s\n", topo_mod_errmsg(mod));
		return (-1); /* mod errno set */
	}

	return (0);
}
Example #5
0
/*ARGSUSED*/
void
_topo_init(topo_mod_t *mod, topo_version_t version)
{
	/*
	 * Turn on module debugging output
	 */
	if (getenv("TOPOMBDBG") != NULL)
		topo_mod_setdebug(mod);
	topo_mod_dprintf(mod, "initializing motherboard enumerator\n");

	if (topo_mod_register(mod, &mb_info, TOPO_VERSION) < 0) {
		topo_mod_dprintf(mod, "motherboard registration failed: %s\n",
		    topo_mod_errmsg(mod));
		return; /* mod errno already set */
	}
	topo_mod_dprintf(mod, "MB enumr initd\n");
}
Example #6
0
int
sw_init(topo_mod_t *mod, topo_version_t version)
{
	if (getenv("TOPOSWDEBUG"))
		topo_mod_setdebug(mod);
	topo_mod_dprintf(mod, "initializing sw builtin\n");

	if (version != SW_VERSION)
		return (topo_mod_seterrno(mod, EMOD_VER_NEW));

	if (topo_mod_register(mod, &sw_info, TOPO_VERSION) != 0) {
		topo_mod_dprintf(mod, "failed to register sw_info: "
		    "%s\n", topo_mod_errmsg(mod));
		return (-1);
	}

	return (0);
}
Example #7
0
int
_topo_init(topo_mod_t *modhdl, topo_version_t version)
{
	/*
	 * Turn on module debugging output
	 */
	if (getenv("TOPOHBDBG") != NULL)
		topo_mod_setdebug(modhdl);
	topo_mod_dprintf(modhdl, "initializing hostbridge enumerator\n");

	if (version != HB_ENUMR_VERS)
		return (topo_mod_seterrno(modhdl, EMOD_VER_NEW));

	if (topo_mod_register(modhdl, &Hb_info, TOPO_VERSION) < 0) {
		topo_mod_dprintf(modhdl, "hostbridge registration failed: %s\n",
		    topo_mod_errmsg(modhdl));
		return (-1); /* mod errno already set */
	}

	topo_mod_dprintf(modhdl, "Hostbridge enumr initd\n");

	return (0);
}
Example #8
0
/*
 * Called by libtopo when the topo module is loaded.
 */
void
_topo_init(topo_mod_t *mod, topo_version_t version)
{
	int		result;
	char		isa[MAXNAMELEN];

	if (getenv("TOPOSUN4VPIDBG") != NULL) {
		/* Debugging is requested for this module */
		topo_mod_setdebug(mod);
	}
	topo_mod_dprintf(mod, "sun4vpi module initializing.\n");

	if (version != TOPO_VERSION) {
		(void) topo_mod_seterrno(mod, EMOD_VER_NEW);
		topo_mod_dprintf(mod, "incompatible topo version %d\n",
		    version);
		return;
	}

	/* Verify that this is a SUN4V architecture machine */
	(void) sysinfo(SI_MACHINE, isa, MAXNAMELEN);
	if (strncmp(isa, "sun4v", MAXNAMELEN) != 0) {
		topo_mod_dprintf(mod, "not sun4v architecture: %s\n", isa);
		return;
	}

	result = topo_mod_register(mod, &pi_modinfo, TOPO_VERSION);
	if (result < 0) {
		topo_mod_dprintf(mod, "registration failed: %s\n",
		    topo_mod_errmsg(mod));

		/* module errno already set */
		return;
	}
	topo_mod_dprintf(mod, "module ready.\n");
}