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

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

?? e1000.c

?? u-boot-1.1.6 源碼包
?? C
?? 第 1 頁 / 共 5 頁
字號:
/**************************************************************************Inter Pro 1000 for ppcboot/das-u-bootDrivers are port from Intel's Linux driver e1000-4.3.15and from Etherboot pro 1000 driver by mrakes at vivato dot nettested on both gig copper and gig fiber boards***************************************************************************//*******************************************************************************  Copyright(c) 1999 - 2002 Intel Corporation. All rights reserved.  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.  This program is distributed in the hope that it will be useful, but WITHOUT  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for  more details.  You should have received a copy of the GNU General Public License along with  this program; if not, write to the Free Software Foundation, Inc., 59  Temple Place - Suite 330, Boston, MA  02111-1307, USA.  The full GNU General Public License is included in this distribution in the  file called LICENSE.  Contact Information:  Linux NICS <linux.nics@intel.com>  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497*******************************************************************************//* *  Copyright (C) Archway Digital Solutions. * *  written by Chrsitopher Li <cli at arcyway dot com> or <chrisl at gnuchina dot org> *  2/9/2002 * *  Copyright (C) Linux Networx. *  Massive upgrade to work with the new intel gigabit NICs. *  <ebiederman at lnxi dot com> */#include "e1000.h"#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_NET_MULTI) && \	defined(CONFIG_E1000)#define TOUT_LOOP   100000#undef	virt_to_bus#define	virt_to_bus(x)	((unsigned long)x)#define bus_to_phys(devno, a)	pci_mem_to_phys(devno, a)#define mdelay(n)       udelay((n)*1000)#define E1000_DEFAULT_PBA    0x00000030/* NIC specific static variables go here */static char tx_pool[128 + 16];static char rx_pool[128 + 16];static char packet[2096];static struct e1000_tx_desc *tx_base;static struct e1000_rx_desc *rx_base;static int tx_tail;static int rx_tail, rx_last;static struct pci_device_id supported[] = {	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82542},	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82543GC_FIBER},	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82543GC_COPPER},	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82544EI_COPPER},	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82544EI_FIBER},	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82544GC_COPPER},	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82544GC_LOM},	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82540EM},	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82545EM_COPPER},	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82546EB_COPPER},	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82545EM_FIBER},	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82546EB_FIBER},	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82540EM_LOM},};/* Function forward declarations */static int e1000_setup_link(struct eth_device *nic);static int e1000_setup_fiber_link(struct eth_device *nic);static int e1000_setup_copper_link(struct eth_device *nic);static int e1000_phy_setup_autoneg(struct e1000_hw *hw);static void e1000_config_collision_dist(struct e1000_hw *hw);static int e1000_config_mac_to_phy(struct e1000_hw *hw);static int e1000_config_fc_after_link_up(struct e1000_hw *hw);static int e1000_check_for_link(struct eth_device *nic);static int e1000_wait_autoneg(struct e1000_hw *hw);static void e1000_get_speed_and_duplex(struct e1000_hw *hw, uint16_t * speed,				       uint16_t * duplex);static int e1000_read_phy_reg(struct e1000_hw *hw, uint32_t reg_addr,			      uint16_t * phy_data);static int e1000_write_phy_reg(struct e1000_hw *hw, uint32_t reg_addr,			       uint16_t phy_data);static void e1000_phy_hw_reset(struct e1000_hw *hw);static int e1000_phy_reset(struct e1000_hw *hw);static int e1000_detect_gig_phy(struct e1000_hw *hw);#define E1000_WRITE_REG(a, reg, value) (writel((value), ((a)->hw_addr + E1000_##reg)))#define E1000_READ_REG(a, reg) (readl((a)->hw_addr + E1000_##reg))#define E1000_WRITE_REG_ARRAY(a, reg, offset, value) (\			writel((value), ((a)->hw_addr + E1000_##reg + ((offset) << 2))))#define E1000_READ_REG_ARRAY(a, reg, offset) ( \	readl((a)->hw_addr + E1000_##reg + ((offset) << 2)))#define E1000_WRITE_FLUSH(a) {uint32_t x; x = E1000_READ_REG(a, STATUS);}#ifndef CONFIG_AP1000 /* remove for warnings *//****************************************************************************** * Raises the EEPROM's clock input. * * hw - Struct containing variables accessed by shared code * eecd - EECD's current value *****************************************************************************/static voide1000_raise_ee_clk(struct e1000_hw *hw, uint32_t * eecd){	/* Raise the clock input to the EEPROM (by setting the SK bit), and then	 * wait 50 microseconds.	 */	*eecd = *eecd | E1000_EECD_SK;	E1000_WRITE_REG(hw, EECD, *eecd);	E1000_WRITE_FLUSH(hw);	udelay(50);}/****************************************************************************** * Lowers the EEPROM's clock input. * * hw - Struct containing variables accessed by shared code * eecd - EECD's current value *****************************************************************************/static voide1000_lower_ee_clk(struct e1000_hw *hw, uint32_t * eecd){	/* Lower the clock input to the EEPROM (by clearing the SK bit), and then	 * wait 50 microseconds.	 */	*eecd = *eecd & ~E1000_EECD_SK;	E1000_WRITE_REG(hw, EECD, *eecd);	E1000_WRITE_FLUSH(hw);	udelay(50);}/****************************************************************************** * Shift data bits out to the EEPROM. * * hw - Struct containing variables accessed by shared code * data - data to send to the EEPROM * count - number of bits to shift out *****************************************************************************/static voide1000_shift_out_ee_bits(struct e1000_hw *hw, uint16_t data, uint16_t count){	uint32_t eecd;	uint32_t mask;	/* We need to shift "count" bits out to the EEPROM. So, value in the	 * "data" parameter will be shifted out to the EEPROM one bit at a time.	 * In order to do this, "data" must be broken down into bits.	 */	mask = 0x01 << (count - 1);	eecd = E1000_READ_REG(hw, EECD);	eecd &= ~(E1000_EECD_DO | E1000_EECD_DI);	do {		/* A "1" is shifted out to the EEPROM by setting bit "DI" to a "1",		 * and then raising and then lowering the clock (the SK bit controls		 * the clock input to the EEPROM).  A "0" is shifted out to the EEPROM		 * by setting "DI" to "0" and then raising and then lowering the clock.		 */		eecd &= ~E1000_EECD_DI;		if (data & mask)			eecd |= E1000_EECD_DI;		E1000_WRITE_REG(hw, EECD, eecd);		E1000_WRITE_FLUSH(hw);		udelay(50);		e1000_raise_ee_clk(hw, &eecd);		e1000_lower_ee_clk(hw, &eecd);		mask = mask >> 1;	} while (mask);	/* We leave the "DI" bit set to "0" when we leave this routine. */	eecd &= ~E1000_EECD_DI;	E1000_WRITE_REG(hw, EECD, eecd);}/****************************************************************************** * Shift data bits in from the EEPROM * * hw - Struct containing variables accessed by shared code *****************************************************************************/static uint16_te1000_shift_in_ee_bits(struct e1000_hw *hw){	uint32_t eecd;	uint32_t i;	uint16_t data;	/* In order to read a register from the EEPROM, we need to shift 16 bits	 * in from the EEPROM. Bits are "shifted in" by raising the clock input to	 * the EEPROM (setting the SK bit), and then reading the value of the "DO"	 * bit.  During this "shifting in" process the "DI" bit should always be	 * clear..	 */	eecd = E1000_READ_REG(hw, EECD);	eecd &= ~(E1000_EECD_DO | E1000_EECD_DI);	data = 0;	for (i = 0; i < 16; i++) {		data = data << 1;		e1000_raise_ee_clk(hw, &eecd);		eecd = E1000_READ_REG(hw, EECD);		eecd &= ~(E1000_EECD_DI);		if (eecd & E1000_EECD_DO)			data |= 1;		e1000_lower_ee_clk(hw, &eecd);	}	return data;}/****************************************************************************** * Prepares EEPROM for access * * hw - Struct containing variables accessed by shared code * * Lowers EEPROM clock. Clears input pin. Sets the chip select pin. This * function should be called before issuing a command to the EEPROM. *****************************************************************************/static voide1000_setup_eeprom(struct e1000_hw *hw){	uint32_t eecd;	eecd = E1000_READ_REG(hw, EECD);	/* Clear SK and DI */	eecd &= ~(E1000_EECD_SK | E1000_EECD_DI);	E1000_WRITE_REG(hw, EECD, eecd);	/* Set CS */	eecd |= E1000_EECD_CS;	E1000_WRITE_REG(hw, EECD, eecd);}/****************************************************************************** * Returns EEPROM to a "standby" state * * hw - Struct containing variables accessed by shared code *****************************************************************************/static voide1000_standby_eeprom(struct e1000_hw *hw){	uint32_t eecd;	eecd = E1000_READ_REG(hw, EECD);	/* Deselct EEPROM */	eecd &= ~(E1000_EECD_CS | E1000_EECD_SK);	E1000_WRITE_REG(hw, EECD, eecd);	E1000_WRITE_FLUSH(hw);	udelay(50);	/* Clock high */	eecd |= E1000_EECD_SK;	E1000_WRITE_REG(hw, EECD, eecd);	E1000_WRITE_FLUSH(hw);	udelay(50);	/* Select EEPROM */	eecd |= E1000_EECD_CS;	E1000_WRITE_REG(hw, EECD, eecd);	E1000_WRITE_FLUSH(hw);	udelay(50);	/* Clock low */	eecd &= ~E1000_EECD_SK;	E1000_WRITE_REG(hw, EECD, eecd);	E1000_WRITE_FLUSH(hw);	udelay(50);}/****************************************************************************** * Reads a 16 bit word from the EEPROM. * * hw - Struct containing variables accessed by shared code * offset - offset of  word in the EEPROM to read * data - word read from the EEPROM *****************************************************************************/static inte1000_read_eeprom(struct e1000_hw *hw, uint16_t offset, uint16_t * data){	uint32_t eecd;	uint32_t i = 0;	int large_eeprom = FALSE;	/* Request EEPROM Access */	if (hw->mac_type > e1000_82544) {		eecd = E1000_READ_REG(hw, EECD);		if (eecd & E1000_EECD_SIZE)			large_eeprom = TRUE;		eecd |= E1000_EECD_REQ;		E1000_WRITE_REG(hw, EECD, eecd);		eecd = E1000_READ_REG(hw, EECD);		while ((!(eecd & E1000_EECD_GNT)) && (i < 100)) {			i++;			udelay(10);			eecd = E1000_READ_REG(hw, EECD);		}		if (!(eecd & E1000_EECD_GNT)) {			eecd &= ~E1000_EECD_REQ;			E1000_WRITE_REG(hw, EECD, eecd);			DEBUGOUT("Could not acquire EEPROM grant\n");			return -E1000_ERR_EEPROM;		}	}	/*  Prepare the EEPROM for reading  */	e1000_setup_eeprom(hw);	/*  Send the READ command (opcode + addr)  */	e1000_shift_out_ee_bits(hw, EEPROM_READ_OPCODE, 3);	e1000_shift_out_ee_bits(hw, offset, (large_eeprom) ? 8 : 6);	/* Read the data */	*data = e1000_shift_in_ee_bits(hw);	/* End this read operation */	e1000_standby_eeprom(hw);	/* Stop requesting EEPROM access */	if (hw->mac_type > e1000_82544) {		eecd = E1000_READ_REG(hw, EECD);		eecd &= ~E1000_EECD_REQ;		E1000_WRITE_REG(hw, EECD, eecd);	}	return 0;}#if 0static voide1000_eeprom_cleanup(struct e1000_hw *hw){	uint32_t eecd;	eecd = E1000_READ_REG(hw, EECD);	eecd &= ~(E1000_EECD_CS | E1000_EECD_DI);	E1000_WRITE_REG(hw, EECD, eecd);	e1000_raise_ee_clk(hw, &eecd);	e1000_lower_ee_clk(hw, &eecd);}static uint16_te1000_wait_eeprom_done(struct e1000_hw *hw){	uint32_t eecd;	uint32_t i;	e1000_standby_eeprom(hw);	for (i = 0; i < 200; i++) {		eecd = E1000_READ_REG(hw, EECD);		if (eecd & E1000_EECD_DO)			return (TRUE);		udelay(5);	}	return (FALSE);}static inte1000_write_eeprom(struct e1000_hw *hw, uint16_t Reg, uint16_t Data){	uint32_t eecd;	int large_eeprom = FALSE;	int i = 0;	/* Request EEPROM Access */	if (hw->mac_type > e1000_82544) {		eecd = E1000_READ_REG(hw, EECD);		if (eecd & E1000_EECD_SIZE)			large_eeprom = TRUE;		eecd |= E1000_EECD_REQ;		E1000_WRITE_REG(hw, EECD, eecd);		eecd = E1000_READ_REG(hw, EECD);		while ((!(eecd & E1000_EECD_GNT)) && (i < 100)) {			i++;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线观看视频欧美| 亚洲欧洲另类国产综合| 中文一区在线播放| 日韩高清不卡一区| 日本韩国欧美一区| 国产精品美女视频| 另类欧美日韩国产在线| 欧美日韩在线三级| 日韩毛片精品高清免费| 国产精品18久久久久久vr| 在线综合亚洲欧美在线视频| 亚洲欧美国产77777| 国产精品一区二区在线观看不卡| 欧美日韩免费电影| 一区二区三区日本| 一本色道久久综合精品竹菊| 日本一区二区成人在线| 狠狠色丁香婷综合久久| 欧美高清视频一二三区| 亚洲一区二区三区小说| 99在线精品一区二区三区| 国产欧美日韩视频在线观看| 久久er精品视频| 日韩欧美成人激情| 石原莉奈一区二区三区在线观看| 精品视频一区二区三区免费| 亚洲精品中文字幕乱码三区| 成人黄色综合网站| 中文字幕日本不卡| 91蜜桃免费观看视频| 国产精品久久久久久久久晋中| 国精产品一区一区三区mba桃花 | 精品美女一区二区| 麻豆精品在线播放| 精品免费国产二区三区| 久久99精品久久久久久久久久久久| 69av一区二区三区| 免费观看日韩av| 精品久久久影院| 国产美女一区二区三区| 亚洲国产高清在线观看视频| 成人久久18免费网站麻豆| 一区在线观看免费| 99久久综合狠狠综合久久| 亚洲品质自拍视频| 欧美亚洲一区二区在线| 欧美bbbbb| 久久久久久久久蜜桃| 成人爱爱电影网址| 一区二区三区四区亚洲| 4438成人网| 国产剧情在线观看一区二区| 久久一区二区三区国产精品| 国产精品系列在线播放| 日韩一区日韩二区| 欧美日韩综合色| 精品一区二区免费| 最新国产の精品合集bt伙计| 欧美日韩中文字幕一区二区| 韩国av一区二区三区四区| 国产欧美中文在线| 欧美在线一区二区| 久久精品国产亚洲a| 国产精品伦理在线| 欧美精品免费视频| 国产福利一区在线观看| 亚洲精品免费播放| 精品日本一线二线三线不卡| www.欧美色图| 日本不卡一二三| |精品福利一区二区三区| 4438成人网| 欧美无乱码久久久免费午夜一区| 蜜臀va亚洲va欧美va天堂| 国产精品久久久一本精品| 欧美精品久久天天躁| 成人激情小说乱人伦| 视频一区二区国产| 亚洲色图欧洲色图| 久久尤物电影视频在线观看| 欧美日韩一区二区在线观看| 成人综合婷婷国产精品久久| 日韩精品一二三| 一区二区三区在线看| 日韩欧美亚洲国产精品字幕久久久 | 欧美日韩免费在线视频| 国产精品18久久久久久久久久久久| 亚洲一二三区不卡| 国产午夜精品一区二区| 91精品国产综合久久精品app| 99久久伊人网影院| 国产精品一卡二卡在线观看| 视频一区视频二区中文字幕| √…a在线天堂一区| 久久综合久久综合久久综合| 欧美日韩免费电影| 欧美性受xxxx黑人xyx性爽| 国产91丝袜在线播放九色| 久久99国产精品尤物| 日韩影院在线观看| 洋洋av久久久久久久一区| 亚洲人亚洲人成电影网站色| 国产欧美一区二区精品仙草咪| 欧美电视剧免费观看| 3d动漫精品啪啪1区2区免费| 欧美吻胸吃奶大尺度电影| 在线欧美日韩国产| 一本色道久久综合亚洲精品按摩| av成人免费在线观看| 成人av综合一区| 成人av资源下载| 97国产一区二区| 色综合夜色一区| 欧美色精品在线视频| 欧美丝袜丝交足nylons图片| 在线亚洲人成电影网站色www| 97aⅴ精品视频一二三区| 一本色道久久综合狠狠躁的推荐| 91亚洲永久精品| 在线观看av一区| 欧美三级韩国三级日本一级| 欧美日韩国产一级二级| 欧美三级欧美一级| 91精品国产欧美日韩| 精品久久99ma| 国产日本欧美一区二区| 日韩理论在线观看| 一区二区三区免费网站| 婷婷综合另类小说色区| 日韩av网站免费在线| 韩国一区二区在线观看| av一二三不卡影片| 欧美主播一区二区三区| 欧美日韩色综合| 精品av久久707| 国产精品人人做人人爽人人添| 亚洲色图欧洲色图婷婷| 午夜精品久久久久影视| 精品无码三级在线观看视频| 高清视频一区二区| 色噜噜久久综合| 精品国产髙清在线看国产毛片| 欧美激情综合网| 洋洋成人永久网站入口| 久久精品国产色蜜蜜麻豆| eeuss鲁一区二区三区| 欧美怡红院视频| 国产午夜精品福利| 一区二区不卡在线播放| 麻豆国产一区二区| 色综合夜色一区| 26uuu色噜噜精品一区二区| 亚洲欧洲综合另类| 日本道免费精品一区二区三区| 精品福利一二区| 国产盗摄女厕一区二区三区| 成人开心网精品视频| 在线观看91精品国产麻豆| 国产亚洲1区2区3区| 亚洲一区二区综合| 福利一区二区在线| 51精品国自产在线| 自拍偷拍欧美精品| 激情小说欧美图片| 欧美综合在线视频| 中文字幕不卡在线| 麻豆高清免费国产一区| 欧美亚洲国产怡红院影院| 精品不卡在线视频| 日本网站在线观看一区二区三区| 成人h精品动漫一区二区三区| 26uuu精品一区二区| 亚洲风情在线资源站| 成人少妇影院yyyy| 26uuu国产电影一区二区| 亚洲国产一区二区视频| 99久久婷婷国产综合精品电影 | 91久久精品一区二区| 国产日韩欧美a| 极品美女销魂一区二区三区| 欧美日韩精品福利| 一区二区三区波多野结衣在线观看| 国产高清久久久久| 精品999在线播放| 蜜臀av性久久久久蜜臀aⅴ四虎| 欧美午夜精品久久久久久超碰| 综合激情成人伊人| 成人性生交大片| 中文字幕不卡在线观看| 国产精品资源在线| 国产香蕉久久精品综合网| 久久国产夜色精品鲁鲁99| 欧美精品欧美精品系列| 五月天丁香久久| 91精品国产手机| 午夜久久福利影院| 91精品欧美福利在线观看| 丝袜国产日韩另类美女| 欧美一区二区三区成人| 美脚の诱脚舐め脚责91|