亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ethernet.h

?? 用于三星S3C44BOX ARM7芯片的Demon板測試
?? H
字號:
/*********************************************************************************************
* File:	ETHERNET.H
* Author:	embest	
* Desc:	Ethernet control define and RTL8019as register description
* History:	
*********************************************************************************************/

#ifndef _ethernet_H_
#define _ethernet_H_

/*--- RTL8019AS Register defines ---*/

/* Register offset applicable to all register pages. */
#define NIC_CR 			0x00    /* Command register 			*/
#define NIC_IOPORT 		0x10    /* I/O data port 				*/
#define NIC_RESET 		0x1f    /* Reset port 					*/

/* Page 0 register offsets. */
#define NIC_PG0_CLDA0 	0x01    /* Current local DMA address 0 	*/
#define NIC_PG0_PSTART 	0x01    /* Page start register 		 	*/
#define NIC_PG0_CLDA1 	0x02    /* Current local DMA address 1 	*/
#define NIC_PG0_PSTOP 	0x02    /* Page stop register 		 	*/
#define NIC_PG0_BNRY 	0x03    /* Boundary pointer 		 	*/
#define NIC_PG0_TSR 	0x04    /* Transmit status register 	*/
#define NIC_PG0_TPSR 	0x04    /* Transmit page start address 	*/
#define NIC_PG0_NCR 	0x05    /* Number of collisions register*/
#define NIC_PG0_TBCR0 	0x05    /* Transmit byte count register 0 */
#define NIC_PG0_FIFO 	0x06    /* FIFO 						*/
#define NIC_PG0_TBCR1 	0x06    /* Transmit byte count register 1 */
#define NIC_PG0_ISR 	0x07    /* Interrupt status register 	*/
#define NIC_PG0_CRDA0 	0x08    /* Current remote DMA address 0 */
#define NIC_PG0_RSAR0 	0x08    /* Remote start address register 0 
                                   Low byte address to read from the buffer.  */
#define NIC_PG0_CRDA1 	0x09    /* Current remote DMA address 1 */
#define NIC_PG0_RSAR1 	0x09    /* Remote start address register 1 
                                   High byte address to read from the buffer. */
#define NIC_PG0_RBCR0 	0x0a    /* Remote byte count register 0 
                                   Low byte of the number of bytes to read
                                   from the buffer. 			*/
#define NIC_PG0_RBCR1 	0x0b    /* Remote byte count register 1
                                   High byte of the number of bytes to read
                                   from the buffer. 			*/
#define NIC_PG0_RSR 	0x0c    /* Receive status register 	 	*/
#define NIC_PG0_RCR 	0x0c    /* Receive configuration register */
#define NIC_PG0_CNTR0 	0x0d    /* Tally counter 0 (frame alignment errors)*/
#define NIC_PG0_TCR 	0x0d    /* Transmit configuration register*/
#define NIC_PG0_CNTR1 	0x0e    /* Tally counter 1 (CRC errors)	*/
#define NIC_PG0_DCR 	0x0e    /* Data configuration register 	*/
#define NIC_PG0_CNTR2 	0x0f    /* Tally counter 2 (Missed packet errors)  */
#define NIC_PG0_IMR 	0x0f    /* Interrupt mask register 	 	*/

/* Page 1 register offsets. */
#define NIC_PG1_PAR0 	0x01    /* Physical address register 0 	*/
#define NIC_PG1_PAR1 	0x02    /* Physical address register 1 	*/
#define NIC_PG1_PAR2 	0x03    /* Physical address register 2 	*/
#define NIC_PG1_PAR3 	0x04    /* Physical address register 3 	*/
#define NIC_PG1_PAR4 	0x05    /* Physical address register 4 	*/
#define NIC_PG1_PAR5 	0x06    /* Physical address register 5 	*/
#define NIC_PG1_CURR 	0x07    /* Current page register
                                   The next incoming packet will be stored
                                   at this page address. 		*/
#define NIC_PG1_MAR0 	0x08    /* Multicast address register 0 */
#define NIC_PG1_MAR1 	0x09    /* Multicast address register 1 */
#define NIC_PG1_MAR2 	0x0a    /* Multicast address register 2 */
#define NIC_PG1_MAR3 	0x0b    /* Multicast address register 3 */
#define NIC_PG1_MAR4 	0x0c    /* Multicast address register 4 */
#define NIC_PG1_MAR5 	0x0d    /* Multicast address register 5 */
#define NIC_PG1_MAR6 	0x0e    /* Multicast address register 6 */
#define NIC_PG1_MAR7 	0x0f    /* Multicast address register 7 */

/* Page 2 register offsets. */
#define NIC_PG2_PSTART 	0x01   	/* Page start register 		 	*/
#define NIC_PG2_CLDA0 	0x01    /* Current local DMA address 0 	*/
#define NIC_PG2_PSTOP 	0x02    /* Page stop register 		 	*/
#define NIC_PG2_CLDA1 	0x02    /* Current local DMA address 1 	*/
#define NIC_PG2_RNP 	0x03    /* Remote next packet pointer  	*/
#define NIC_PG2_TSPR 	0x04    /* Transmit page start register	*/
#define NIC_PG2_LNP 	0x05    /* Local next packet pointer   	*/
#define NIC_PG2_ACU 	0x06    /* Address counter (upper) 	 	*/
#define NIC_PG2_ACL 	0x07    /* Address counter (lower) 	 	*/
#define NIC_PG2_RCR 	0x0c    /* Receive configuration register */
#define NIC_PG2_TCR 	0x0d    /* Transmit configuration register*/
#define NIC_PG2_DCR 	0x0e    /* Data configuration register 	*/
#define NIC_PG2_IMR 	0x0f    /* Interrupt mask register 	 	*/

/* Page 3 register offsets. */
#define NIC_PG3_EECR    0x01   	/* EEPROM command register 		*/
#define NIC_PG3_BPAGE   0x02   	/* Boot-ROM page register 		*/
#define NIC_PG3_CONFIG0 0x03   	/* Configuration register 0 (r/o) */
#define NIC_PG3_CONFIG1 0x04   	/* Configuration register 1 	*/
#define NIC_PG3_CONFIG2 0x05   	/* Configuration register 2 	*/
#define NIC_PG3_CONFIG3 0x06   	/* Configuration register 3 	*/
#define NIC_PG3_CSNSAV  0x08   	/* CSN save register (r/o) 		*/
#define NIC_PG3_HLTCLK  0x09   	/* Halt clock 					*/
#define NIC_PG3_INTR    0x0b   	/* Interrupt pins (r/o) 		*/

/* Command register bits. */
#define NIC_CR_STP 		0x01    /* Stop 						*/
#define NIC_CR_STA 		0x02    /* Start 						*/
#define NIC_CR_TXP 		0x04    /* Transmit packet 				*/
#define NIC_CR_RD0 		0x08    /* Remote DMA command bit 0 	*/
#define NIC_CR_RD1 		0x10    /* Remote DMA command bit 1 	*/
#define NIC_CR_RD2 		0x20    /* Remote DMA command bit 2 	*/
#define NIC_CR_PS0 		0x40    /* Page select bit 0 			*/
#define NIC_CR_PS1 		0x80    /* Page select bit 1 			*/

/* Interrupt status register bits. */
#define NIC_ISR_PRX 	0x01    /* Packet received 				*/
#define NIC_ISR_PTX 	0x02    /* Packet transmitted 			*/
#define NIC_ISR_RXE 	0x04    /* Receive error 				*/
#define NIC_ISR_TXE 	0x08    /* Transmit error 				*/
#define NIC_ISR_OVW 	0x10    /* Overwrite warning 			*/
#define NIC_ISR_CNT 	0x20    /* Counter overflow 			*/
#define NIC_ISR_RDC 	0x40    /* Remote DMA complete			*/
#define NIC_ISR_RST 	0x80    /* Reset status 				*/

/* Interrupt mask register bits. */
#define NIC_IMR_PRXE 	0x01    /* Packet received interrupt enable 	*/
#define NIC_IMR_PTXE 	0x02    /* Packet transmitted interrupt enable 	*/
#define NIC_IMR_RXEE 	0x04    /* Receive error interrupt enable 		*/
#define NIC_IMR_TXEE 	0x08    /* Transmit error interrupt enable 		*/
#define NIC_IMR_OVWE 	0x10    /* Overwrite warning interrupt enable 	*/
#define NIC_IMR_CNTE 	0x20    /* Counter overflow interrupt enable 	*/
#define NIC_IMR_RCDE 	0x40    /* Remote DMA complete interrupt enable */

/* Data configuration register bits. */
#define NIC_DCR_WTS 	0x01    /* Word transfer select 		*/
#define NIC_DCR_BOS 	0x02    /* Byte order select 			*/
#define NIC_DCR_LAS 	0x04    /* Long address select 			*/
#define NIC_DCR_LS 		0x08    /* Loopback select 				*/
#define NIC_DCR_AR 		0x10    /* Auto-initialize remote 		*/
#define NIC_DCR_FT0 	0x20    /* FIFO threshold select bit 0 	*/
#define NIC_DCR_FT1 	0x40    /* FIFO threshold select bit 1 	*/

/* Transmit configuration register bits. */
#define NIC_TCR_CRC 	0x01    /* Inhibit CRC 					*/
#define NIC_TCR_LB0 	0x02    /* Encoded loopback control bit 0 */
#define NIC_TCR_LB1 	0x04    /* Encoded loopback control bit 1 */
#define NIC_TCR_ATD 	0x08    /* Auto transmit disable 		*/
#define NIC_TCR_OFST 	0x10    /* Collision offset enable 		*/

/* Transmit status register bits. */
#define NIC_TSR_PTX 	0x01	/* Packet transmitted 			*/
#define NIC_TSR_COL 	0x04    /* Transmit collided 			*/
#define NIC_TSR_ABT 	0x08    /* Transmit aborted 			*/
#define NIC_TSR_CRS 	0x10    /* Carrier sense lost 			*/
#define NIC_TSR_FU 		0x20    /* FIFO underrun 				*/
#define NIC_TSR_CDH 	0x40    /* CD heartbeat 				*/
#define NIC_TSR_OWC 	0x80    /* Out of window collision 		*/

/* Receive configuration register bits. */
#define NIC_RCR_SEP 	0x01    /* Save errored packets 		*/
#define NIC_RCR_AR 		0x02    /* Accept runt packets 			*/
#define NIC_RCR_AB 		0x04    /* Accept broadcast 			*/
#define NIC_RCR_AM 		0x08    /* Accept multicast 			*/
#define NIC_RCR_PRO 	0x10    /* Promiscuous physical 		*/
#define NIC_RCR_MON 	0x20    /* Monitor mode 				*/

/* Receive status register bits. */
#define NIC_RSR_PRX 	0x01    /* Packet received intact 		*/
#define NIC_RSR_CRC 	0x02    /* CRC error 					*/
#define NIC_RSR_FAE 	0x04    /* Frame alignment error 		*/
#define NIC_RSR_FO 		0x08    /* FIFO overrun 				*/
#define NIC_RSR_MPA 	0x10    /* Missed packet 				*/
#define NIC_RSR_PHY 	0x20    /* Physical/multicast address 	*/
#define NIC_RSR_DIS 	0x40    /* Receiver disabled 			*/
#define NIC_RSR_DFR 	0x80    /* Deferring 					*/

/* EEPROM command register bits. */
#define NIC_EECR_EEM1  	0x80    /* EEPROM Operating Mode 		*/
#define NIC_EECR_EEM0  	0x40    /*  EEPROM Operating Mode
                                    - 0 0 Normal operation
                                    - 0 1 Auto-load 
                                    - 1 0 9346 programming 
                                    - 1 1 Config register write enab */
#define NIC_EECR_EECS  	0x08    /* EEPROM Chip Select 			*/
#define NIC_EECR_EESK  	0x04    /* EEPROM Clock 				*/
#define NIC_EECR_EEDI  	0x02    /* EEPROM Data In 				*/
#define NIC_EECR_EEDO  	0x01    /* EEPROM Data Out 				*/

/* Configuration register 2 bits. */
#define NIC_CONFIG2_PL1 	0x80 	/* Network media type 		*/
#define NIC_CONFIG2_PL0 	0x40 	/* Network media type
                                    	- 0 0 TP/CX auto-detect 
                                    	- 0 1 10baseT 
                                    	- 1 0 10base5 
                                    	- 1 1 10base2 			*/
#define NIC_CONFIG2_BSELB 	0x20 	/* BROM disable 			*/
#define NIC_CONFIG2_BS4   	0x10 	/* BROM size/base 			*/
#define NIC_CONFIG2_BS3   	0x08
#define NIC_CONFIG2_BS2   	0x04
#define NIC_CONFIG2_BS1   	0x02
#define NIC_CONFIG2_BS0   	0x01

/* Configuration register 3 bits */
#define NIC_CONFIG3_PNP     0x80 	/* PnP Mode 				*/
#define NIC_CONFIG3_FUDUP   0x40 	/* Full duplex 				*/
#define NIC_CONFIG3_LEDS1   0x20 	/* LED1/2 pin configuration 
                                        - 0 LED1 == LED_RX, LED2 == LED_TX 
                                        - 1 LED1 == LED_CRS, LED2 == MCSB */
#define NIC_CONFIG3_LEDS0   0x10 	/* LED0 pin configration
                                        - 0 LED0 pin == LED_COL 
                                        - 1 LED0 pin == LED_LINK*/
#define NIC_CONFIG3_SLEEP   0x04 	/* Sleep mode 				*/
#define NIC_CONFIG3_PWRDN   0x02 	/* Power Down 				*/
#define NIC_CONFIG3_ACTIVEB 0x01 	/* inverse of bit 0 in PnP Act Reg */

/* Configuration register 1 bits */
#define NIC_CONFIG1_IRQEN	0x80	/* Enable IRQ				*/
#define NIC_CONFIG1_IRQS2	0x40	/* IRQ Select				*/
#define NIC_CONFIG1_IRQS1	0x20	/* IRQ Select				*/
#define NIC_CONFIG1_IRQS0	0x10	/* IRQ Select				
										- 0 0 0 INT0
										- 0 0 1 INT1
										- 0 1 0 INT2
										- 0 1 1 INT3
										- 1 0 0 INT4
										- 1 0 1 INT5
										- 1 1 0 INT6
										- 1 1 1 INT7			*/
#define NIC_CONFIG1_IOS3	0x08	/* I/O Base Address			*/
#define NIC_CONFIG1_IOS2	0x04	/* I/O Base Address			*/
#define NIC_CONFIG1_IOS1	0x02	/* I/O Base Address			*/
#define NIC_CONFIG1_IOS0	0x01	/* I/O Base Address			*/

#define NIC_PAGE_SIZE       0x100
#define NIC_START_PAGE      0x40
#define NIC_STOP_PAGE       0x60
#define NIC_TX_PAGES        6
#define NIC_TX_BUFFERS      2
#define NIC_FIRST_TX_PAGE   NIC_START_PAGE
#define NIC_FIRST_RX_PAGE   (NIC_FIRST_TX_PAGE + NIC_TX_PAGES * NIC_TX_BUFFERS)
#define TX_PAGES            12

/* Read byte from controller register. */
#define nic_read(reg) 		 *(ether_base + (reg)*0x200)

/* Write byte to controller register. */
#define nic_write(reg, data) *(ether_base + (reg)*0x200) = data

/* MAC Protocol Header */
struct ETHERHDR
{
    UCHAR  ether_dhost[6];     		/* Destination MAC address. */
    UCHAR  ether_shost[6];     		/* Source MAC address. 		*/
    USHORT ether_type;         		/* Protocol type. 			*/
}__attribute__((packed));

/* Realtek packet header. */
struct NICPKYTHEADER
{
    UCHAR  ph_status;     			/* Status, contents of RSR register */
    UCHAR  ph_nextpg;     			/* Page for next packet 			*/
    USHORT ph_size;      			/* Size of header and packet in octets */
}__attribute__((packed));

#endif /* _ethernet_H_ */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
婷婷综合久久一区二区三区| 中文字幕一区二区三区乱码在线| 午夜激情久久久| 欧美日韩国产另类不卡| 亚洲gay无套男同| 日韩一区二区三区视频在线| 精品一区二区免费视频| 亚洲成人精品影院| 欧美一区二区精品久久911| 精品一区二区三区日韩| 国产精品女人毛片| 欧美色偷偷大香| 日韩av不卡在线观看| 久久久精品tv| 色婷婷综合久色| 蜜臀久久99精品久久久久宅男| 精品免费国产一区二区三区四区| 懂色一区二区三区免费观看| 亚洲蜜臀av乱码久久精品| 欧美巨大另类极品videosbest | 日日夜夜精品免费视频| 日韩欧美国产高清| 丁香婷婷综合五月| 亚洲午夜精品久久久久久久久| 欧美一卡二卡三卡| 欧美电影免费观看高清完整版在线观看| 麻豆免费看一区二区三区| 国产欧美一区二区精品性色超碰| 在线视频观看一区| 国产乱一区二区| 亚洲成人精品在线观看| 久久天天做天天爱综合色| 色老综合老女人久久久| 极品少妇xxxx偷拍精品少妇| 亚洲激情中文1区| 久久青草国产手机看片福利盒子 | 久久99精品久久久久久国产越南 | 精品国产精品网麻豆系列| 91亚洲国产成人精品一区二三| 日韩高清在线一区| 亚洲日本va午夜在线电影| 精品99一区二区| 欧美日韩久久久| 成年人国产精品| 经典一区二区三区| 日韩国产欧美在线观看| 亚洲免费看黄网站| 国产欧美一区二区精品婷婷| 欧美一区二区在线观看| 91国偷自产一区二区使用方法| 国产剧情一区二区| 午夜精品久久久久影视| 亚洲美女区一区| 欧美激情一区二区三区在线| 欧美一区二区人人喊爽| 精品视频一区 二区 三区| 99视频一区二区| 国产成人一级电影| 国产又黄又大久久| 美国av一区二区| 欧美午夜精品一区二区三区| 成人av中文字幕| 成人免费观看av| 国产精品白丝av| 国产精品中文字幕欧美| 精品午夜一区二区三区在线观看| 免费在线成人网| 日本亚洲免费观看| 秋霞电影网一区二区| 亚洲成人综合视频| 亚洲国产精品久久久久婷婷884| 亚洲欧美日本韩国| 樱桃国产成人精品视频| 亚洲三级理论片| 亚洲人成7777| 一区二区三区 在线观看视频| 亚洲色图色小说| 亚洲精品国久久99热| 亚洲人成影院在线观看| 亚洲私人影院在线观看| 亚洲精品一二三| 一区二区三区四区中文字幕| 亚洲永久免费av| 日日欢夜夜爽一区| 日本va欧美va瓶| 国产综合成人久久大片91| 国产精品白丝av| 成人黄色一级视频| 91美女在线看| 欧美日韩性生活| 欧美电视剧免费全集观看| 精品国产不卡一区二区三区| 国产午夜精品理论片a级大结局| 日本一区二区三区四区| 国产精品网站一区| 亚洲美女免费视频| 午夜精品久久久久影视| 韩国在线一区二区| 成人午夜视频免费看| 色一区在线观看| 777xxx欧美| 国产日韩精品久久久| 中文字幕在线观看一区| 亚洲亚洲精品在线观看| 免费在线观看一区二区三区| 国产成人av电影在线| 91美女蜜桃在线| 日韩欧美的一区| 中文字幕在线一区| 亚洲在线中文字幕| 精品一区二区免费| 91视频你懂的| 精品美女在线播放| 亚洲视频你懂的| 青青草国产成人av片免费| 成人精品视频网站| 3d成人h动漫网站入口| 2020国产精品自拍| 国产精品家庭影院| 免费人成网站在线观看欧美高清| 国产成人午夜视频| 欧美另类z0zxhd电影| 国产精品国模大尺度视频| 天堂在线亚洲视频| zzijzzij亚洲日本少妇熟睡| 欧美二区在线观看| 国产精品国产三级国产aⅴ原创| 亚洲成人av电影在线| 成人av免费在线| 精品国产乱码久久久久久老虎| 亚洲精品水蜜桃| 成人一区二区在线观看| 日韩欧美在线123| 成人精品视频一区二区三区 | 国产精品无码永久免费888| 午夜精品福利在线| 一本到三区不卡视频| 国产日产欧美一区二区视频| 爽好久久久欧美精品| 色综合久久99| 亚洲国产激情av| 黑人精品欧美一区二区蜜桃 | 欧美一区二区久久| 亚洲国产精品久久艾草纯爱| 91玉足脚交白嫩脚丫在线播放| 26uuu久久天堂性欧美| 日韩成人精品在线观看| 在线一区二区三区做爰视频网站| 国产精品视频免费| 国产一区二区三区高清播放| 欧美一级在线免费| 五月天久久比比资源色| 色噜噜狠狠色综合中国| 国产精品久久777777| 成人精品一区二区三区四区| 久久久.com| 国产一区二区按摩在线观看| 日韩一区二区不卡| 五月综合激情婷婷六月色窝| 欧美中文字幕一二三区视频| 中文字幕亚洲一区二区va在线| 国产成人免费在线视频| 久久九九国产精品| 国产乱子伦一区二区三区国色天香| 日韩视频一区二区三区| 麻豆精品视频在线观看| 日韩欧美高清dvd碟片| 久久精品国产一区二区| 日韩无一区二区| 精品在线一区二区三区| 精品国产一二三| 国产精品1024久久| 欧美激情一区二区三区四区| 成人小视频免费观看| 中文字幕一区在线观看视频| 91在线小视频| 亚洲一区二区3| 91精品国产全国免费观看| 麻豆精品一区二区av白丝在线| 日韩精品一区二区三区中文不卡| 精品中文字幕一区二区小辣椒| 精品99一区二区| www.久久久久久久久| 亚洲美女在线一区| 欧美精品日韩一本| 久久99九九99精品| 国产精品亲子伦对白| 色婷婷亚洲综合| 日韩二区三区四区| 久久久99精品免费观看| 99re这里只有精品6| 亚州成人在线电影| 精品国产成人在线影院| 99麻豆久久久国产精品免费优播| 亚洲伦理在线免费看| 欧美精品xxxxbbbb| 国产高清不卡一区二区| 亚洲美女偷拍久久| 精品国产91洋老外米糕| 成人黄色在线网站|