📄 piport.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: piport.h
*
* Purpose: Port module UI callback functions
*
* Author: Tevin Chen
*
* Date: Jan 08, 2002
*
*/
#ifndef _PIPORT_H
#define _PIPORT_H
#include "ttype.h"
#include "switch.h"
///////////////////////////////////////////////////////////////////////////////////////////
#include "pipc_qos.h"
/*--------------------- Export Classes -----------------------------*/
// Shared struct with QoS module
#define SPerPortCfg SPort_QosCfg
#define SPortPageCfg SPort_QosPageCfg
////
// struct of port status
typedef struct tagSPortStatus { // Single port config
UINT8 f1Enable: 1; // port enable
UINT8 f2LinkUp: 2; // If port link state
UINT8 f3SpdDpx: 3; // Auto negotiation ability and Port speed & duplex config
UINT8 f2FlowCtrl: 2; // Flow control ability
} SPortStatus;
typedef struct tagSPortStatusPage { // Port system config
SPortStatus aSPortStatus[SWITCH_PORT_NUM];
} SPortStatusPage;
/*--------------------- Export Definitions -------------------------*/
/*--------------------- Export Macro --------------------------*/
// Get config from EEPROM and set into hardware (combine with QOS)
// boot init: eep -> hw
#define PIPORT_vSetHwFromEep(pSPageCfg_Port) PIPCQOS_byOp(pSPageCfg_Port, PORT_QOS_OP_EEP_TO_BUF, 0);PIPCQOS_byOp(pSPageCfg_Port, PORT_OP_BUF_TO_HW, 0);PIPCQOS_byOp(pSPageCfg_Port, QOS_OP_BUF_TO_HW, 0)
// Write default into EEPROM (combine with QOS) heavychen
//#define PIPORT_vSetEepDefault(pSPageCfg_Port) PIPCQOS_vSetEepDefault(pSPageCfg_Port)
// Get config from EEPROM and set into page buf
// load config: eep -> buf
#define PIPORT_vInitPage(pSPageCfg_Port) PIPCQOS_byOp(pSPageCfg_Port, PORT_QOS_OP_EEP_TO_BUF, 0)
// Write config to EEPROM and set to hardware
// save config: buf -> eep, hw
#define PIPORT_bySavePage(pSPageCfg_Port, pbyRtnPortId) PIPCQOS_byOp(pSPageCfg_Port, PORT_OP_BUF_TO_EEP_HW, pbyRtnPortId)
/*--------------------- Export Functions --------------------------*/
// Get port status
void PIPORT_vGetPortStatus(SPortStatusPage* pSPage_PortStatus) DIRECT_FUNTYPE_REENT;
// Definition for page status: the index of string array for N/A
#define LISTBOX_ONOFF_NA 2
#define LISTBOX_ENDIS_NA 2
#define LISTBOX_SPDDPX_NA PORT_SPDPX_NA
#define LISTBOX_LINK_NA 2
#endif /* __PIPORT_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -