📄 pirate.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: pirate.h
*
* Purpose:
*
* Author: Jenda Jao
*
* Date: 0213, 2003
*
*/
#ifndef _PIRATE_H
#define _PIRATE_H
#include "ttype.h"
/*--------------------- Export Classes -----------------------------*/
typedef struct tagSRatePageCfg {
BYTE abyRate[SWITCH_MEGA_PORT_NUM*2]; // P0I, P0O, P1I, P1O, ...
} SRatePageCfg;
/*--------------------- Export Definitions -------------------------*/
#define EEP_SIZE_RATE_CFG (sizeof(SRatePageCfg))
#define EEP_SIZE_RATE_PORT_OFFSET 2
// operator for PIRATE_vOp()
enum {
RATE_OP_EEP_TO_BUF,
RATE_OP_BUF_TO_EEP_HW,
RATE_OP_BUF_TO_HW
};
/*--------------------- Export Macro --------------------------*/
// Get config from EEPROM and set into hardware
// boot init: eep -> hw
#define PIRATE_vSetHwFromEep(pSPageCfg_Rate) {PIRATE_vOp(pSPageCfg_Rate, RATE_OP_EEP_TO_BUF);PIRATE_vOp(pSPageCfg_Rate, RATE_OP_BUF_TO_HW);}
// Get config from EEPROM and set into page buf
// load config: eep -> buf
#define PIRATE_vInitPage(pSPageCfg_Rate) PIRATE_vOp(pSPageCfg_Rate, RATE_OP_EEP_TO_BUF)
// Write config to EEPROM and set to hardware
// save config: buf -> eep, hw
#define PIRATE_vSavePage(pSPageCfg_Rate) PIRATE_vOp(pSPageCfg_Rate, RATE_OP_BUF_TO_EEP_HW)
/*--------------------- Export Functions --------------------------*/
// Operate within buf, eep, and hw
// shared with piportcl and piqos and used for macros only
void PIRATE_vOp(SRatePageCfg* pSPageCfg_Rate, BYTE byOp) DIRECT_FUNTYPE_REENT;
// Set EEPROM into default value
void PIRATE_vSetEepDefault(SRatePageCfg* pSPageCfg_Rate) DIRECT_FUNTYPE_REENT;
#endif /* __PIRATE_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -