?? rtl8019.h
字號(hào):
/*------------------------------------------------------------------------ . 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) // 中斷狀態(tài)寄存器的值 #define ISR_PRX 0x01 // 正確接收數(shù)據(jù)包中斷。做接收處理#define ISR_PTX 0x02 // 正確發(fā)送數(shù)據(jù)包中斷。做不做處理要看上層軟件了。#define ISR_RXE 0x04 // 接收數(shù)據(jù)包出錯(cuò)。做重新設(shè)置BNRY=CURR處理。 #define ISR_TXE 0x08 // 由于沖突次數(shù)過多,發(fā)送出錯(cuò)。做重發(fā)處理#define ISR_OVW 0x10 // 網(wǎng)卡內(nèi)存溢出。做軟件重啟網(wǎng)卡處理。見手冊(cè)。#define ISR_CNT 0x20 // 出錯(cuò)計(jì)數(shù)器中斷,屏蔽掉(屏蔽用IMR寄存器)。#define ISR_RDC 0x40 // Remote DMA結(jié)束 。屏蔽掉。輪詢等待DMA結(jié)束。#define ISR_RST 0x80 // 網(wǎng)卡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_ */
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -