?? motfccend.h
字號:
/* motFccEnd.h - Motorola FCC Ethernet network interface header *//* Copyright 1990-1998 Wind River Systems, Inc. *//*modification history--------------------01c,15jul99,ms_ make compliant with our coding standards01b,17apr99,ms_ get m8260Cpm.h locally01a,09apr99,cn written from motFecEnd.h, 01c.*/#ifndef __INCmotFccEndh#define __INCmotFccEndh/* includes */#ifdef __cplusplusextern "C" {#endif #include "etherLib.h"#include "miiLib.h"#include "m8260Cpm.h"/* defines *//* * redefine the macro below in the bsp if you need to access the device * registers/descriptors in a more suitable way. */#ifndef MOT_FCC_LONG_WR#define MOT_FCC_LONG_WR(addr, value) \ (* (addr) = ((UINT32) (value)))#endif /* MOT_FCC_LONG_WR */ #ifndef MOT_FCC_WORD_WR#define MOT_FCC_WORD_WR(addr, value) \ (* (addr) = ((UINT16) (value)))#endif /* MOT_FCC_WORD_WR */ #ifndef MOT_FCC_BYTE_WR#define MOT_FCC_BYTE_WR(addr, value) \ (* (addr) = ((UINT8) (value)))#endif /* MOT_FCC_BYTE_WR */ #ifndef MOT_FCC_LONG_RD#define MOT_FCC_LONG_RD(addr, value) \ ((value) = (* (UINT32 *) (addr)))#endif /* MOT_FCC_LONG_RD */ #ifndef MOT_FCC_WORD_RD#define MOT_FCC_WORD_RD(addr, value) \ ((value) = (* (UINT16 *) (addr)))#endif /* MOT_FCC_WORD_RD */ #ifndef MOT_FCC_BYTE_RD#define MOT_FCC_BYTE_RD(addr, value) \ ((value) = (* (UINT8 *) (addr)))#endif /* MOT_FCC_BYTE_RD */ /* * Default macro definitions for BSP interface. * These macros can be redefined in a wrapper file, to generate * a new module with an optimized interface. */ #define MOT_FCC_INUM(pDrvCtrl) \ ((int) INUM_FCC1 + ((pDrvCtrl)->fccNum - 1))#define MOT_FCC_IVEC(pDrvCtrl) \ INUM_TO_IVEC (MOT_FCC_INUM (pDrvCtrl))#ifndef SYS_FCC_INT_CONNECT#define SYS_FCC_INT_CONNECT(pDrvCtrl, pFunc, arg, ret) \{ \IMPORT STATUS intConnect (VOIDFUNCPTR *, VOIDFUNCPTR, int); \ret = OK; \ \ pDrvCtrl->intrConnect = TRUE; \ ret = (intConnect) ((VOIDFUNCPTR*) MOT_FCC_IVEC (pDrvCtrl), \ (pFunc), (int) (arg)); \}#endif /* SYS_FCC_INT_CONNECT */ #ifndef SYS_FCC_INT_DISCONNECT#define SYS_FCC_INT_DISCONNECT(pDrvCtrl, pFunc, arg, ret) \{ \ret = OK; \ \if (MOT_FCC_IVEC (pDrvCtrl) && (_func_motFccIntDisc != NULL)) \ { \ pDrvCtrl->intrConnect = FALSE; \ ret = (*_func_motFccIntDisc) ((VOIDFUNCPTR*) MOT_FCC_IVEC (pDrvCtrl), \ (pFunc)); \ } \}#endif /* SYS_FCC_INT_DISCONNECT */ #ifndef SYS_FCC_INT_ENABLE#define SYS_FCC_INT_ENABLE(pDrvCtrl, ret) \{ \IMPORT int intEnable (int); \ret = OK; \ \if (MOT_FCC_INUM (pDrvCtrl)) \ ret = intEnable ((int) (MOT_FCC_INUM (pDrvCtrl))); \}#endif /* SYS_FCC_INT_ENABLE */ #ifndef SYS_FCC_INT_DISABLE#define SYS_FCC_INT_DISABLE(pDrvCtrl, ret) \{ \IMPORT int intDisable (int); \ret = OK; \ \if (MOT_FCC_INUM (pDrvCtrl)) \ ret = intDisable ((int) (MOT_FCC_INUM (pDrvCtrl))); \}#endif /* SYS_FCC_INT_DISABLE */ #ifndef SYS_FCC_INT_ACK#define SYS_FCC_INT_ACK(pDrvCtrl, ret) \{ \ret = OK; \}#endif /* SYS_FCC_INT_ACK */ #define SYS_FCC_ENET_ADDR_GET(address) \if (sysFccEnetAddrGet != NULL) \ if (sysFccEnetAddrGet (pDrvCtrl->immrVal, pDrvCtrl->fccNum, \ (address)) == ERROR) \ { \ errnoSet (S_iosLib_INVALID_ETHERNET_ADDRESS); \ return (NULL); \ } #define SYS_FCC_ENET_ENABLE \if (sysFccEnetEnable != NULL) \ if (sysFccEnetEnable (pDrvCtrl->immrVal, pDrvCtrl->fccNum) \ == ERROR) \ return (ERROR); #define SYS_FCC_ENET_DISABLE \if (sysFccEnetDisable != NULL) \ if (sysFccEnetDisable (pDrvCtrl->immrVal, pDrvCtrl->fccNum) \ == ERROR) \ return (ERROR); #define SYS_FCC_MII_BIT_RD(bit) \if (sysFccMiiBitRd != NULL) \ if (sysFccMiiBitRd (pDrvCtrl->immrVal, pDrvCtrl->fccNum, (bit)) \ == ERROR) \ return (ERROR);#define SYS_FCC_MII_BIT_WR(bit) \if (sysFccMiiBitWr != NULL) \ if (sysFccMiiBitWr (pDrvCtrl->immrVal, pDrvCtrl->fccNum, (bit)) \ == ERROR) \ return (ERROR);#define MOT_FCC_MII_WR(data, len) \ { \ UINT8 i = len; \ \ while (i--) \ SYS_FCC_MII_BIT_WR (((data) >> i) & 0x1); \ }#define MOT_FCC_MII_RD(data, len) \ { \ UINT8 i = len; \ UINT8 bitVal = 0; \ \ while (i--) \ { \ (data) <<= 1; \ SYS_FCC_MII_BIT_RD (&bitVal); \ (data) |= bitVal & 0x1; \ } \ }#define MOT_FCC_LOOP_NS 10#define MOT_FCC_DEV_NAME "motfcc"#define MOT_FCC_DEV_NAME_LEN 7#define MOT_FCC_TBD_DEF_NUM 64 /* default number of TBDs */#define MOT_FCC_RBD_DEF_NUM 32 /* default number of RBDs */#define MOT_FCC_TX_CL_NUM 6 /* number of tx clusters */#define MOT_FCC_BD_LOAN_NUM 32 /* loaned BDs */#define MOT_FCC_TX_POLL_NUM 1 /* one TBD for poll operation */#define MOT_FCC_TBD_MAX 128 /* max number of TBDs */#define MOT_FCC_RBD_MAX 128 /* max number of TBDs */#define MOT_FCC_WAIT_MAX 0xf0000000 /* max delay after sending */#define MOT_FCC_ADDR_LEN 6 /* ethernet address length */#if 1#define MOT_FCC_RIPTR_VAL 0xb000 /* rx FIFO pointer value */#define MOT_FCC_TIPTR_VAL 0xb200 /* tx FIFO pointer value */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -