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

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

?? hp.c

?? <Linux1.0核心游記>電子書+書后源碼+Linux1.0源碼
?? C
字號:
/* hp.c: A HP LAN ethernet driver for linux. *//*	Written 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 is a driver for the HP LAN adaptors.	The Author may be reached as becker@super.org or	C/O Supercomputing Research Ctr., 17100 Science Dr., Bowie MD 20715*/static char *version =	"hp.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 <linux/ioport.h>#include <asm/system.h>#include <asm/io.h>#include "dev.h"#include "8390.h"#ifndef HAVE_PORTRESERVE#define check_region(ioaddr, size)				0#define snarf_region(ioaddr, size);				do ; while (0)#endif#define HP_IO_EXTENT	32#define HP_DATAPORT		0x0c	/* "Remote DMA" data port. */#define HP_ID			0x07#define HP_CONFIGURE	0x08	/* Configuration register. */#define	 HP_RUN			0x01	/* 1 == Run, 0 == reset. */#define	 HP_IRQ			0x0E	/* Mask for software-configured IRQ line. */#define	 HP_DATAON		0x10	/* Turn on dataport */#define NIC_OFFSET		0x10	/* Offset the 8390 registers. */#define HP_START_PG		0x00	/* First page of TX buffer */#define HP_8BSTOP_PG	0x80	/* Last page +1 of RX ring */#define HP_16BSTOP_PG	0xFF	/* Same, for 16 bit cards. */int hp_probe(struct device *dev);int hpprobe1(struct device *dev, int ioaddr);static void hp_reset_8390(struct device *dev);static int hp_block_input(struct device *dev, int count,						  char *buf, int ring_offset);static void hp_block_output(struct device *dev, int count,							const unsigned char *buf, const start_page);static void hp_init_card(struct device *dev);/* The map from IRQ number to HP_CONFIGURE register setting. *//* My default is IRQ5	   0  1	 2  3  4  5  6	7  8  9 10 11 */static char irqmap[16] = { 0, 0, 4, 6, 8,10, 0,14, 0, 4, 2,12,0,0,0,0};/*	Probe for an HP LAN adaptor.	Also initialize the card and fill in STATION_ADDR with the station	address. */int hp_probe(struct device *dev){	int *port, ports[] = {0x300, 0x320, 0x340, 0x280, 0x2C0, 0x200, 0x240, 0};	short ioaddr = dev->base_addr;	if (ioaddr > 0x1ff)			/* Check a single specified location. */		return hpprobe1(dev, ioaddr);	else if (ioaddr > 0)				/* Don't probe at all. */		return ENXIO;	for (port = &ports[0]; *port; port++) {		if (check_region(*port, HP_IO_EXTENT))			continue;		if (hpprobe1(dev, *port) == 0) {			return 0;		}	}	return ENODEV;}int hpprobe1(struct device *dev, int ioaddr){	int i, board_id, wordmode;	char *name;	unsigned char *station_addr = dev->dev_addr;	/* Check for the HP physical address, 08 00 09 xx xx xx. */	/* This really isn't good enough: we may pick up HP LANCE boards	   also!  Avoid the lance 0x5757 signature. */	if (inb(ioaddr) != 0x08		|| inb(ioaddr+1) != 0x00		|| inb(ioaddr+2) != 0x09		|| inb(ioaddr+14) == 0x57)		return ENODEV;	/* Set up the parameters based on the board ID.	   If you have additional mappings, please mail them to becker@super.org. */	if ((board_id = inb(ioaddr + HP_ID)) & 0x80) {		name = "HP27247";		wordmode = 1;	} else {		name = "HP27250";		wordmode = 0;	}	/* Grab the region so we can find another board if something fails. */	snarf_region(ioaddr, HP_IO_EXTENT);	printk("%s: %s (ID %02x) at %#3x,", dev->name, name, board_id, ioaddr);	for(i = 0; i < ETHER_ADDR_LEN; i++)		printk(" %2.2x", station_addr[i] = inb(ioaddr + i));	/* Snarf the interrupt now.  Someday this could be moved to open(). */	if (dev->irq < 2) {		int irq_16list[] = { 11, 10, 5, 3, 4, 7, 9, 0};		int irq_8list[] = { 7, 5, 3, 4, 9, 0};		int *irqp = wordmode ? irq_16list : irq_8list;		do {			int irq = *irqp;			if (request_irq (irq, NULL) != -EBUSY) {				autoirq_setup(0);				/* Twinkle the interrupt, and check if it's seen. */				outb_p(irqmap[irq] | HP_RUN, ioaddr + HP_CONFIGURE);				outb_p( 0x00 | HP_RUN, ioaddr + HP_CONFIGURE);				if (irq == autoirq_report(0)		 /* It's a good IRQ line! */					&& request_irq (irq, &ei_interrupt) == 0) {					printk(" selecting IRQ %d.\n", irq);					dev->irq = *irqp;					break;				}			}		} while (*++irqp);		if (*irqp == 0) {			printk(" no free IRQ lines.\n");			return EBUSY;		}	} else {		if (dev->irq == 2)			dev->irq = 9;		if (irqaction(dev->irq, &ei_sigaction)) {			printk (" unable to get IRQ %d.\n", dev->irq);			return EBUSY;		}	}	if (ei_debug > 1)		printk(version);	/* Set the base address to point to the NIC, not the "real" base! */	dev->base_addr = ioaddr + NIC_OFFSET;	ethdev_init(dev);	ei_status.name = name;	ei_status.word16 = wordmode;	ei_status.tx_start_page = HP_START_PG;	ei_status.rx_start_page = HP_START_PG + TX_PAGES;	ei_status.stop_page = wordmode ? HP_16BSTOP_PG : HP_8BSTOP_PG;	ei_status.reset_8390 = &hp_reset_8390;	ei_status.block_input = &hp_block_input;	ei_status.block_output = &hp_block_output;	hp_init_card(dev);	return 0;}static voidhp_reset_8390(struct device *dev){	int hp_base = dev->base_addr - NIC_OFFSET;	int saved_config = inb_p(hp_base + HP_CONFIGURE);	if (ei_debug > 1) printk("resetting the 8390 time=%ld...", jiffies);	outb_p(0x00, hp_base + HP_CONFIGURE);	ei_status.txing = 0;	/* Pause just a few cycles for the hardware reset to take place. */	SLOW_DOWN_IO;	SLOW_DOWN_IO;	outb_p(saved_config, hp_base + HP_CONFIGURE);	SLOW_DOWN_IO; SLOW_DOWN_IO;		if ((inb_p(hp_base+NIC_OFFSET+EN0_ISR) & ENISR_RESET) == 0)		printk("%s: hp_reset_8390() did not complete.\n", dev->name);	if (ei_debug > 1) printk("8390 reset done (%ld).", jiffies);	return;}/* 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 HP LAN doesn't use shared memory -- we put the packet   out through the "remote DMA" dataport. */static inthp_block_input(struct device *dev, int count, char *buf, int ring_offset){	int nic_base = dev->base_addr;	int saved_config = inb_p(nic_base - NIC_OFFSET + HP_CONFIGURE);	int xfer_count = count;	outb_p(saved_config | HP_DATAON, nic_base - NIC_OFFSET + HP_CONFIGURE);	outb_p(E8390_NODMA+E8390_PAGE0+E8390_START, nic_base);	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);	if (ei_status.word16) {	  insw(nic_base - NIC_OFFSET + HP_DATAPORT,buf,count>>1);	  if (count & 0x01)		buf[count-1] = inb(nic_base - NIC_OFFSET + HP_DATAPORT), xfer_count++;	} else {		insb(nic_base - NIC_OFFSET + HP_DATAPORT, buf, count);	}	/* This is for the ALPHA version only, remove for later releases. */	if (ei_debug > 0) {			/* DMA termination address check... */	  int high = inb_p(nic_base + EN0_RSARHI);	  int low = inb_p(nic_base + EN0_RSARLO);	  int addr = (high << 8) + low;	  /* Check only the lower 8 bits so we can ignore ring wrap. */	  if (((ring_offset + xfer_count) & 0xff) != (addr & 0xff))		printk("%s: RX transfer address mismatch, %#4.4x vs. %#4.4x (actual).\n",			   dev->name, ring_offset + xfer_count, addr);	}	outb_p(saved_config & (~HP_DATAON), nic_base - NIC_OFFSET + HP_CONFIGURE);	return ring_offset + count;}static voidhp_block_output(struct device *dev, int count,				const unsigned char *buf, const start_page){	int nic_base = dev->base_addr;	int saved_config = inb_p(nic_base - NIC_OFFSET + HP_CONFIGURE);	outb_p(saved_config | HP_DATAON, nic_base - NIC_OFFSET + HP_CONFIGURE);	/* 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++;	/* We should already be in page 0, but to be safe... */	outb_p(E8390_PAGE0+E8390_START+E8390_NODMA, nic_base);#ifdef ei8390_bug	/* Handle the read-before-write bug the same way as the	   Crynwr packet driver -- the NatSemi method doesn't work. */	outb_p(0x42, nic_base + EN0_RCNTLO);	outb_p(0,	nic_base + EN0_RCNTHI);	outb_p(0xff, nic_base + EN0_RSARLO);	outb_p(0x00, nic_base + EN0_RSARHI);	outb_p(E8390_RREAD+E8390_START, EN_CMD);	/* Make certain that the dummy read has occured. */	inb_p(0x61);	inb_p(0x61);#endif	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);	if (ei_status.word16) {		/* Use the 'rep' sequence for 16 bit boards. */		outsw(nic_base - NIC_OFFSET + HP_DATAPORT, buf, count>>1);	} else {		outsb(nic_base - NIC_OFFSET + HP_DATAPORT, buf, count);	}	/* DON'T check for 'inb_p(EN0_ISR) & ENISR_RDC' here -- it's broken! */	/* This is for the ALPHA version only, remove for later releases. */	if (ei_debug > 0) {			/* DMA termination address check... */	  int high = inb_p(nic_base + EN0_RSARHI);	  int low  = inb_p(nic_base + EN0_RSARLO);	  int addr = (high << 8) + low;	  if ((start_page << 8) + count != addr)		printk("%s: TX Transfer address mismatch, %#4.4x vs. %#4.4x.\n",			   dev->name, (start_page << 8) + count, addr);	}	outb_p(saved_config & (~HP_DATAON), nic_base - NIC_OFFSET + HP_CONFIGURE);	return;}/* This function resets the ethercard if something screws up. */static voidhp_init_card(struct device *dev){	int irq = dev->irq;	NS8390_init(dev, 0);	outb_p(irqmap[irq&0x0f] | HP_RUN,		   dev->base_addr - NIC_OFFSET + HP_CONFIGURE);	return;}/* * Local variables: * compile-command: "gcc -D__KERNEL__ -I/usr/src/linux/net/inet -Wall -Wstrict-prototypes -O6 -m486 -c hp.c" * version-control: t * kept-new-versions: 5 * tab-width: 4 * c-indent-level: 4 * End: */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久久久一本精品| 成人国产一区二区三区精品| 樱桃国产成人精品视频| 日韩一区欧美小说| 中文字幕一区二区不卡 | 国产精品久久久久久久久免费丝袜 | 日本美女视频一区二区| 日韩电影免费在线观看网站| 日韩av电影免费观看高清完整版在线观看| 亚洲精品日韩一| 午夜亚洲福利老司机| 日韩av在线发布| 国内精品久久久久影院薰衣草 | 成人av在线网| av一区二区三区黑人| 91亚洲男人天堂| 91久久精品一区二区二区| 欧美三级视频在线播放| 91精品免费在线| 久久免费美女视频| 中文字幕一区二区三| 亚洲国产视频一区| 免费的国产精品| 懂色av一区二区在线播放| 99久久精品费精品国产一区二区| 在线看不卡av| 日韩欧美你懂的| 国产精品视频你懂的| 亚洲最快最全在线视频| 日韩av在线播放中文字幕| 国产一区二区精品久久91| www.在线成人| 91精品国产综合久久精品麻豆| 精品久久久久香蕉网| 成人免费视频在线观看| 无吗不卡中文字幕| 国产91精品一区二区| 欧洲日韩一区二区三区| 欧美精品一区二区精品网| 国产婷婷色一区二区三区在线| 亚洲你懂的在线视频| 久久精品国内一区二区三区| www.亚洲国产| 欧美成人艳星乳罩| 亚洲欧美偷拍卡通变态| 美女看a上一区| 色婷婷亚洲一区二区三区| 日韩一级视频免费观看在线| 亚洲欧美激情一区二区| 久久99久久99| 欧美在线高清视频| 国产欧美一区二区三区在线老狼| 洋洋成人永久网站入口| 国产美女av一区二区三区| 欧美私模裸体表演在线观看| 久久精品夜色噜噜亚洲aⅴ| 亚洲成人自拍偷拍| 成人av电影在线| 精品久久久久久久久久久久包黑料 | 粉嫩av一区二区三区在线播放 | 日韩欧美国产系列| 亚洲视频一区二区在线观看| 久久精品国产999大香线蕉| 一本大道综合伊人精品热热| 精品国产乱码久久| 午夜久久电影网| 色综合久久久久网| 欧美国产视频在线| 精品一区二区三区日韩| 欧美图区在线视频| 1000部国产精品成人观看| 国产一区二区视频在线| 欧美一区二区视频在线观看2022| 亚洲精品高清在线| bt欧美亚洲午夜电影天堂| 亚洲色欲色欲www在线观看| 久久成人免费日本黄色| 欧美高清视频www夜色资源网| 中文字幕一区二区三区四区| 国产高清亚洲一区| 日韩欧美一区在线| 午夜日韩在线观看| 在线影视一区二区三区| 亚洲日韩欧美一区二区在线| 国产成人8x视频一区二区| 精品免费日韩av| 麻豆精品一区二区av白丝在线 | 一二三区精品视频| 97久久人人超碰| 中文字幕在线视频一区| 大胆亚洲人体视频| 国产日韩欧美精品综合| 国产精品一区二区91| 2020国产成人综合网| 久久精品久久精品| 日韩欧美的一区| 久久99精品久久久久久动态图| 欧美一卡二卡三卡| 蜜臀av性久久久久蜜臀aⅴ流畅| 欧美日韩不卡一区| 亚洲国产精品一区二区久久| 欧美三级中文字| 午夜成人免费视频| 3751色影院一区二区三区| 日韩av电影免费观看高清完整版在线观看| 欧美视频完全免费看| 午夜精品久久久久久久99樱桃 | 一区二区三区中文字幕| 日本乱码高清不卡字幕| 亚洲一区二区视频在线观看| 欧美三电影在线| 日本欧美肥老太交大片| 日韩欧美专区在线| 国产裸体歌舞团一区二区| 久久新电视剧免费观看| 国产成人精品一区二区三区网站观看| 国产欧美日韩视频在线观看| a美女胸又www黄视频久久| 亚洲欧美一区二区三区极速播放| 在线观看亚洲a| 美女网站一区二区| 久久久精品欧美丰满| 成人av网站在线| 亚洲综合另类小说| 日韩一区二区三区观看| 国产在线一区观看| 国产精品视频一二三区| 在线影视一区二区三区| 伦理电影国产精品| 国产精品国产三级国产aⅴ无密码| 精品少妇一区二区三区视频免付费| 久久精品国产在热久久| 国产精品欧美经典| 欧美日韩综合在线免费观看| 久久精品国产第一区二区三区| 国产色91在线| 欧美亚洲国产怡红院影院| 久久精品国产色蜜蜜麻豆| 国产精品女同互慰在线看| 色综合久久天天| 热久久国产精品| 国产精品美女久久久久高潮| 精品视频在线免费看| 国产精品资源网站| 亚洲一区电影777| 久久久久久久久久看片| 在线观看日韩av先锋影音电影院| 蜜臀va亚洲va欧美va天堂| 国产精品短视频| 日韩欧美一区在线观看| 97久久超碰国产精品| 另类调教123区| 一区二区三区日韩欧美| 精品国产在天天线2019| 色婷婷激情综合| 韩国成人福利片在线播放| 亚洲最大的成人av| 久久久久久久综合| 欧美久久一区二区| av成人老司机| 精品综合久久久久久8888| 一区二区三区四区激情| 国产女人aaa级久久久级| 欧美久久久一区| 99久久国产综合精品女不卡| 久久精品国产在热久久| 亚洲国产一区二区视频| 国产欧美日韩视频在线观看| 欧美一区二区在线免费播放| 色悠久久久久综合欧美99| 国产成人av电影在线观看| 日本中文字幕一区二区视频| 亚洲色图色小说| 中文字幕第一页久久| 精品成人一区二区三区四区| 欧美女孩性生活视频| 色综合久久久久网| 大尺度一区二区| 韩国一区二区在线观看| 日本sm残虐另类| 亚洲资源中文字幕| 国产成人自拍在线| 美腿丝袜一区二区三区| 午夜日韩在线电影| 夜夜爽夜夜爽精品视频| 亚洲视频在线观看三级| 中文字幕欧美国产| 国产欧美日韩精品在线| 久久精品人人做| 欧美岛国在线观看| 欧美电视剧免费全集观看| 91精品国产品国语在线不卡| 欧美在线观看禁18| 色狠狠av一区二区三区| av网站免费线看精品| jizzjizzjizz欧美| 成人国产一区二区三区精品| 丁香婷婷综合色啪| 成人黄色软件下载| 99久久国产综合精品色伊|