📄 swsmactb.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: swsmactb.h
*
* Purpose: Secondary Mac table operation functions
*
* Author: Henry Lin
*
* Date: Dec 06, 2004
*
*/
#ifndef __SWSMACTB_H__
#define __SWSMACTB_H__
#if !defined(__TTYPE_H__)
#include "ttype.h"
#endif
/*--------------------- Export Definitions ------------------------*/
//
// Bit position for static SMAC(BCAM) unicast table fields
//
#define BCAM_BIT_FID_S 0
#define BCAM_BIT_FID_E 12
#define BCAM_BIT_ADDR_TYPE_S 15
#define BCAM_BIT_ADDR_TYPE_E 15
#define BCAM_BIT_MAC_ADDR_S 16
#define BCAM_BIT_MAC_ADDR_E 63
#define BCAM_BIT_VALID_S 64
#define BCAM_BIT_VALID_E 64
//
// Bit position for static SMAC unicast table fields
//
#define SMAC_BIT_SRC_ID_S 0
#define SMAC_BIT_SRC_ID_E 4
#define SMAC_BIT_TRK_TYPE_S 5
#define SMAC_BIT_TRK_TYPE_E 5
#define SMAC_BIT_SMAC_CPU_S 6
#define SMAC_BIT_SMAC_CPU_E 6
#define SMAC_BIT_SMAC_PRI_S 7
#define SMAC_BIT_SMAC_PRI_E 7
#define SMAC_BIT_SMAC_REDIR_S 8
#define SMAC_BIT_SMAC_REDIR_E 8
#define SMAC_BIT_SMAC_FLT_S 9
#define SMAC_BIT_SMAC_FLT_E 9
#define SMAC_BIT_CAST_TYPE_S 10
#define SMAC_BIT_CAST_TYPE_E 10
#define SMAC_BIT_STATIC_S 11
#define SMAC_BIT_STATIC_E 11
#define SMAC_BIT_DMAC_REDIR_S 13
#define SMAC_BIT_DMAC_REDIR_E 13
#define SMAC_BIT_DMAC_PRI_S 14
#define SMAC_BIT_DMAC_PRI_E 14
#define SMAC_BIT_SEC_DRP_S 15
#define SMAC_BIT_SEC_DRP_E 15
#define SMAC_BIT_BIND_ID_S 16
#define SMAC_BIT_BIND_ID_E 23
// Bit position for static SMAC multicast table fields
#define SMAC_BIT_MCST_INDEX_S 0
#define SMAC_BIT_MCST_INDEX_E 9
#define SMAC_BIT_AGE_COUNT_S 13
#define SMAC_BIT_AGE_COUNT_E 15
// Bit position for static SMAC multicast table fields
#define SMAC_BIT_MCST_ADDR_S 0
#define SMAC_BIT_MCST_ADDR_E 9
/*--------------------- Export Types ------------------------------*/
/*--------------------- Export Macros -----------------------------*/
#define BCAM_INDEX_TO_SA(indx) (SRAM_SECOND_MAC_INDX_BASE_ADDR + (indx<<SHIFT_NUM_SIZE_16Byte))
#define SMAC_INDEX_TO_SA(indx) (SRAM_SECOND_MAC_TBL_BASE_ADDR + (indx<<SHIFT_NUM_SIZE_8Byte))
/*--------------------- Export Classes ----------------------------*/
/*--------------------- Export Variables --------------------------*/
/*--------------------- Export Functions --------------------------*/
BOOL SWSMACTB_bReservePage(UINT8 byResvPg);
BOOL SWSMACTB_bIsEntryEmpty (UINT16 u16Indx, UINT8 bySlotId);
UINT16 SWSMACBCAM_wSearchEntry(PUINT8 abyMacAddr, UINT16 u16Fid);
UINT16 SWSMACBCAM_wSearchEntryInHw(PUINT8 abyMacAddr, UINT16 u16Fid);
BOOL SWSMACBCAM_bIsEntryEmpty (UINT16 u16Indx);
BOOL SWSMACTB_bGetEntry(UINT16 u16Indx, SMacEntry* pSEntry);
BOOL SWSMACTB_bInsEntry(SMacEntry* pSEntry, BOOL bIsOverWrite);
BOOL SWSMACTB_bDelEntry(PUINT8 abyMacAddr, UINT16 u16Fid);
void SWSMACTB_vDelEntryByIndx(UINT16 u16Indx);
//For analyzer use(Debug use)
BOOL ANLZSMACTB_bDelEntryByAddr(UINT32 u32BcamAddr);
BOOL SWSMACTB_bIsEntryUcst(UINT32 u32SmacAddr, UINT8 bySlotId);
#endif // __SWSMACTB_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -