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

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

?? ne2kif.c

?? 前段時間把lwip和ucos移植在44b0平臺上,用的是hfrk44b0開發板.已經調試通過,并且在板子上運行正常.
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* * Copyright (c) 2001-2004 Swedish Institute of Computer Science. * All rights reserved.  *  * Redistribution and use in source and binary forms, with or without modification,  * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, *    this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, *    this list of conditions and the following disclaimer in the documentation *    and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products *    derived from this software without specific prior written permission.  * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT  * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY  * OF SUCH DAMAGE. * * This file is part of the lwIP TCP/IP stack. *  * Author: Adam Dunkels <adam@sics.se> * *//* * This file is a skeleton for developing Ethernet network interface * drivers for lwIP. Add code to the low_level functions and do a * search-and-replace for the word "ethernetif" to replace it with * something that better describes your network interface. *//* * modified by hugang <hgxxx@51eda.com> * date : 2004-07-02 */ #include "lwip/opt.h"#include "lwip/def.h"#include "lwip/mem.h"#include "lwip/pbuf.h"#include "lwip/sys.h"#include "lwip/stats.h"#include "lwip/err.h"#include "lwip/debug.h"#include "netif/etharp.h"#include "ne2kif.h"#include "string.h"#include "inc/44b.h"#include "inc/44blib.h"/* Define those to better describe your network interface. */#define IFNAME0 'e'#define IFNAME1 'n'struct ethernetif {  struct eth_addr *ethaddr;  /* Add whatever per-interface state that is needed here. */};static const struct eth_addr ethbroadcast = {{0xff,0xff,0xff,0xff,0xff,0xff}};extern struct netif *rtl8019_netif;static void ethernetif_input(struct netif *netif);static err_t ethernetif_output(struct netif *netif, struct pbuf *p, struct ip_addr *ipaddr);/* * Read the specified number of bytes from the device DMA port into * the supplied buffer. */static void ne2k_copyin(u16_t len, u8_t *buf){  u16_t count;  u16_t *dataw;	  count = NE_WORDMODE ? len >> 1 : len;	#if NE_WORDMODE  dataw = (unsigned short *)buf;				// Use pointer for speed   while(count--)                      		// Get words     *dataw++ = NE_DATAW;  if (len & 0x01)                        		// If odd length, do last byte     *(unsigned char *)dataw = NE_DATAB;#else  while(count--)                      		// Get bytes     *buf++ = NE_DATAB;#endif}/* * Write the specified number of bytes from the device DMA port into * the supplied buffer. */ static void ne2k_copyout(u16_t len, u8_t *buf){  u16_t count;	  count = NE_WORDMODE ? len >> 1 : len;	#if NE_WORDMODE                   	// Word transfer?  if((u32_t)buf & 0x01)  {								/* 若為奇數地址則按字節讀取*/    while(count--) {      NE_DATAW = (*buf) | ((u16_t)*(buf + 1)) << 8;      buf += 2;    }    if (len & 0x01)         	/* If odd length, do last byte */      NE_DATAW = *buf;  }  else  {								/* 若為偶數地址則按半字讀取 */    u16_t *dataw;    dataw = (u16_t *)buf;    while(count--)      NE_DATAW = *dataw++;    if (len & 0x01)            	/* If odd length, do last byte */      NE_DATAW = *(u8_t *)dataw;  }#else  while(count--)           NE_DATAB = *buf++;#endif	}static void ne2k_outpad(u16_t len){  u16_t count;	  count = NE_WORDMODE ? len >> 1 : len;	#if NE_WORDMODE                			/* Word transfer? */  while(count--)    NE_DATAW = 0;#else  while(count--)                  	/* O/P bytes */    NE_DATAB = 0;#endif	}/* * Pull the specified number of bytes from the device DMA port, * and throw them away. */static void ne2k_discard(u16_t len){  u8_t tmp;  u16_t tmpw;  u16_t count;	  count = NE_WORDMODE ? len >> 1 : len;#if NE_WORDMODE  while(count--)                      		    tmpw = NE_DATAW;  if (len & 0x01)                        		    tmp = NE_DATAB;#else  while(count--)                      	    tmp = NE_DATAB;#endif}/* void NICISR(void) interrupt */void ne2k_isr(void){  u8_t  isr,curr,bnry;  rI_ISPC = BIT_EINT3;  rINTMSK = rINTMSK | BIT_EINT3;  /* close nic */  NE_CR = ENCR_PAGE0 | ENCR_NODMA | ENCR_STOP;  isr = NE_ISR;  if (isr & ENISR_OVER) {    NE_ISR = ENISR_OVER;				  }	  if (isr & ENISR_TX_ERR) {    NE_ISR = ENISR_TX_ERR;				  }  /* Rx error , reset BNRY pointer to CURR (use SEND PACKET mode) */  if (isr & ENISR_RX_ERR) {    NE_ISR = ENISR_RX_ERR;		    NE_CR = ENCR_PAGE1 | ENCR_NODMA | ENCR_STOP;    curr = NE_CURR;    NE_CR = ENCR_PAGE0 | ENCR_NODMA | ENCR_STOP;    NE_BNRY = curr;  }	  /* got packet with no errors */  if (isr & ENISR_RX) {    NE_ISR = ENISR_RX;    NE_CR = ENCR_PAGE1 | ENCR_NODMA | ENCR_STOP;    curr  = NE_CURR;    NE_CR = ENCR_PAGE0 | ENCR_NODMA | ENCR_STOP;    bnry = NE_BNRY;    /* get more than one packet until receive buffer is empty */    while(curr != bnry) {	  ethernetif_input(rtl8019_netif);      NE_CR = ENCR_PAGE1 | ENCR_NODMA | ENCR_STOP;      curr =  NE_CURR;      NE_CR = ENCR_PAGE0 | ENCR_NODMA | ENCR_STOP;      bnry = NE_BNRY;			    }  }		  /* Transfer complelte, do nothing here */  if( isr & ENISR_TX) {    NE_ISR = ENISR_TX;  }		  NE_CR = ENCR_PAGE0 | ENCR_NODMA | ENCR_STOP;  NE_ISR = 0xff;	  /* open nic for next packet */  NE_CR = ENCR_PAGE0 | ENCR_NODMA | ENCR_START;  rINTMSK = rINTMSK & (~BIT_EINT3);	}static voidlow_level_init(struct netif *netif){  struct ethernetif *ethernetif;  u8_t mac_addr[6];  u8_t temp;	  mac_addr[0] = 0;  mac_addr[1] = 1;  mac_addr[2] = 2;  mac_addr[3] = 3;  mac_addr[4] = 4;  mac_addr[5] = 5;  ethernetif = netif->state;    /* set MAC hardware address length */  netif->hwaddr_len = 6;  /* set MAC hardware address */  netif->hwaddr[0] = mac_addr[0];  netif->hwaddr[1] = mac_addr[1];  netif->hwaddr[2] = mac_addr[2];  netif->hwaddr[3] = mac_addr[3];  netif->hwaddr[4] = mac_addr[4];                  netif->hwaddr[5] = mac_addr[5];                       /* maximum transfer unit */  netif->mtu = 1500;     /* broadcast capability */  netif->flags = NETIF_FLAG_BROADCAST;   /* Do whatever else is needed to initialize interface. */    NE_CR = ENCR_PAGE0 + ENCR_NODMA + ENCR_START;  Delay(100);		  rPCONC |= 0x10000000;  #if NE_WORDMODE	rPDATC |= 0x4000;  #else	rPDATC &= 0xbfff;  #endif	  Delay(500);  temp = NE_RESET;  NE_RESET = temp;  Delay(500);  rPDATC &= 0xbfff;  rPCONC &= 0xcfffffff;  NE_CR = ENCR_PAGE0 + ENCR_NODMA + ENCR_STOP;  Delay(100);    NE_DCR 	= NE_DCRVAL;  NE_RBCR0 	= 0x00; 				/* MSB remote byte count reg */  NE_RBCR1 	= 0x00; 				/* LSB remote byte count reg */  NE_RCR 	= ENRCR_RXOFF; 			/* RX configuration reg    Monitor mode (no packet receive) */  NE_TCR 	= ENTCR_TXOFF; 			/* TX configuration reg    set internal loopback mode  */  NE_TPSR   = TX_START_PG;  NE_PSTART = RX_START_PG ; 		/* DMA START PAGE 46h */   NE_PSTOP  = RX_STOP_PG;    		/* Ending page +1 of ring buffer */  NE_BNRY 	= RX_START_PG;			/* Boundary page of ring buffer */  NE_ISR    = 0xff; 				/* INTerrupt stauts reg */  NE_IMR    = ENIMR_RX | ENIMR_RX_ERR | ENIMR_TX | ENIMR_TX_ERR;		//hgxxx 2003-10-11 add  NE_CR = ENCR_PAGE1 + ENCR_NODMA + ENCR_STOP;  Delay(100);	  NE_PAR0 = mac_addr[0];  NE_PAR1 = mac_addr[1];  NE_PAR2 = mac_addr[2];  NE_PAR3 = mac_addr[3];  NE_PAR4 = mac_addr[4];  NE_PAR5 = mac_addr[5];  NE_MAR0 	= 0xff;    NE_MAR1 	= 0xff;  NE_MAR2 	= 0xff;  NE_MAR3 	= 0xff;  NE_MAR4 	= 0xff;  NE_MAR5 	= 0xff;  NE_MAR6 	= 0xff;  NE_MAR7 	= 0xff;  NE_CURR 	= RX_START_PG; 		/* RX_CURR_PG; Current memory page = RX_CURR_PG  ? */    NE_CR = ENCR_PAGE0 + ENCR_NODMA ;  	/* 00001010B: PS1 PS0 RD2 RD1 RD0 TXP STA STP */  Delay(100);  NE_RCR 		= ENRCR_RXCONFIG;   	/* rx on(broadcasts, no multicast,errors   04*/  NE_TCR 		= ENTCR_TXCONFIG; 		/* xmit on. */  NE_ISR 		= 0xff; 	 			/* Individual bits are cleared by writing a "1" into it. */  NE_IMR 		= ENISR_ALL; 			/* INTerrupt mask reg */      NE_CR = ENCR_PAGE0 + ENCR_NODMA + ENCR_START;  }/* * low_level_output(): * * Should do the actual transmission of the packet. The packet is * contained in the pbuf that is passed to the function. This pbuf

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲自拍偷拍九九九| 91精品国产美女浴室洗澡无遮挡| 欧美精品免费视频| www.亚洲在线| 国产一区二区导航在线播放| 午夜天堂影视香蕉久久| 国产精品理论在线观看| 亚洲精品一区二区三区精华液| 欧洲一区二区av| 成人国产在线观看| 国产成人在线网站| 国产一区二区三区日韩| 首页综合国产亚洲丝袜| 亚洲综合免费观看高清完整版在线 | 美洲天堂一区二卡三卡四卡视频 | 亚洲乱码中文字幕| 久久精品视频免费| 久久亚洲一区二区三区明星换脸 | 精品剧情在线观看| 91精品国产综合久久久久| 欧美日韩综合一区| 97se亚洲国产综合自在线不卡| 福利一区在线观看| 成人永久免费视频| 国产精品88888| 成人av手机在线观看| 风间由美一区二区三区在线观看| 国产精品综合久久| 国产91精品一区二区| 午夜精品成人在线视频| 视频在线在亚洲| 麻豆精品一二三| 国产一区二区精品久久99| 国产专区综合网| 激情综合色播五月| 粗大黑人巨茎大战欧美成人| 91在线观看下载| 日韩午夜激情视频| 亚洲你懂的在线视频| 国内精品写真在线观看| 99re这里只有精品6| 欧美一激情一区二区三区| 国产精品传媒入口麻豆| 日韩精品午夜视频| 色婷婷香蕉在线一区二区| 久久综合久色欧美综合狠狠| 亚洲一区在线观看视频| 国产精品一品视频| 日韩午夜在线播放| 亚洲一级片在线观看| 成人三级在线视频| 精品不卡在线视频| 五月天久久比比资源色| 99国产精品国产精品久久| 久久久三级国产网站| 日韩精彩视频在线观看| 日本道在线观看一区二区| 久久久久97国产精华液好用吗| 午夜精品福利视频网站| 色先锋资源久久综合| 亚洲国产经典视频| 国产精品中文字幕一区二区三区| 欧美老肥妇做.爰bbww| 亚洲老妇xxxxxx| 成人黄色a**站在线观看| 久久综合久久综合九色| 久久99久久久欧美国产| 欧美丰满高潮xxxx喷水动漫| 亚洲综合偷拍欧美一区色| av一区二区三区| 国产精品你懂的在线| 国产成人精品免费网站| 久久伊人中文字幕| 韩国三级中文字幕hd久久精品| 欧美丰满美乳xxx高潮www| 亚洲成人免费av| 欧美日韩综合色| 香蕉影视欧美成人| 欧美日韩精品三区| 琪琪一区二区三区| 欧美大片在线观看| 国产乱一区二区| 国产精品无码永久免费888| 成人av一区二区三区| 亚洲男人的天堂网| 日本电影欧美片| 丝袜美腿亚洲一区| 91精品欧美一区二区三区综合在| 日韩制服丝袜先锋影音| 日韩一区二区三区观看| 国产一区二区三区四| 国产精品传媒入口麻豆| 欧洲av一区二区嗯嗯嗯啊| 婷婷亚洲久悠悠色悠在线播放| 日韩欧美国产1| 国产91精品在线观看| 一区二区三区中文字幕精品精品 | 精品一区二区三区免费视频| 久久久久久久免费视频了| 成人免费毛片a| 亚洲综合一二三区| 欧美电视剧在线看免费| 成人高清在线视频| 亚洲成人激情自拍| 久久无码av三级| 一本色道久久综合亚洲aⅴ蜜桃 | 色综合天天综合网国产成人综合天 | 日韩一区二区三区三四区视频在线观看| 美女精品自拍一二三四| 久久久久久久久伊人| 91搞黄在线观看| 国产在线精品一区二区不卡了| 国产精品第四页| 日韩欧美中文字幕公布| 99久久久精品| 麻豆成人久久精品二区三区小说| ●精品国产综合乱码久久久久| 欧美精三区欧美精三区| 国产成人免费视频网站| 日韩精品乱码免费| 国产精品久久久久久久久免费樱桃| 欧美色精品天天在线观看视频| 欧美日韩三级一区| 亚洲另类春色国产| 精品久久人人做人人爰| 91丨porny丨国产| 精品中文av资源站在线观看| 亚洲激情自拍偷拍| 国产午夜精品福利| 欧美久久高跟鞋激| 99免费精品视频| 国产成人精品一区二| 天天av天天翘天天综合网| 日韩美女视频19| 日本一区二区免费在线| 日韩欧美久久久| 欧美日韩电影一区| 色欧美片视频在线观看| 国产成人精品免费看| 捆绑紧缚一区二区三区视频 | 色悠悠久久综合| 国产精品88av| 国产福利一区二区三区视频在线 | 亚洲国产电影在线观看| 中文在线资源观看网站视频免费不卡 | 国产一区二区三区免费看| 石原莉奈在线亚洲二区| 亚洲另类一区二区| 一区二区三区中文在线观看| 亚洲欧洲制服丝袜| 亚洲欧美一区二区久久| 中文字幕中文字幕在线一区 | 美女诱惑一区二区| 日韩激情中文字幕| 日产精品久久久久久久性色| 五月天一区二区| 日韩精品视频网| 美女视频黄 久久| 久久99国产精品免费| 寂寞少妇一区二区三区| 国产制服丝袜一区| 岛国av在线一区| 99国内精品久久| 精品视频全国免费看| 在线播放视频一区| 欧美va亚洲va国产综合| 精品国产91洋老外米糕| 国产亲近乱来精品视频| 国产精品久久久久久久第一福利 | 一区二区不卡在线播放| 亚洲二区在线观看| 午夜精品久久久久久久久| 久久精品国产精品青草| 国产一区二区三区| 色综合久久综合中文综合网| 欧美日韩精品专区| 日韩精品一区二区三区四区 | 91美女在线观看| 色琪琪一区二区三区亚洲区| 欧美一区永久视频免费观看| 欧美精品一区二区三| 1024亚洲合集| 日韩电影免费在线看| 国产一区不卡精品| 欧美色精品天天在线观看视频| 欧美va日韩va| 全部av―极品视觉盛宴亚洲| 国产麻豆日韩欧美久久| 在线免费观看不卡av| 日韩无一区二区| 国产精品大尺度| 美女视频黄 久久| 91丨九色porny丨蝌蚪| 91精品国产乱| 自拍偷拍亚洲激情| 精品一区二区三区av| 欧美日韩精品欧美日韩精品 | 亚洲欧洲成人av每日更新| 婷婷亚洲久悠悠色悠在线播放| 成人免费观看视频|