📄 swqos.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: swqos.c
*
* Purpose: QoS hardware accessing functions
*
* Author: Tevin Chen
*
* Date: Jan 08, 2002
*
* Functions:
*
* Revision History:
*
*/
#if !defined(__SWITCH_H__)
#include "switch.h"
#endif
#if !defined(__SWREG_H__)
#include "swreg.h"
#endif
/*--------------------- Static Definitions ------------------------*/
// for Qos
#define PTN_QOS_FCFS 0x00
#define PTN_QOS_SP 0x01
#define PTN_QOS_WRR_3 0x66 //B011 001 10
#define PTN_QOS_WRR_5 0xA6 //B101 001 10
#define PTN_QOS_WRR_7 0xE6 //B111 001 10
// lookup table for g_aszQosMode
static DIRECT_MEMTYPE_CODE BYTE s_abyQosModePtn[] = {
PTN_QOS_FCFS,
PTN_QOS_SP,
PTN_QOS_WRR_3,
PTN_QOS_WRR_5,
PTN_QOS_WRR_7
};
// static port priority
#define PTN_PORT_PRIORI_DISABLE 0x00
#define PTN_PORT_PRIORI_LOW 0x01
#define PTN_PORT_PRIORI_HIGH 0x03
// lookup table for g_aszStaticPortPriorCfg
static DIRECT_MEMTYPE_CODE BYTE s_abyStaticPortPriorPtn[] = {
PTN_PORT_PRIORI_DISABLE,
PTN_PORT_PRIORI_LOW,
PTN_PORT_PRIORI_HIGH
};
/*--------------------- Static Types ------------------------------*/
/*--------------------- Static Macros -----------------------------*/
/*--------------------- Static Classes ----------------------------*/
/*--------------------- Static Variables --------------------------*/
/*--------------------- Static Functions --------------------------*/
/*--------------------- Export Variables --------------------------*/
void SWQOS_vSetQosCfg(BYTE byOpt) DIRECT_FUNTYPE_REENT
{
SWREG_vWriteB(QUE_SCHE_SEL, s_abyQosModePtn[byOpt]);
}
void SWQOS_vSetStaticPrior (UINT8 byPortId, UINT8 byCfg) DIRECT_FUNTYPE_REENT
{
SWREG_vWriteB((UINT16)(MACIO_IN_PRIOR_OVERWRITE + byPortId * MACIO_PORT_OFFSET), s_abyStaticPortPriorPtn[byCfg]);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -