コード例 #1
0
ファイル: nas_ecos.c プロジェクト: NieHao/Tomato-RAF
/* nas task entry */
int nas_main(void)
{
#ifdef BCMDBG
	char debug[8];
#endif
	/* clear _nas_ready */
	_nas_ready = 0;

	/* fill up NAS task pid */
	_nas_pid = oslib_pid();

	/* clear rootnwksp */
	nas_nwksp = NULL;

	/* alloc nas/wpa work space */
	if (!(nas_nwksp = nas_wksp_alloc_workspace())) {
		NASMSG("Unable to allocate work space memory. Quitting...\n");
		return -1;
	}

#ifdef BCMDBG
	/* verbose - 0:no | others:yes */
	/* for workspace */
	if (nas_safe_get_conf(debug, sizeof(debug), "nas_dbg") == 0)
		debug_nwksp = (int)atoi(debug);
#endif

	/* run main loop to dispatch message */
	nas_wksp_main_loop(nas_nwksp);

	return 0;
}
コード例 #2
0
ファイル: eapd_ecos.c プロジェクト: gygy/asuswrt
int eapd_main(void)
{
#ifdef BCMDBG
	char *dbg;

	/* get eapd_msg_level from nvram */
	if ((dbg = nvram_safe_get("eapd_dbg"))) {
		eapd_msg_level = (uint)strtoul(dbg, NULL, 0);
	}
#endif /* BCMDBG */

	EAPD_INFO("EAP Dispatch Start...\n");

	/* fill up EAPD task pid */
	_eapd_pid = oslib_pid();

	/* alloc eapd work space */
	if (!(eapd_nwksp = eapd_wksp_alloc_workspace())) {
		EAPD_ERROR("Unable to allocate wksp memory. Quitting...\n");
		return -1;
	}

	if (eapd_wksp_auto_config(eapd_nwksp)) {
		EAPD_ERROR("Unable to auto config. Quitting...\n");
		eapd_wksp_cleanup(eapd_nwksp);
		return -1;
	}

	/* run main loop to dispatch messages */
	eapd_wksp_main_loop(eapd_nwksp);

	return 0;
}