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

📄 pieeprom.h

📁 vt6528芯片交换机API函数和文档运行程序
💻 H
字号:
/*
 * 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:    pieeprom.h
 *
 * Purpose: UI controlled EEPROM accessing functions
 *
 * Author:  Tevin Chen
 *
 * Date:    Jan 08, 2002
 *
 */


#ifndef _PIEEPROM_H
#define _PIEEPROM_H

#include "ttype.h"
#if !defined(__NVRAM_H__)
#include "nvram.h"
#endif
#include "pitrunk.h"
#include "pivlan.h"
#include "pisniff.h"
#include "pimisc.h"
#include "piadmin.h"
#include "piport.h"
#include "piqos.h"
#include "pirate.h"
#if !defined(__SWMODL_H__)
#include "swmodl.h"
#endif
#ifdef __MODULE_WEB_SMART
#include "piipcfg.h"
#include "pifwupdt.h"
#endif

#include "pistp.h"
#include "piipm.h"
#include "piprvmis.h"
#include "pi8021x.h"
#include "pismac.h"
#include "pigmrp.h"

#include "piacl.h"
#include "pimacflt.h"



/*---------------------  Export Definitions -------------------------*/
//
// Definition of Non-Volatile RAM address (application data area)
//

// image parameter is starting at this address
#define NVR_ADDR_DATA_AREA_CHKSM    (NVR_ADDR_LD_END + 1)           // 2 bytes for data area checksum
#define NVR_ADDR_SIGNATURE          (NVR_ADDR_DATA_AREA_CHKSM + 2)  // 1 byte for signature
#define NVR_ADDR_CONTENT_VER        (NVR_ADDR_SIGNATURE + 1)        // 1 byte for content version
#define NVR_ADDR_RESERVED           (NVR_ADDR_CONTENT_VER + 1)      // 4 bytes reserved for nv-ram test

#define EEP_ADDR_PORT_CFG           (NVR_ADDR_RESERVED      + 4)
#define EEP_ADDR_TRUNK_CFG          (EEP_ADDR_PORT_CFG      + EEP_SIZE_PORT_CFG)
#define EEP_ADDR_VLAN_CFG           (EEP_ADDR_TRUNK_CFG     + EEP_SIZE_TRUNK_CFG)
#define EEP_ADDR_SNIFF_CFG          (EEP_ADDR_VLAN_CFG      + EEP_SIZE_VLAN_CFG)
#define EEP_ADDR_MISC_CFG           (EEP_ADDR_SNIFF_CFG     + EEP_SIZE_SNIFF_CFG)
#define EEP_ADDR_ADM_CFG            (EEP_ADDR_MISC_CFG      + EEP_SIZE_MISC_CFG)
#define EEP_ADDR_QOS_CFG            (EEP_ADDR_ADM_CFG       + EEP_SIZE_ADM_CFG)
#define EEP_ADDR_RATE_CFG           (EEP_ADDR_QOS_CFG       + EEP_SIZE_QOS_CFG)
#define EEP_ADDR_MOD_CARD_TYPE      (EEP_ADDR_RATE_CFG      + EEP_SIZE_RATE_CFG)

//Modified by Tim Feng
#define EEP_ADDR_ACL_CFG            (EEP_ADDR_MOD_CARD_TYPE + EEP_SIZE_MOD_CARD_TYPE) 
#define EEP_ADDR_MACFLT_CFG         (EEP_ADDR_ACL_CFG       + EEP_SIZE_ACL_CFG)
//#define EEP_ADDR_PROV_STP_CFG       (EEP_ADDR_ACL_CFG       + EEP_SIZE_ACL_CFG)
//End modified by Tim Feng
#define EEP_ADDR_PROV_STP_CFG       (EEP_ADDR_MACFLT_CFG       + EEP_SIZE_MACFLT_CFG)
#define EEP_ADDR_PROV_IGMP_CFG      (EEP_ADDR_PROV_STP_CFG  + EEP_SIZE_PROV_STP_CFG)
#define EEP_ADDR_PROV_SMAC_CFG      (EEP_ADDR_PROV_IGMP_CFG + EEP_SIZE_PROV_IGMP_CFG)
#define EEP_ADDR_PROV_8021X_CFG     (EEP_ADDR_PROV_SMAC_CFG + EEP_SIZE_PROV_SMAC_CFG)
#define EEP_ADDR_PROV_MISC_CFG      (EEP_ADDR_PROV_8021X_CFG+ EEP_SIZE_PROV_8021X_CFG)
#define EEP_ADDR_PROV_GMRP_CFG      (EEP_ADDR_PROV_MISC_CFG + EEP_SIZE_PROV_MISC_CFG)


#define NVR_ADDR_DATA_AREA_START    NVR_ADDR_SIGNATURE              // start address of nvram checksum area
#define NVR_ADDR_DATA_AREA_END      (EEP_ADDR_PROV_GMRP_CFG + EEP_SIZE_PROV_GMRP_CFG)

#define EEP_SIZE_DATA_AREA          (NVR_ADDR_DATA_AREA_END - NVR_ADDR_DATA_AREA_START + ((NVR_ADDR_DATA_AREA_END - NVR_ADDR_DATA_AREA_START) % 2))

// definition of flash size
#define NVR_SW_CACHE_SIZE           0x20000    // 128 kbytes

/*---------------------  Export Classes -----------------------------*/

/*---------------------  Export Variables  --------------------------*/
extern UINT8    g_abyNVRSwCache[];
extern PUINT8   g_pu8NVRSwCache;

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

/*---------------------  Export Functions  --------------------------*/
void NVRAM_vUpdateChecksum(UINT32 u32Size);
BOOL NVRAM_bVerifyChecksum(UINT32 u32Size);

void PIEEP_vGetCfgFromEep(UINT32 byAddr, UINT8 bySize, PUINT8 abyCfgBuf);
void PIEEP_vSetCfgIntoEep(PUINT8 abyCfgBuf, UINT32 byAddr, UINT8 bySize);

BOOL PIEEP_bCheckVerAndSig(void);
void PIEEP_vSetVerAndSig(BOOL bWriteDefault);




#endif /* __PIEEPROM_H__ */


⌨️ 快捷键说明

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