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

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

?? lan9118.h

?? Lan9118以太網(wǎng)芯片linux驅(qū)動程序
?? H
?? 第 1 頁 / 共 2 頁
字號:
/*****************************************************************************
   
Copyright (c) 2004-2005, SMSC
 
This code and information is provided as is without warranty of any kind,
either expressed or implied, including but not limited to the implied
warranties of merchantability and/or fitness for a particular purpose.
 
File name   :  lan9118.c  

Description :  Declares chip layer functions and defines.

Date            Modification                	Name        	
----            ------------                	-------				
18/02/05	Initial release V1.16		Phong Le
*****************************************************************************/

#ifndef LAN9118_H
#define LAN9118_H

/*------- includes files ----------------------------------------------------*/
// lint suppressions for StMicro/NexGen headers

// -e537	// Repeated include file



// -e607	// Parameter 'type' of macro found within string

// -e659	// Nothing follows '}' on line within struct/union/enum declaration



// -e773	// Expression-like macro not parenthesized



// -e935	// int within struct

// -e941	// Result 0 due to operand(s) equaling 0 in operation '<<'

// -e955	// Parameter name missing from prototype for function

// -e956	// Non const, non volatile static or external variable 'ngProtoList'

// -e958	// Padding is required to align member on 'n' byte boundary

// -e959	// Nominal struct size is not an even multiple of the maximum member alignment

// -e960	// a whole group of MISRA Required rules

// -e961	// a whole group of MISRA Advisory rules

// -e973	// Unary operator in macro not parenthesized



// -e1916	// Ellipsis encountered



/*lint -save*/

/*lint -e537 -e607 -e659 -e773 -e935 -e941 -e955 -e956 -e958 -e959 -e960 -e961 -e973 -e1916*/

#include <string.h>
#include <interrup.h>
#include <stdlib.h>
#include <stdio.h>
#include <ngnet.h>
#include <ngip/buf.h>
#include <ngeth.h>  
#include <ngip/ethernet.h>
#include <debug.h>
#include <stddefs.h>
#include <ngos.h>

/*
 **************************************************************
 *	BUGBUG (nw)  Dec. 16, 2004
 *
 *	When the above #include's ngnet.h, it indirectly #includes macros.h as follows:
 *      Including file ..\..\include\ngnet.h (library)
 *          Including file ..\..\include\ngos.h (library)
 *              Including file ..\..\include\ngos\cpu\st20\macros.h (library)
 *
 *	The problem is that macros.h incorrectly re-define's NULL, and there does
 *	not appear to be any good way to avoid that without changing macros.h.
 **************************************************************
 */
#ifdef _lint
#ifdef NULL
#undef NULL  /* lint -e{961,92} MISRA advisory rule 92 doesn't like undef*/
#define NULL ((void *)0)
#endif
#endif
/*lint -restore*/

typedef unsigned long DWORD;
typedef int BOOLEAN;

/* FUNCTION: 
 *   SetRegDW
 * DESCRIPTION: 
 *   Write to a memory mapped register
 * PARAMETERS:
 *   dwBase,   virtual base address of the register set.
 *	 dwOffset, offset from dwBase of register in the register set.
 *   dwVal,    the value to write to the register.
 * RETURN VALUE:
 *   none.
 */
#define SetRegDW(dwBase,dwOffset,dwVal) \
{	\
	(*(volatile DWORD *)((dwBase) + (dwOffset))) = (dwVal);	\
}

/* FUNCTION:
 *   GetRegDW
 * DESCRIPTION:
 *   Reads from a memory mapped register
 * PARAMETERS:
 *   dwBase,   virtual base address of the registers set.
 *   dwOffset, offset from dwBase of register in the register set.
 * RETURN VALUE:
 *   DWORD,    value read from register.
 */
#define GetRegDW(dwBase,dwOffset) \
	((DWORD)(*(volatile DWORD *)(dwBase + dwOffset)))

/* 
 * WriteFifo (dwBase, dwOffset, pdwBuf, dwDwordCount)
 *	Writes 'dwDwordCount' 4-byte integers starting at address 'pdwBuf'
 *	into TX fifo at address (dwBase + dwOffset)
 */
void WriteFifo(
	const DWORD dwBase,
	const DWORD dwOffset,
	const DWORD *pdwBuf,
	DWORD dwDwordCount);

/*
 * ReadFifo (dwBase, dwOffset, pdwBuf, dwDwordCount)
 * 	Reads 'dwDwordCount' 4-byte integers from RX fifo at address
 * 	(dwBase + dwOffset) and stores in memory buffer at address
 * 	pdwBuf
 */
void ReadFifo(
	const DWORD dwBase,
	const DWORD dwOffset,
	DWORD *pdwBuf,
	DWORD dwDwordCount);

/*
STRUCTURE: LAN9118_DATA
	This structure is used by the chip layer.
	It remembers where to access registers.
	It remembers revision IDs if there are subtle
	  differences between them.
	It remembers modes of operation.
	It will start tx and rx queue information
	And it may be used for other things that
	  have not been conceived yet.
	The members of this structure should be 
	considered private and only excessable from 
	the Lan_xxx functions
*/
typedef struct _LAN9118_DATA {
	NGbuf *saved_buf;	// store buffer taken out of queue but haven't
				// putted to TX fifo
	DWORD dwIdRev;

	DWORD dwPhyAddress;

	DWORD GpioSetting;

	NGushort  wLastADVatRestart;
	NGushort  wLastADV;

	NGushort eif_linkadv;
	NGubyte eif_link;
	NGubyte eif_linkcfg;

} LAN9118_DATA, * PLAN9118_DATA;

/* returns member variable 'eif_linkadv' within driver structure */
NGushort GetLinkAdv (const NGifnet * const netp);

/* sets member variable 'eif_linkadv' within driver structure */
void SetLinkAdv (const NGifnet * const netp, const NGushort value);

/* returns member variable 'eif_linkcfg' within driver structure */
NGubyte GetLinkCfg (const NGifnet * const netp);

/* sets member variable 'eif_linkcfg' within driver structure */
void SetLinkCfg (const NGifnet * const netp, const NGubyte value);

/* returns member variable 'eif_link' within driver structure */
NGubyte GetLink (const NGifnet * const netp);

/* sets member variable 'eif_link' within driver structure */
void SetLink (const NGifnet * const netp, const NGubyte value);

/* Phy_GetRegW () reads a 16-bit phy register values */
NGushort Phy_GetRegW(const NGifnet * const netp, const DWORD dwRegIndex);

/* Phy_SetRegW () writes a 16-bit phy register values */
void Phy_SetRegW(const NGifnet * const netp, DWORD dwRegIndex,NGushort wVal);

/* Phy_SetLink(netp) does link management settings */
void Phy_SetLink(const NGifnet * const netp);

/* Phy_GetLinkMode(netp) reads the current link settings */
void Phy_GetLinkMode(const NGifnet * const netp);

/* Phy_UpdateLinkMode(netp) detects any link changes */
void Phy_UpdateLinkMode(const NGifnet * const netp);

/*
 * LanDetectChipId () returns the ID of the Concord Ethernet chip.
 * 	Possible valid values are 0x115, 0x116, 0x117, 0x118
 */
DWORD LanDetectChipId (const DWORD dwLanBase);

/*
FUNCTION: Lan_WriteTxFifo
	This function is used to write a buffer to the
	Tx Fifo in PIO mode.
	This function is only intended to be called 
	  from with in other Lan_xxx functions.
*/
void Lan_WriteTxFifo(
	const DWORD dwLanBase, 
	const DWORD *pdwBuf, 
	DWORD dwDwordCount);

/*
FUNCTION: Lan_ReadRxFifo
    This function is used to read a buffer to the 
	Rx Fifo in PIO mode.
	This function is only intended to be called
	  from with in other Lan_xxx functions.
*/
void Lan_ReadRxFifo(
	const DWORD dwLanBase, 
	DWORD * pdwBuf, 
	DWORD dwDwordCount);

/*
FUNCTION: Lan_GetMacRegDW
    This function is used to read a Mac Register.
	This function is only intended to be called
	  from with in other Lan_xxx functions.
*/
DWORD Lan_GetMacRegDW(
	const DWORD dwLanBase, 
	const DWORD dwOffset);

/*
FUNCTION: Lan_SetMacRegDW
	This function is used to write a Mac register.
	This function is only intended to be called
	  from with in other Lan_xxx functions.
*/
void Lan_SetMacRegDW(
	const DWORD dwLanBase, 
	const DWORD dwOffset, 
	const DWORD dwVal);

/*
FUNCTION: Lan_GetPhyRegW
    This function is used to read a Mii/Phy register.
	This function is only intended to be called 
	  from with in other Lan_xxx functions.
*/
NGushort Lan_GetPhyRegW(
	const DWORD dwLanBase,
	const DWORD dwPhyAddress,
	const DWORD dwMiiIndex);

/*
FUNCTION: Lan_SetPhyRegW
    This function is used to write a Mii/Phy register.
	This function is only intended to be called
	  from with in other Lan_xxx functions.
*/
void Lan_SetPhyRegW(
	const DWORD dwLanBase,
	const DWORD dwPhyAddress,
	const DWORD dwMiiIndex,
	const NGushort wVal);

/*
FUNCTION: Lan_ShowRegs
    This function is used to display the registers. 
	Except the phy.
*/
void Lan_ShowRegs(const DWORD dwLanBase);

/*
FUNCTION: Lan_StopGptTimer
    This function disables Lan9118 GPT timer
*/
void Lan_StopGptTimer (const DWORD dwLanBase);

/*
FUNCTION: Lan_Initialize
  This function should be the first Lan_xxx function called
  It begins to initialize the LAN9118_DATA structure.
  It reads some ID values from the chip.
  It resets the chip.

RETURN VALUE:
	returns TRUE on Success,
	returns FALSE on Failure,
*/
BOOLEAN Lan_Initialize(const NGifnet * const netp);

/*
FUNCTION: Phy_Initialize
  This function should be called after Lan_InitializeInterrupts.
  Continues to initialize the LAN9118_DATA structure.
  It reads some phy ID values from the phy
  It resets the phy.
RETURN VALUE:
	returns TRUE on Success,
	returns FALSE on Failure,
*/
BOOLEAN Phy_Initialize(const NGifnet * const netp, DWORD dwPhyAddr);

/*
FUNCTION: Lan_EnableInterrupt
  Enables bits in INT_EN according to the set bits in dwMask
  WARNING this has thread synchronization issues. Use with caution.
*/
void Lan_EnableInterrupt(const DWORD dwLanBase,DWORD dwMask);

/*
FUNCTION: Lan_GetInterruptStatus
  Reads and returns the value in the INT_STS register.
*/
DWORD Lan_GetInterruptStatus(const DWORD dwLanBase);

/*
FUNCTION: Lan_ClearInterruptStatus
  Clears the bits in INT_STS according to the bits set in dwMask
*/
void Lan_ClearInterruptStatus(const DWORD dwLanBase,DWORD dwMask);

/*
FUNCTION: Lan_InitializeInterrupts
  Should be called after Lan_Initialize
  Should be called before the ISR is registered.
*/
void Lan_InitializeInterrupts(const DWORD dwLanBase,DWORD dwIntCfg);

/*
FUNCTION: Lan_EnableSoftwareInterrupt
  Clears a flag in the LAN9118_DATA structure
  Sets the SW_INT_EN bit of the INT_EN register
  WARNING this has thread sychronization issues. Use with caution.
*/
void Lan_EnableSoftwareInterrupt(const DWORD dwLanBase);

/*
FUNCTION: Lan_HandleSoftwareInterrupt
  Disables the SW_INT_EN bit of the INT_EN register,
  Clears the SW_INT in the INT_STS,
  Sets a flag in the LAN9118_DATA structure
*/
void Lan_HandleSoftwareInterrupt(const DWORD dwLanBase);

/*
FUNCTION: Lan_SetMacAddress sets the Mac Address
*/
void Lan_SetMacAddress(const DWORD dwLanBase,DWORD dwHigh16,DWORD dwLow32);

/*
FUNCTION: Lan_GetMacAddress gets the Mac Address
*/
void Lan_GetMacAddress(const DWORD dwLanBase,DWORD * dwHigh16,DWORD * dwLow32);

/*
FUNCTION: Lan_InitializeTx
  Prepares the LAN9118 for transmission of packets
  must be called before 
	Lan_SendPacketPIO
	Lan_CompleteTx
*/
void Lan_InitializeTx(const DWORD dwLanBase);

/*
FUNCTION: Lan_SendPacketPIO
  Sends a specified packet out on the ethernet line.
  Must first call Lan_InitializeTx
  WARNING: wPacketTag must not be 0. Zero is reserved.
*/
void Lan_SendPacketPIO(
		const DWORD dwLanBase,
		NGushort wPacketTag, 
		NGushort wPacketLength,
		NGubyte *pbPacketData);

/*
FUNCTION: Lan_CompleteTx
  Gets the Status DWORD of a previous transmission from the TX status FIFO
  If the TX Status FIFO is empty as indicated by TX_FIFO_INF then this
    function will return 0
*/
DWORD Lan_CompleteTx(const DWORD dwLanBase);

/*
FUNCTION: Lan_GetTxDataFreeSpace
  Gets the free space available in the TX fifo
*/
DWORD Lan_GetTxDataFreeSpace(const DWORD dwLanBase);

/*
FUNCTION: Lan_GetTxStatusCount
  Gets the number of TX completion status' available on the TX_STATUS_FIFO
  These can be read from Lan_CompleteTx
*/
DWORD Lan_GetTxStatusCount(const DWORD dwLanBase);

/*
FUNCTION: Lan_InitializeRx
  Prepares the LAN9118 for reception of packets
  Must be called After Lan_InitializeInterrupts
*/
void Lan_InitializeRx(const DWORD dwLanBase,DWORD dwRxCfg);

/*
FUNCTION: Lan_PopRxStatus
  If an Rx Status DWORD is available it will return it.
*/
DWORD Lan_PopRxStatus(const DWORD dwLanBase);

/* Phy_CheckLink(netp) is called periodically at every 100 msec
 * 	to check and update current link status.
 */
void Phy_CheckLink (const NGifnet * const netp);

/*
FUNCTION: Rx_FastForward
This function skips the current packet in RX fifo.
*/
void Rx_FastForward(const DWORD dwLanBase);

/*
 * LanDelayUS (dwLanBase, dwUS) delays 'dwUS' microseconds in this
 * 	function.
 */
void LanDelayUS(const DWORD dwLanBase, const DWORD dwUS);

/*
FUNCTION: update_tx_counters

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产永久精品大片wwwapp| 欧美狂野另类xxxxoooo| 在线观看成人小视频| 91精品国产综合久久精品app| 精品88久久久久88久久久| 亚洲一线二线三线视频| 国产成人丝袜美腿| 日韩午夜激情电影| 亚洲自拍与偷拍| 国产高清无密码一区二区三区| 精品1区2区3区| 亚洲免费观看视频| 国产成人精品一区二| 精品国产一区二区精华| 日韩中文字幕不卡| 色婷婷精品久久二区二区蜜臀av| 亚洲国产高清aⅴ视频| 黄一区二区三区| 日韩欧美三级在线| 秋霞电影一区二区| 欧美男生操女生| 亚洲成人精品在线观看| 在线精品视频一区二区三四 | 欧美激情一区二区三区全黄| 精品亚洲欧美一区| 日韩一区二区三区在线观看| 亚洲电影第三页| 欧美自拍偷拍一区| 亚洲一区二区在线免费观看视频| 91在线小视频| 亚洲人成电影网站色mp4| av午夜一区麻豆| 亚洲天堂免费看| av电影在线观看一区| 成人欧美一区二区三区白人 | 亚洲丝袜美腿综合| 色欧美日韩亚洲| 亚洲伊人伊色伊影伊综合网| 欧美精品一区男女天堂| 黄页视频在线91| 中文字幕乱码亚洲精品一区| 国产成人aaaa| 国产精品久久久久一区| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 欧美成人vr18sexvr| 久久99精品国产.久久久久| 精品欧美一区二区久久| 国产最新精品精品你懂的| 国产欧美精品一区二区色综合| 国产成人啪免费观看软件| 国产精品久久久久影院老司 | 国产大陆精品国产| 亚洲欧洲av在线| 欧美色老头old∨ideo| 日韩国产欧美三级| 国产日韩高清在线| 欧洲av一区二区嗯嗯嗯啊| 久久精品免费看| 中文字幕亚洲在| 日韩一区二区精品在线观看| 国产精品一色哟哟哟| 夜色激情一区二区| 欧美精品一区二区不卡| 91色porny蝌蚪| 久久精品噜噜噜成人av农村| 国产精品久久影院| 91精品婷婷国产综合久久性色 | 亚洲精品一区二区三区香蕉| 成人av动漫在线| 午夜精品一区二区三区免费视频 | 欧美电影一区二区| 国产精品1024| 亚洲成人福利片| 国产精品欧美一级免费| 欧美一区三区二区| av高清久久久| 国产一区二区三区免费| 午夜精品久久久久久久久久| 久久久精品国产免费观看同学| 91丝袜美女网| 国产精品996| 三级影片在线观看欧美日韩一区二区| 久久久www免费人成精品| 欧美人动与zoxxxx乱| av电影一区二区| 激情图片小说一区| 天天影视色香欲综合网老头| 国产精品国产三级国产普通话99| 精品国产一二三区| 欧美久久一区二区| 99久久综合国产精品| 国产麻豆日韩欧美久久| 美女网站视频久久| 亚洲成a天堂v人片| 一区二区久久久| 国产精品久久免费看| 久久一区二区三区四区| 精品久久久久99| 日韩欧美国产综合| 在线电影欧美成精品| 欧美日韩一区二区在线观看| 99久久99久久久精品齐齐| 国产伦精品一区二区三区在线观看| 亚洲123区在线观看| 亚洲国产精品综合小说图片区| 国产精品福利一区二区| 欧美国产精品久久| 中文久久乱码一区二区| 日本一区二区三区在线观看| 精品国产乱码久久久久久夜甘婷婷| 欧美顶级少妇做爰| 欧美精品粉嫩高潮一区二区| 欧美日韩你懂的| 欧美日韩一本到| 欧美久久一二三四区| 555www色欧美视频| 777午夜精品视频在线播放| 欧美绝品在线观看成人午夜影视| 欧美日韩国产片| 欧美精品乱码久久久久久| 91精品欧美福利在线观看| 91精品视频网| 久久综合精品国产一区二区三区| 26uuuu精品一区二区| 精品少妇一区二区三区| www激情久久| 国产精品国产三级国产a| 日本一区二区三区dvd视频在线 | 日韩亚洲欧美成人一区| 日韩精品一区在线观看| 久久久久久免费毛片精品| 久久久久久久久蜜桃| 国产视频911| 一区二区三区在线观看网站| 亚洲国产成人高清精品| 久久成人18免费观看| 成人激情黄色小说| 97精品久久久午夜一区二区三区 | 亚洲情趣在线观看| 亚洲人吸女人奶水| 日韩精品一卡二卡三卡四卡无卡| 日韩vs国产vs欧美| 成人深夜在线观看| 欧美性色黄大片手机版| wwwwww.欧美系列| 亚洲三级久久久| 免费成人小视频| 97se狠狠狠综合亚洲狠狠| 欧美日韩国产综合一区二区三区| 欧美一区二区免费视频| 日韩毛片高清在线播放| 捆绑变态av一区二区三区| 91首页免费视频| 91麻豆精品国产综合久久久久久| 久久九九久精品国产免费直播| 亚洲蜜臀av乱码久久精品蜜桃| 日本网站在线观看一区二区三区| 成人性生交大片免费看中文| 777午夜精品视频在线播放| 国产精品素人视频| 日韩激情av在线| 成人综合婷婷国产精品久久蜜臀| 欧美日韩国产另类一区| 国产精品理论片在线观看| 日韩福利视频网| 91视视频在线直接观看在线看网页在线看 | 亚洲国产高清在线| 国产精品久久久久久久久久免费看| 国产女主播视频一区二区| 亚洲中国最大av网站| 国产成人免费视| 亚洲精品一区二区三区四区高清| 亚洲一级不卡视频| av电影在线观看不卡| 久久精品欧美日韩精品| 六月丁香婷婷久久| 欧美三级视频在线播放| 综合激情成人伊人| 成人综合婷婷国产精品久久免费| 精品久久久三级丝袜| 日韩成人精品视频| 欧美一a一片一级一片| 国产精品嫩草影院av蜜臀| 韩国精品主播一区二区在线观看| 欧美日韩国产精品成人| 亚洲主播在线播放| 色呦呦网站一区| 亚洲精品一二三| 91在线精品一区二区| 国产精品狼人久久影院观看方式| 国产麻豆精品视频| 久久久久国产精品麻豆| 国产精品自拍毛片| 国产午夜精品美女毛片视频| 久久99久久99精品免视看婷婷| 日韩丝袜美女视频| 久久成人综合网| 欧美大片日本大片免费观看| 久久精品国产99| 精品第一国产综合精品aⅴ|