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

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

?? rrunner.c

?? linux和2410結合開發 用他可以生成2410所需的zImage文件
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* * rrunner.c: Linux driver for the Essential RoadRunner HIPPI board. * * Copyright (C) 1998-2000 by Jes Sorensen, <Jes.Sorensen@cern.ch>. * * Thanks to Essential Communication for providing us with hardware * and very comprehensive documentation without which I would not have * been able to write this driver. A special thank you to John Gibbon * for sorting out the legal issues, with the NDA, allowing the code to * be released under the GPL. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Thanks to Jayaram Bhat from ODS/Essential for fixing some of the * stupid bugs in my code. * * Softnet support and various other patches from Val Henson of * ODS/Essential. */#define DEBUG 1#define RX_DMA_SKBUFF 1#define PKT_COPY_THRESHOLD 512#include <linux/config.h>#include <linux/module.h>#include <linux/version.h>#include <linux/types.h>#include <linux/errno.h>#include <linux/ioport.h>#include <linux/pci.h>#include <linux/kernel.h>#include <linux/netdevice.h>#include <linux/hippidevice.h>#include <linux/skbuff.h>#include <linux/init.h>#include <linux/delay.h>#include <linux/mm.h>#include <net/sock.h>#include <asm/system.h>#include <asm/cache.h>#include <asm/byteorder.h>#include <asm/io.h>#include <asm/irq.h>#include <asm/uaccess.h>#if (LINUX_VERSION_CODE < 0x02030e)#define net_device device#endif#if (LINUX_VERSION_CODE >= 0x02031b)#define NEW_NETINIT#endif#if (LINUX_VERSION_CODE < 0x02032b)/* * SoftNet changes */#define dev_kfree_skb_irq(a)	dev_kfree_skb(a)#define netif_wake_queue(dev)	clear_bit(0, &dev->tbusy)#define netif_stop_queue(dev)	set_bit(0, &dev->tbusy)static inline void netif_start_queue(struct net_device *dev){	dev->tbusy = 0;	dev->start = 1;}#define rr_mark_net_bh(foo) mark_bh(foo)#define rr_if_busy(dev)     dev->tbusy#define rr_if_running(dev)  dev->start /* Currently unused. */#define rr_if_down(dev)     {do{dev->start = 0;}while (0);}#else#define NET_BH              0#define rr_mark_net_bh(foo) {do{} while(0);}#define rr_if_busy(dev)     netif_queue_stopped(dev)#define rr_if_running(dev)  netif_running(dev)#define rr_if_down(dev)     {do{} while(0);}#endif#include "rrunner.h"#define RUN_AT(x) (jiffies + (x))/* * Implementation notes: * * The DMA engine only allows for DMA within physical 64KB chunks of * memory. The current approach of the driver (and stack) is to use * linear blocks of memory for the skbuffs. However, as the data block * is always the first part of the skb and skbs are 2^n aligned so we * are guarantted to get the whole block within one 64KB align 64KB * chunk. * * On the long term, relying on being able to allocate 64KB linear * chunks of memory is not feasible and the skb handling code and the * stack will need to know about I/O vectors or something similar. */static char version[] __initdata = "rrunner.c: v0.22 03/01/2000  Jes Sorensen (Jes.Sorensen@cern.ch)\n";static struct net_device *root_dev;/* * These are checked at init time to see if they are at least 256KB * and increased to 256KB if they are not. This is done to avoid ending * up with socket buffers smaller than the MTU size, */extern __u32 sysctl_wmem_max;extern __u32 sysctl_rmem_max;static int probed __initdata = 0;#if LINUX_VERSION_CODE >= 0x20400static struct pci_device_id rrunner_pci_tbl[] __initdata = {	{ PCI_VENDOR_ID_ESSENTIAL, PCI_DEVICE_ID_ESSENTIAL_ROADRUNNER, PCI_ANY_ID, PCI_ANY_ID, },	{ }			/* Terminating entry */};MODULE_DEVICE_TABLE(pci, rrunner_pci_tbl);#endif /* LINUX_VERSION_CODE >= 0x20400 */#ifdef NEW_NETINITint __init rr_hippi_probe (void)#elseint __init rr_hippi_probe (struct net_device *dev)#endif{#ifdef NEW_NETINIT	struct net_device *dev;#endif	int boards_found = 0;	int version_disp;	/* was version info already displayed? */	struct pci_dev *pdev = NULL;	struct pci_dev *opdev = NULL;	u8 pci_latency;	struct rr_private *rrpriv;	if (probed)		return -ENODEV;	probed++;	version_disp = 0;	while((pdev = pci_find_device(PCI_VENDOR_ID_ESSENTIAL,				      PCI_DEVICE_ID_ESSENTIAL_ROADRUNNER,				      pdev)))	{		if (pci_enable_device(pdev))			continue;		if (pdev == opdev)			return 0;		/*		 * So we found our HIPPI ... time to tell the system.		 */		dev = init_hippi_dev(NULL, sizeof(struct rr_private));		if (!dev)			break;		if (!dev->priv)			dev->priv = kmalloc(sizeof(*rrpriv), GFP_KERNEL);		if (!dev->priv)			return -ENOMEM;		rrpriv = (struct rr_private *)dev->priv;		memset(rrpriv, 0, sizeof(*rrpriv));#ifdef CONFIG_SMP		spin_lock_init(&rrpriv->lock);#endif		sprintf(rrpriv->name, "RoadRunner serial HIPPI");		dev->irq = pdev->irq;		SET_MODULE_OWNER(dev);		dev->open = &rr_open;		dev->hard_start_xmit = &rr_start_xmit;		dev->stop = &rr_close;		dev->get_stats = &rr_get_stats;		dev->do_ioctl = &rr_ioctl;#if (LINUX_VERSION_CODE < 0x02030d)		dev->base_addr = pdev->base_address[0];#else		dev->base_addr = pdev->resource[0].start;#endif		/* display version info if adapter is found */		if (!version_disp)		{			/* set display flag to TRUE so that */			/* we only display this string ONCE */			version_disp = 1;			printk(version);		}		pci_read_config_byte(pdev, PCI_LATENCY_TIMER, &pci_latency);		if (pci_latency <= 0x58){			pci_latency = 0x58;			pci_write_config_byte(pdev, PCI_LATENCY_TIMER,					      pci_latency);		}		pci_set_master(pdev);		printk(KERN_INFO "%s: Essential RoadRunner serial HIPPI "		       "at 0x%08lx, irq %i, PCI latency %i\n", dev->name,		       dev->base_addr, dev->irq, pci_latency);		/*		 * Remap the regs into kernel space.		 */		rrpriv->regs = (struct rr_regs *)			ioremap(dev->base_addr, 0x1000);		if (!rrpriv->regs){			printk(KERN_ERR "%s:  Unable to map I/O register, "			       "RoadRunner %i will be disabled.\n",			       dev->name, boards_found);			break;		}		/*		 * Don't access any registes before this point!		 */#ifdef __BIG_ENDIAN		writel(readl(&regs->HostCtrl) | NO_SWAP, &regs->HostCtrl);#endif		/*		 * Need to add a case for little-endian 64-bit hosts here.		 */		rr_init(dev);		boards_found++;		dev->base_addr = 0;		dev = NULL;		opdev = pdev;	}	/*	 * If we're at this point we're going through rr_hippi_probe()	 * for the first time.  Return success (0) if we've initialized	 * 1 or more boards. Otherwise, return failure (-ENODEV).	 */#ifdef MODULE	return boards_found;#else	if (boards_found > 0)		return 0;	else		return -ENODEV;#endif}#ifdef MODULE#if LINUX_VERSION_CODE > 0x20118MODULE_AUTHOR("Jes Sorensen <Jes.Sorensen@cern.ch>");MODULE_DESCRIPTION("Essential RoadRunner HIPPI driver");#endifint init_module(void){	int cards;	root_dev = NULL;#ifdef NEW_NETINIT	cards = rr_hippi_probe();#else	cards = rr_hippi_probe(NULL);#endif	return cards ? 0 : -ENODEV;}void cleanup_module(void){	struct rr_private *rr;	struct net_device *next;	while (root_dev) {		next = ((struct rr_private *)root_dev->priv)->next;		rr = (struct rr_private *)root_dev->priv;		if (!(readl(&rr->regs->HostCtrl) & NIC_HALTED)){			printk(KERN_ERR "%s: trying to unload running NIC\n",			       root_dev->name);			writel(HALT_NIC, &rr->regs->HostCtrl);		}		iounmap(rr->regs);		unregister_hipdev(root_dev);		kfree(root_dev);		root_dev = next;	}}#endif/* * Commands are considered to be slow, thus there is no reason to * inline this. */static void rr_issue_cmd(struct rr_private *rrpriv, struct cmd *cmd){	struct rr_regs *regs;	u32 idx;	regs = rrpriv->regs;	/*	 * This is temporary - it will go away in the final version.	 * We probably also want to make this function inline.	 */	if (readl(&regs->HostCtrl) & NIC_HALTED){		printk("issuing command for halted NIC, code 0x%x, "		       "HostCtrl %08x\n", cmd->code, readl(&regs->HostCtrl));		if (readl(&regs->Mode) & FATAL_ERR)			printk("error codes Fail1 %02x, Fail2 %02x\n",			       readl(&regs->Fail1), readl(&regs->Fail2));	}	idx = rrpriv->info->cmd_ctrl.pi;	writel(*(u32*)(cmd), &regs->CmdRing[idx]);	wmb();	idx = (idx - 1) % CMD_RING_ENTRIES;	rrpriv->info->cmd_ctrl.pi = idx;	wmb();	if (readl(&regs->Mode) & FATAL_ERR)		printk("error code %02x\n", readl(&regs->Fail1));}/* * Reset the board in a sensible manner. The NIC is already halted * when we get here and a spin-lock is held. */static int rr_reset(struct net_device *dev){	struct rr_private *rrpriv;	struct rr_regs *regs;	struct eeprom *hw = NULL;	u32 start_pc;	int i;	rrpriv = (struct rr_private *)dev->priv;	regs = rrpriv->regs;	rr_load_firmware(dev);	writel(0x01000000, &regs->TX_state);	writel(0xff800000, &regs->RX_state);	writel(0, &regs->AssistState);	writel(CLEAR_INTA, &regs->LocalCtrl);	writel(0x01, &regs->BrkPt);	writel(0, &regs->Timer);	writel(0, &regs->TimerRef);	writel(RESET_DMA, &regs->DmaReadState);	writel(RESET_DMA, &regs->DmaWriteState);	writel(0, &regs->DmaWriteHostHi);	writel(0, &regs->DmaWriteHostLo);	writel(0, &regs->DmaReadHostHi);	writel(0, &regs->DmaReadHostLo);	writel(0, &regs->DmaReadLen);	writel(0, &regs->DmaWriteLen);	writel(0, &regs->DmaWriteLcl);	writel(0, &regs->DmaWriteIPchecksum);	writel(0, &regs->DmaReadLcl);	writel(0, &regs->DmaReadIPchecksum);	writel(0, &regs->PciState);#if (BITS_PER_LONG == 64) && defined __LITTLE_ENDIAN	writel(SWAP_DATA | PTR64BIT | PTR_WD_SWAP, &regs->Mode);#elif (BITS_PER_LONG == 64)	writel(SWAP_DATA | PTR64BIT | PTR_WD_NOSWAP, &regs->Mode);#else	writel(SWAP_DATA | PTR32BIT | PTR_WD_NOSWAP, &regs->Mode);#endif#if 0	/*	 * Don't worry, this is just black magic.	 */	writel(0xdf000, &regs->RxBase);	writel(0xdf000, &regs->RxPrd);	writel(0xdf000, &regs->RxCon);	writel(0xce000, &regs->TxBase);	writel(0xce000, &regs->TxPrd);	writel(0xce000, &regs->TxCon);	writel(0, &regs->RxIndPro);	writel(0, &regs->RxIndCon);	writel(0, &regs->RxIndRef);	writel(0, &regs->TxIndPro);	writel(0, &regs->TxIndCon);	writel(0, &regs->TxIndRef);	writel(0xcc000, &regs->pad10[0]);	writel(0, &regs->DrCmndPro);	writel(0, &regs->DrCmndCon);	writel(0, &regs->DwCmndPro);	writel(0, &regs->DwCmndCon);	writel(0, &regs->DwCmndRef);	writel(0, &regs->DrDataPro);	writel(0, &regs->DrDataCon);	writel(0, &regs->DrDataRef);	writel(0, &regs->DwDataPro);	writel(0, &regs->DwDataCon);	writel(0, &regs->DwDataRef);#endif	writel(0xffffffff, &regs->MbEvent);	writel(0, &regs->Event);	writel(0, &regs->TxPi);	writel(0, &regs->IpRxPi);	writel(0, &regs->EvtCon);	writel(0, &regs->EvtPrd);	rrpriv->info->evt_ctrl.pi = 0;	for (i = 0; i < CMD_RING_ENTRIES; i++)		writel(0, &regs->CmdRing[i]);/* * Why 32 ? is this not cache line size dependant? */	writel(RBURST_64|WBURST_64, &regs->PciState);	wmb();	start_pc = rr_read_eeprom_word(rrpriv, &hw->rncd_info.FwStart);#if (DEBUG > 1)	printk("%s: Executing firmware at address 0x%06x\n",	       dev->name, start_pc);#endif	writel(start_pc + 0x800, &regs->Pc);	wmb();	udelay(5);	writel(start_pc, &regs->Pc);	wmb();	return 0;}/* * Read a string from the EEPROM. */static unsigned int rr_read_eeprom(struct rr_private *rrpriv,				unsigned long offset,				unsigned char *buf,				unsigned long length){	struct rr_regs *regs = rrpriv->regs;	u32 misc, io, host, i;	io = readl(&regs->ExtIo);	writel(0, &regs->ExtIo);	misc = readl(&regs->LocalCtrl);	writel(0, &regs->LocalCtrl);	host = readl(&regs->HostCtrl);	writel(host | HALT_NIC, &regs->HostCtrl);	mb();	for (i = 0; i < length; i++){		writel((EEPROM_BASE + ((offset+i) << 3)), &regs->WinBase);		mb();		buf[i] = (readl(&regs->WinData) >> 24) & 0xff;		mb();	}	writel(host, &regs->HostCtrl);	writel(misc, &regs->LocalCtrl);	writel(io, &regs->ExtIo);	mb();	return i;}/* * Shortcut to read one word (4 bytes) out of the EEPROM and convert * it to our CPU byte-order. */static u32 rr_read_eeprom_word(struct rr_private *rrpriv,			    void * offset){	u32 word;	if ((rr_read_eeprom(rrpriv, (unsigned long)offset,			    (char *)&word, 4) == 4))		return be32_to_cpu(word);	return 0;}/* * Write a string to the EEPROM. * * This is only called when the firmware is not running. */static unsigned int write_eeprom(struct rr_private *rrpriv,				 unsigned long offset,				 unsigned char *buf,				 unsigned long length){	struct rr_regs *regs = rrpriv->regs;	u32 misc, io, data, i, j, ready, error = 0;	io = readl(&regs->ExtIo);	writel(0, &regs->ExtIo);	misc = readl(&regs->LocalCtrl);	writel(ENABLE_EEPROM_WRITE, &regs->LocalCtrl);	mb();	for (i = 0; i < length; i++){		writel((EEPROM_BASE + ((offset+i) << 3)), &regs->WinBase);		mb();		data = buf[i] << 24;		/*		 * Only try to write the data if it is not the same		 * value already.		 */		if ((readl(&regs->WinData) & 0xff000000) != data){			writel(data, &regs->WinData);			ready = 0;			j = 0;			mb();			while(!ready){				udelay(20);				if ((readl(&regs->WinData) & 0xff000000) ==				    data)					ready = 1;				mb();				if (j++ > 5000){					printk("data mismatch: %08x, "					       "WinData %08x\n", data,					       readl(&regs->WinData));					ready = 1;					error = 1;				}			}		}	}	writel(misc, &regs->LocalCtrl);	writel(io, &regs->ExtIo);	mb();	return error;}static int __init rr_init(struct net_device *dev){	struct rr_private *rrpriv;	struct rr_regs *regs;	struct eeprom *hw = NULL;	u32 sram_size, rev;	int i;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人成人成人在线视频| 99精品一区二区| 成人小视频在线| 色妞www精品视频| 欧美岛国在线观看| 日韩美女啊v在线免费观看| 亚洲va韩国va欧美va| 国产在线看一区| 欧美日韩综合在线免费观看| 久久综合九色综合97婷婷 | 男女性色大片免费观看一区二区 | 久久久精品人体av艺术| 亚洲日本va午夜在线影院| 奇米在线7777在线精品| 99综合影院在线| 久久久天堂av| 麻豆成人久久精品二区三区红 | 欧美性猛交xxxx乱大交退制版| 欧美精品一区二区高清在线观看| 一区二区三区四区不卡视频| 成人av片在线观看| 国产精品激情偷乱一区二区∴| 久久99精品久久只有精品| 日韩你懂的在线播放| 日本大胆欧美人术艺术动态| 欧美日韩久久久| 亚洲在线成人精品| 欧美三级一区二区| 天天综合网天天综合色| 欧美日韩精品免费观看视频| 午夜久久久久久电影| 欧美三级韩国三级日本三斤| 亚洲国产一区二区三区青草影视| 在线免费观看不卡av| 亚洲一线二线三线久久久| 在线亚洲免费视频| 婷婷开心激情综合| 日韩一区二区三区视频在线观看| 老司机免费视频一区二区三区| 91精品综合久久久久久| 麻豆91在线观看| 久久精品人人做人人爽97| 国产91精品一区二区麻豆亚洲| 中文成人av在线| 91久久国产最好的精华液| 午夜欧美电影在线观看| 欧美一二三四在线| 成人永久aaa| 亚洲一区二区三区四区在线观看 | 免费高清在线视频一区·| 精品福利在线导航| 不卡一区二区三区四区| 亚洲综合av网| 日韩女优制服丝袜电影| 粉嫩高潮美女一区二区三区| 亚洲三级理论片| 日韩欧美亚洲国产精品字幕久久久| 国产一本一道久久香蕉| 亚洲美女淫视频| 精品久久久久久久久久久久包黑料| 另类小说色综合网站| 国产精品少妇自拍| 欧美精品色综合| 国产夫妻精品视频| 洋洋成人永久网站入口| 精品国产一区二区三区四区四| 成人网页在线观看| 五月婷婷综合网| 中文字幕久久午夜不卡| 欧美日韩aaaaa| 国产91露脸合集magnet| 丝袜亚洲另类欧美综合| 国产精品视频一区二区三区不卡| 欧美国产精品一区二区| 在线不卡的av| av亚洲精华国产精华精华| 奇米精品一区二区三区在线观看| 中文字幕免费一区| 91精品国产91久久久久久一区二区| 国产河南妇女毛片精品久久久| 亚洲国产综合视频在线观看| 中文在线资源观看网站视频免费不卡| 欧美午夜理伦三级在线观看| 国产精品一二二区| 日本亚洲天堂网| 亚洲国产一区视频| 国产精品二三区| 久久久精品黄色| 欧美大片一区二区| 欧美性猛片aaaaaaa做受| 成人va在线观看| 国产精品系列在线播放| 午夜精品一区二区三区电影天堂| 国产欧美一区二区精品性色| 91精品国产综合久久精品麻豆| 日本精品视频一区二区| 91免费看`日韩一区二区| 国产成人精品免费看| 狠狠色伊人亚洲综合成人| 午夜精品久久久久久久99水蜜桃 | 久久福利资源站| 青青草精品视频| 午夜久久电影网| 丝袜亚洲另类欧美综合| 亚洲高清视频中文字幕| 一区二区三区美女| 亚洲欧美国产三级| 亚洲欧美综合在线精品| 中文字幕一区二区三区乱码在线| 精品福利av导航| 久久综合色8888| 日韩欧美成人激情| 精品日韩欧美一区二区| 欧美精品久久99久久在免费线| 欧美日韩视频一区二区| 欧美日韩一区二区三区免费看| 欧洲一区在线观看| 欧美午夜精品一区| 欧美视频在线观看一区二区| 在线亚洲免费视频| 欧美日韩一级视频| 欧美一级久久久久久久大片| 欧美高清视频不卡网| 日韩欧美在线综合网| 精品剧情在线观看| 欧美国产精品专区| 亚洲精品v日韩精品| 亚洲一区二区三区中文字幕 | 亚洲国产精品麻豆| 婷婷中文字幕一区三区| 久久99久久99精品免视看婷婷| 激情五月婷婷综合| 不卡的av在线播放| 欧美午夜不卡在线观看免费| 日韩午夜三级在线| 中文字幕第一区第二区| 一区二区三区不卡视频在线观看| 图片区小说区区亚洲影院| 麻豆精品久久久| 93久久精品日日躁夜夜躁欧美| 欧美中文字幕一区二区三区| 欧美一级二级三级蜜桃| 国产精品毛片久久久久久久| 一区二区三区精品视频在线| 蜜桃在线一区二区三区| 成人av免费在线| 欧美一级国产精品| 国产精品国产三级国产a| 午夜精品久久久久影视| 国产91色综合久久免费分享| 精品视频在线视频| 国产精品丝袜黑色高跟| 日韩精品一级二级| 91亚洲国产成人精品一区二区三 | www.日本不卡| 日韩美女主播在线视频一区二区三区| 国产亚洲一区二区三区四区| 亚洲一区视频在线| 成人影视亚洲图片在线| 正在播放亚洲一区| 亚洲另类在线制服丝袜| 国产精品一区一区三区| 欧美电影一区二区三区| 国产精品久久久久aaaa| 日韩av中文字幕一区二区| av午夜一区麻豆| 久久婷婷国产综合国色天香| 亚洲一区二区欧美日韩| 成人激情免费视频| 26uuu久久天堂性欧美| 亚洲国产成人av网| 色综合婷婷久久| 久久精品这里都是精品| 免费观看30秒视频久久| 日本电影亚洲天堂一区| 中文字幕在线免费不卡| 国产伦精一区二区三区| 日韩限制级电影在线观看| 首页国产丝袜综合| 欧美性受xxxx| 亚洲永久免费av| 91社区在线播放| 国产精品国产三级国产有无不卡 | 色狠狠综合天天综合综合| 国产丝袜美腿一区二区三区| 麻豆精品蜜桃视频网站| 日韩一区二区在线观看| 99久久伊人久久99| 国产精品电影院| 99久久er热在这里只有精品15| 国产无人区一区二区三区| 国内精品写真在线观看| 精品国产露脸精彩对白| 丝袜脚交一区二区| 欧美一区二区三区在线| 男男gaygay亚洲| 日韩欧美电影一区| 激情丁香综合五月| 国产精品视频在线看| 99久久精品免费看国产免费软件|