⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pimisc.c

📁 VIA VT6524 8口网管交换机源码
💻 C
字号:
/*
 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
 * All rights reserved.
 *
 * This software is copyrighted by and is the sole property of
 * VIA Networking Technologies, Inc. This software may only be used
 * in accordance with the corresponding license agreement. Any unauthorized
 * use, duplication, transmission, distribution, or disclosure of this
 * software is expressly forbidden.
 *
 * This software is provided by VIA Networking Technologies, Inc. "as is"
 * and any express or implied warranties, including, but not limited to, the
 * implied warranties of merchantability and fitness for a particular purpose
 * are disclaimed. In no event shall VIA Networking Technologies, Inc.
 * be liable for any direct, indirect, incidental, special, exemplary, or
 * consequential damages.
 *
 *
 * File:    pimisc.c
 *
 * Purpose: Misc module UI callback functions
 *
 * Author:  Tevin Chen
 *
 * Date:    Jan 08, 2002
 *
 * Functions:
 *
 * Revision History:
 *
 */


#if !defined(__PLATFORM_H__)
#include "platform.h"
#endif
#include "swfwd.h"
#include "swmisc.h"
#include "pigencfg.h"
#include "pimisc.h"
#include "pidef.h"




/*---------------------  Static Definitions -------------------------*/

/*---------------------  Static Classes  ----------------------------*/

/*---------------------  Static Variables  --------------------------*/

/*---------------------  Static Functions  --------------------------*/

/*---------------------  Export Variables  --------------------------*/
static DIRECT_MEMTYPE_CODE BYTE s_abyAutoLogoutTime[] = {
    0, 5, 10, 20
};

/*---------------------  Export Macros  -----------------------------*/

/*---------------------  Export Functions  --------------------------*/

void s_vSetCfgToHW(SMiscPageCfg* pSPageCfg_Misc) DIRECT_FUNTYPE_REENT
{
    SWFWD_vSetBsfCfg(pSPageCfg_Misc->f2BSFMode);
    SWFWD_vSetAutoAgingCfg(pSPageCfg_Misc->f2AutoAging);
    SWFWD_vSetMacTblHashMode(pSPageCfg_Misc->f1MacHashMode);
    SWMISC_vSetCollRetryEn(pSPageCfg_Misc->f1CollisionForever);

    g_wAutoLogoutTime = s_abyAutoLogoutTime[pSPageCfg_Misc->f2AutoLogout] * TICK_PER_MIN;
    // reset g_wAutoLogoutCntr and g_wWebAutoLogoutCntr to avoid immediate logout
    g_wAutoLogoutCntr = 0;

#ifdef __MODULE_WEB_SMART
    g_wWebAutoLogoutTime = s_abyAutoLogoutTime[pSPageCfg_Misc->f2WebAutoLogout + 1] * TICK_PER_MIN;
	g_wWebAutoLogoutCntr = 0;
#endif
}

void PIMISC_vSetEepDefault(SMiscPageCfg* pSPageCfg_Misc) DIRECT_FUNTYPE_REENT
{
    pSPageCfg_Misc->f1CollisionForever = DEFAULT_RETRY_FOREVER;
    pSPageCfg_Misc->f2AutoAging = DEFAULT_AUTO_AGING;
    pSPageCfg_Misc->f2BSFMode = DEFAULT_BSF_MODE;
    pSPageCfg_Misc->f2AutoLogout = DEFAULT_AUTO_LOGOUT;
#ifdef __MODULE_WEB_SMART
    pSPageCfg_Misc->f2WebAutoLogout = DEFAULT_WEB_AUTO_LOGOUT;
#endif
    PIEEP_vSetCfgIntoEep((PBYTE)pSPageCfg_Misc, EEP_ADDR_MISC_CFG, EEP_SIZE_MISC_CFG);
    PIEEP_vUpdateChecksum();
}

void PIMISC_vSetHwFromEep(SMiscPageCfg* pSPageCfg_Misc) DIRECT_FUNTYPE_REENT
{
    PIMISC_vInitPage(pSPageCfg_Misc);
    s_vSetCfgToHW(pSPageCfg_Misc);
}

void PIMISC_vSavePage(SMiscPageCfg* pSPageCfg_Misc) DIRECT_FUNTYPE_REENT
{
    PIEEP_vSetCfgIntoEep((PBYTE)pSPageCfg_Misc, EEP_ADDR_MISC_CFG, EEP_SIZE_MISC_CFG);
    PIEEP_vUpdateChecksum();
    s_vSetCfgToHW(pSPageCfg_Misc);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -