⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 s3c2510eth.h

📁 S3c2510下的VXWORKS的BSP源代码(包括了以太网、串口、USB等等驱动)
💻 H
📖 第 1 页 / 共 2 页
字号:
#define S3C2510_ETH_TBD_MUNDERFLOW      0x0008              /* MAC Tx FIFO Underflow */
#define S3C2510_ETH_TBD_MEXCOLL         0x0004              /* MAC Tx Excessive Collion is Occured */

#define S3C2510_ETH_TBD_WA_MASK         0x0003              /* Widget Alignment of the Current Frame */
#define     S3C2510_ETH_TBD_WA_0            0x0000          /* No Invalid Bytes */
#define     S3C2510_ETH_TBD_WA_1            0x0001          /* 1 Invalid Byte */
#define     S3C2510_ETH_TBD_WA_2            0x0002          /* 2 Invalid Bytes */
#define     S3C2510_ETH_TBD_WA_3            0x0003          /* 3 Invalid Bytes */
#define     S3C2510_ETH_TBD_WA_SHIFT        0


/* S3C2510 Ethernet Driver Control Structure */

typedef struct eth_drv_ctrl {
    END_OBJ         endObj;                                 /* base class */
    int             unit;                                   /* unit number */
    PHY_INFO        phyInfo;                                /* info on a MII-compliant PHY */
    FUNCPTR         receiveRtn;                             /* routine to call on reception */

    /* Driver Specific Fields */
    int             intLvlRx;                               /* Rx interrupt vevel */
    int             intLvlTx;                               /* Tx interrupt vevel */
    VOIDFUNCPTR    *intVecRx;                               /* Rx interrupt vector */
    VOIDFUNCPTR    *intVecTx;                               /* Tx interrupt vector */
    CL_POOL_ID      pClPool;                                /* pointer to the cluster pool */
    void           *pMblkArea;                              /* pointer to the mBlk/clBlk pool */
    void           *pClArea;                                /* pointer to the cluster pool */
    void           *pBdArea;                                /* pointer to the buffer descriptor pool */
    int             clSize;                                 /* cluster pool size */
    UINT32          rbdBase;                                /* RBD ring */
    UINT32          rbdIndex;                               /* RBD index */
    UINT32          tbdBase;                                /* TBD ring */
    UINT32          tbdIndex;                               /* TBD index */
    UINT32          tbdFree;                                /* free TBD index */
    BOOL            bPolling;                               /* TRUE if polling */
    BOOL            bTxBlocked;                             /* TRUE if tx is blocked */
    BOOL            bRxHandler;                             /* TRUE if rx handler is busy */
    BOOL            bTxHandler;                             /* TRUE if tx handler is busy */
    UINT16          l80225Status;                           /* L80225 Status Output Register */

    /* Statistics */
    UINT            bmRxStatBfull;
    UINT            bmRxStatBno;

    UINT            bRxMso;
    UINT            mRxHalted;
    UINT            mRxParErr;
    UINT            mRxLongErr;
    UINT            mRxOverflow;
    UINT            mRxCrcErr;
    UINT            mRxAlignErr;

    UINT            bmTxStatBempty;
    UINT            bmTxStatBno;

    UINT            mTxPaused;
    UINT            mTxHalted;
    UINT            mTxSqeErr;
    UINT            mTxParErr;
    UINT            mTxLateColl;
    UINT            mTxNocarr;
    UINT            mTxDeferErr;
    UINT            mTxUnderflow;
    UINT            mTxExColl;

    UINT            mTxDefer;
    UINT            mTxColl;

    /* Diagnostic Function Specific Fields */
    UINT            okRx;
    UINT            okTx;
    UINT            errRx;
    UINT            errTx;
    UINT            ok1Rx;
    UINT            ok1Tx;
    UINT            err1Rx;
    UINT            err1Tx;
    UINT            ok2Rx;
    UINT            ok2Tx;
    UINT            err2Rx;
    UINT            err2Tx;
    UINT            ok3Rx;
    UINT            ok3Tx;
    UINT            err3Rx;
    UINT            err3Tx;
} ETH_DRV_CTRL;

/* Short-cut Macros */

#define IFADDR                          endObj.mib2Tbl.ifPhysAddress
#define MIB2TBL                         endObj.mib2Tbl
#define PHYREGS                         phyInfo.miiRegs


/* Function Prototypes */

#if defined(__STDC__) || defined(__cplusplus)

IMPORT STATUS   s3c2510EthInit(ETH_DRV_CTRL* pDrvCtrl);
IMPORT STATUS   s3c2510EthAddrSet(ETH_DRV_CTRL *pDrvCtrl);
IMPORT STATUS   s3c2510EthFlagsSet(ETH_DRV_CTRL *pDrvCtrl);
IMPORT void     s3c2510EthLoopSet(ETH_DRV_CTRL *pDrvCtrl, int mode);
IMPORT STATUS   s3c2510EthMCastAdd(ETH_DRV_CTRL *pDrvCtrl, UCHAR *pAddr);
IMPORT STATUS   s3c2510EthMCastDel(ETH_DRV_CTRL *pDrvCtrl, UCHAR *pAddr);

IMPORT STATUS   s3c2510EthStart(ETH_DRV_CTRL *pDrvCtrl);
IMPORT STATUS   s3c2510EthStop(ETH_DRV_CTRL *pDrvCtrl);
IMPORT STATUS   s3c2510EthPollStart(ETH_DRV_CTRL *pDrvCtrl);
IMPORT STATUS   s3c2510EthPollStop(ETH_DRV_CTRL *pDrvCtrl);

IMPORT PETHRBD  s3c2510EthRbdGet(ETH_DRV_CTRL *pDrvCtrl);
IMPORT void     s3c2510EthRbdFree(ETH_DRV_CTRL *pDrvCtrl, PETHRBD pRbd);
IMPORT ULONG    s3c2510EthRbdCheck(ETH_DRV_CTRL *pDrvCtrl, PETHRBD pRbd);

IMPORT PETHTBD  s3c2510EthTbdGet(ETH_DRV_CTRL *pDrvCtrl);
IMPORT void     s3c2510EthTbdFree(ETH_DRV_CTRL *pDrvCtrl, PETHTBD pTbd);
IMPORT void     s3c2510EthTbdStart(ETH_DRV_CTRL *pDrvCtrl, PETHTBD pTbd, ULONG length);
IMPORT STATUS   s3c2510EthTbdCheck(ETH_DRV_CTRL *pDrvCtrl, PETHTBD pTbd);

IMPORT STATUS   s3c2510EthPollReceive(ETH_DRV_CTRL *pDrvCtrl, M_BLK_ID pMblk);
IMPORT STATUS   s3c2510EthPollSend(ETH_DRV_CTRL *pDrvCtrl, M_BLK_ID pMblk);

IMPORT STATUS   s3c2510EthSend(ETH_DRV_CTRL *pDrvCtrl, M_BLK_ID pMblk);

IMPORT void     s3c2510EthRbdProcess(ETH_DRV_CTRL *pDrvCtrl, PETHRBD pRbd);
IMPORT void     s3c2510EthTbdProcess(ETH_DRV_CTRL *pDrvCtrl, PETHTBD pTbd);

IMPORT STATUS   s3c2510EthShow(int unit);
IMPORT STATUS   s3c2510EthMiiShow(int unit);

#else  /* defined(__STDC__) || defined(__cplusplus) */

IMPORT STATUS   s3c2510EthInit();
IMPORT STATUS   s3c2510EthAddrSet();
IMPORT STATUS   s3c2510EthFlagsSet();
IMPORT void     s3c2510EthLoopSet();
IMPORT STATUS   s3c2510EthMCastAdd();
IMPORT STATUS   s3c2510EthMCastDel();

IMPORT STATUS   s3c2510EthStart();
IMPORT STATUS   s3c2510EthStop();
IMPORT STATUS   s3c2510EthPollStart();
IMPORT STATUS   s3c2510EthPollStop();

IMPORT PETHRBD  s3c2510EthRbdGet();
IMPORT void     s3c2510EthRbdFree();
IMPORT STATUS   s3c2510EthRbdCheck();

IMPORT PETHTBD  s3c2510EthTbdGet();
IMPORT void     s3c2510EthTbdFree();
IMPORT void     s3c2510EthTbdStart();
IMPORT STATUS   s3c2510EthTbdCheck();

IMPORT STATUS   s3c2510EthPollReceive();
IMPORT STATUS   s3c2510EthPollSend();

IMPORT STATUS   s3c2510EthSend();

IMPORT void     s3c2510EthRbdProcess();
IMPORT void     s3c2510EthTbdProcess();

IMPORT STATUS   s3c2510EthShow();
IMPORT STATUS   s3c2510EthMiiShow();

#endif  /* defined(__STDC__) || defined(__cplusplus) */


#ifdef __cplusplus
}
#endif

#endif  /* __INCs3c2510Ethh */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -