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

📄 if_vcom.h

📁 IXP425的BSP代码
💻 H
📖 第 1 页 / 共 2 页
字号:
/* if_vcom.h - VLAN ethernet board transparent mode library *//* Copyright 1990-1994, PEP Modular Computers *//* Copyright 1984-1994, Wind River Systems, Inc. *//*modification history--------------------01f,07jan94,haw  removed include of copyright, fixed spacing, indentation01e,07jun93,haw  renamed to if_vcom.h (used to be vcomLib.h),                 moved it to this directory, copyied definition of                 VCOM structure to this file, moved all includes to the driver,                 now uses of volatile variables where necessary, added                 definitions for some registers01d,07jan93,haw  made variables LOCAL01c,09oct92,haw  added definitions for EEPROM01b,12jul92,haw  added some casts to satisfy LINT01a,11jun92,haw  written*/ #ifndef __INCif_vcomh#define __INCif_vcomh#ifdef __cplusplusextern "C" {#endif /* __cplusplus */#define EADDRS          6 #define GOTTRAILERTYPE  0#define GOTTYPE         1#define GOTNOTYPE       2 #define ETHER_MIN   (ETHERMIN + sizeof(struct ether_header))#define ETHER_MAX   (ETHERMTU + sizeof(struct ether_header))/* Intel 82596 specific definitions  */ /* * RFD - receive frame descriptor: linear mode, simplified model */ typedef struct rfd    {    volatile UINT16      rfdStat1;   /* first status word */    volatile UINT16      rfdStat2;   /* second status word */    struct rfd *pRfdLeNext;          /* ptr to next rfd (little-end) */    void       *pRfdRbd;             /* ptr to receive buffer descriptor */    volatile UINT16      rfdAcount;  /* number of actual bytes in buffer */    UINT16      rfdSize;             /* size of buffer */    volatile UINT8       rfdDa [6];  /* destination address */    volatile UINT8       rfdSa [6];  /* source address */    UINT16      rfdLength;           /* length/type from 802.3 frame */    UINT8       rfdData [ETHER_MAX]; /* ethernet received data */    struct rfd *pRfdBeNext;          /* ptr to next rfd (big-end for driver) */    struct rfd *pRfdBePrev;          /* ptr to prev rfd (big-end for driver) */    } RFD;/* * TBD - Transmit buffer descriptor */ typedef struct tbd    {    UINT16      tbdCnt;              /* number of bytes to xmit from this TBD */    UINT16      zeroes;    struct tbd *pTbdLeNext;          /* pointer to next tbd in xmit chain */    void       *pTbdData;            /* pointer to data to xmit */    UINT32      tbdPadd;             /* pad to 16 bytes */    UINT8       xmitData [1536];     /* xmit data buffer (lld + alignment) */    } TBD;typedef struct tcb    {    TBD        *pTbd;                /* ptr to transmit buffer descriptor */    UINT16      tcbCnt;              /* number of bytes to xmit from TCB */    UINT16      zeroes;              /* must be zeroes */    UINT8       da [6];              /* destination ethernet address */    UINT16      tcbLen;              /* length/type for 802.3 frame */    } TCB; /* * CB - Command block template */typedef struct cb    {    volatile UINT16      cbStatus;   /* status word */    volatile UINT16      cbCommand;  /* command word */    struct cb *pCbLeNext;            /* ptr to nxt command block (little end) */    union        {        UINT8   ia [6];              /* ethernet address (for IA command) */        TCB     tcb;                 /* transmit command block */        } cmd;    struct cb  *pCbBeNext;           /* next cmd block (bigend for driver) */    struct cb  *pCbBePrev;           /* prev cmd block (bigend for driver) */    } CB;/* * SCB - system control block template */ typedef struct scb    {    volatile UINT16      scbStatus;  /* status word */    volatile UINT16      scbCmd;     /* command word */    CB         *pCbl;                /* command block list ptr */    RFD        *pRfa;                /* receive frame area ptr */    UINT32      crcErrs;             /* CRC errors */    UINT32      alignErrs;           /* alignment errors */    UINT32      resErrs;             /* resource errors */    UINT32      overrunErrs;         /* overrun errors */    UINT32      rcvcdtErrs;          /* receive collisions errors */    UINT32      sfErrs;              /* short frame errors */    UINT16      toffTimer;           /* throttle t-off timer */    UINT16      tonTimer;            /* throttle t-on timer */    UINT8       cbPadd [8];          /* padd to 16-byte bound */    } SCB; /* * ISCP - Intermediate System configuration pointer */ typedef struct iscp    {    UINT8       iscpUnused1;    UINT8       iscpBusy;            /* busy indicator */    UINT16      iscpUnused2;    SCB        *pIscpLeSCB;          /* (little end) scb pointer */    SCB        *pIscpBeSCB;          /* (big end) scb pointer */    UINT8       iscpPadd [4];        /* padd to 16-byte bound */    } ISCP;/* * SCP - System configuration pointer */ typedef struct scp    {    UINT32      scpSysbus;           /* configuration goodies */    UINT32      scpUnused2;    ISCP       *pScpLeISCP;          /* (little end) iscp pointer */    ISCP       *pScpBeISCP;          /* (big end) iscp pointer */    } SCP; /* * template for selftest result */typedef struct    {    volatile UINT32      strRomsig;  /* ROM signature */    volatile UINT32      strResult;  /* selftest result */    } STR; /* defines for the TBD */ #define TBD_EOF             0x8000   /* last TBD in xmit list */#define TBD_CNTMASK         0x3fff   /* 14-bit count field */ #define TBD_NOT_USED    (void *)-1 /* defines for the TCB */#define TCB_EOF             0x8000   /* entire frame is in TCB */#define TCB_CNTMASK         0x3fff   /* 14-bit count field */ /* defines for the RFD */ #define RFD_COMPLETE        0x8000   /* reception complete */#define RFD_BUSY            0x4000   /* reception in progress */#define RFD_OK              0x2000   /* received frame has no errors */ #define RFD_LAST            0x8000   /* last rfd in rdl */#define RFD_SUSPEND         0x4000   /* suspend after receive */#define RFD_FLEXIBLE        0x0008   /* flexible/simple memory model */ #define RFD_RBD_NOTUSED (void *)-1#define RFD_EOF             0x8000   /* last buffer in frame */#define RFD_USED            0x4000   /* buffer has been used (and abused) */ #define RFD_SIZEMASK        0x3fff   /* size is 14-bits */ /* defines for the CB */ #define CB_COMPLETE         0x8000   /* 1=command complete */#define CB_BUSY             0x4000   /* 1=command in progress */#define CB_OK               0x2000   /* 1=completed without error */#define CB_ABORT            0x1000   /* 1=command aborted */#define XMIT_LCOL           0x0800   /* 1=late collision on xmit */#define XMIT_LCAR           0x0400   /* 1=no carrier sensed */#define XMIT_LCTS           0x0200   /* 1=lost clear to send */#define XMIT_UDMA           0x0100   /* 1=dma underrun */#define XMIT_DEFR           0x0080   /* 1=transmit deferred */#define XMIT_BEAT           0x0040   /* 1=CDT (heartbeat) active */#define XMIT_MTRY           0x0020   /* 1=exceeded maximum retries for xmit */#define XMIT_COLLMASK       0x000f   /* collision count field */#define CB_LAST             0x8000   /* last command in list */#define CB_SUSPEND          0x4000   /* suspend after this command */#define CB_IRQ              0x2000   /* generate IRQ after command */#define XMIT_NC             0x0010   /* 1=no CRC insertion enable */#define XMIT_SF             0x0008   /* 1=flexible, 0=simplified (sic) */#define CB_CMDMASK          0x0007   /* mask for command code */#define CB_CMD_NOP               0   /* NOP command */#define CB_CMD_IASETUP           1   /* Intermediate address setup command */#define CB_CMD_CONFIG            2   /* CONFIG command */#define CB_CMD_MCSETUP           3   /* Multicast setup command */#define CB_CMD_XMIT              4   /* Transmit command */#define CB_CMD_TDR               5   /* TDR command */#define CB_CMD_DUMP              6   /* Dump internals command */#define CB_CMD_DIAG              7   /* Diagnose command */ /* defines for the SCB */ #define SCB_STATUS_CX       0x8000   /* command complete interrupt */#define SCB_STATUS_FR       0x4000   /* finished receiving frame interrupt */#define SCB_STATUS_CNA      0x2000   /* CU left in active state */#define SCB_STATUS_RNR      0x1000   /* RU left in ready state */#define SCB_CU_ACTIVE       0x0200   /* CU in active state */#define SCB_CU_SUSPEND      0x0100   /* CU is suspended */#define SCB_CU_IDLE         0x0000   /* CU is idle */#define SCB_RU_NO_RBD       0x0080   /* RU is in no RBD state */#define SCB_RU_READY        0x0040   /* RU is in ready state */#define SCB_RU_NO_RES       0x0020   /* RU is in no resources state */

⌨️ 快捷键说明

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