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

📄 lan91c111end.h

📁 LAN91C111驱动源码,使用C语言写成
💻 H
📖 第 1 页 / 共 2 页
字号:
/* Interrupt Registers (BANK2_INT_STS, BANK2_INT_ACK, BANK2_INT_MSK) */
#define 	INT_TX_IDLE             0x80    	/*  Xmit IDLE interrupt */
/* PG added for 91c111 12/22/00 */
#define 	INT_MDINT				0x80		/*  91C111 MDINT interrupt */
#define 	INT_EARLY_RX            0x40    	/*  Early receive */
#define 	INT_EPH_INT             0x20    	/*  EPH type interrupt */
#define 	INT_RX_OVRN             0x10    	/*  Receive overrun interrupt */
#define 	INT_ALLOC               0x08    	/*  Allocation interrupt */
#define 	INT_TXF_EMPTY           0x04    	/*  Xmit fifo empty interrupt */
#define 	INT_TX_CMP              0x02    	/*  Xmit complete interrupt */
#define 	INT_RX_CMP              0x01    	/*  Receive complete interrupt */
#define 	NUMBER_INTS             7       	/*  Number of possible bits in the mask */
#define 	ENABLED_INTS    (INT_MDINT | INT_TX_CMP | INT_RX_CMP | INT_EPH_INT | INT_RX_OVRN )


/* Isolate packet number in PNR */
#define 	PNR_MASK                0x7f


/* Management Interface Register (BANK3_MGMT) */
#define 	MGMT_MDOE               0x0008  	/*  Output enable */
#define 	MGMT_MCLK               0x0004  	/*  Drive MDCLK */
#define 	MGMT_MDI                0x0002  	/*  Read MDI pin */
#define 	MGMT_MDO                0x0001  	/*  Write MDO pin */

/* Revision Register (BANK3_REV) */
#define 	REV_CHIP_ID             0x00f0  	/*  Mask chip ID */
#define 	REV_REV_ID              0x000f  	/*  Mask chip revision. */
#define 	CHIP_ID_92              3       	/*  Chip is 91C92 */
#define 	CHIP_ID_94              4       	/*  Chip is 91C94 */
#define 	CHIP_ID_100             7       	/*  Chip is 91C100 (FEAST) */


/* RK 970306 */
#define 	CHIP_ID_95              5       	/*  Chip is 91C95 */
#define 	REV_CHIP_ID_96          6       	/*  Chip is 91C96 */
#define 	CHIP_ID_100FD           8       	/*  Chip is 91C100FD (FEAST FD) */
#define 	CHIP_ID_110FD			9			/*  Chip is 91c110FD */

/* Early Receive Register (Bank3_Ercv) */
#define 	ERCV_DISCARD            0x0080  	/*  Discard packet being received */
#define 	ERCV_THRESHOLD          0x001f  	/*  Threshold for ERCV-INT in 64 byte units */

BOOLEAN							Ositech;											


/* Hardware packet representation. */
typedef  struct _SMC_PACK_HEADER
{
    USHORT     Status;
    USHORT     Range;
} SMC_PACK_HEADER;

#define SMC_PACK_HEADER_SIZE    sizeof(SMC_PACK_HEADER)


/*OSITECH++ */
#define 	CCR_MEMORY_OFFSET		(0x0400)
#define 	NET_CCR_OFFSET			(0x00)
#define		MODEM_CCR_OFFSET		(0x20)
 
/* OSITECH-- */
/* Dual function card attribute memory representation. */
typedef struct  _DUAL_ATTRIBUTE_MEMORY
{
    UCHAR   EthernetOption;
    UCHAR   Reserved1;
    UCHAR   EthernetStatus;
    UCHAR   Reserved2;
    UCHAR   Unused1[6];
    UCHAR   LanPortLo;
    UCHAR   Reserved3;
    UCHAR   LanPortHi;
    UCHAR   Reserved4;
    UCHAR   Unused2[18];
    UCHAR   ModemOption;
    UCHAR   Reserved5;
    UCHAR   ModemStatus;
    UCHAR   Reserved6;
    UCHAR   Pin;
    UCHAR   Reserved7;
    UCHAR   Unused3[2];
    UCHAR   Event;
    UCHAR   Reserved8;
    UCHAR   ModemPortLo;
    UCHAR   Reserved9;
    UCHAR   ModemPortHi;
    UCHAR   Reserved10;
} DUAL_ATTRIBUTE_MEMORY;

typedef struct
{
    int len;
    UCHAR * pData;
} RX_PKT;	/* received packet */	

typedef struct
{
    M_BLK_ID	pMblk;
} TX_PKT;	/* transmit packet */

#define DUAL_ATTRIBUTE_MEMORY_SIZE  sizeof(DUAL_ATTRIBUTE_MEMORY)

#define TX_PACKETS					0x20
#define RX_PACKETS					0x40


/* Masks for dual function PCMCIA card OPTION register.*/
#define 	SRESET              0x80            /*	Reset function. */
#define 	LEV_IRQ             0x40            /*  Level mode interrupts. */
#define 	DISABLE_EEPROM      0x08            /*  Disable EEPROM usage. */
#define 	ENABLE_IRQ          0x04            /*  Enable function interrupts. */
#define 	ENABLE_BASE         0x02            /*  Enable I/O decoder. */
#define 	ENABLE_FUNCTION     0x01            /*  Enable function. */

/* Masks for dual function PCMCIA card STATUS register. */
#define 	IO8                 0x20            /*  Only 8-bit I/O from host. */
#define 	POWER_DOWN          0x04            /*  Enter power-down mode.*/
#define 	INTERRUPT_ACTIVE    0x02            /*  Function is interrupting. */
#define 	INTERRUPT_ACK       0x01            /*  Acknowledge interrupt.*/


/*OSITECH++ */
#define 	MODEM_AUDIO         0x08

/* OSITECH-- */

/* Media Connect and Disconnect Vars */
#define 	MEDIA_CONNECT		0x01
#define 	MEDIA_DISCONNECT	0x02
#define		ETH_LENGTH_OF_ADDRESS 	6

/* Multicast Table Entry Structure */
typedef struct {
	UINT  MulticastTableEntryCount;
	UCHAR MulticastTableEntry[MAX_MULTICAST_ADDRESS * ETH_LENGTH_OF_ADDRESS];
	} MULTICAST_TABLE;
 

/* Add feature function variable here. By Shawn X.D. Meng March 24, 1997. */
#define 	ETxThresholdDefault      0x04
#define 	ETxThresholdDefault100   0x50
#define		ERxThresholdDefault		 31	  /* Increament is 64 Byte Multiple */
#define 	FC_RETRY_COUNTER         10
#define 	ThresholdIncreament      1        /* Increament is 16Byte multiple */
#define 	AUTO_NEGOTIATION         0xFF
#define 	DEFAULT_VALUE            0xFE
#define 	FULL_DUPLEX              0x01
#define 	HALF_DUPLEX              0x00
#define 	SPEED10                  0
#define 	SPEED100                 100
#define 	National_PHY_ID          0x3500


/* National PHY register address. */
#define 	BMCR                     0x00
#define 	BMSR                     0x01
#define 	PHY_ID1					 0x02
#define 	PHY_ID2					 0x03 
#define 	ANAR                     0x04
#define 	ANLPAR                   0x05


/* OSITECH++ */
#define 	ANEXPN                   0x06

/* OSITECH-- */
/* PG 07/21/00 83C183++ */
#define 	PHY_STATUS_OUTPUT		 0x12
#define 	PHY_INT_MASK		   	 0x13
#define 	PHY_MASK_BASE			 0xFFC0
#define 	PHY_MASK_INT			 ~0x8000
#define 	PHY_MASK_LINK			 ~0x4000

/* PG 07/21/00 83C183-- */
#define 	CTL_TEST				 0x18 	
#define 	PAR						 0x19

/* National PHY BMCR register mask bit */
#define 	BMCR_100                 0x2000
#define 	BMCR_FULL_DUPLEX         0x0100

/*OSITECH++ */
#define 	BMCR_RESET               0x8000
#define 	BMCR_LOOPBACK            0x4000
#define 	BMCR_RESTART_NEGOTIATION 0x0200

/* OSITECH-- */
#define BMCR_AUTO_NEGOTIATION    0x1000

/*OSITECH++ */

/*
 * National PHY BMSR register mask bit
 */
#define BMSR_ANEGC               0x0020
#define BMSR_LINK                0x0004

 /*
  *  National PHY TEST register mask bit
  */
#define TEST_CRS_CTL            0x0020

/* OSITECH-- */

/* National PHY ANAR & ANLPAR registers mask bit */
#define 	ANAR_TX100_FD       0x0100
#define 	ANAR_TX100          0x0080
#define 	ANAR_TX10_FD        0x0040
#define 	ANAR_TX10           0x0020

/* supported PHYs */
#define 	NATIONAL		0x1
#define 	LAN83C180		0x2
#define		LAN83C183		0x3

/* driver related macros starts here */

/* The network address structure.  Two per adapter. */
#define  MAC_ADDRESS_SIZE   6
typedef struct  _NETWORK_ADDRESS
{
    UCHAR           Address[MAC_ADDRESS_SIZE];     /*  Network address */
} NETWORK_ADDRESS;

#define NETWORK_ADDRESS_SIZE    sizeof(NETWORK_ADDRESS)


/* Defines possible states for MAC structures. */
typedef enum    _STATE_TYPE
{
     VOID_STATE,                        /* Illegal value. */
     ERROR_STATE,                       /* Initialization has failed. */
     INITIALIZING_STATE,                /* Structure is being built. */
     NORMAL_STATE,                      /* Operational state. */
     RESET_STATE,                       /* Reset in progress. */
     RESET_PEND_STATE,                  /* Reset when can. */
     RESET_TRANSMITTING_STATE,          /* Complete reset after transmit. */
     CLOSED_STATE,                      /* Close in progress. */
     CLOSE_PEND_STATE,                  /* Close when can. */
     CLOSE_TRANSMITTING_STATE,          /* Complete close after transmit. */
     STATUS_PEND_STATE,                 /* Still busy, don't do nuttin */
     RESET_COMPLETE_STATE,              /* Clean up after reset. */
     OPEN_PEND_STATE                    /* Wait for open to complete. */
} STATE_TYPE;


/* Values for severity of trace message */
#define 	DEBUG_LEVEL_ALL         0
#define 	DEBUG_LEVEL_TRACE       1
#define 	DEBUG_LEVEL_INFORMATION 2
#define 	DEBUG_LEVEL_WARN        3
#define 	DEBUG_LEVEL_ERROR       4
#define 	DEBUG_LEVEL_NONE        256

/* Dummy entry for TraceMsg macro */
#ifdef  TRACE
#define TraceMsg(DebugValue, DebugText) {\
UINT __x = \
(DebugValue >= DebugLevel) ? DbgPrint("Smc9000.Sys:  %s\n", DebugText) : 0; \
}
#else
#define TraceMsg(DebugValue, DebugText)
#endif

/* Debug breakpoint macro. */
#ifdef  BREAKPOINT
/* #define BreakPoint  _asm int 3 */
#else
#define BreakPoint
#endif


/* Version Information. */
#ifdef NDIS40_MINIPORT
	#define DRIVER_NDIS_MAJOR_VERSION  4       /* ndis level */
	#define DRIVER_NDIS_MINOR_VERSION  0       /* ndis level */
#else
	#define DRIVER_NDIS_MAJOR_VERSION  3       /* ndis level */
	#define DRIVER_NDIS_MINOR_VERSION  0       /* ndis level */

#endif

#define DRIVER_NDIS_VERSION        ((DRIVER_NDIS_MAJOR_VERSION << 8) + DRIVER_NDIS_MINOR_VERSION)


/* environment variabls starts here */

/* Definitions for the SMC 9000 Evaluation Board driver. */
#ifdef SMC

/* Common definitions for all modules. */
#undef   VER_COMPANYNAME_STR
#define  VER_LEGALCOPYRIGHT_YEARS     "1993-2000"
#define  VER_LEGALCOPYRIGHT_STR       "Copyright \251 SMSC " VER_LEGALCOPYRIGHT_YEARS
#define  VER_COMPANYNAME_STR          "Standard Microsystems Corp."
#define  VER_FILEVERSION_STR          "3.12"

/* Definitions for the driver. */

#ifdef DEBUG
#define  DRV_VER_FILEDESCRIPTION_STR      "LAN9000 Adapter Driver (Debug Version)"
#else
#define  DRV_VER_FILEDESCRIPTION_STR      "LAN9000 Adapter Driver"
#endif

#ifdef NDIS_WIN
#define  DRV_VER_ORIGINALFILENAME_STR     "LAN9000.VXD"
#else
#define  DRV_VER_ORIGINALFILENAME_STR     "LAN9000.SYS"
#endif

#define  DRV_VER_INTERNALNAME_STR         "LAN9000"

/* OID Query return strings. */
#define 	DRV_VENDOR_NAME     "LAN 9000 Ethernet Adapter"
#define 	DRV_VENDOR_NAME_92  "LAN 91C92 Ethernet Adapter"
#define 	DRV_VENDOR_NAME_94  "LAN 91C94 Ethernet Adapter"
#define 	DRV_VENDOR_NAME_100 "LAN 91C1XX Ethernet Adapter"
#define 	DRV_VENDOR_NAME_MF  "SMC PCMCIA Multifunction Ethernet Adapter"

/* Byte count of description strings. */
#define 	SIZE_DRV_VENDOR_NAME        26
#define 	SIZE_DRV_VENDOR_NAME_92     27
#define 	SIZE_DRV_VENDOR_NAME_94     27
#define 	SIZE_DRV_VENDOR_NAME_100    28
#define 	SIZE_DRV_VENDOR_NAME_MF     50

#endif /* SMC */

/* Definitions for the ALTNAME Adapter. */

#ifdef ALTNAME

/* Common definitions for all modules. */

#undef   VER_COMPANYNAME_STR
#define  VER_LEGALCOPYRIGHT_YEARS     "1995"
#define  VER_LEGALCOPYRIGHT_STR       "Copyright \251 ALTNAME " VER_LEGALCOPYRIGHT_YEARS
#define  VER_COMPANYNAME_STR          "ALTNAME Corp."
#define  VER_FILEVERSION_STR          "1.02"

/* Definitions for the driver. */

#ifdef DEBUG
#define  DRV_VER_FILEDESCRIPTION_STR      "ALTNAME Adapter Driver (Debug Version)"
#else
#define  DRV_VER_FILEDESCRIPTION_STR      "ALTNAME Adapter Driver"
#endif

#ifdef NDIS_WIN
#define  DRV_VER_ORIGINALFILENAME_STR     "SMC9000.VXD"
#else
#define  DRV_VER_ORIGINALFILENAME_STR     "SMC9000.SYS"
#endif

#define  DRV_VER_INTERNALNAME_STR         "SMC9000"

/* OID Query return strings. */

#define 	DRV_VENDOR_NAME     "ALTNAME 9000 Ethernet Adapter"
#define 	DRV_VENDOR_NAME_92  "ALTNAME 91C92 Ethernet Adapter"
#define 	DRV_VENDOR_NAME_94  "ALTNAME 91C94 Ethernet Adapter"
#define 	DRV_VENDOR_NAME_100 "ALTNAME 91C100 Ethernet Adapter"
#define 	DRV_VENDOR_NAME_MF  "ALTNAME PCMCIA Multifunction Ethernet Adapter"

/* Byte count of description strings. */

#define 	SIZE_DRV_VENDOR_NAME        30
#define 	SIZE_DRV_VENDOR_NAME_92     31
#define 	SIZE_DRV_VENDOR_NAME_94     31
#define 	SIZE_DRV_VENDOR_NAME_100    32
#define 	SIZE_DRV_VENDOR_NAME_MF     46

#endif /* ALTNAME */

#ifdef __cplusplus
}
#endif

#endif /* __INClan91c111Endh */

⌨️ 快捷键说明

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