📄 swport.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: swport.h
*
* Purpose: Port configuration and status hardware accessing functions
*
* Author: Tevin Chen
*
* Date: Jan 08, 2002
*
*/
#ifndef __SWPORT_H__
#define __SWPORT_H__
#if !defined(__TTYPE_H__)
#include "ttype.h"
#endif
#if !defined(__SWREG_H__)
#include "swreg.h"
#endif
#if !defined(__SWMII_H__)
#include "swmii.h"
#endif
/*--------------------- Export Definitions ------------------------*/
/*--------------------- Export Types ------------------------------*/
enum {
PORT_SPDPX_AUTO,
PORT_SPDPX_100M_FULL,
PORT_SPDPX_100M_HALF,
PORT_SPDPX_10M_FULL,
PORT_SPDPX_10M_HALF,
#ifndef __ASIC_VT6524
PORT_SPDPX_1000M_FULL,
PORT_SPDPX_1000M_HALF,
#endif
PORT_SPDPX_NA
};
/*--------------------- Export Macros -----------------------------*/
#define SWPORT_bGetLinkSts(byPortId) SWREG_vIsSpecBitOn(PHY_LINK_STATUS, byPortId)
#define SWPORT_bGetFlowCtrlEn(byPortId) SWREG_bIfBitsOff((UINT16)(PHY_PORT_ABL_BASE + byPortId), 0x18)
#ifndef __ASIC_VT6526
#define SWPORT_bGetPortEn(byPortId) SWMII_bIsRegBitsOff(byPortId, MII_REG_BMCR, BMCR_PD)
#endif
/*--------------------- Export Classes ----------------------------*/
/*--------------------- Export Variables --------------------------*/
/*--------------------- Export Functions --------------------------*/
#ifdef __ASIC_VT6526
BOOL SWPORT_bGetPortEn(BYTE byPortId) DIRECT_FUNTYPE_REENT;
BOOL SWPORT_bIfTbiPort(UINT8 byPortId) DIRECT_FUNTYPE_REENT;
#endif
void SWPORT_vSetPortEn(UINT8 byPortId, BOOL bPortEn) DIRECT_FUNTYPE_REENT;
UINT8 SWPORT_byGetSpdDpx(UINT8 byPortId) DIRECT_FUNTYPE_REENT;
BYTE SWPORT_bySetSpdDpx(UINT8 byPortId, BOOL bAuto, UINT8 bySpdDpx) DIRECT_FUNTYPE_REENT;
void SWPORT_vSetFlowCtrlEn(UINT8 byPortId, BOOL bFC) DIRECT_FUNTYPE_REENT;
#endif /* __SWPORT_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -