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

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

?? e1000_nvm.c

?? DELL755 Intel 網卡驅動
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*******************************************************************************  Intel PRO/1000 Linux driver  Copyright(c) 1999 - 2008 Intel Corporation.  This program is free software; you can redistribute it and/or modify it  under the terms and conditions of the GNU General Public License,  version 2, as published by the Free Software Foundation.  This program is distributed in the hope 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.,  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.  The full GNU General Public License is included in this distribution in  the file called "COPYING".  Contact Information:  Linux NICS <linux.nics@intel.com>  e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497*******************************************************************************/#include "e1000_hw.h"/** *  e1000_init_nvm_ops_generic - Initialize NVM function pointers *  @hw: pointer to the HW structure * *  Setups up the function pointers to no-op functions **/void e1000_init_nvm_ops_generic(struct e1000_hw *hw){	struct e1000_nvm_info *nvm = &hw->nvm;	DEBUGFUNC("e1000_init_nvm_ops_generic");	/* Initialize function pointers */	nvm->ops.reload = e1000_reload_nvm_generic;}/** *  e1000_raise_eec_clk - Raise EEPROM clock *  @hw: pointer to the HW structure *  @eecd: pointer to the EEPROM * *  Enable/Raise the EEPROM clock bit. **/static void e1000_raise_eec_clk(struct e1000_hw *hw, u32 *eecd){	*eecd = *eecd | E1000_EECD_SK;	E1000_WRITE_REG(hw, E1000_EECD, *eecd);	E1000_WRITE_FLUSH(hw);	usec_delay(hw->nvm.delay_usec);}/** *  e1000_lower_eec_clk - Lower EEPROM clock *  @hw: pointer to the HW structure *  @eecd: pointer to the EEPROM * *  Clear/Lower the EEPROM clock bit. **/static void e1000_lower_eec_clk(struct e1000_hw *hw, u32 *eecd){	*eecd = *eecd & ~E1000_EECD_SK;	E1000_WRITE_REG(hw, E1000_EECD, *eecd);	E1000_WRITE_FLUSH(hw);	usec_delay(hw->nvm.delay_usec);}/** *  e1000_shift_out_eec_bits - Shift data bits our to the EEPROM *  @hw: pointer to the HW structure *  @data: data to send to the EEPROM *  @count: number of bits to shift out * *  We need to shift 'count' bits out to the EEPROM.  So, the 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. **/static void e1000_shift_out_eec_bits(struct e1000_hw *hw, u16 data, u16 count){	struct e1000_nvm_info *nvm = &hw->nvm;	u32 eecd = E1000_READ_REG(hw, E1000_EECD);	u32 mask;	DEBUGFUNC("e1000_shift_out_eec_bits");	mask = 0x01 << (count - 1);	if (nvm->type == e1000_nvm_eeprom_microwire)		eecd &= ~E1000_EECD_DO;	else if (nvm->type == e1000_nvm_eeprom_spi)		eecd |= E1000_EECD_DO;	do {		eecd &= ~E1000_EECD_DI;		if (data & mask)			eecd |= E1000_EECD_DI;		E1000_WRITE_REG(hw, E1000_EECD, eecd);		E1000_WRITE_FLUSH(hw);		usec_delay(nvm->delay_usec);		e1000_raise_eec_clk(hw, &eecd);		e1000_lower_eec_clk(hw, &eecd);		mask >>= 1;	} while (mask);	eecd &= ~E1000_EECD_DI;	E1000_WRITE_REG(hw, E1000_EECD, eecd);}/** *  e1000_shift_in_eec_bits - Shift data bits in from the EEPROM *  @hw: pointer to the HW structure *  @count: number of bits to shift in * *  In order to read a register from the EEPROM, we need to shift 'count' 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 data out *  "DO" bit.  During this "shifting in" process the data in "DI" bit should *  always be clear. **/static u16 e1000_shift_in_eec_bits(struct e1000_hw *hw, u16 count){	u32 eecd;	u32 i;	u16 data;	DEBUGFUNC("e1000_shift_in_eec_bits");	eecd = E1000_READ_REG(hw, E1000_EECD);	eecd &= ~(E1000_EECD_DO | E1000_EECD_DI);	data = 0;	for (i = 0; i < count; i++) {		data <<= 1;		e1000_raise_eec_clk(hw, &eecd);		eecd = E1000_READ_REG(hw, E1000_EECD);		eecd &= ~E1000_EECD_DI;		if (eecd & E1000_EECD_DO)			data |= 1;		e1000_lower_eec_clk(hw, &eecd);	}	return data;}/** *  e1000_poll_eerd_eewr_done - Poll for EEPROM read/write completion *  @hw: pointer to the HW structure *  @ee_reg: EEPROM flag for polling * *  Polls the EEPROM status bit for either read or write completion based *  upon the value of 'ee_reg'. **/s32 e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int ee_reg){	u32 attempts = 100000;	u32 i, reg = 0;	s32 ret_val = -E1000_ERR_NVM;	DEBUGFUNC("e1000_poll_eerd_eewr_done");	for (i = 0; i < attempts; i++) {		if (ee_reg == E1000_NVM_POLL_READ)			reg = E1000_READ_REG(hw, E1000_EERD);		else			reg = E1000_READ_REG(hw, E1000_EEWR);		if (reg & E1000_NVM_RW_REG_DONE) {			ret_val = E1000_SUCCESS;			break;		}		usec_delay(5);	}	return ret_val;}/** *  e1000_acquire_nvm_generic - Generic request for access to EEPROM *  @hw: pointer to the HW structure * *  Set the EEPROM access request bit and wait for EEPROM access grant bit. *  Return successful if access grant bit set, else clear the request for *  EEPROM access and return -E1000_ERR_NVM (-1). **/s32 e1000_acquire_nvm_generic(struct e1000_hw *hw){	u32 eecd = E1000_READ_REG(hw, E1000_EECD);	s32 timeout = E1000_NVM_GRANT_ATTEMPTS;	s32 ret_val = E1000_SUCCESS;	DEBUGFUNC("e1000_acquire_nvm_generic");	E1000_WRITE_REG(hw, E1000_EECD, eecd | E1000_EECD_REQ);	eecd = E1000_READ_REG(hw, E1000_EECD);	while (timeout) {		if (eecd & E1000_EECD_GNT)			break;		usec_delay(5);		eecd = E1000_READ_REG(hw, E1000_EECD);		timeout--;	}	if (!timeout) {		eecd &= ~E1000_EECD_REQ;		E1000_WRITE_REG(hw, E1000_EECD, eecd);		DEBUGOUT("Could not acquire NVM grant\n");		ret_val = -E1000_ERR_NVM;	}	return ret_val;}/** *  e1000_standby_nvm - Return EEPROM to standby state *  @hw: pointer to the HW structure * *  Return the EEPROM to a standby state. **/static void e1000_standby_nvm(struct e1000_hw *hw){	struct e1000_nvm_info *nvm = &hw->nvm;	u32 eecd = E1000_READ_REG(hw, E1000_EECD);	DEBUGFUNC("e1000_standby_nvm");	if (nvm->type == e1000_nvm_eeprom_microwire) {		eecd &= ~(E1000_EECD_CS | E1000_EECD_SK);		E1000_WRITE_REG(hw, E1000_EECD, eecd);		E1000_WRITE_FLUSH(hw);		usec_delay(nvm->delay_usec);		e1000_raise_eec_clk(hw, &eecd);		/* Select EEPROM */		eecd |= E1000_EECD_CS;		E1000_WRITE_REG(hw, E1000_EECD, eecd);		E1000_WRITE_FLUSH(hw);		usec_delay(nvm->delay_usec);		e1000_lower_eec_clk(hw, &eecd);	} else if (nvm->type == e1000_nvm_eeprom_spi) {		/* Toggle CS to flush commands */		eecd |= E1000_EECD_CS;		E1000_WRITE_REG(hw, E1000_EECD, eecd);		E1000_WRITE_FLUSH(hw);		usec_delay(nvm->delay_usec);		eecd &= ~E1000_EECD_CS;		E1000_WRITE_REG(hw, E1000_EECD, eecd);		E1000_WRITE_FLUSH(hw);		usec_delay(nvm->delay_usec);	}}/** *  e1000_stop_nvm - Terminate EEPROM command *  @hw: pointer to the HW structure * *  Terminates the current command by inverting the EEPROM's chip select pin. **/void e1000_stop_nvm(struct e1000_hw *hw){	u32 eecd;	DEBUGFUNC("e1000_stop_nvm");	eecd = E1000_READ_REG(hw, E1000_EECD);	if (hw->nvm.type == e1000_nvm_eeprom_spi) {		/* Pull CS high */		eecd |= E1000_EECD_CS;		e1000_lower_eec_clk(hw, &eecd);	} else if (hw->nvm.type == e1000_nvm_eeprom_microwire) {		/* CS on Microwire is active-high */		eecd &= ~(E1000_EECD_CS | E1000_EECD_DI);		E1000_WRITE_REG(hw, E1000_EECD, eecd);		e1000_raise_eec_clk(hw, &eecd);		e1000_lower_eec_clk(hw, &eecd);	}}/** *  e1000_release_nvm_generic - Release exclusive access to EEPROM *  @hw: pointer to the HW structure * *  Stop any current commands to the EEPROM and clear the EEPROM request bit. **/void e1000_release_nvm_generic(struct e1000_hw *hw){	u32 eecd;	DEBUGFUNC("e1000_release_nvm_generic");	e1000_stop_nvm(hw);	eecd = E1000_READ_REG(hw, E1000_EECD);	eecd &= ~E1000_EECD_REQ;	E1000_WRITE_REG(hw, E1000_EECD, eecd);}/** *  e1000_ready_nvm_eeprom - Prepares EEPROM for read/write *  @hw: pointer to the HW structure * *  Setups the EEPROM for reading and writing. **/static s32 e1000_ready_nvm_eeprom(struct e1000_hw *hw){	struct e1000_nvm_info *nvm = &hw->nvm;	u32 eecd = E1000_READ_REG(hw, E1000_EECD);	s32 ret_val = E1000_SUCCESS;	u16 timeout = 0;	u8 spi_stat_reg;	DEBUGFUNC("e1000_ready_nvm_eeprom");	if (nvm->type == e1000_nvm_eeprom_microwire) {		/* Clear SK and DI */		eecd &= ~(E1000_EECD_DI | E1000_EECD_SK);		E1000_WRITE_REG(hw, E1000_EECD, eecd);		/* Set CS */		eecd |= E1000_EECD_CS;		E1000_WRITE_REG(hw, E1000_EECD, eecd);	} else if (nvm->type == e1000_nvm_eeprom_spi) {		/* Clear SK and CS */		eecd &= ~(E1000_EECD_CS | E1000_EECD_SK);		E1000_WRITE_REG(hw, E1000_EECD, eecd);		usec_delay(1);		timeout = NVM_MAX_RETRY_SPI;		/*		 * Read "Status Register" repeatedly until the LSB is cleared.		 * The EEPROM will signal that the command has been completed		 * by clearing bit 0 of the internal status register.  If it's		 * not cleared within 'timeout', then error out.		 */		while (timeout) {			e1000_shift_out_eec_bits(hw, NVM_RDSR_OPCODE_SPI,			                         hw->nvm.opcode_bits);			spi_stat_reg = (u8)e1000_shift_in_eec_bits(hw, 8);			if (!(spi_stat_reg & NVM_STATUS_RDY_SPI))				break;			usec_delay(5);			e1000_standby_nvm(hw);			timeout--;		}		if (!timeout) {			DEBUGOUT("SPI NVM Status error\n");			ret_val = -E1000_ERR_NVM;			goto out;		}	}out:	return ret_val;}/** *  e1000_read_nvm_spi - Read EEPROM's using SPI *  @hw: pointer to the HW structure *  @offset: offset of word in the EEPROM to read *  @words: number of words to read *  @data: word read from the EEPROM * *  Reads a 16 bit word from the EEPROM. **/s32 e1000_read_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data){	struct e1000_nvm_info *nvm = &hw->nvm;	u32 i = 0;	s32 ret_val;	u16 word_in;	u8 read_opcode = NVM_READ_OPCODE_SPI;	DEBUGFUNC("e1000_read_nvm_spi");	/*	 * A check for invalid values:  offset too large, too many words,	 * and not enough words.	 */	if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||	    (words == 0)) {		DEBUGOUT("nvm parameter(s) out of bounds\n");		ret_val = -E1000_ERR_NVM;		goto out;	}	ret_val = nvm->ops.acquire(hw);	if (ret_val)		goto out;	ret_val = e1000_ready_nvm_eeprom(hw);	if (ret_val)		goto release;	e1000_standby_nvm(hw);	if ((nvm->address_bits == 8) && (offset >= 128))		read_opcode |= NVM_A8_OPCODE_SPI;	/* Send the READ command (opcode + addr) */	e1000_shift_out_eec_bits(hw, read_opcode, nvm->opcode_bits);	e1000_shift_out_eec_bits(hw, (u16)(offset*2), nvm->address_bits);	/*	 * Read the data.  SPI NVMs increment the address with each byte	 * read and will roll over if reading beyond the end.  This allows	 * us to read the whole NVM from any offset	 */	for (i = 0; i < words; i++) {		word_in = e1000_shift_in_eec_bits(hw, 16);		data[i] = (word_in >> 8) | (word_in << 8);	}release:	nvm->ops.release(hw);out:	return ret_val;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人欧美一区二区三区小说| 五月婷婷欧美视频| 欧美一二区视频| 欧美日本免费一区二区三区| 91最新地址在线播放| 国产成人自拍高清视频在线免费播放| 蜜桃一区二区三区在线观看| 日本一不卡视频| 日本成人在线一区| 激情综合色综合久久| 久久91精品久久久久久秒播| 精品一区中文字幕| 国产精品主播直播| 大美女一区二区三区| zzijzzij亚洲日本少妇熟睡| 97se狠狠狠综合亚洲狠狠| 91福利国产精品| 在线播放中文字幕一区| 欧美videossexotv100| 久久久www成人免费无遮挡大片| 国产欧美一二三区| 一区二区三区四区蜜桃| 日韩国产在线观看一区| 久88久久88久久久| 91精品1区2区| 7777精品久久久大香线蕉| 欧美大度的电影原声| 日本一区二区成人| 亚洲高清在线视频| 国产乱人伦精品一区二区在线观看| 风间由美中文字幕在线看视频国产欧美| 久久久99免费| 一区二区日韩电影| 国产麻豆日韩欧美久久| 色狠狠色狠狠综合| 久久亚洲精品小早川怜子| 综合激情网...| 久久国产精品色婷婷| 99这里只有精品| 精品国产乱码久久久久久夜甘婷婷| 国产日韩欧美一区二区三区综合| 有码一区二区三区| 国产精品12区| 欧美日韩国产综合一区二区三区| 国产清纯美女被跳蛋高潮一区二区久久w | 亚洲制服丝袜av| 久久国产精品第一页| 色婷婷久久99综合精品jk白丝| 欧美精品视频www在线观看 | 国产精品乱码一区二三区小蝌蚪| 中文字幕日韩av资源站| 奇米精品一区二区三区在线观看一| 欧美精选在线播放| 国产日韩欧美高清| 九九在线精品视频| 欧美美女bb生活片| 亚洲午夜在线视频| 91亚洲精品乱码久久久久久蜜桃 | 高清av一区二区| 精品日韩一区二区三区免费视频| 亚洲午夜免费视频| 99精品欧美一区二区三区小说| 精品久久人人做人人爰| 日韩精品电影在线| 欧美色图免费看| 亚洲精品成人悠悠色影视| 成人免费av在线| 国产人伦精品一区二区| 国产一区二区电影| 亚洲精品在线三区| 久久er精品视频| 精品粉嫩超白一线天av| 蜜桃av一区二区在线观看| 欧美精品免费视频| 日韩精品亚洲一区| 欧美一区二区精美| 免费看精品久久片| 日韩欧美不卡在线观看视频| 免费国产亚洲视频| 精品福利在线导航| 国产成人高清在线| 国产精品免费aⅴ片在线观看| 成人午夜又粗又硬又大| 中文欧美字幕免费| 不卡的看片网站| 国产精品视频一二| 91日韩一区二区三区| 亚洲一区二区三区激情| 91精品国产综合久久久蜜臀粉嫩 | 中文字幕欧美日韩一区| 成人污视频在线观看| 中文久久乱码一区二区| 99久久精品情趣| 亚洲婷婷综合色高清在线| 91久久线看在观草草青青| 一区二区不卡在线视频 午夜欧美不卡在 | 麻豆国产精品777777在线| 欧美成人性战久久| 国产精品亚洲第一 | 欧美曰成人黄网| 亚洲午夜影视影院在线观看| 欧美狂野另类xxxxoooo| 久久99国产精品久久99 | 欧美在线视频不卡| 日韩激情一区二区| 欧美国产日韩精品免费观看| 91久久香蕉国产日韩欧美9色| 久久国产生活片100| 国产精品亲子乱子伦xxxx裸| 欧美色精品天天在线观看视频| 蜜臀av亚洲一区中文字幕| 国产日产精品一区| 欧美片在线播放| 国产成人免费视频网站高清观看视频 | 久久超级碰视频| 亚洲精品视频在线观看免费| 日韩免费看网站| 不卡的电影网站| 美女一区二区在线观看| 国产精品大尺度| 欧美一区二区三区在线观看 | 国产经典欧美精品| 亚洲制服欧美中文字幕中文字幕| 国产亚洲短视频| 欧美一区二区三区免费大片| 不卡欧美aaaaa| 国产激情一区二区三区| 日韩va欧美va亚洲va久久| 亚洲麻豆国产自偷在线| 久久九九久久九九| 日韩一区二区三区视频| 欧洲精品一区二区三区在线观看| 国产精品综合一区二区| 午夜国产精品一区| 亚洲女子a中天字幕| 久久精品男人的天堂| 欧美一区二区在线视频| 欧美日韩一区二区不卡| 在线视频综合导航| 91浏览器入口在线观看| 成人天堂资源www在线| 国产精品自产自拍| 韩国欧美一区二区| 激情综合一区二区三区| 久久黄色级2电影| 久久精品国产一区二区| 蜜臀91精品一区二区三区| 日韩国产欧美在线观看| 三级影片在线观看欧美日韩一区二区| 亚洲蜜臀av乱码久久精品| 亚洲日本一区二区三区| 亚洲欧美日韩久久精品| 国产精品欧美极品| 中文字幕一区二区三区不卡在线| 欧美国产精品v| 欧美国产禁国产网站cc| 国产精品第四页| 亚洲欧美经典视频| 亚洲综合色网站| 亚洲午夜久久久久| 日韩综合一区二区| 欧美aa在线视频| 国产一区二区三区四区五区入口| 日本午夜一本久久久综合| 奇米影视一区二区三区| 久久国产精品免费| 国产aⅴ综合色| 成人精品视频一区二区三区尤物| aaa国产一区| 欧美日韩另类国产亚洲欧美一级| 欧美日韩国产综合一区二区| 91精品国产色综合久久不卡蜜臀 | 视频一区中文字幕| 国产一区视频导航| 白白色 亚洲乱淫| 欧美精品日韩综合在线| 久久精品视频网| 亚洲欧美另类图片小说| 日本女优在线视频一区二区| 狠狠色狠狠色综合系列| 成人h动漫精品| 欧美日韩视频在线观看一区二区三区 | www.日本不卡| 欧美日韩第一区日日骚| 欧美videossexotv100| 中文字幕日韩av资源站| 日韩av中文字幕一区二区三区| 经典三级一区二区| 91亚洲精华国产精华精华液| 欧美精品v国产精品v日韩精品| 久久久精品免费免费| 一区二区三区精品在线| 国产呦萝稀缺另类资源| 欧美中文字幕一区| 国产人成亚洲第一网站在线播放| 午夜激情一区二区三区| jizzjizzjizz欧美| 精品国产乱码久久久久久久| 亚洲欧美一区二区久久| 国产91精品免费|