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

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

?? e1000.c

?? 嵌入式試驗箱S3C2410的bootloader源代碼
?? 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一区二区三区免费野_久草精品视频
国产成人精品影视| 欧美影院午夜播放| 国产成人在线视频网站| 欧美日韩久久久一区| 国产精品久久久久久久久免费相片 | 国产不卡视频一区| 精品成人在线观看| 麻豆成人综合网| 久久久午夜精品理论片中文字幕| 亚洲在线成人精品| 欧美日韩高清一区二区| 午夜精彩视频在线观看不卡| 91老司机福利 在线| 国产精品久久久久久久久久免费看 | 午夜欧美电影在线观看| 亚洲欧洲综合另类在线| 高清不卡一二三区| 美女在线视频一区| 色综合久久中文字幕综合网 | 欧美日韩黄色一区二区| 亚洲日本va午夜在线影院| 亚洲成人自拍网| 精品av综合导航| 成人免费精品视频| 亚洲丝袜自拍清纯另类| 欧美亚洲一区三区| 国产专区欧美精品| 国产精品久久久久精k8| 91无套直看片红桃| 欧美aⅴ一区二区三区视频| 欧美经典一区二区| www.色精品| 国产亚洲视频系列| 欧美电视剧在线观看完整版| 在线免费视频一区二区| 午夜av一区二区三区| 国产午夜亚洲精品理论片色戒| 91麻豆蜜桃一区二区三区| 九色porny丨国产精品| 亚洲免费观看高清完整版在线观看熊| 精品成人一区二区| 日韩精品一区二| 成人av电影观看| 国产老女人精品毛片久久| 丝袜a∨在线一区二区三区不卡| 久久嫩草精品久久久久| 欧美妇女性影城| 欧美一激情一区二区三区| 欧美日韩中文国产| 91国内精品野花午夜精品| 91色九色蝌蚪| 欧美卡1卡2卡| 精品捆绑美女sm三区| 亚洲欧洲精品成人久久奇米网| 一区在线观看视频| 一卡二卡欧美日韩| 国产成都精品91一区二区三| 成人久久视频在线观看| 色综合色综合色综合色综合色综合| 成人免费视频一区二区| 色综合色综合色综合| 欧美高清www午色夜在线视频| 久久综合精品国产一区二区三区| 精品毛片乱码1区2区3区| 国产蜜臀av在线一区二区三区| 日韩毛片精品高清免费| 亚洲成人动漫在线免费观看| 日韩成人av影视| 99久久99久久精品国产片果冻 | 成人av综合在线| 色婷婷精品久久二区二区蜜臂av| 在线观看日韩电影| 久久久久久久精| 午夜国产精品一区| 94-欧美-setu| 26uuu亚洲综合色| 亚洲在线一区二区三区| 国产一区二区看久久| 日本大香伊一区二区三区| 久久这里只有精品6| 亚洲a一区二区| 色综合天天性综合| 国产女主播视频一区二区| 蜜桃一区二区三区四区| 欧美色视频一区| 成人免费一区二区三区在线观看| 国产中文字幕一区| 欧美浪妇xxxx高跟鞋交| 樱桃国产成人精品视频| www.亚洲免费av| 日韩理论电影院| 成人av电影在线观看| 久久久国产一区二区三区四区小说| 亚洲影院久久精品| 色综合一区二区| 亚洲欧洲成人自拍| 播五月开心婷婷综合| 中文字幕精品综合| 99热99精品| 亚洲精品国产无套在线观| 91蜜桃网址入口| 亚洲人成电影网站色mp4| 色视频欧美一区二区三区| 亚洲精品亚洲人成人网在线播放| 9i看片成人免费高清| 亚洲精品成a人| 8x8x8国产精品| 国产一区不卡视频| 一区二区三区小说| 宅男噜噜噜66一区二区66| 美女脱光内衣内裤视频久久网站| 精品卡一卡二卡三卡四在线| 国产一区二区久久| 亚洲精品免费在线| 欧美本精品男人aⅴ天堂| 福利91精品一区二区三区| 一区二区三区欧美在线观看| 欧美一区二区三区在线视频 | 18欧美乱大交hd1984| 欧美日韩亚洲高清一区二区| 久久97超碰色| 亚洲国产裸拍裸体视频在线观看乱了 | 久久国产精品99久久人人澡| 国产欧美一区二区三区沐欲| 精品视频在线免费看| 狠狠色综合日日| 亚欧色一区w666天堂| 国产精品久久夜| 精品va天堂亚洲国产| 欧美日韩亚洲综合在线| 成人av动漫在线| 国产乱子轮精品视频| 亚洲国产精品欧美一二99| 国产欧美日韩在线| 久久亚洲私人国产精品va媚药| 91国模大尺度私拍在线视频| 国产成人av电影在线| 寂寞少妇一区二区三区| 男女男精品网站| 日本不卡123| 婷婷开心久久网| 亚洲国产精品天堂| 亚洲福利一区二区| 亚洲综合自拍偷拍| 精品一区二区三区影院在线午夜| 日本中文在线一区| 日本亚洲电影天堂| 国内偷窥港台综合视频在线播放| 美女诱惑一区二区| 久久99蜜桃精品| 粉嫩嫩av羞羞动漫久久久| 风间由美中文字幕在线看视频国产欧美| 另类的小说在线视频另类成人小视频在线| 亚洲国产色一区| 久久国产精品99久久久久久老狼| 蜜桃一区二区三区在线观看| 麻豆freexxxx性91精品| 国产一区二区日韩精品| 成人国产精品视频| 在线免费亚洲电影| 欧美精品一区二区三区视频| 国产精品女上位| 亚洲不卡av一区二区三区| 国产精品一级片| 欧美色大人视频| 久久精品人人做人人综合| 亚洲精品视频在线观看免费| 美女视频第一区二区三区免费观看网站| 狠狠色伊人亚洲综合成人| 色综合天天狠狠| 久久一日本道色综合| 亚洲自拍都市欧美小说| 丁香婷婷综合色啪| 欧美片在线播放| 成人欧美一区二区三区在线播放| 青青草成人在线观看| 一本到不卡精品视频在线观看| 精品国产凹凸成av人导航| 亚洲国产日韩在线一区模特| 成人激情免费视频| 久久婷婷成人综合色| 日韩国产欧美在线观看| 99久久精品国产一区二区三区| 国产精品成人在线观看| 国产一区二区在线免费观看| 欧美三级在线播放| 亚洲色图一区二区三区| 成人午夜电影久久影院| 国产三级欧美三级| 国产乱码精品一区二区三| 91精选在线观看| 美女视频网站久久| 日韩精品中文字幕在线不卡尤物| 日本三级亚洲精品| 欧美肥妇毛茸茸| 天堂va蜜桃一区二区三区| 91精品啪在线观看国产60岁| 免费成人在线播放| 久久久久久久国产精品影院| 国产盗摄女厕一区二区三区|