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

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

?? 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++;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产99久久久久| 国产裸体歌舞团一区二区| 亚洲视频香蕉人妖| 中文字幕综合网| 中文字幕av在线一区二区三区| 国产欧美一区二区精品婷婷| 综合久久久久久| 亚洲一区二区三区四区的| 日韩和欧美的一区| 韩国成人精品a∨在线观看| 国产成人精品免费视频网站| 高清不卡在线观看| 一本色道久久加勒比精品| 欧美日韩午夜在线| 欧美xxxx老人做受| 国产亚洲自拍一区| 成人免费小视频| 午夜精品久久久久久久久久| 免费观看在线色综合| 国产精品一品二品| 成人午夜激情视频| 欧美群妇大交群的观看方式| 久久综合九色综合97婷婷| 自拍偷自拍亚洲精品播放| 亚洲视频精选在线| 亚洲欧美成aⅴ人在线观看| 日韩成人伦理电影在线观看| 暴力调教一区二区三区| 欧美成人艳星乳罩| 亚洲福利一区二区| 不卡一区二区三区四区| 精品国产精品网麻豆系列| 亚洲小说春色综合另类电影| 成人的网站免费观看| 欧美一区午夜精品| 亚洲综合av网| 99精品视频在线免费观看| 亚洲精品一区二区三区精华液| 亚洲午夜精品久久久久久久久| 床上的激情91.| 欧美变态口味重另类| 亚洲444eee在线观看| 99久久99久久免费精品蜜臀| 欧美精品一区二区不卡| 日韩在线a电影| 色狠狠色噜噜噜综合网| 中文子幕无线码一区tr| 国产一区二区美女| 欧美va亚洲va| 老司机精品视频在线| 欧美日韩国产小视频| 亚洲欧美日韩国产综合在线| 成a人片亚洲日本久久| 久久久亚洲午夜电影| 麻豆成人在线观看| 日韩亚洲欧美一区| 日本成人中文字幕在线视频| 欧美日韩激情在线| 亚洲午夜视频在线| 91黄色免费观看| 亚洲欧美另类久久久精品| 成人精品高清在线| 国产精品久99| 成人av电影免费观看| 国产精品你懂的在线欣赏| 国产二区国产一区在线观看| 精品国产麻豆免费人成网站| 老司机精品视频在线| 欧美成人精品高清在线播放| 毛片不卡一区二区| 精品国内二区三区| 国产一区二区电影| 国产午夜亚洲精品理论片色戒| 国产河南妇女毛片精品久久久| 久久综合资源网| 国产成人一级电影| 国产免费久久精品| www.爱久久.com| 一区二区三区在线高清| 日本韩国一区二区三区视频| 一个色综合av| 欧美日韩一卡二卡三卡 | 久久成人免费电影| 欧美成人精品高清在线播放| 国产一区二区三区免费看| 久久先锋影音av| 成人免费高清视频在线观看| 一区精品在线播放| 日本精品视频一区二区| 午夜一区二区三区视频| 日韩三级视频中文字幕| 黑人精品欧美一区二区蜜桃| 国产欧美日韩三级| 色天天综合色天天久久| 爽好久久久欧美精品| 日韩视频一区在线观看| 国产精品18久久久久久久久| 国产精品免费免费| 欧美最猛黑人xxxxx猛交| 日韩精品一区第一页| 精品av久久707| 99免费精品视频| 三级不卡在线观看| 久久人人97超碰com| 99久久免费精品| 天堂在线亚洲视频| 久久久国际精品| 91成人在线精品| 久久99热这里只有精品| 日本一区二区久久| 欧美色图12p| 国产美女视频一区| 一区二区三区久久| 精品少妇一区二区三区视频免付费 | 国产夫妻精品视频| 一区二区三区在线视频观看| 日韩亚洲欧美在线观看| jizz一区二区| 日韩精品亚洲一区| 亚洲国产经典视频| 欧美老年两性高潮| 高清不卡一区二区在线| 五月综合激情网| 日本一二三不卡| 91精品国产一区二区人妖| 不卡影院免费观看| 麻豆视频一区二区| 亚洲人快播电影网| 欧美精品一区二区久久婷婷| 欧美系列日韩一区| 国产成人a级片| 天天综合天天做天天综合| 国产婷婷精品av在线| 欧美日韩情趣电影| 成人免费视频caoporn| 欧美a级一区二区| 亚洲欧洲av另类| 日韩精品中文字幕在线不卡尤物| 色欧美日韩亚洲| 国产白丝精品91爽爽久久| 日韩高清中文字幕一区| 一区二区三区中文字幕| 久久久久久久综合色一本| 欧美日韩1区2区| 色欧美88888久久久久久影院| 国精产品一区一区三区mba视频 | 欧美日韩一区成人| av成人免费在线观看| 国产九色精品成人porny| 日精品一区二区| 一区二区三区四区亚洲| 国产欧美久久久精品影院| 欧美成人官网二区| 欧美日韩高清在线| 在线观看亚洲精品| 99视频精品在线| 国产精品一区二区男女羞羞无遮挡| 午夜精品久久久久| 亚洲一区二区三区不卡国产欧美| 国产精品久久久久三级| 国产亚洲精品资源在线26u| 日韩欧美一区二区不卡| 欧美久久高跟鞋激| 欧美日韩一区成人| 欧美性三三影院| 91国产免费观看| 91在线视频观看| 99久久精品免费看| fc2成人免费人成在线观看播放 | 国产精品久久久久一区二区三区| 久久一夜天堂av一区二区三区 | 国产成人精品综合在线观看 | www久久久久| 精品噜噜噜噜久久久久久久久试看| 欧美精品三级日韩久久| 欧美午夜不卡在线观看免费| 色av综合在线| 91在线精品一区二区| jlzzjlzz国产精品久久| av动漫一区二区| 91麻豆精品在线观看| av电影天堂一区二区在线| av在线一区二区三区| fc2成人免费人成在线观看播放| 成人黄色av网站在线| 成人理论电影网| 91在线一区二区三区| 色香蕉成人二区免费| 在线欧美日韩国产| 欧亚一区二区三区| 欧美三区在线观看| 91.成人天堂一区| 日韩欧美高清dvd碟片| 久久久欧美精品sm网站| 久久久久亚洲蜜桃| 国产精品私人自拍| 亚洲男人的天堂在线aⅴ视频| 一个色在线综合| 琪琪久久久久日韩精品| 久久超碰97中文字幕|