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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ne.c

?? linux 1.0 源代碼
?? C
字號(hào):
/* ne.c: A general non-shared-memory NS8390 ethernet driver for linux. *//*    Written 1992,1993 by Donald Becker.    Copyright 1993 United States Government as represented by the    Director, National Security Agency.  This software may be used and    distributed according to the terms of the GNU Public License,    incorporated herein by reference.    This driver should work with many 8390-based ethernet boards.  Currently    it support the NE1000, NE2000, clones, and some Cabletron products.    The Author may be reached as becker@super.org or    C/O Supercomputing Research Ctr., 17100 Science Dr., Bowie MD 20715*//* Routines for the NatSemi-based designs (NE[12]000). */static char *version =    "ne.c:v0.99-15k 3/3/94 Donald Becker (becker@super.org)\n";#include <linux/config.h>#include <linux/kernel.h>#include <linux/sched.h>#include <linux/errno.h>#include <asm/system.h>#include <asm/io.h>#include "dev.h"#include "8390.h"#define NE_BASE	 (dev->base_addr)#define NE_CMD	 	0x00#define NE_DATAPORT	0x10	/* NatSemi-defined port window offset. */#define NE_RESET	0x1f	/* Issue a read to reset, a write to clear. */#define NE1SM_START_PG	0x20	/* First page of TX buffer */#define NE1SM_STOP_PG 	0x40	/* Last page +1 of RX ring */#define NESM_START_PG	0x40	/* First page of TX buffer */#define NESM_STOP_PG	0x80	/* Last page +1 of RX ring */int ne_probe(struct device *dev);static int neprobe1(int ioaddr, struct device *dev, int verbose);static void ne_reset_8390(struct device *dev);static int ne_block_input(struct device *dev, int count,			  char *buf, int ring_offset);static void ne_block_output(struct device *dev, const int count,		const unsigned char *buf, const int start_page);/*  Probe for various non-shared-memory ethercards.   NEx000-clone boards have a Station Address PROM (SAPROM) in the packet   buffer memory space.  NE2000 clones have 0x57,0x57 in bytes 0x0e,0x0f of   the SAPROM, while other supposed NE2000 clones must be detected by their   SA prefix.   Reading the SAPROM from a word-wide card with the 8390 set in byte-wide   mode results in doubled values, which can be detected and compansated for.   The probe is also responsible for initializing the card and filling   in the 'dev' and 'ei_status' structures.   We use the minimum memory size for some ethercard product lines, iff we can't   distinguish models.  You can increase the packet buffer size by setting   PACKETBUF_MEMSIZE.  Reported Cabletron packet buffer locations are:	E1010   starts at 0x100 and ends at 0x2000.	E1010-x starts at 0x100 and ends at 0x8000. ("-x" means "more memory")	E2010	 starts at 0x100 and ends at 0x4000.	E2010-x starts at 0x100 and ends at 0xffff.  */int ne_probe(struct device *dev){    int *port, ports[] = {0x300, 0x280, 0x320, 0x340, 0x360, 0};    short ioaddr = dev->base_addr;    if (ioaddr < 0)	return ENXIO;		/* Don't probe at all. */    if (ioaddr > 0x100)	return ! neprobe1(ioaddr, dev, 1);    for (port = &ports[0]; *port; port++) {#ifdef HAVE_PORTRESERVE	if (check_region(*port, 32))	    continue;#endif	if (inb_p(*port) != 0xff && neprobe1(*port, dev, 0)) {	    dev->base_addr = *port;	    return 0;	}    }    dev->base_addr = ioaddr;    return ENODEV;}static int neprobe1(int ioaddr, struct device *dev, int verbose){    int i;    unsigned char SA_prom[32];    int wordlength = 2;    char *name;    int start_page, stop_page;    int neX000, ctron, dlink, dfi;    int reg0 = inb(ioaddr);    if ( reg0 == 0xFF)	return 0;    /* Do a quick preliminary check that we have a 8390. */    {	int regd;	outb_p(E8390_NODMA+E8390_PAGE1+E8390_STOP, ioaddr + E8390_CMD);	regd = inb_p(ioaddr + 0x0d);	outb_p(0xff, ioaddr + 0x0d);	outb_p(E8390_NODMA+E8390_PAGE0, ioaddr + E8390_CMD);	inb_p(ioaddr + EN0_COUNTER0); /* Clear the counter by reading. */	if (inb_p(ioaddr + EN0_COUNTER0) != 0) {	    outb_p(reg0, ioaddr);	    outb(regd, ioaddr + 0x0d);	/* Restore the old values. */	    return 0;	}    }    printk("NE*000 ethercard probe at %#3x:", ioaddr);    /* Read the 16 bytes of station address prom, returning 1 for       an eight-bit interface and 2 for a 16-bit interface.       We must first initialize registers, similar to NS8390_init(eifdev, 0).       We can't reliably read the SAPROM address without this.       (I learned the hard way!). */    {	struct {unsigned char value, offset; } program_seq[] = {	    {E8390_NODMA+E8390_PAGE0+E8390_STOP, E8390_CMD}, /* Select page 0*/	    {0x48,	EN0_DCFG},	/* Set byte-wide (0x48) access. */	    {0x00,	EN0_RCNTLO},	/* Clear the count regs. */	    {0x00,	EN0_RCNTHI},	    {0x00,	EN0_IMR},	/* Mask completion irq. */	    {0xFF,	EN0_ISR},	    {E8390_RXOFF, EN0_RXCR},	/* 0x20  Set to monitor */	    {E8390_TXOFF, EN0_TXCR},	/* 0x02  and loopback mode. */	    {32,	EN0_RCNTLO},	    {0x00,	EN0_RCNTHI},	    {0x00,	EN0_RSARLO},	/* DMA starting at 0x0000. */	    {0x00,	EN0_RSARHI},	    {E8390_RREAD+E8390_START, E8390_CMD},	};	for (i = 0; i < sizeof(program_seq)/sizeof(program_seq[0]); i++)	    outb_p(program_seq[i].value, ioaddr + program_seq[i].offset);    }    for(i = 0; i < 32 /*sizeof(SA_prom)*/; i+=2) {	SA_prom[i] = inb(ioaddr + NE_DATAPORT);	SA_prom[i+1] = inb(ioaddr + NE_DATAPORT);	if (SA_prom[i] != SA_prom[i+1])	    wordlength = 1;    }    if (wordlength == 2) {	/* We must set the 8390 for word mode. */	outb_p(0x49, ioaddr + EN0_DCFG);	/* We used to reset the ethercard here, but it doesn't seem	   to be necessary. */	/* Un-double the SA_prom values. */	for (i = 0; i < 16; i++)	    SA_prom[i] = SA_prom[i+i];    }#if defined(show_all_SAPROM)    /* If your ethercard isn't detected define this to see the SA_PROM. */    for(i = 0; i < sizeof(SA_prom); i++)	printk(" %2.2x", SA_prom[i]);#else    for(i = 0; i < ETHER_ADDR_LEN; i++) {	dev->dev_addr[i] = SA_prom[i];	printk(" %2.2x", SA_prom[i]);    }#endif    neX000 = (SA_prom[14] == 0x57  &&  SA_prom[15] == 0x57);    ctron =  (SA_prom[0] == 0x00 && SA_prom[1] == 0x00 && SA_prom[2] == 0x1d);    dlink =  (SA_prom[0] == 0x00 && SA_prom[1] == 0xDE && SA_prom[2] == 0x01);    dfi   =  (SA_prom[0] == 'D' && SA_prom[1] == 'F' && SA_prom[2] == 'I');    /* Set up the rest of the parameters. */    if (neX000 || dlink || dfi) {	if (wordlength == 2) {	    name = dlink ? "DE200" : "NE2000";	    start_page = NESM_START_PG;	    stop_page = NESM_STOP_PG;	} else {	    name = dlink ? "DE100" : "NE1000";	    start_page = NE1SM_START_PG;	    stop_page = NE1SM_STOP_PG;	}    } else if (ctron) {	name = "Cabletron";	start_page = 0x01;	stop_page = (wordlength == 2) ? 0x40 : 0x20;    } else {	printk(" not found.\n");	return 0;    }    if (dev->irq < 2) {	autoirq_setup(0);	outb_p(0x50, ioaddr + EN0_IMR);	/* Enable one interrupt. */	outb_p(0x00, ioaddr + EN0_RCNTLO);	outb_p(0x00, ioaddr + EN0_RCNTHI);	outb_p(E8390_RREAD+E8390_START, ioaddr); /* Trigger it... */	outb_p(0x00, ioaddr + EN0_IMR); 		/* Mask it again. */	dev->irq = autoirq_report(0);	if (ei_debug > 2)	    printk(" autoirq is %d", dev->irq);    } else if (dev->irq == 2)	/* Fixup for users that don't know that IRQ 2 is really IRQ 9,	   or don't know which one to set. */	dev->irq = 9;        /* Snarf the interrupt now.  There's no point in waiting since we cannot       share and the board will usually be enabled. */    {	int irqval = irqaction (dev->irq, &ei_sigaction);	if (irqval) {	    printk (" unable to get IRQ %d (irqval=%d).\n", dev->irq, irqval);	    return 0;	}    }    dev->base_addr = ioaddr;#ifdef HAVE_PORTRESERVE    snarf_region(ioaddr, 32);#endif    ethdev_init(dev);    printk("\n%s: %s found at %#x, using IRQ %d.\n",	   dev->name, name, ioaddr, dev->irq);    if (ei_debug > 0)	printk(version);    ei_status.name = name;    ei_status.tx_start_page = start_page;    ei_status.stop_page = stop_page;    ei_status.word16 = (wordlength == 2);    ei_status.rx_start_page = start_page + TX_PAGES;#ifdef PACKETBUF_MEMSIZE    /* Allow the packet buffer size to be overridden by know-it-alls. */    ei_status.stop_page = ei_status.tx_start_page + PACKETBUF_MEMSIZE;#endif    ei_status.reset_8390 = &ne_reset_8390;    ei_status.block_input = &ne_block_input;    ei_status.block_output = &ne_block_output;    NS8390_init(dev, 0);    return dev->base_addr;}/* Hard reset the card.  This used to pause for the same period that a   8390 reset command required, but that shouldn't be necessary. */static voidne_reset_8390(struct device *dev){    int tmp = inb_p(NE_BASE + NE_RESET);    int reset_start_time = jiffies;    if (ei_debug > 1) printk("resetting the 8390 t=%ld...", jiffies);    ei_status.txing = 0;    outb_p(tmp, NE_BASE + NE_RESET);    /* This check _should_not_ be necessary, omit eventually. */    while ((inb_p(NE_BASE+EN0_ISR) & ENISR_RESET) == 0)	if (jiffies - reset_start_time > 2) {	    printk("%s: ne_reset_8390() did not complete.\n", dev->name);	    break;	}}/* Block input and output, similar to the Crynwr packet driver.  If you   porting to a new ethercard look at the packet driver source for hints.   The NEx000 doesn't share it on-board packet memory -- you have to put   the packet out through the "remote DMA" dataport using outb. */static intne_block_input(struct device *dev, int count, char *buf, int ring_offset){    int xfer_count = count;    int nic_base = dev->base_addr;    if (ei_status.dmaing) {	if (ei_debug > 0)	    printk("%s: DMAing conflict in ne_block_input."		   "[DMAstat:%1x][irqlock:%1x]\n",		   dev->name, ei_status.dmaing, ei_status.irqlock);	return 0;    }    ei_status.dmaing |= 0x01;    outb_p(E8390_NODMA+E8390_PAGE0+E8390_START, nic_base+ NE_CMD);    outb_p(count & 0xff, nic_base + EN0_RCNTLO);    outb_p(count >> 8, nic_base + EN0_RCNTHI);    outb_p(ring_offset & 0xff, nic_base + EN0_RSARLO);    outb_p(ring_offset >> 8, nic_base + EN0_RSARHI);    outb_p(E8390_RREAD+E8390_START, nic_base + NE_CMD);    if (ei_status.word16) {      insw(NE_BASE + NE_DATAPORT,buf,count>>1);      if (count & 0x01)	buf[count-1] = inb(NE_BASE + NE_DATAPORT), xfer_count++;    } else {	insb(NE_BASE + NE_DATAPORT, buf, count);    }    /* This was for the ALPHA version only, but enough people have       encountering problems that it is still here.  If you see       this message you either 1) have an slightly imcompatible clone       or 2) have noise/speed problems with your bus. */    if (ei_debug > 1) {		/* DMA termination address check... */	int addr, tries = 20;	do {	    /* DON'T check for 'inb_p(EN0_ISR) & ENISR_RDC' here	       -- it's broken! Check the "DMA" address instead. */	    int high = inb_p(nic_base + EN0_RSARHI);	    int low = inb_p(nic_base + EN0_RSARLO);	    addr = (high << 8) + low;	    if (((ring_offset + xfer_count) & 0xff) == low)		break;	} while (--tries > 0);	if (tries <= 0)	    printk("%s: RX transfer address mismatch,"		   "%#4.4x (expected) vs. %#4.4x (actual).\n",		   dev->name, ring_offset + xfer_count, addr);    }    ei_status.dmaing &= ~0x01;    return ring_offset + count;}static voidne_block_output(struct device *dev, int count,		const unsigned char *buf, const int start_page){    int retries = 0;    int nic_base = NE_BASE;    /* Round the count up for word writes.  Do we need to do this?       What effect will an odd byte count have on the 8390?       I should check someday. */    if (ei_status.word16 && (count & 0x01))      count++;    if (ei_status.dmaing) {	if (ei_debug > 0)	    printk("%s: DMAing conflict in ne_block_output."		   "[DMAstat:%1x][irqlock:%1x]\n",		   dev->name, ei_status.dmaing, ei_status.irqlock);	return;    }    ei_status.dmaing |= 0x02;    /* We should already be in page 0, but to be safe... */    outb_p(E8390_PAGE0+E8390_START+E8390_NODMA, nic_base + NE_CMD); retry:#if defined(rw_bugfix)    /* Handle the read-before-write bug the same way as the       Crynwr packet driver -- the NatSemi method doesn't work.       Actually this doesn't aways work either, but if you have       problems with your NEx000 this is better than nothing! */    outb_p(0x42, nic_base + EN0_RCNTLO);    outb_p(0x00,   nic_base + EN0_RCNTHI);    outb_p(0x42, nic_base + EN0_RSARLO);    outb_p(0x00, nic_base + EN0_RSARHI);    outb_p(E8390_RREAD+E8390_START, nic_base + NE_CMD);    /* Make certain that the dummy read has occured. */    SLOW_DOWN_IO;    SLOW_DOWN_IO;    SLOW_DOWN_IO;#endif  /* rw_bugfix */    /* Now the normal output. */    outb_p(count & 0xff, nic_base + EN0_RCNTLO);    outb_p(count >> 8,   nic_base + EN0_RCNTHI);    outb_p(0x00, nic_base + EN0_RSARLO);    outb_p(start_page, nic_base + EN0_RSARHI);    outb_p(E8390_RWRITE+E8390_START, nic_base + NE_CMD);    if (ei_status.word16) {	outsw(NE_BASE + NE_DATAPORT, buf, count>>1);    } else {	outsb(NE_BASE + NE_DATAPORT, buf, count);    }    /* This was for the ALPHA version only, but enough people have       encountering problems that it is still here. */    if (ei_debug > 1) {		/* DMA termination address check... */	int addr, tries = 20;	do {	    /* DON'T check for 'inb_p(EN0_ISR) & ENISR_RDC' here	       -- it's broken! Check the "DMA" address instead. */	    int high = inb_p(nic_base + EN0_RSARHI);	    int low = inb_p(nic_base + EN0_RSARLO);	    addr = (high << 8) + low;	    if ((start_page << 8) + count == addr)		break;	} while (--tries > 0);	if (tries <= 0) {	    printk("%s: Tx packet transfer address mismatch,"		   "%#4.4x (expected) vs. %#4.4x (actual).\n",		   dev->name, (start_page << 8) + count, addr);	    if (retries++ == 0)		goto retry;	}    }    ei_status.dmaing &= ~0x02;    return;}/* * Local variables: *  compile-command: "gcc -DKERNEL -Wall -O6 -fomit-frame-pointer -I/usr/src/linux/net/tcp -c ne.c" *  version-control: t *  kept-new-versions: 5 * End: */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品美女久久久久aⅴ| 亚洲天堂av老司机| 97se亚洲国产综合自在线观| 国产高清在线精品| 一区二区在线观看不卡| 欧美精品一区二区三区视频| 色老汉一区二区三区| 国产一区二区三区| 亚洲成av人在线观看| 国产精品伦一区| 欧美大片一区二区| 欧美性一区二区| 成人免费看视频| 极品美女销魂一区二区三区| 亚洲一级电影视频| 中文字幕一区二区三区不卡| www精品美女久久久tv| 欧美妇女性影城| 色香蕉久久蜜桃| 成人av在线看| 国产精品一区二区在线播放| 日韩国产在线观看一区| 亚洲男同1069视频| 欧美一区二区福利在线| 成人国产一区二区三区精品| 久久精品国产秦先生| 天天色 色综合| 一区二区三区精品视频在线| 日本一区二区久久| 久久综合久久鬼色| 日韩欧美www| 欧美一区二区三区公司| 欧美男人的天堂一二区| 在线观看视频一区二区 | 国产综合色在线| 免费成人美女在线观看| 日韩国产一区二| 亚洲午夜在线观看视频在线| 亚洲黄色av一区| 一区二区三区四区在线| 一区二区三区日韩欧美| 亚洲精品一二三| 一区二区三区中文在线| 亚洲一区二区三区中文字幕| 亚洲妇熟xx妇色黄| 午夜一区二区三区在线观看| 性久久久久久久久久久久| 午夜久久久久久久久久一区二区| 亚洲一区二区三区激情| 婷婷六月综合亚洲| 蜜桃久久久久久久| 久久精品国产免费| 国产一区二区在线免费观看| 国产精品18久久久久久vr| 国产成人av电影在线播放| 不卡的看片网站| 99re热视频精品| 欧美亚洲综合色| 7777精品伊人久久久大香线蕉的| 欧美一区二区三区白人| 精品国产露脸精彩对白| 日本一区二区三区国色天香| 中文字幕永久在线不卡| 一区二区三区国产精品| 日本一区中文字幕 | 色综合久久综合网欧美综合网| 色欲综合视频天天天| 欧美欧美欧美欧美首页| 久久久噜噜噜久久中文字幕色伊伊| 国产午夜亚洲精品理论片色戒 | 亚洲男人的天堂一区二区 | 成人精品一区二区三区四区| 色综合欧美在线视频区| 这里是久久伊人| 精品久久久久久久久久久久包黑料| 久久久久久免费毛片精品| 亚洲少妇30p| 蜜臀va亚洲va欧美va天堂| 成人污污视频在线观看| 欧美视频在线播放| 国产亚洲一区字幕| 一区二区免费视频| 狠狠v欧美v日韩v亚洲ⅴ| 99精品欧美一区二区三区小说 | 欧美老肥妇做.爰bbww视频| 久久日韩精品一区二区五区| 国产精品电影一区二区三区| 亚洲va欧美va人人爽| 久草中文综合在线| 色噜噜夜夜夜综合网| 日韩亚洲欧美在线观看| 中文字幕一区二区三区在线播放 | 日本欧美一区二区在线观看| 丁香婷婷深情五月亚洲| 欧美一区二区三区在线看| 欧美韩国日本综合| 蜜桃一区二区三区四区| 在线观看91视频| 国产日本一区二区| 日韩综合在线视频| caoporn国产一区二区| 日韩精品中文字幕一区二区三区| 亚洲免费观看高清完整| 国产精品羞羞答答xxdd| 欧美久久久久久久久| 成人欧美一区二区三区小说 | 在线播放日韩导航| 亚洲色欲色欲www| 国产精品99久久不卡二区| 欧美日韩精品电影| 亚洲欧美区自拍先锋| 国产专区欧美精品| 欧美一区二区视频免费观看| 亚洲高清视频的网址| 91婷婷韩国欧美一区二区| 精品国产免费久久| 免费观看在线综合色| 在线影院国内精品| 国产精品久久久久久久久动漫| 国产在线乱码一区二区三区| 7878成人国产在线观看| 一区二区三区久久| 91猫先生在线| 日韩毛片一二三区| 成人av电影免费在线播放| 久久久亚洲精品一区二区三区| 日本特黄久久久高潮| 欧美日韩免费观看一区二区三区 | 国产欧美精品区一区二区三区 | 丁香啪啪综合成人亚洲小说| 久久免费看少妇高潮| 老司机精品视频线观看86| 91精品国产色综合久久不卡电影 | 成人av第一页| 中文字幕亚洲区| 91老司机福利 在线| 亚洲三级视频在线观看| 91香蕉视频在线| 亚洲精品国产无天堂网2021| 91丨九色丨蝌蚪丨老版| 亚洲色图丝袜美腿| 色婷婷精品久久二区二区蜜臂av| 亚洲精品成人少妇| 欧美亚洲动漫精品| 午夜国产精品影院在线观看| 欧美日韩一卡二卡| 日韩黄色小视频| 日韩精品一区二区三区中文精品| 久久机这里只有精品| 精品日韩在线观看| 精品一区二区国语对白| 久久久久久久久97黄色工厂| 国产盗摄女厕一区二区三区 | 老司机精品视频一区二区三区| 精品国产一区a| 风间由美性色一区二区三区| 亚洲欧美国产77777| 欧美日韩一区二区三区在线看| 日本三级亚洲精品| 久久夜色精品一区| 国产91精品精华液一区二区三区| 国产精品久久久久天堂| 91福利视频网站| 美腿丝袜在线亚洲一区| 国产片一区二区| 色综合亚洲欧洲| 奇米四色…亚洲| 国产午夜久久久久| 91久久久免费一区二区| 视频一区在线播放| 国产日韩欧美a| 色狠狠色狠狠综合| 另类中文字幕网| 亚洲国产经典视频| 精品视频在线免费看| 精品影院一区二区久久久| 日本一区二区久久| 欧美日韩高清一区二区| 精品一区二区免费看| 成人免费在线视频| 欧美一区二区精品久久911| 成人一区二区三区在线观看 | 婷婷综合五月天| 国产欧美综合在线观看第十页| 日本高清不卡在线观看| 久久国产三级精品| 中文字幕一区二区三区色视频| 9191久久久久久久久久久| 福利电影一区二区三区| 午夜精品福利久久久| 国产欧美日韩视频在线观看| 欧美日韩国产天堂| 国产91精品免费| 免费亚洲电影在线| 国产精品国产三级国产a| 欧美一卡2卡三卡4卡5免费| 91在线观看污| 国产一区在线精品| 日韩不卡手机在线v区| 亚洲日本在线a|