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

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

?? pci-skeleton.c

?? linux和2410結合開發 用他可以生成2410所需的zImage文件
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*	drivers/net/pci-skeleton.c	Maintained by Jeff Garzik <jgarzik@mandrakesoft.com>	Original code came from 8139too.c, which in turns was based	originally on Donald Becker's rtl8139.c driver, versions 1.11	and older.  This driver was originally based on rtl8139.c	version 1.07.  Header of rtl8139.c version 1.11:	-----<snip>-----        	Written 1997-2000 by Donald Becker.		This software may be used and distributed according to the		terms of the GNU General Public License (GPL), incorporated		herein by reference.  Drivers based on or derived from this		code fall under the GPL and must retain the authorship,		copyright and license notice.  This file is not a complete		program and may only be used when the entire operating		system is licensed under the GPL.		This driver is for boards based on the RTL8129 and RTL8139		PCI ethernet chips.		The author may be reached as becker@scyld.com, or C/O Scyld		Computing Corporation 410 Severn Ave., Suite 210 Annapolis		MD 21403		Support and updates available at		http://www.scyld.com/network/rtl8139.html		Twister-tuning table provided by Kinston		<shangh@realtek.com.tw>.	-----<snip>-----	This software may be used and distributed according to the terms	of the GNU General Public License, incorporated herein by reference.-----------------------------------------------------------------------------				Theory of OperationI. Board CompatibilityThis device driver is designed for the RealTek RTL8139 series, the RealTekFast Ethernet controllers for PCI and CardBus.  This chip is used on manylow-end boards, sometimes with its markings changed.II. Board-specific settingsPCI bus devices are configured by the system at boot time, so no jumpersneed to be set on the board.  The system BIOS will assign thePCI INTA signal to a (preferably otherwise unused) system IRQ line.III. Driver operationIIIa. Rx Ring buffersThe receive unit uses a single linear ring buffer rather than the morecommon (and more efficient) descriptor-based architecture.  Incoming framesare sequentially stored into the Rx region, and the host copies them intoskbuffs.Comment: While it is theoretically possible to process many frames in place,any delay in Rx processing would cause us to drop frames.  More importantly,the Linux protocol stack is not designed to operate in this manner.IIIb. Tx operationThe RTL8139 uses a fixed set of four Tx descriptors in register space.In a stunningly bad design choice, Tx frames must be 32 bit aligned.  Linuxaligns the IP header on word boundaries, and 14 byte ethernet header meansthat almost all frames will need to be copied to an alignment buffer.IVb. Referenceshttp://www.realtek.com.tw/cn/cn.htmlhttp://www.scyld.com/expert/NWay.htmlIVc. Errata*/#include <linux/config.h>#include <linux/module.h>#include <linux/kernel.h>#include <linux/pci.h>#include <linux/init.h>#include <linux/ioport.h>#include <linux/netdevice.h>#include <linux/etherdevice.h>#include <linux/delay.h>#include <linux/ethtool.h>#include <linux/mii.h>#include <asm/io.h>#define NETDRV_VERSION		"1.0.0"#define MODNAME			"netdrv"#define NETDRV_DRIVER_LOAD_MSG	"MyVendor Fast Ethernet driver " NETDRV_VERSION " loaded"#define PFX			MODNAME ": "static char version[] __devinitdata =KERN_INFO NETDRV_DRIVER_LOAD_MSG "\n"KERN_INFO "  Support available from http://foo.com/bar/baz.html\n";/* define to 1 to enable PIO instead of MMIO */#undef USE_IO_OPS/* define to 1 to enable copious debugging info */#undef NETDRV_DEBUG/* define to 1 to disable lightweight runtime debugging checks */#undef NETDRV_NDEBUG#ifdef NETDRV_DEBUG/* note: prints function name for you */#  define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args)#else#  define DPRINTK(fmt, args...)#endif#ifdef NETDRV_NDEBUG#  define assert(expr) do {} while (0)#else#  define assert(expr) \        if(!(expr)) {					\        printk( "Assertion failed! %s,%s,%s,line=%d\n",	\        #expr,__FILE__,__FUNCTION__,__LINE__);		\        }#endif/* A few user-configurable values. *//* media options */static int media[] = {-1, -1, -1, -1, -1, -1, -1, -1};/* Maximum events (Rx packets, etc.) to handle at each interrupt. */static int max_interrupt_work = 20;/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast).   The RTL chips use a 64 element hash table based on the Ethernet CRC.  */static int multicast_filter_limit = 32;/* Size of the in-memory receive ring. */#define RX_BUF_LEN_IDX	2	/* 0==8K, 1==16K, 2==32K, 3==64K */#define RX_BUF_LEN (8192 << RX_BUF_LEN_IDX)#define RX_BUF_PAD 16#define RX_BUF_WRAP_PAD 2048 /* spare padding to handle lack of packet wrap */#define RX_BUF_TOT_LEN (RX_BUF_LEN + RX_BUF_PAD + RX_BUF_WRAP_PAD)/* Number of Tx descriptor registers. */#define NUM_TX_DESC	4/* max supported ethernet frame size -- must be at least (dev->mtu+14+4).*/#define MAX_ETH_FRAME_SIZE	1536/* Size of the Tx bounce buffers -- must be at least (dev->mtu+14+4). */#define TX_BUF_SIZE	MAX_ETH_FRAME_SIZE#define TX_BUF_TOT_LEN	(TX_BUF_SIZE * NUM_TX_DESC)/* PCI Tuning Parameters   Threshold is bytes transferred to chip before transmission starts. */#define TX_FIFO_THRESH 256	/* In bytes, rounded down to 32 byte units. *//* The following settings are log_2(bytes)-4:  0 == 16 bytes .. 6==1024, 7==end of packet. */#define RX_FIFO_THRESH	6	/* Rx buffer level before first PCI xfer.  */#define RX_DMA_BURST	6	/* Maximum PCI burst, '6' is 1024 */#define TX_DMA_BURST	6	/* Maximum PCI burst, '6' is 1024 *//* Operational parameters that usually are not changed. *//* Time in jiffies before concluding the transmitter is hung. */#define TX_TIMEOUT  (6*HZ)enum {	HAS_CHIP_XCVR = 0x020000,	HAS_LNK_CHNG = 0x040000,};#define NETDRV_MIN_IO_SIZE 0x80#define RTL8139B_IO_SIZE 256#define NETDRV_CAPS	HAS_CHIP_XCVR|HAS_LNK_CHNGtypedef enum {	RTL8139 = 0,	NETDRV_CB,	SMC1211TX,	/*MPX5030,*/	DELTA8139,	ADDTRON8139,} board_t;/* indexed by board_t, above */static struct {	const char *name;} board_info[] __devinitdata = {	{ "RealTek RTL8139 Fast Ethernet" },	{ "RealTek RTL8139B PCI/CardBus" },	{ "SMC1211TX EZCard 10/100 (RealTek RTL8139)" },/*	{ MPX5030, "Accton MPX5030 (RealTek RTL8139)" },*/	{ "Delta Electronics 8139 10/100BaseTX" },	{ "Addtron Technolgy 8139 10/100BaseTX" },};static struct pci_device_id netdrv_pci_tbl[] __devinitdata = {	{0x10ec, 0x8139, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },	{0x10ec, 0x8138, PCI_ANY_ID, PCI_ANY_ID, 0, 0, NETDRV_CB },	{0x1113, 0x1211, PCI_ANY_ID, PCI_ANY_ID, 0, 0, SMC1211TX },/*	{0x1113, 0x1211, PCI_ANY_ID, PCI_ANY_ID, 0, 0, MPX5030 },*/	{0x1500, 0x1360, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DELTA8139 },	{0x4033, 0x1360, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ADDTRON8139 },	{0,}};MODULE_DEVICE_TABLE (pci, netdrv_pci_tbl);/* The rest of these values should never change. *//* Symbolic offsets to registers. */enum NETDRV_registers {	MAC0 = 0,		/* Ethernet hardware address. */	MAR0 = 8,		/* Multicast filter. */	TxStatus0 = 0x10,	/* Transmit status (Four 32bit registers). */	TxAddr0 = 0x20,		/* Tx descriptors (also four 32bit). */	RxBuf = 0x30,	RxEarlyCnt = 0x34,	RxEarlyStatus = 0x36,	ChipCmd = 0x37,	RxBufPtr = 0x38,	RxBufAddr = 0x3A,	IntrMask = 0x3C,	IntrStatus = 0x3E,	TxConfig = 0x40,	ChipVersion = 0x43,	RxConfig = 0x44,	Timer = 0x48,		/* A general-purpose counter. */	RxMissed = 0x4C,	/* 24 bits valid, write clears. */	Cfg9346 = 0x50,	Config0 = 0x51,	Config1 = 0x52,	FlashReg = 0x54,	MediaStatus = 0x58,	Config3 = 0x59,	Config4 = 0x5A,		/* absent on RTL-8139A */	HltClk = 0x5B,	MultiIntr = 0x5C,	TxSummary = 0x60,	BasicModeCtrl = 0x62,	BasicModeStatus = 0x64,	NWayAdvert = 0x66,	NWayLPAR = 0x68,	NWayExpansion = 0x6A,	/* Undocumented registers, but required for proper operation. */	FIFOTMS = 0x70,		/* FIFO Control and test. */	CSCR = 0x74,		/* Chip Status and Configuration Register. */	PARA78 = 0x78,	PARA7c = 0x7c,		/* Magic transceiver parameter register. */	Config5 = 0xD8,		/* absent on RTL-8139A */};enum ClearBitMasks {	MultiIntrClear = 0xF000,	ChipCmdClear = 0xE2,	Config1Clear = (1<<7)|(1<<6)|(1<<3)|(1<<2)|(1<<1),};enum ChipCmdBits {	CmdReset = 0x10,	CmdRxEnb = 0x08,	CmdTxEnb = 0x04,	RxBufEmpty = 0x01,};/* Interrupt register bits, using my own meaningful names. */enum IntrStatusBits {	PCIErr = 0x8000,	PCSTimeout = 0x4000,	RxFIFOOver = 0x40,	RxUnderrun = 0x20,	RxOverflow = 0x10,	TxErr = 0x08,	TxOK = 0x04,	RxErr = 0x02,	RxOK = 0x01,};enum TxStatusBits {	TxHostOwns = 0x2000,	TxUnderrun = 0x4000,	TxStatOK = 0x8000,	TxOutOfWindow = 0x20000000,	TxAborted = 0x40000000,	TxCarrierLost = 0x80000000,};enum RxStatusBits {	RxMulticast = 0x8000,	RxPhysical = 0x4000,	RxBroadcast = 0x2000,	RxBadSymbol = 0x0020,	RxRunt = 0x0010,	RxTooLong = 0x0008,	RxCRCErr = 0x0004,	RxBadAlign = 0x0002,	RxStatusOK = 0x0001,};/* Bits in RxConfig. */enum rx_mode_bits {	AcceptErr = 0x20,	AcceptRunt = 0x10,	AcceptBroadcast = 0x08,	AcceptMulticast = 0x04,	AcceptMyPhys = 0x02,	AcceptAllPhys = 0x01,};/* Bits in TxConfig. */enum tx_config_bits {	TxIFG1 = (1 << 25),	/* Interframe Gap Time */	TxIFG0 = (1 << 24),	/* Enabling these bits violates IEEE 802.3 */	TxLoopBack = (1 << 18) | (1 << 17), /* enable loopback test mode */	TxCRC = (1 << 16),	/* DISABLE appending CRC to end of Tx packets */	TxClearAbt = (1 << 0),	/* Clear abort (WO) */	TxDMAShift = 8,		/* DMA burst value (0-7) is shift this many bits */	TxVersionMask = 0x7C800000, /* mask out version bits 30-26, 23 */};/* Bits in Config1 */enum Config1Bits {	Cfg1_PM_Enable = 0x01,	Cfg1_VPD_Enable = 0x02,	Cfg1_PIO = 0x04,	Cfg1_MMIO = 0x08,	Cfg1_LWAKE = 0x10,	Cfg1_Driver_Load = 0x20,	Cfg1_LED0 = 0x40,	Cfg1_LED1 = 0x80,};enum RxConfigBits {	/* Early Rx threshold, none or X/16 */	RxCfgEarlyRxNone = 0,	RxCfgEarlyRxShift = 24,	/* rx fifo threshold */	RxCfgFIFOShift = 13,	RxCfgFIFONone = (7 << RxCfgFIFOShift),	/* Max DMA burst */	RxCfgDMAShift = 8,	RxCfgDMAUnlimited = (7 << RxCfgDMAShift),	/* rx ring buffer length */	RxCfgRcv8K = 0,	RxCfgRcv16K = (1 << 11),	RxCfgRcv32K = (1 << 12),	RxCfgRcv64K = (1 << 11) | (1 << 12),	/* Disable packet wrap at end of Rx buffer */	RxNoWrap = (1 << 7),};/* Twister tuning parameters from RealTek.   Completely undocumented, but required to tune bad links. */enum CSCRBits {	CSCR_LinkOKBit = 0x0400,	CSCR_LinkChangeBit = 0x0800,	CSCR_LinkStatusBits = 0x0f000,	CSCR_LinkDownOffCmd = 0x003c0,	CSCR_LinkDownCmd = 0x0f3c0,};enum Cfg9346Bits {	Cfg9346_Lock = 0x00,	Cfg9346_Unlock = 0xC0,};#define PARA78_default	0x78fa8388#define PARA7c_default	0xcb38de43	/* param[0][3] */#define PARA7c_xxx		0xcb38de43static const unsigned long param[4][4] = {	{0xcb39de43, 0xcb39ce43, 0xfb38de03, 0xcb38de43},	{0xcb39de43, 0xcb39ce43, 0xcb39ce83, 0xcb39ce83},	{0xcb39de43, 0xcb39ce43, 0xcb39ce83, 0xcb39ce83},	{0xbb39de43, 0xbb39ce43, 0xbb39ce83, 0xbb39ce83}};struct ring_info {	struct sk_buff *skb;	dma_addr_t mapping;};typedef enum {	CH_8139 = 0,	CH_8139_K,	CH_8139A,	CH_8139B,	CH_8130,	CH_8139C,} chip_t;/* directly indexed by chip_t, above */const static struct {	const char *name;	u8 version; /* from RTL8139C docs */	u32 RxConfigMask; /* should clear the bits supported by this chip */} rtl_chip_info[] = {	{ "RTL-8139",	  0x40,	  0xf0fe0040, /* XXX copied from RTL8139A, verify */	},	{ "RTL-8139 rev K",	  0x60,	  0xf0fe0040,	},	{ "RTL-8139A",	  0x70,	  0xf0fe0040,	},	{ "RTL-8139B",	  0x78,	  0xf0fc0040	},	{ "RTL-8130",	  0x7C,	  0xf0fe0040, /* XXX copied from RTL8139A, verify */	},	{ "RTL-8139C",	  0x74,	  0xf0fc0040, /* XXX copied from RTL8139B, verify */	},};struct netdrv_private {	board_t board;	void *mmio_addr;	int drv_flags;	struct pci_dev *pci_dev;	struct net_device_stats stats;	struct timer_list timer;	/* Media selection timer. */	unsigned char *rx_ring;	unsigned int cur_rx;	/* Index into the Rx buffer of next Rx pkt. */	unsigned int tx_flag;	atomic_t cur_tx;	atomic_t dirty_tx;	/* The saved address of a sent-in-place packet/buffer, for skfree(). */	struct ring_info tx_info[NUM_TX_DESC];	unsigned char *tx_buf[NUM_TX_DESC];	/* Tx bounce buffers */	unsigned char *tx_bufs;	/* Tx bounce buffer region. */	dma_addr_t rx_ring_dma;	dma_addr_t tx_bufs_dma;	char phys[4];		/* MII device addresses. */	char twistie, twist_row, twist_col;	/* Twister tune state. */	unsigned int full_duplex:1;	/* Full-duplex operation requested. */	unsigned int duplex_lock:1;	unsigned int default_port:4;	/* Last dev->if_port value. */	unsigned int media2:4;	/* Secondary monitored media port. */	unsigned int medialock:1;	/* Don't sense media type. */	unsigned int mediasense:1;	/* Media sensing in progress. */	spinlock_t lock;	chip_t chipset;};MODULE_AUTHOR ("Jeff Garzik <jgarzik@mandrakesoft.com>");MODULE_DESCRIPTION ("Skeleton for a PCI Fast Ethernet driver");MODULE_LICENSE("GPL");MODULE_PARM (multicast_filter_limit, "i");MODULE_PARM (max_interrupt_work, "i");MODULE_PARM (debug, "i");MODULE_PARM (media, "1-" __MODULE_STRING(8) "i");MODULE_PARM_DESC (multicast_filter_limit, "pci-skeleton maximum number of filtered multicast addresses");MODULE_PARM_DESC (max_interrupt_work, "pci-skeleton maximum events handled per interrupt");MODULE_PARM_DESC (media, "pci-skeleton: Bits 0-3: media type, bit 17: full duplex");MODULE_PARM_DESC (debug, "(unused)");static int read_eeprom (void *ioaddr, int location, int addr_len);static int netdrv_open (struct net_device *dev);static int mdio_read (struct net_device *dev, int phy_id, int location);static void mdio_write (struct net_device *dev, int phy_id, int location,			int val);static void netdrv_timer (unsigned long data);static void netdrv_tx_timeout (struct net_device *dev);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
制服丝袜激情欧洲亚洲| 51午夜精品国产| 日本人妖一区二区| 国产精品伦一区二区三级视频| 色哟哟一区二区| 国产精一区二区三区| 亚洲精品久久久蜜桃| 精品久久人人做人人爱| 在线观看国产精品网站| 国内精品免费在线观看| 亚洲高清免费在线| 国产精品伦理一区二区| 日韩亚洲电影在线| 欧美日韩中文另类| 99久久久无码国产精品| 国产乱码精品一区二区三区五月婷| 一区二区三区四区av| 国产亚洲精品超碰| 日韩一区二区不卡| 欧美性大战久久久久久久| 国产成人在线看| 毛片av中文字幕一区二区| 欧美欧美午夜aⅴ在线观看| 午夜日韩在线观看| 在线亚洲一区观看| 国产成人av网站| 久久精品久久99精品久久| 亚洲免费观看在线观看| 久久精品综合网| 欧美精品自拍偷拍| 97精品电影院| 9i在线看片成人免费| 国产精品一区2区| 久久精品国产99国产| 免费看日韩精品| 日韩高清在线一区| 亚洲一区二区美女| 亚洲成人动漫精品| 亚洲午夜激情av| 亚洲综合在线观看视频| 亚洲少妇30p| 中文字幕在线免费不卡| 国产精品素人视频| 久久久久亚洲综合| 久久久精品国产99久久精品芒果| 欧美不卡一区二区三区| 欧美v亚洲v综合ⅴ国产v| 欧美mv和日韩mv的网站| 欧美一区二区黄色| 日韩精品资源二区在线| 精品日韩欧美在线| 久久―日本道色综合久久| 久久色.com| 国产日韩欧美一区二区三区乱码 | 成人免费观看视频| 成人综合在线观看| 91丨porny丨国产| 一本大道av伊人久久综合| 色狠狠一区二区三区香蕉| 色悠悠亚洲一区二区| 欧美色网站导航| 91精品国产日韩91久久久久久| 精品国精品自拍自在线| 久久久久久久久岛国免费| 中文一区二区在线观看 | 日本伊人色综合网| 六月丁香婷婷久久| 成人免费看的视频| 欧美天堂一区二区三区| 91精品福利在线一区二区三区| 精品粉嫩超白一线天av| 国产视频一区在线观看| 亚洲日本在线天堂| 日韩精品亚洲一区二区三区免费| 麻豆成人91精品二区三区| 国产一区二区三区四| 99久久国产综合精品色伊| 欧美性一级生活| 精品少妇一区二区| 亚洲精品视频在线看| 日韩激情视频在线观看| 国产馆精品极品| 色94色欧美sute亚洲线路一ni| 在线不卡欧美精品一区二区三区| 欧美r级电影在线观看| 国产精品久久久久影视| 午夜视频在线观看一区二区三区 | 在线日韩av片| 欧美一卡2卡3卡4卡| 国产欧美精品一区二区三区四区 | 欧美日韩精品是欧美日韩精品| 日韩精品一区二区三区蜜臀| 中文字幕中文字幕一区二区| 日韩高清不卡在线| 成+人+亚洲+综合天堂| 91精品婷婷国产综合久久竹菊| 久久久久久久久久看片| 亚洲第一成人在线| 国产福利一区在线观看| 欧美午夜精品一区二区三区| 精品少妇一区二区三区视频免付费 | 日韩专区中文字幕一区二区| 精品一区二区在线看| 99久免费精品视频在线观看| 欧美男男青年gay1069videost| 日韩一区二区三区四区| 中文字幕视频一区| 美女被吸乳得到大胸91| 成人av网在线| 日韩欧美成人激情| 一区二区三区精品视频| 国产综合成人久久大片91| 欧美日韩一二区| 国产色爱av资源综合区| 亚洲高清免费一级二级三级| 国产超碰在线一区| 在线成人av网站| 亚洲欧美视频一区| 亚洲精品国产精品乱码不99| 国产一区二区伦理片| 精品视频在线视频| 欧美激情中文不卡| 美女www一区二区| 欧美在线免费观看亚洲| 日本一区二区三区在线不卡 | 免费成人在线视频观看| 91丨porny丨首页| 欧美激情综合在线| 久久99久久久久| 欧美日韩一区二区在线观看| 国产欧美一区二区三区在线看蜜臀 | 国产综合色在线| 欧美一区二区三区精品| 亚洲欧美精品午睡沙发| 国产电影一区在线| 日韩一级二级三级| 午夜婷婷国产麻豆精品| 99国产欧美久久久精品| 日韩一区欧美小说| 国产精品91xxx| 欧美大片国产精品| 免费成人深夜小野草| 欧美日本在线播放| 亚洲不卡av一区二区三区| 欧美日韩亚洲另类| 亚洲国产日韩综合久久精品| 色成年激情久久综合| 亚洲日本一区二区| 成人一区二区三区| 国产日韩影视精品| 成人午夜电影网站| 欧美激情中文字幕一区二区| 国产精品一区二区黑丝| 国产亚洲一区二区在线观看| 麻豆一区二区三| 欧美日韩一二三区| 麻豆国产一区二区| 日韩精品在线一区| 久久99精品久久久久久国产越南| 91精品国产全国免费观看| 婷婷久久综合九色综合伊人色| 欧美视频精品在线观看| 蜜臀精品一区二区三区在线观看| 91.xcao| 六月丁香婷婷色狠狠久久| 日韩精品一区二区三区四区| 久久99精品久久只有精品| 久久亚洲精华国产精华液 | 国产农村妇女精品| 国产成人午夜高潮毛片| 国产精品国产三级国产aⅴ原创| 成人手机电影网| 亚洲情趣在线观看| 欧美日韩国产综合久久| 久久av资源站| 中文字幕一区二区三区四区| 色成年激情久久综合| 首页亚洲欧美制服丝腿| 欧美videofree性高清杂交| 国产福利一区在线观看| 久久久综合视频| 欧美在线看片a免费观看| 日日夜夜一区二区| 精品国产制服丝袜高跟| 不卡av在线网| 一区二区三区欧美激情| 亚洲精品在线三区| 成人av影院在线| 日韩精品福利网| 久久精品视频在线看| 欧美手机在线视频| 精品一区二区三区在线观看| 国产精品午夜在线| 欧美日韩精品免费| 国产凹凸在线观看一区二区| 亚洲成年人网站在线观看| 久久久久青草大香线综合精品| 92国产精品观看| 免费观看日韩av| 亚洲视频在线一区观看|