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

📄 dec21140.h

📁 基于psos操作系统的dec21140驱动
💻 H
📖 第 1 页 / 共 3 页
字号:
#define LAN_CSR14_LTE     0x00001000   /* Link Test Enable             */
#define LAN_CSR14_APE     0x00002000   /* Auto Polarity Enable         */
#define LAN_CSR14_SPP     0x00004000   /* Set Polarity Plus            */

/*---------------------------------------------------------------------*/
/* Control & Status Register 15 - SIA General Register                 */
/*---------------------------------------------------------------------*/
#define LAN_CSR15_JBD     0x00000001   /* Jabber Disable               */
#define LAN_CSR15_HUJ     0x00000002   /* Host Unjab                   */
#define LAN_CSR15_JCK     0x00000004   /* Jabber Clock                 */
#define LAN_CSR15_RWD     0x00000010   /* Receive Watchdog Disable     */
#define LAN_CSR15_RWR     0x00000020   /* Receive Watchdog Release     */
#define LAN_CSR15_TSCK    0x00000100   /* Test Clock                   */
#define LAN_CSR15_FUSQ    0x00000200   /* Force Unsquelch              */
#define LAN_CSR15_FLF     0x00000400   /* Force Link Fail              */
#define LAN_CSR15_DPST    0x00001000   /* PLL Self Test Start          */
#define LAN_CSR15_FRL     0x00002000   /* Force Receiver Low           */

/*---------------------------------------------------------------------*/
/* Lan chip Transmit & Receive Descriptor Format                       */
/*---------------------------------------------------------------------*/
typedef volatile struct buff_desc
{
  ULONG status;
  ULONG ctrlNsize;
  void *buffAddr1;
  volatile struct buff_desc *nextDesc;
  ULONG padding[12]; /* to fit 64 byte cache line */
} LAN_BUFF_DESC;

#define MAC_OWNS_DESC   0x80000000     /* MAC owns descriptor */

/*---------------------------------------------------------------------*/
/* Lan chip Receive Descriptor Status Fields                           */
/*---------------------------------------------------------------------*/
#define LAN_RCVD_OF       0x00000001   /* Overflow                     */
#define LAN_RCVD_CE       0x00000002   /* CRC Error                    */
#define LAN_RCVD_DB       0x00000004   /* Dribbling Bit                */
#define LAN_RCVD_RJ       0x00000010   /* Receive Watchdog             */
#define LAN_RCVD_FT       0x00000020   /* Frame Type                   */
#define LAN_RCVD_CS       0x00000040   /* Collision Seen               */
#define LAN_RCVD_TL       0x00000080   /* Frame Too Long               */
#define LAN_RCVD_LS       0x00000100   /* Last Descriptor              */
#define LAN_RCVD_FS       0x00000200   /* First Descriptor             */
#define LAN_RCVD_MF       0x00000400   /* Multicast Frame              */
#define LAN_RCVD_RF       0x00000800   /* Runt Frame                   */
#define LAN_RCVD_DT       0x00003000   /* Data Type - Mask             */
#define LAN_RCVD_DT_SER   0x00000000   /* Data Type - Serial Frame Rcvd*/
#define LAN_RCVD_DT_ILP   0x00001000   /* Data Type - Internal Loopback*/
#define LAN_RCVD_DT_ELP   0x00002000   /* Data Type - External Loopback*/
#define LAN_RCVD_DT_RSV   0x00003000   /* Data Type - Reserved         */
#define LAN_RCVD_LE       0x00004000   /* Length Error */
#define LAN_RCVD_ES       0x00008000   /* Error Summary */
#define LAN_RCVD_FL       0x7FFF0000   /* Frame Length */

#define LAN_RCVD_FLOFF            16   /* Frame Length field Offset */

/*---------------------------------------------------------------------*/
/* Lan chip Receive Descriptor Control & Size Fields                   */
/*---------------------------------------------------------------------*/
#define LAN_RCVD_RBS1     0x000007FF   /* Receive Buffer Size 1        */
#define LAN_RCVD_RBS2     0x003FF800   /* Receive Buffer Size 2        */
#define LAN_RCVD_RCH      (1 << 24)    /* Second Address Chained       */
#define LAN_RCVD_RER      (1 << 25)    /* Receive End of Ring          */
#define LAN_RCVD_RBS2OFF          11   /* Bit offset of 2nd buffer size*/

/*---------------------------------------------------------------------*/
/* Lan chip Transmit Descriptor Status Fields                          */
/*---------------------------------------------------------------------*/
#define LAN_XMTD_DE       0x00000001   /* Deferred                     */
#define LAN_XMTD_UF       0x00000002   /* Underflow Error              */
#define LAN_XMTD_LF       0x00000004   /* Link Fail                    */
#define LAN_XMTD_CC       0x00000078   /* Collision Count              */
#define LAN_XMTD_HF       0x00000080   /* Heartbeat Fail               */
#define LAN_XMTD_EC       0x00000100   /* Excessive Collisions         */
#define LAN_XMTD_LC       0x00000200   /* Late Collisions              */
#define LAN_XMTD_NC       0x00000400   /* No Carrier                   */
#define LAN_XMTD_LO       0x00000800   /* Loss of Carrier              */
#define LAN_XMTD_TO       0x00004000   /* Transmit Jabber Time Out     */
#define LAN_XMTD_ES       0x00008000   /* Error Summary                */

/*---------------------------------------------------------------------*/
/* Lan chip Transmit Descriptor Control & Size Fields                  */
/*---------------------------------------------------------------------*/
#define LAN_XMTD_TBS1     0x000007FF   /* Transmit Buffer Size 1       */
#define LAN_XMTD_TBS2     0x003FF800   /* Transmit Buffer Size 2       */
#define LAN_XMTD_FT0      0x00400000   /* Filtering Type 0             */
#define LAN_XMTD_DPD      0x00800000   /* Disabled Padding             */
#define LAN_XMTD_TCH      (1 << 24)    /* Second Address Chained       */
#define LAN_XMTD_TER      (1 << 25)    /* Transmit End of Ring         */
#define LAN_XMTD_AC       0x04000000   /* Add CRC Disable              */
#define LAN_XMTD_SET      0x08000000   /* Setup Packet                 */
#define LAN_XMTD_FT1      0x10000000   /* Filtering Type 1             */
#define LAN_XMTD_FS       0x20000000   /* First Segment                */
#define LAN_XMTD_LS       0x40000000   /* Last Segment                 */
#define LAN_XMTD_IC       0x80000000   /* Interrupt on Completion      */

/* SROM Version defines */
#define MAX_GP_WRITES     10
#define MAX_MEDIAS        10

/*---------------------------------------------------------------------*/
/* Default Media Type                                                  */
/* If the serial rom is not programed, the below indexes in to         */
/* MediaArray to set up the media.                                     */
/*---------------------------------------------------------------------*/
#define DMT_AUI           0
#define DMT_10BASET       1
#define DMT_100BASET4     2

/*---------------------------------------------------------------------*/
/* Compact Format                                                      */
/*---------------------------------------------------------------------*/
typedef struct
    {
    UCHAR MediaCode;
    UCHAR GPPortData;
    USHORT Command;
    } CompactFormat;

/*---------------------------------------------------------------------*/
/* Extended Format 0                                                   */
/*---------------------------------------------------------------------*/
typedef struct
    {
    UCHAR Length;
    UCHAR Type;
    UCHAR BlockData[4];
    } ExtendedFormat0;

/*---------------------------------------------------------------------*/
/* Extended Format 1                                                   */
/*---------------------------------------------------------------------*/
typedef struct
    {
    UCHAR Length;
    UCHAR Type;
    UCHAR BlockData[40];
    } ExtendedFormat1;

/*---------------------------------------------------------------------*/
/* Info Block                                                          */
/*---------------------------------------------------------------------*/
typedef union InfoBlock
    {
    CompactFormat Compact;
    ExtendedFormat0 Extended0;
    ExtendedFormat1 Extended1;
    } InfoBlock;

/*---------------------------------------------------------------------*/
/* Leaf Information                                                    */
/*---------------------------------------------------------------------*/
typedef struct
    {
    USHORT ConnType;
    UCHAR GPControl;
    UCHAR BlockCount;
    InfoBlock srInfoBlock;
    } InfoLeaf;

/*---------------------------------------------------------------------*/
/* Media Settings                                                      */
/*---------------------------------------------------------------------*/
typedef struct
    {
    UINT ValCSR6;
    UINT GPCount;
    UINT GPValue[MAX_GP_WRITES];
    UINT GPResetLen;
    UINT GPResetValue[MAX_GP_WRITES];
    } MediaSettingsType;

/*---------------------------------------------------------------------*/
/* Media Block Information                                             */
/*---------------------------------------------------------------------*/
typedef struct {
   UINT ActiveMedia;
   UINT MediaFound;
   UINT GPMask;
   MediaSettingsType MediaArray[MAX_MEDIAS];
   UINT DontSwitch;
} MediaBlocksType;

#endif /* _DEC21140_H */

⌨️ 快捷键说明

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