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

📄 rtl8019.h

📁 linux下的RTL8019驱动源码
💻 H
字号:
/*------------------------------------------------------------------------ . rtl8019.h - macros for the RTL8019AS Ethernet Driver . . (C) Copyright 2003 . ---------------------------------------------------------------------------*/#ifndef _RTL8019_H_#define _RTL8019_H_/* * This function may be called by the board specific initialisation code * in order to override the default mac address. */err_t ne2k_send_packet(struct netif *netif, struct pbuf *p,struct ip_addr *ipaddr);void  ne2k_recv_packet(struct netif *netif);err_t ne2k_init       (struct netif *netif);void __irq Exint1_ISR (void);#define Ethernet_EINT1     (0x01<<24)       // 采用外部中断 1./* RTL8019*/	#define	RWPORT	(0x10)	/* dma read write address, form 0x10 - 0x17 */#define	RstAddr (0x18)	/* reset register, 0x18, 0x1a, 0x1c, 0x1e even address is recommanded *//* page 0 */#define RCPORT	(0)#define	Pstart	(1)	/* page start */#define	Pstop	(2)	/* page stop */#define	BNRY	(3)	#define	TPSR	(4)	/* transmit page start */#define	TBCR0	(5)#define	TBCR1	(6)#define	ISR	 	(7)	/* interrupt status register */#define	RSAR0	(8)	/* dma read address */#define	RSAR1	(9)#define	RBCR0	(10)	/* dma read byte count */#define	RBCR1	(11)#define	RCR	(12)	/* receive config */#define	TCR	(13)	/* transmit config */#define	DCR	(14)	/* data config */#define	IMR	(15)	/* interrupt mask */#define	ID8019L	(10)#define	ID8019H	(11)/* page 1 */#define	PAR0	(1)#define	PAR1	(2)#define	PAR2	(3)#define	PAR3	(4)#define	PAR4	(5)#define	PAR6	(6)#define	CURR	(7)		#define	MAR0	(8)#define	MAR1	(9)#define	MAR2	(10)#define	MAR3	(11)#define	MAR4	(12)#define	MAR5	(13)#define	MAR6	(14)#define	MAR7	(15)/* page 2 *//* page 3 */#define	CR9346	(1)#define	CONFIG0	(3)#define	CONFIG1	(4)#define	CONFIG2	(5)#define	CONFIG3	(6)/* *	IEEE 802.3 Ethernet magic constants.  The frame sizes omit the preamble *	and FCS/CRC (frame check sequence).  */#define ETH_ALEN	6		/* Octets in one ethernet addr	 */#define ETH_HLEN	14		/* Total octets in header.	 */#define ETH_ZLEN	60		/* Min. octets in frame sans FCS */#define ETH_DATA_LEN	1500		/* Max. octets in payload	 */#define ETH_FRAME_LEN	1514		/* Max. octets in frame sans FCS *//* *	These are the defined Ethernet Protocol ID's. */#define ETH_P_LOOP	0x0060		/* Ethernet Loopback packet	*/#define ETH_P_ECHO	0x0200		/* Ethernet Echo packet		*/#define ETH_P_PUP	0x0400		/* Xerox PUP packet		*/#define ETH_P_IP	0x0800		/* Internet Protocol packet	*/#define ETH_P_X25	0x0805		/* CCITT X.25			*/#define ETH_P_ARP	0x0806		/* Address Resolution packet	*/#define	ETH_P_BPQ	0x08FF		/* G8BPQ AX.25 Ethernet Packet	[ NOT AN OFFICIALLY REGISTERED ID ] */#define ETH_P_DEC       0x6000          /* DEC Assigned proto           */#define ETH_P_DNA_DL    0x6001          /* DEC DNA Dump/Load            */#define ETH_P_DNA_RC    0x6002          /* DEC DNA Remote Console       */#define ETH_P_DNA_RT    0x6003          /* DEC DNA Routing              */#define ETH_P_LAT       0x6004          /* DEC LAT                      */#define ETH_P_DIAG      0x6005          /* DEC Diagnostics              */#define ETH_P_CUST      0x6006          /* DEC Customer use             */#define ETH_P_SCA       0x6007          /* DEC Systems Comms Arch       */#define ETH_P_RARP      0x8035		/* Reverse Addr Res packet	*/#define ETH_P_ATALK	0x809B		/* Appletalk DDP		*/#define ETH_P_AARP	0x80F3		/* Appletalk AARP		*/#define ETH_P_IPX	0x8137		/* IPX over DIX			*/#define ETH_P_IPV6	0x86DD		/* IPv6 over bluebook		*/// Receive status bits#define RS_ALGNERR	0x8000#define RS_BRODCAST	0x4000#define RS_BADCRC	0x2000#define RS_ODDFRAME	0x1000	#define RS_TOOLONG	0x0800#define RS_TOOSHORT	0x0400#define RS_MULTICAST	0x0001#define RS_ERRORS	(RS_ALGNERR | RS_BADCRC | RS_TOOLONG | RS_TOOSHORT) // 中断状态寄存器的值 #define	ISR_PRX	        0x01                // 正确接收数据包中断。做接收处理#define	ISR_PTX         0x02                // 正确发送数据包中断。做不做处理要看上层软件了。#define	ISR_RXE	    	0x04                // 接收数据包出错。做重新设置BNRY=CURR处理。 #define	ISR_TXE	    	0x08                // 由于冲突次数过多,发送出错。做重发处理#define	ISR_OVW	    	0x10                // 网卡内存溢出。做软件重启网卡处理。见手册。#define	ISR_CNT	    	0x20                // 出错计数器中断,屏蔽掉(屏蔽用IMR寄存器)。#define	ISR_RDC	        0x40                // Remote DMA结束 。屏蔽掉。轮询等待DMA结束。#define	ISR_RST         0x80                // 网卡Reset,屏蔽掉。// 中断屏蔽寄存器的值 #define	ISR_PRX	    	0x01#define	ISR_PTX	        0x02#define	ISR_RXE	    	0x04#define	ISR_TXE	    	0x08#define	ISR_OVW	    	0x10#define	ISR_CNT         0x20#define	ISR_RDC	    	0x40#define	ISR_RST	        0x80#endif  /* _RTL8019_H_ */

⌨️ 快捷键说明

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