📄 piprvmis.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: piprvmis.c
*
* Purpose: Protocol misc module UI callback functions
*
* Author: Freeya Lin
*
* Date: Dec 12, 2003
*
* Functions:
*
* Revision History:
*
*/
#include "str.h"
#include "swmsg.h"
#include "pigencfg.h"
#include "piprvmis.h"
#include "swproto.h"
#include "piportmp.h"
#include "pidef.h"
/*--------------------- Static Definitions -------------------------*/
/*--------------------- Static Classes ----------------------------*/
/*--------------------- Static Variables --------------------------*/
/*--------------------- Static Functions --------------------------*/
static UINT8 s_bySetCfgToHW(SProvMiscPageCfg* pSPageCfg_ProvMisc);
/*--------------------- Export Variables --------------------------*/
/*--------------------- Export Macros -----------------------------*/
/*--------------------- Export Functions --------------------------*/
void PIPROVMISC_vInitPage(SProvMiscPageCfg* pSPageCfg_ProvMisc)
{
STR_pvMemset(pSPageCfg_ProvMisc, 0, sizeof(SProvMiscPageCfg));
PIEEP_vGetCfgFromEep(EEP_ADDR_PROV_MISC_CFG , EEP_SIZE_PROV_MISC_CFG, (PUINT8)pSPageCfg_ProvMisc);
}
void PIPROVMISC_vSetEepDefault(SProvMiscPageCfg* pSPageCfg_ProvMisc, BOOL bWriteDefault)
{
STR_pvMemset(pSPageCfg_ProvMisc, 0, sizeof(SProvMiscPageCfg));
pSPageCfg_ProvMisc->byLacpMode = DEFAULT_LACP_MODE;
pSPageCfg_ProvMisc->byGVRPMode = DEFAULT_GVRP_MODE;
if (bWriteDefault) {
// Set value to nvram software cache
STR_pvMemcpy(g_pu8NVRSwCache + (EEP_ADDR_PROV_MISC_CFG - NVR_ADDR_DATA_AREA_START), (PUINT8)pSPageCfg_ProvMisc, EEP_SIZE_PROV_MISC_CFG);
}
else {
PIEEP_vSetCfgIntoEep((PUINT8)pSPageCfg_ProvMisc, EEP_ADDR_PROV_MISC_CFG, EEP_SIZE_PROV_MISC_CFG);
NVRAM_vUpdateChecksum(EEP_SIZE_DATA_AREA);
}
}
void PIPROVMISC_vSetHwFromEep(SProvMiscPageCfg* pSPageCfg_ProvMisc)
{
PIEEP_vGetCfgFromEep(EEP_ADDR_PROV_MISC_CFG, EEP_SIZE_PROV_MISC_CFG, (PUINT8)pSPageCfg_ProvMisc);
s_bySetCfgToHW(pSPageCfg_ProvMisc);
}
UINT8 PIPROVMISC_bySavePage(SProvMiscPageCfg* pSPageCfg_ProvMisc)
{
UINT8 byRes;
// Set config into HW
byRes = s_bySetCfgToHW(pSPageCfg_ProvMisc);
if (byRes != OP_OK)
return byRes;
// Set config into EEPROM and return
PIEEP_vSetCfgIntoEep((PUINT8)pSPageCfg_ProvMisc, EEP_ADDR_PROV_MISC_CFG, EEP_SIZE_PROV_MISC_CFG);
NVRAM_vUpdateChecksum(EEP_SIZE_DATA_AREA);
return byRes;
}
static UINT8 s_bySetCfgToHW(SProvMiscPageCfg* pSPageCfg_ProvMisc)
{
SWPROTO_bLacpSetEn(pSPageCfg_ProvMisc->byLacpMode);
SWPROTO_bGvrpSetEn(pSPageCfg_ProvMisc->byGVRPMode);
return OP_OK;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -