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

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

?? skvpd.c

?? 移植好的楊創(chuàng)utu2440F ARM9 的uboot1.1.4代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
/****************************************************************************** * * Name:	skvpd.c * Project:	GEnesis, PCI Gigabit Ethernet Adapter * Version:	$Revision: 1.37 $ * Date:	$Date: 2003/01/13 10:42:45 $ * Purpose:	Shared software to read and write VPD data * ******************************************************************************//****************************************************************************** * *	(C)Copyright 1998-2003 SysKonnect GmbH. * *	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. * *	The information in this file is provided "AS IS" without warranty. * ******************************************************************************//****************************************************************************** * * History: * *	$Log: skvpd.c,v $ *	Revision 1.37  2003/01/13 10:42:45  rschmidt *	Replaced check for PCI device Id from YUKON with GENESIS *	to set the VPD size in VpdInit() *	Editorial changes * *	Revision 1.36  2002/11/14 15:16:56  gheinig *	Added const specifier to key and buf parameters for VpdPara, VpdRead *	and VpdWrite for Diag 7 GUI * *	Revision 1.35  2002/10/21 14:31:59  gheinig *	Took out CVS web garbage at head of file * *	Revision 1.34  2002/10/21 11:47:24  gheinig *	Reverted to version 1.32 due to unwanted commit * *	Revision 1.32  2002/10/14 16:04:29  rschmidt *	Added saving of VPD ROM Size from PCI_OUR_REG_2 *	Avoid reading of PCI_OUR_REG_2 in VpdTransferBlock() *	Editorial changes * *	Revision 1.31  2002/09/10 09:21:32  mkarl *	Replaced all if(GIChipId == CHIP_ID_GENESIS) with new entry GIGenesis * *	Revision 1.30  2002/09/09 14:43:03  mkarl *	changes for diagnostics in order to read VPD data before the adapter *	has been initialized *	editorial changes * *	Revision 1.29  2002/07/26 13:20:43  mkarl *	added Yukon support *	save size of VPD in pAC->vpd.vpd_size * *	Revision 1.28  2002/04/02 15:31:47  afischer *	Bug fix in VpdWait() * *	Revision 1.27  2000/08/10 11:29:06  rassmann *	Editorial changes. *	Preserving 32-bit alignment in structs for the adapter context. *	Removed unused function VpdWriteDword() (#if 0). *	Made VpdReadKeyword() available for SKDIAG only. * *	Revision 1.26  2000/06/13 08:00:01  mkarl *	additional cast to avoid compile problems in 64 bit environment * *	Revision 1.25  1999/11/22 13:39:32  cgoos *	Changed license header to GPL. * *	Revision 1.24  1999/03/11 14:25:49  malthoff *	Replace __STDC__ with SK_KR_PROTO. * *	Revision 1.23  1999/01/11 15:13:11  gklug *	fix: syntax error * *	Revision 1.22  1998/10/30 06:41:15  gklug *	rmv: WARNING * *	Revision 1.21  1998/10/29 07:15:14  gklug *	fix: Write Stream function needs verify. * *	Revision 1.20  1998/10/28 18:05:08  gklug *	chg: no DEBUG in VpdMayWrite * *	Revision 1.19  1998/10/28 15:56:11  gklug *	fix: Return len at end of ReadStream *	fix: Write even less than 4 bytes correctly * *	Revision 1.18  1998/10/28 09:00:47  gklug *	fix: unreferenced local vars * *	Revision 1.17  1998/10/28 08:25:45  gklug *	fix: WARNING * *	Revision 1.16  1998/10/28 08:17:30  gklug *	fix: typo * *	Revision 1.15  1998/10/28 07:50:32  gklug *	fix: typo * *	Revision 1.14  1998/10/28 07:20:38  gklug *	chg: Interface functions to use IoC as parameter as well *	fix: VpdRead/WriteDWord now returns SK_U32 *	chg: VPD_IN/OUT names conform to SK_IN/OUT *	add: usage of VPD_IN/OUT8 macros *	add: VpdRead/Write Stream functions to r/w a stream of data *	fix: VpdTransferBlock swapped illegal *	add: VpdMayWrite * *	Revision 1.13  1998/10/22 10:02:37  gklug *	fix: SysKonnectFileId typo * *	Revision 1.12  1998/10/20 10:01:01  gklug *	fix: parameter to SkOsGetTime * *	Revision 1.11  1998/10/15 12:51:48  malthoff *	Remove unrequired parameter p in vpd_setup_para(). * *	Revision 1.10  1998/10/08 14:52:43  malthoff *	Remove CvsId by SysKonnectFileId. * *	Revision 1.9  1998/09/16 07:33:52  malthoff *	replace memcmp() by SK_MEMCMP and *	memcpy() by SK_MEMCPY() to be *	independent from the 'C' Standard Library. * *	Revision 1.8  1998/08/19 12:52:35  malthoff *	compiler fix: use SK_VPD_KEY instead of S_VPD. * *	Revision 1.7  1998/08/19 08:14:01  gklug *	fix: remove struct keyword as much as possible from the C-code (see CCC) * *	Revision 1.6  1998/08/18 13:03:58  gklug *	SkOsGetTime now returns SK_U64 * *	Revision 1.5  1998/08/18 08:17:29  malthoff *	Ensure we issue a VPD read in vpd_read_dword(). *	Discard all VPD keywords other than Vx or Yx, where *	x is '0..9' or 'A..Z'. * *	Revision 1.4  1998/07/03 14:52:19  malthoff *	Add category SK_DBGCAT_FATAL to some debug macros. *	bug fix: correct the keyword name check in vpd_write(). * *	Revision 1.3  1998/06/26 11:16:53  malthoff *	Correct the modified File Identifier. * *	Revision 1.2  1998/06/26 11:13:43  malthoff *	Modify the File Identifier. * *	Revision 1.1  1998/06/19 14:11:08  malthoff *	Created, Tests with AIX were performed successfully * * ******************************************************************************/#include <config.h>#ifdef CONFIG_SK98/*	Please refer skvpd.txt for infomation how to include this module */static const char SysKonnectFileId[] =	"@(#)$Id: skvpd.c,v 1.37 2003/01/13 10:42:45 rschmidt Exp $ (C) SK";#include "h/skdrv1st.h"#include "h/sktypes.h"#include "h/skdebug.h"#include "h/skdrv2nd.h"/* * Static functions */#ifndef SK_KR_PROTOstatic SK_VPD_PARA	*vpd_find_para(	SK_AC	*pAC,	const char	*key,	SK_VPD_PARA *p);#else	/* SK_KR_PROTO */static SK_VPD_PARA	*vpd_find_para();#endif	/* SK_KR_PROTO *//* * waits for a completion of a VPD transfer * The VPD transfer must complete within SK_TICKS_PER_SEC/16 * * returns	0:	success, transfer completes *		error	exit(9) with a error message */static int VpdWait(SK_AC	*pAC,	/* Adapters context */SK_IOC	IoC,	/* IO Context */int		event)	/* event to wait for (VPD_READ / VPD_write) completion*/{	SK_U64	start_time;	SK_U16	state;	SK_DBG_MSG(pAC,SK_DBGMOD_VPD, SK_DBGCAT_CTRL,		("VPD wait for %s\n", event?"Write":"Read"));	start_time = SkOsGetTime(pAC);	do {		if (SkOsGetTime(pAC) - start_time > SK_TICKS_PER_SEC) {			/* Bug fix AF: Thu Mar 28 2002			 * Do not call: VPD_STOP(pAC, IoC);			 * A pending VPD read cycle can not be aborted by writing			 * VPD_WRITE to the PCI_VPD_ADR_REG (VPD address register).			 * Although the write threshold in the OUR-register protects			 * VPD read only space from being overwritten this does not			 * protect a VPD read from being `converted` into a VPD write			 * operation (on the fly). As a consequence the VPD_STOP would			 * delete VPD read only data. In case of any problems with the			 * I2C bus we exit the loop here. The I2C read operation can			 * not be aborted except by a reset (->LR).			 */			SK_DBG_MSG(pAC, SK_DBGMOD_VPD, SK_DBGCAT_FATAL | SK_DBGCAT_ERR,				("ERROR:VPD wait timeout\n"));			return(1);		}		VPD_IN16(pAC, IoC, PCI_VPD_ADR_REG, &state);		SK_DBG_MSG(pAC, SK_DBGMOD_VPD, SK_DBGCAT_CTRL,			("state = %x, event %x\n",state,event));	} while((int)(state & PCI_VPD_FLAG) == event);	return(0);}#ifdef SKDIAG/* * Read the dword at address 'addr' from the VPD EEPROM. * * Needed Time:	MIN 1,3 ms	MAX 2,6 ms * * Note: The DWord is returned in the endianess of the machine the routine *       is running on. * * Returns the data read. */SK_U32 VpdReadDWord(SK_AC	*pAC,	/* Adapters context */SK_IOC	IoC,	/* IO Context */int		addr)	/* VPD address */{	SK_U32	Rtv;	/* start VPD read */	SK_DBG_MSG(pAC, SK_DBGMOD_VPD, SK_DBGCAT_CTRL,		("VPD read dword at 0x%x\n",addr));	addr &= ~VPD_WRITE;		/* ensure the R/W bit is set to read */	VPD_OUT16(pAC, IoC, PCI_VPD_ADR_REG, (SK_U16)addr);	/* ignore return code here */	(void)VpdWait(pAC, IoC, VPD_READ);	/* Don't swap here, it's a data stream of bytes */	Rtv = 0;	VPD_IN32(pAC, IoC, PCI_VPD_DAT_REG, &Rtv);	SK_DBG_MSG(pAC, SK_DBGMOD_VPD, SK_DBGCAT_CTRL,		("VPD read dword data = 0x%x\n",Rtv));	return(Rtv);}#endif	/* SKDIAG */#if 0/*	Write the dword 'data' at address 'addr' into the VPD EEPROM, and	verify that the data is written. Needed Time:.				MIN		MAX. -------------------------------------------------------------------. write				1.8 ms		3.6 ms. internal write cyles		0.7 ms		7.0 ms. -------------------------------------------------------------------. over all program time	 	2.5 ms		10.6 ms. read				1.3 ms		2.6 ms. -------------------------------------------------------------------. over all 			3.8 ms		13.2 ms. Returns	0:	success			1:	error,	I2C transfer does not terminate			2:	error,	data verify error */static int VpdWriteDWord(SK_AC	*pAC,	/* pAC pointer */SK_IOC	IoC,	/* IO Context */int		addr,	/* VPD address */SK_U32	data)	/* VPD data to write */{	/* start VPD write */	/* Don't swap here, it's a data stream of bytes */	SK_DBG_MSG(pAC, SK_DBGMOD_VPD, SK_DBGCAT_CTRL,		("VPD write dword at addr 0x%x, data = 0x%x\n",addr,data));	VPD_OUT32(pAC, IoC, PCI_VPD_DAT_REG, (SK_U32)data);	/* But do it here */	addr |= VPD_WRITE;	VPD_OUT16(pAC, IoC, PCI_VPD_ADR_REG, (SK_U16)(addr | VPD_WRITE));	/* this may take up to 10,6 ms */	if (VpdWait(pAC, IoC, VPD_WRITE)) {		SK_DBG_MSG(pAC, SK_DBGMOD_VPD, SK_DBGCAT_ERR,			("Write Timed Out\n"));		return(1);	};	/* verify data */	if (VpdReadDWord(pAC, IoC, addr) != data) {		SK_DBG_MSG(pAC, SK_DBGMOD_VPD, SK_DBGCAT_ERR | SK_DBGCAT_FATAL,			("Data Verify Error\n"));		return(2);	}	return(0);}	/* VpdWriteDWord */#endif	/* 0 *//* *	Read one Stream of 'len' bytes of VPD data, starting at 'addr' from *	or to the I2C EEPROM. * * Returns number of bytes read / written. */static int VpdWriteStream(SK_AC	*pAC,	/* Adapters context */SK_IOC	IoC,	/* IO Context */char	*buf,	/* data buffer */int		Addr,	/* VPD start address */int		Len)	/* number of bytes to read / to write */{	int		i;	int		j;	SK_U16	AdrReg;	int		Rtv;	SK_U8	* pComp;	/* Compare pointer */	SK_U8	Data;		/* Input Data for Compare */	/* Init Compare Pointer */	pComp = (SK_U8 *) buf;	for (i = 0; i < Len; i++, buf++) {		if ((i%sizeof(SK_U32)) == 0) {			/*			 * At the begin of each cycle read the Data Reg			 * So it is initialized even if only a few bytes			 * are written.			 */			AdrReg = (SK_U16) Addr;			AdrReg &= ~VPD_WRITE;	/* READ operation */			VPD_OUT16(pAC, IoC, PCI_VPD_ADR_REG, AdrReg);			/* Wait for termination */			Rtv = VpdWait(pAC, IoC, VPD_READ);			if (Rtv != 0) {				return(i);			}		}		/* Write current Byte */		VPD_OUT8(pAC, IoC, PCI_VPD_DAT_REG + (i%sizeof(SK_U32)),				*(SK_U8*)buf);		if (((i%sizeof(SK_U32)) == 3) || (i == (Len - 1))) {			/* New Address needs to be written to VPD_ADDR reg */			AdrReg = (SK_U16) Addr;			Addr += sizeof(SK_U32);			AdrReg |= VPD_WRITE;	/* WRITE operation */			VPD_OUT16(pAC, IoC, PCI_VPD_ADR_REG, AdrReg);			/* Wait for termination */			Rtv = VpdWait(pAC, IoC, VPD_WRITE);			if (Rtv != 0) {				SK_DBG_MSG(pAC, SK_DBGMOD_VPD, SK_DBGCAT_ERR,					("Write Timed Out\n"));				return(i - (i%sizeof(SK_U32)));			}			/*			 * Now re-read to verify			 */			AdrReg &= ~VPD_WRITE;	/* READ operation */			VPD_OUT16(pAC, IoC, PCI_VPD_ADR_REG, AdrReg);			/* Wait for termination */			Rtv = VpdWait(pAC, IoC, VPD_READ);			if (Rtv != 0) {				SK_DBG_MSG(pAC, SK_DBGMOD_VPD, SK_DBGCAT_ERR,					("Verify Timed Out\n"));				return(i - (i%sizeof(SK_U32)));			}			for (j = 0; j <= (int)(i%sizeof(SK_U32)); j++, pComp++) {				VPD_IN8(pAC, IoC, PCI_VPD_DAT_REG + j, &Data);				if (Data != *pComp) {					/* Verify Error */					SK_DBG_MSG(pAC, SK_DBGMOD_VPD, SK_DBGCAT_ERR,						("WriteStream Verify Error\n"));					return(i - (i%sizeof(SK_U32)) + j);				}			}		}	}	return(Len);}/* *	Read one Stream of 'len' bytes of VPD data, starting at 'addr' from *	or to the I2C EEPROM. * * Returns number of bytes read / written. */static int VpdReadStream(SK_AC	*pAC,	/* Adapters context */SK_IOC	IoC,	/* IO Context */char	*buf,	/* data buffer */int		Addr,	/* VPD start address */int		Len)	/* number of bytes to read / to write */{

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本不卡在线视频| 亚洲第一二三四区| 高清不卡在线观看av| 久久婷婷久久一区二区三区| 国产精品伊人色| 亚洲欧美综合色| 色诱亚洲精品久久久久久| 亚洲成人黄色影院| 2023国产一二三区日本精品2022| 国产二区国产一区在线观看| 国产精品大尺度| 欧美日韩高清在线播放| 精品一区二区三区影院在线午夜| 精品国产a毛片| 99视频一区二区三区| 亚洲国产精品自拍| 精品国产乱码久久久久久蜜臀| 国产成人免费视| 一区二区不卡在线视频 午夜欧美不卡在| 91成人在线观看喷潮| 美女视频一区在线观看| 中文字幕欧美日本乱码一线二线 | 欧美本精品男人aⅴ天堂| 国产一区二区三区四区在线观看| 国产精品久久综合| 欧美精品在线观看播放| 国产99精品在线观看| 亚洲综合成人网| 久久久国产精华| 欧美色图天堂网| 国产成人综合在线| 五月天激情综合| 中文字幕一区视频| 日韩视频在线永久播放| aaa亚洲精品一二三区| 欧美bbbbb| 专区另类欧美日韩| 欧美大肚乱孕交hd孕妇| 在线视频你懂得一区| 国产乱人伦偷精品视频免下载| 亚洲永久精品国产| 国产日产亚洲精品系列| 欧美日韩国产中文| 97se亚洲国产综合自在线观| 久久精品国产在热久久| 亚洲国产精品一区二区www在线 | 国产成人精品午夜视频免费| 一片黄亚洲嫩模| 国产精品视频麻豆| 精品国产一区久久| 在线观看91精品国产麻豆| 成人激情免费网站| 狠狠色丁香婷婷综合久久片| 亚洲第一搞黄网站| 亚洲免费观看高清完整版在线观看熊| 久久久久久久性| 日韩午夜电影av| 在线播放中文一区| 欧美在线观看视频在线| 99视频有精品| 99这里都是精品| 成人精品视频一区| 国产91精品欧美| 国产精品一品二品| 久久99国产精品尤物| 日本不卡视频在线| 日本最新不卡在线| 日本aⅴ免费视频一区二区三区| 一区二区高清视频在线观看| 亚洲蜜桃精久久久久久久| 亚洲欧洲日产国产综合网| 国产精品美女久久久久高潮| 国产清纯在线一区二区www| 精品成人一区二区三区| 2020国产精品久久精品美国| 欧美tickling挠脚心丨vk| 日韩女优av电影| 精品奇米国产一区二区三区| 精品成人在线观看| 国产亚洲精品7777| 中文字幕不卡在线播放| 国产精品卡一卡二| 亚洲欧美日本韩国| 亚洲国产精品久久不卡毛片 | 欧美不卡一区二区三区| 日韩一区二区免费在线电影| 日韩一级完整毛片| 精品久久久久久久久久久久久久久久久| 日韩区在线观看| 久久久久久亚洲综合| 国产精品久久久久久久久晋中| 18成人在线观看| 亚洲精品日韩综合观看成人91| 亚洲一区二区偷拍精品| 奇米色一区二区三区四区| 国产九色sp调教91| jizz一区二区| 欧美日韩一区久久| 欧美mv和日韩mv国产网站| 国产日韩v精品一区二区| 亚洲欧美日韩国产一区二区三区 | 蜜桃视频在线观看一区| 国产精品一区二区久久精品爱涩| av亚洲精华国产精华| 欧美性猛片xxxx免费看久爱| 欧美一区二区免费| 欧美经典一区二区| 亚洲一区二区综合| 伦理电影国产精品| 成人黄色777网| 欧美日本在线视频| 久久久久久黄色| 亚洲一区二区三区视频在线| 美女国产一区二区三区| www.成人网.com| 5566中文字幕一区二区电影| 久久精品人人爽人人爽| 亚洲尤物视频在线| 国内精品国产成人国产三级粉色 | 午夜精品福利一区二区蜜股av| 久久成人免费网| 色综合天天综合色综合av| 日韩一级大片在线| 亚洲免费资源在线播放| 国内外成人在线视频| 欧美午夜一区二区| 国产亚洲成av人在线观看导航| 亚洲影视在线观看| 成人视屏免费看| 日韩亚洲欧美在线| 亚洲男帅同性gay1069| 国产自产2019最新不卡| 欧美日韩国产高清一区二区三区| 国产精品入口麻豆原神| 日本大胆欧美人术艺术动态| 99精品欧美一区二区三区小说 | 在线中文字幕不卡| 国产精品网站在线观看| 日韩激情视频在线观看| 91免费看`日韩一区二区| 久久综合网色—综合色88| 亚洲国产精品综合小说图片区| 波多野结衣中文字幕一区二区三区| 日韩精品在线一区二区| 亚洲一区二区在线观看视频| www.日韩在线| 国产亚洲欧美日韩日本| 久久精品国产一区二区三区免费看 | 国产+成+人+亚洲欧洲自线| 日韩精品一区二区三区在线观看| 亚洲一二三专区| 91在线视频免费91| 国产欧美一区二区精品性色 | 亚洲天天做日日做天天谢日日欢| 精品夜夜嗨av一区二区三区| 在线观看91av| 日韩精品久久理论片| 欧美视频在线一区二区三区| 一区二区三区免费网站| 97久久超碰精品国产| 亚洲欧洲av在线| 91一区一区三区| 亚洲猫色日本管| 色婷婷激情久久| 一区二区三区在线视频观看| 一本色道久久综合精品竹菊| 亚洲人成7777| 欧美亚日韩国产aⅴ精品中极品| 亚洲黄色录像片| 91官网在线观看| 亚洲国产一二三| 91精品国产色综合久久不卡电影| 天天色天天操综合| 91精品在线一区二区| 日本sm残虐另类| 久久综合资源网| 99亚偷拍自图区亚洲| 亚洲免费视频中文字幕| 欧美性大战xxxxx久久久| 视频一区二区三区在线| 欧美一级日韩免费不卡| 国模冰冰炮一区二区| 国产精品嫩草99a| 色屁屁一区二区| 日韩国产一区二| 精品国产一区二区精华| 国产福利精品导航| 亚洲免费av高清| 欧美一区二区三区播放老司机| 久久激情五月激情| 国产精品蜜臀在线观看| 日本韩国欧美一区二区三区| 亚洲成人第一页| 精品国产一区二区三区不卡 | 国产精品88av| 国产精品久久久久久久浪潮网站| 日本道精品一区二区三区| 欧美a级一区二区| 国产亚洲精品超碰| 欧美日韩一区高清|