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

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

?? ethernet.c

?? Mavell AP32 無線模塊驅動。VxWorks BSP BootRom源代碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/********************************************************************************                   Copyright 2002, GALILEO TECHNOLOGY, LTD.                   ** THIS CODE CONTAINS CONFIDENTIAL INFORMATION OF MARVELL.                      ** NO RIGHTS ARE GRANTED HEREIN UNDER ANY PATENT, MASK WORK RIGHT OR COPYRIGHT  ** OF MARVELL OR ANY THIRD PARTY. MARVELL RESERVES THE RIGHT AT ITS SOLE        ** DISCRETION TO REQUEST THAT THIS CODE BE IMMEDIATELY RETURNED TO MARVELL.     ** THIS CODE IS PROVIDED "AS IS". MARVELL MAKES NO WARRANTIES, EXPRESSED,       ** IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, COMPLETENESS OR PERFORMANCE.   **                                                                              ** MARVELL COMPRISES MARVELL TECHNOLOGY GROUP LTD. (MTGL) AND ITS SUBSIDIARIES, ** MARVELL INTERNATIONAL LTD. (MIL), MARVELL TECHNOLOGY, INC. (MTI), MARVELL    ** SEMICONDUCTOR, INC. (MSI), MARVELL ASIA PTE LTD. (MAPL), MARVELL JAPAN K.K.  ** (MJKK), GALILEO TECHNOLOGY LTD. (GTL) AND GALILEO TECHNOLOGY, INC. (GTI).    *********************************************************************************** ethernet.c - Marvell Fast Ethernte Controller driver** DESCRIPTION:*       This file introduce low level API to Marvell's Fast Ethernet *		Controller. This Fast Ethernet Controller driver API controls*		1) Operations (i.e. port init, start, reset etc').*		2) Data flow (i.e. port send, receive etc').*		This driver is designed to support multiple Fast Ethernet Controllers.*       The Fast Ethernet port is controlled via ETH_PORT_INFO struct.*		This struct includes user configuration information as well as driver *		internal data needed for its operations.*		                                                                       *		Supported Features:													   *		- This low level driver is OS independent. Allocating memory for the *		  descriptor rings and buffers are not within the scope of this driver.*		- The user is free from Rx/Tx queue managing.*		- This low level driver introduce functionality API that enable the *		  to operate Marvell's Fast Ethernet Controller in a convenient way.*		- Simple Fast Ethernet port operation API.*		- Simple Fast Ethernet port data flow API.*		- Support cached descriptors for better performance.*		- Phy access and control API.*		- Port control register configuration API.*		- Full control over Unicast and Multicast MAC configurations.*																			   *		Operation flow:**		Initialization phase*		This phase complete the initialization of the ETH_PORT_INFO struct. *		User information regarding port configuration has to be set prior to *		calling the port initialization routine. For example, the user has to *		assign the portPhyAddr field which is board depended parameter.*		In this phase any port Tx/Rx activity is halted, MIB counters are *		cleared, PHY address is set according to user parameter and access to*		DRAM and internal SRAM memory spaces.**		Driver ring initialization*		Allocating memory for the descriptor rings and buffers is not *		within the scope of this driver. Thus, the user is required to allocate *		memory for the descriptors ring and buffers. Those memory parameters *		are used by the Rx and Tx ring initialization routines in order to *		curve the descriptor linked list in a form of a ring. *		Note: Pay special attention to alignment issues when using cached *		descriptors/buffers. In this phase the driver stores information in the *		ETH_PORT_INFO struct regarding each queue ring.**		Driver start *		This phase prepares the Ethernet port for Rx and Tx activity. It uses *		the information stored in the ETH_PORT_INFO struct to initialize the *		various port registers.**		Data flow:*		All packet references to/from the driver are done using PKT_INFO struct.*       This struct is a unified struct used with Rx and Tx operations. *       This way the user is not required to be fully familiar with neither Tx  *       nor Rx descriptors structures.*		The driver's descriptors rings are management by indexes. Those indexes*		controls the ring resources and used to indicate a SW resource error:*		'current' *			This index points to the current available resource for use. For *			example in Rx process this index will point to the descriptor  *			that will be passed to the user upon calling the receive routine.*			In Tx process, this index will point to the descriptor*			that will be assigned with the user packet info and transmitted.*		'used'    *			This index points to the descriptor that need to restore its *			resources. For example in Rx process, using the Rx buffer return*			API will attach the buffer returned in packet info to the descriptor *			pointed by 'used'. In Tx process, using the Tx descriptor return *			will merely return the user packet info with the command status of  *			the transmitted buffer pointed by the 'used' index. Nevertheless, it *			is essential to use this routine to update the 'used' index.*		'first'*			This index supports Tx Scatter-Gather. It points to the first *			descriptor of a packet assembled of multiple buffers. For example *			when in middle of such packet we have a Tx resource error the *			'curr' index get the value of 'first' to indicate that the ring *			returned to its state before trying to transmit this packet.*																			   *		Receive operation:*		The ethPortReceive API set the packet information struct, passed by the *       caller, with received information from the 'current' SDMA descriptor. *		It is the user responsibility to return this resource back to the Rx *       descriptor ring to enable the reuse of this source. Return Rx resource *       is done using the ethRxReturnBuff API.*		                                                                       *		Transmit operation:*		The ethPortSend API supports Scatter-Gather which enables to send a *		packet spanned over multiple buffers. This means that for each *		packet info structure given by the user and put into the Tx descriptors *		ring, will be transmitted only if the 'LAST' bit will be set in the *		packet info command status field. This API also consider restriction *       regarding buffer alignments and sizes.*		The user must return a Tx resource after ensuring the buffer has been *		transmitted to enable the Tx ring indexes to update.*		                                                                       *		BOARD LAYOUT                                                           *		This device is on-board.  No jumper diagram is necessary.              *		                                                                       *		EXTERNAL INTERFACE                                                     *		                                                                       *       Prior to calling the initialization routine ethPortInit() the user must*       set the following fields under ETH_PORT_INFO struct:		                                                                       *       portNum             User Ethernet port number.*       portBaseAddr		    User PHY address of Ethernet port.*       portPhyAddr		    User PHY address of Ethernet port.*       portMacAddr[6]	    User defined port MAC address.*       portConfig          User port configuration value.*       portConfigExtend    User port config extend value.*       portSdmaConfig      User port SDMA config value.*       *portVirtToPhys ()  User function to cast virtual addr to CPU bus addr.*       *portPrivate        User scratch pad for user specific data structures.*		                                                                       *       This driver introduce a set of default values to use prior to calling*       the port initialization routine:*       PORT_CONFIG_VALUE           Default port configuration value*       PORT_CONFIG_EXTEND_VALUE    Default port extend configuration value*       PORT_SDMA_CONFIG_VALUE      Default sdma control value**		This driver data flow is done using the PKT_INFO struct which is a * 		unified struct for Rx and Tx operations:*		byteCnt				Tx/Rx descriptor buffer byte count.*		cmdSts				Tx/Rx descriptor command status.*		bufPtr				Tx/Rx descriptor buffer pointer.*		returnInfo			Tx/Rx user resource return information.*		                                                                       **		EXTERNAL SUPPORT REQUIREMENTS                                          *		                                                                       *		This driver requires the following external support:*		                                                                       *		D_CACHE_FLUSH_LINE (address, address offset)*		                                                                       *		This macro applies assembly code to flush and invalidate cache line.*		address        - address base.                                 *		address offset - address offset                   *		                                                                       *			                                                                   *		CPU_PIPE_FLUSH*		                                                                       *		This macro applies assembly code to flush the CPU pipeline.*		                                                                       *******************************************************************************//* includes */#include "platformTools.h"#include "ethernet.h"#include "addressTable.h"/* defines */#undef DRV_DEBUG/* Driver debug control *//* Driver debug control */#ifdef DRV_DEBUG#include <vxWorks.h>#include "private/funcBindP.h"#include "logLib.h"#define DRV_DEBUG_OFF		0x0000#define DRV_DEBUG_RX		0x0001#define DRV_DEBUG_TX		0x0002#define DRV_DEBUG_POLL		(DRV_DEBUG_POLL_RX | DRV_DEBUG_POLL_TX)#define DRV_DEBUG_POLL_RX   0x0004#define DRV_DEBUG_POLL_TX   0x0008#define DRV_DEBUG_IOCTL		0x0020#define DRV_DEBUG_INT		0x0040#define DRV_DEBUG_START    	0x0080#define DRV_DEBUG_DUMP    	0x0100#define DRV_DEBUG_MEM    	0x0200#define DRV_DEBUG_RX_ERR   	0x0400#define DRV_DEBUG_ALL    	0xffffint	ethPortDebug = DRV_DEBUG_OFF; #define DRV_LOG(FLG, X0, X1, X2, X3, X4, X5, X6)				\    {															\    if (ethPortDebug & FLG)										\		if (_func_logMsg != NULL)								\			_func_logMsg (X0, X1, X2, X3, X4, X5, X6);			\}#define DRV_PRINT(FLG, X)										\    {															\    if (ethPortDebug & FLG) printf X;							\    }#else /* DRV_DEBUG */#define DRV_LOG(FLG, X0, X1, X2, X3, X4, X5, X6)#define DRV_PRINT(FLG, X)#endif /* DRV_DEBUG *//* SDMA command macros */#define ETH_SDMA_START_TX(txQueue)										\    PORT_REG_WRITE(SDMA_COMMAND_REGISTER, (1 << (23 + txQueue))) 	#define ETH_SDMA_STOP_TX(txQueue)                              			\    PORT_REG_WRITE(SDMA_COMMAND_REGISTER, (1 << (16 + txQueue))) #define ETH_SDMA_ABORT_TX()                              				\    PORT_REG_WRITE(SDMA_COMMAND_REGISTER, (1 << 31)) #define ETH_SDMA_ENABLE_RX()                              				\    PORT_REG_WRITE(SDMA_COMMAND_REGISTER, (1 << 7)) #define ETH_SDMA_ABORT_RX()                              				\    PORT_REG_WRITE(SDMA_COMMAND_REGISTER, (1 << 15)) #define CURR_RFD_GET(pCurrDesc, queue)									\    ((pCurrDesc) = pEthPortCtrl->pRxCurrDescQ[queue])#define CURR_RFD_SET(pCurrDesc, queue)									\    (pEthPortCtrl->pRxCurrDescQ[queue] = (pCurrDesc))#define USED_RFD_GET(pUsedDesc, queue)									\    ((pUsedDesc) = pEthPortCtrl->pRxUsedDescQ[queue])#define USED_RFD_SET(pUsedDesc, queue)									\    (pEthPortCtrl->pRxUsedDescQ[queue] = (pUsedDesc))#define CURR_TFD_GET(pCurrDesc, queue)									\    ((pCurrDesc) = pEthPortCtrl->pTxCurrDescQ[queue])#define CURR_TFD_SET(pCurrDesc, queue)									\    (pEthPortCtrl->pTxCurrDescQ[queue] = (pCurrDesc))#define USED_TFD_GET(pUsedDesc, queue)									\    ((pUsedDesc) = pEthPortCtrl->pTxUsedDescQ[queue])#define USED_TFD_SET(pUsedDesc, queue)									\    (pEthPortCtrl->pTxUsedDescQ[queue] = (pUsedDesc))#define FIRST_TFD_GET(pFirstDesc, queue)								\    ((pFirstDesc) = pEthPortCtrl->pTxFirstDescQ[queue])	#define FIRST_TFD_SET(pFirstDesc, queue)								\    (pEthPortCtrl->pTxFirstDescQ[queue] = (pFirstDesc))	/* Macros that save access to desc in order to find next desc pointer  */#define RX_NEXT_DESC_PTR(pRxDesc, queue)								\	(ETH_RX_DESC*)(((((unsigned int)pRxDesc - 								   \    (unsigned int)pEthPortCtrl->pRxDescAreaBase[queue]) + RX_DESC_ALIGNED_SIZE)\    % pEthPortCtrl->rxDescAreaSize[queue]) + 								   \    (unsigned int)pEthPortCtrl->pRxDescAreaBase[queue])#define TX_NEXT_DESC_PTR(pTxDesc, queue)								\	(ETH_TX_DESC*)(((((unsigned int)pTxDesc - 								   \    (unsigned int)pEthPortCtrl->pTxDescAreaBase[queue]) + TX_DESC_ALIGNED_SIZE)\    % pEthPortCtrl->txDescAreaSize[queue]) + 								   \    (unsigned int)pEthPortCtrl->pTxDescAreaBase[queue])#define SMI_TIMEOUT	1000 	/* in 100MS units *//* locals *//* Phy routines */static ETH_STATUS ethernetPhyInit(ETH_PORT_INFO *pEthPortCtrl);/* Ethernet Port routines */static ETH_STATUS ethernetAddrTableInit(ETH_PORT_INFO *pEthPortCtrl);void ethBCopy(unsigned int srcAddr, unsigned int dstAddr, int byteCount);void ethDbg(ETH_PORT_INFO *pEthPortCtrl);/******************************************************************************** ethPortInit - Initialize the Ethernet port driver** DESCRIPTION:*       This function prepares the ethernet port to start its activity:*       1) Completes the ethernet port driver struct initialization toward port*           start routine.*       2) Resets the device to a quiescent state in case of warm reboot.*       3) Enable SDMA access to all four DRAM banks as well as internal SRAM.*       4) Clean MAC tables. The reset status of those tables is unknown.*       5) Set PHY address. *       Note: Call this routine prior to ethPortStart routine and after setting*       user values in the user fields of Ethernet port control struct (i.e.*       portPhyAddr).** INPUT:*       ETH_PORT_INFO 	*pEthPortCtrl       Ethernet port control struct** OUTPUT:*       See description.** RETURN:*       None.********************************************************************************/void ethPortInit(ETH_PORT_INFO *pEthPortCtrl){    int queue;    DRV_PRINT (DRV_DEBUG_START, ("In ethPortInit\n"));	    /* Zero out SW structs */	for(queue = 0; queue < MAX_RX_QUEUE_NUM; queue++)	{        CURR_RFD_SET ((ETH_RX_DESC*)0x00000000, queue);        USED_RFD_SET ((ETH_RX_DESC*)0x00000000, queue);		pEthPortCtrl->rxResourceErr[queue] = 0;	}		for(queue = 0; queue < MAX_TX_QUEUE_NUM; queue++)	{        CURR_TFD_SET ((ETH_TX_DESC*)0x00000000, queue);        USED_TFD_SET ((ETH_TX_DESC*)0x00000000, queue);		FIRST_TFD_SET((ETH_TX_DESC*)0x00000000, queue);		pEthPortCtrl->txResourceErr[queue] = 0;	}	ethPortReset(pEthPortCtrl);     DRV_PRINT (DRV_DEBUG_START, ("ethPortReset OK...\n"));	    ethernetAddrTableInit(pEthPortCtrl);    DRV_PRINT (DRV_DEBUG_START, ("ethernetAddrTableInit OK...\n"));    if(ethernetPhyInit(pEthPortCtrl) == ETH_ERROR)		DRV_PRINT (DRV_DEBUG_START,                 ("Unknown Phy device. Default interface set to RMII\n"));    DRV_PRINT (DRV_DEBUG_START, ("ethPortInit OK...\n"));	return;}/******************************************************************************** ethPortStart - Start the Ethernet port activity.** DESCRIPTION:*       This routine prepares the Ethernet port for Rx and Tx activity:*       1. Initialize Tx and Rx Current Descriptor Pointer for each queue that*           has been initialized a descriptor's ring (using etherInitTxDescRing *           for Tx and etherInitRxDescRing for Rx)*       2. Initialize and enable the Ethernet configuration port by writing to 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
樱桃视频在线观看一区| 国产精品私人影院| 91久久免费观看| 成人黄色电影在线| k8久久久一区二区三区| 在线亚洲欧美专区二区| 日本高清不卡一区| 欧美日韩精品二区第二页| 欧美性欧美巨大黑白大战| 欧美亚洲丝袜传媒另类| 91精品国产91久久综合桃花| 日韩无一区二区| 久久久久亚洲蜜桃| 国产精品久久久久影视| 亚洲激情图片一区| 午夜精品福利一区二区三区av| 视频一区二区欧美| 激情欧美一区二区| 成人黄色av网站在线| 91久久精品日日躁夜夜躁欧美| 88在线观看91蜜桃国自产| 欧美大尺度电影在线| 国产三级一区二区三区| 亚洲精品国产精华液| 久久国产人妖系列| av中文字幕不卡| 欧美日韩一级二级三级| 精品国产乱码久久久久久1区2区 | 一区二区在线观看视频| 亚洲国产精品一区二区久久| 蜜臀av在线播放一区二区三区| 成人免费视频caoporn| 欧美日韩一区不卡| 久久久久久久免费视频了| 亚洲男人的天堂在线观看| 日日夜夜一区二区| 成人久久久精品乱码一区二区三区| 91极品美女在线| wwww国产精品欧美| 亚洲国产一二三| 国产不卡视频一区二区三区| 欧美日韩视频专区在线播放| 久久精品人人做| 午夜电影一区二区| 菠萝蜜视频在线观看一区| 欧美精品丝袜久久久中文字幕| 国产欧美精品一区二区色综合| 日本欧美一区二区在线观看| 色婷婷av一区| 国产精品免费av| 久久精品国产澳门| 欧美精品一卡二卡| 一区二区三区产品免费精品久久75 | 欧美电影免费观看高清完整版 | 日韩欧美一级二级三级久久久| 亚洲三级电影网站| 国产精品自拍三区| 欧美成人综合网站| 日韩成人一区二区| 欧美久久久久久蜜桃| 自拍偷拍亚洲综合| 成人高清在线视频| 国产日韩欧美a| 国产精品一卡二卡在线观看| 欧美三区免费完整视频在线观看| 亚洲丝袜自拍清纯另类| 粉嫩久久99精品久久久久久夜| 日韩免费看的电影| 六月丁香婷婷久久| 欧美一区二区三区四区久久| 性久久久久久久久久久久| 91国产免费看| 久久激五月天综合精品| 精品视频在线免费看| 一区二区三区日本| 在线观看网站黄不卡| 亚洲妇女屁股眼交7| 欧美日韩不卡一区二区| 日韩精品乱码免费| 日韩午夜小视频| 经典一区二区三区| 久久久久久久久久久黄色| 国产成人午夜高潮毛片| 国产精品久久久久久久久免费桃花 | 国产丝袜美腿一区二区三区| 高潮精品一区videoshd| 国产精品视频在线看| 91电影在线观看| 天堂一区二区在线| 欧美精品一区二区三| 成人丝袜高跟foot| 亚洲激情自拍偷拍| 日韩视频一区在线观看| 国产精选一区二区三区 | 91国偷自产一区二区开放时间| 亚洲线精品一区二区三区| 欧美一区二区三区的| 国产九色sp调教91| 日韩成人dvd| 国产目拍亚洲精品99久久精品| 99久久综合精品| 午夜精品久久久久久| 久久久99精品免费观看| 91网站黄www| 蜜桃精品视频在线观看| 欧美激情一区二区在线| 欧美日韩亚洲国产综合| 国内精品久久久久影院薰衣草| 综合婷婷亚洲小说| 制服丝袜成人动漫| 丁香另类激情小说| 午夜影院在线观看欧美| 欧美高清在线精品一区| 欧美精品视频www在线观看| 国产乱人伦精品一区二区在线观看| 亚洲欧美aⅴ...| 日韩欧美一级二级三级 | 日韩电影一区二区三区| 国产精品久久久久精k8| 日韩一本二本av| 色悠久久久久综合欧美99| 免费日韩伦理电影| 一区二区三区免费在线观看| 精品国产伦一区二区三区免费| 91免费版在线| 91亚洲大成网污www| 经典一区二区三区| 日韩精品国产欧美| 一区二区不卡在线播放| 国产农村妇女精品| 精品国产一区二区国模嫣然| 欧美在线观看你懂的| 国产福利精品导航| 久88久久88久久久| 亚洲国产精品精华液网站| 中文字幕视频一区| 国产精品蜜臀av| 久久久一区二区| 精品国产乱码久久久久久蜜臀 | 日韩理论片一区二区| 久久久久国产精品麻豆| 日韩欧美成人一区| 91精品国产综合久久福利软件| 91片在线免费观看| 成人国产精品免费观看动漫| 国产精品亚洲第一区在线暖暖韩国| 麻豆久久久久久| 久久不见久久见免费视频7| 免费看黄色91| 久久国产精品72免费观看| 久久精品免费看| 老司机精品视频线观看86| 日韩精品电影一区亚洲| 日韩中文字幕av电影| 婷婷久久综合九色国产成人| 亚洲二区在线观看| 午夜私人影院久久久久| 亚洲18影院在线观看| 香蕉av福利精品导航| 蜜臀av性久久久久蜜臀aⅴ流畅| 图片区日韩欧美亚洲| 免费高清在线一区| 久久国产精品第一页| 国产福利91精品| 91蜜桃网址入口| 欧美午夜精品一区二区蜜桃| 欧美美女一区二区在线观看| 91精品蜜臀在线一区尤物| 欧美成人一区二区三区片免费| 久久先锋影音av| 欧美经典一区二区| 中文字幕一区二区三区不卡| 怡红院av一区二区三区| 日本网站在线观看一区二区三区| 美女视频黄a大片欧美| 国产精品亚洲第一区在线暖暖韩国 | 这里只有精品免费| 久久精品视频免费| 亚洲影视资源网| 狠狠色丁香婷综合久久| 成人午夜激情片| 欧美性视频一区二区三区| 日韩欧美不卡一区| 综合分类小说区另类春色亚洲小说欧美| 亚洲已满18点击进入久久| 久久99国产精品麻豆| 99国产精品久久| 精品日韩在线观看| 中文字幕在线不卡一区| 丝袜美腿亚洲一区二区图片| 国产91精品欧美| 欧美丰满一区二区免费视频| 亚洲国产精品二十页| 亚洲高清一区二区三区| 国产精品一二一区| 欧美日韩精品一区二区在线播放| 国产午夜精品一区二区三区嫩草| 亚洲电影一区二区三区| 国产成人亚洲精品青草天美| 69堂精品视频|