📄 swpci.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: swpci.h
*
* Purpose:
*
* Author: Henry Lin
*
* Date: Aug 10, 2005
*
*/
#ifndef __SWPCI_H__
#define __SWPCI_H__
#if !defined(__TTYPE_H__)
#include "ttype.h"
#endif
#if !defined(__PCIDRIVER_H__)
#include "pcidriver.h"
#endif
#if !defined(__SWSYS_H__)
#include "swsys.h"
#endif
#ifdef __SWITCH_CPUIF_PCI
/*--------------------- Export Definitions ------------------------*/
#define DEF_RX_PAGE_SIZE 256 // page size
#define DEF_TX_PAGE_SIZE 256 // page size
#define DEF_RX_PAGE_NUM 7 // page num, 256*40=10240Bytes(jumbo frame max length=9022)
#define DEF_TX_PAGE_NUM 7// page num, 256*40=10240Bytes(jumbo frame max length=9022)
/*--------------------- Export Types ------------------------------*/
struct tagSPacketPage {
UINT8 au8Buffer[DEF_RX_PAGE_SIZE];
};
typedef struct tagSPacketPage SPacketPage;
/*--------------------- Export Macros -----------------------------*/
#define SWPCICSR_vReadU8(u16Off, pu8Data) PCIIO_Read8((g_u32SwIoBA + u16Off), pu8Data)
#define SWPCICSR_vWriteU8(u16Off, u8Data) PCIIO_Write8((g_u32SwIoBA + u16Off), u8Data)
#define SWPCICSR_vReadU16(u16Off, pu16Data) PCIIO_Read16((g_u32SwIoBA + u16Off), pu16Data)
#define SWPCICSR_vWriteU16(u16Off, u16Data) PCIIO_Write16((g_u32SwIoBA + u16Off), u16Data)
#define SWPCICSR_vReadU32(u16Off, pu32Data) PCIIO_Read32((g_u32SwIoBA + u16Off), pu32Data)
#define SWPCICSR_vWriteU32(u16Off, u32Data) PCIIO_Write32((g_u32SwIoBA + u16Off), u32Data)
/*--------------------- Export Classes ----------------------------*/
/*--------------------- Export Variables --------------------------*/
extern UINT32 g_u32RdStrtPageAddr, g_u32RdStopPageAddr, g_u32RdPktCurr;
extern UINT32 g_u32TdStrtPageAddr, g_u32TdStopPageAddr, g_u32TdPktBnry;
/*--------------------- Export Functions --------------------------*/
void SWPCI_vMstrInit(void);
//void SWPCI_vBusErrHandler(void);
BOOL SWPCICSR_bWaitStatus (UINT16 u16Off, UINT8 u8StsBitPtn, BOOL bWaitCond);
#endif //__SWITCH_CPUIF_PCI
#endif /* __SWPCI_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -