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

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

?? usbpcistub.c

?? at91rm9200 bsp at91rm9200 bsp
?? C
字號:
/*9200 USB host*//* Includes */#include "vxWorks.h"#include "string.h"#include "sysLib.h"#include "cacheLib.h"#include "iv.h"#include "intLib.h"/*#include "drv/pci/pciConfigLib.h"*/   /* VxWorks PCI funcs */#include "usb/usbPlatform.h"		/* Basic definitions */#include "usb/usbPciLib.h"			/* Our API */#include "drv/usb/usbOhci.h"                /* OHCI definitions */#define USB_BASE_ADDR		0x300000		/*USB host port :0x300000-0x3fffff*/#define USB_HOST_INT_NUM	23/*just for :)*/#define BUSNO	10#define DEVNO	10#define FUNCNO	10#define sysOutByte(addr,data)	(*((UINT8  *) (addr)) = ((UINT8)  (data)))#define sysOutWord(addr,data)   (*((UINT16 *) (addr)) = ((UINT16) (data)))#define sysOutLong(addr,data)   (*((UINT32 *) (addr)) = ((UINT32) (data)))#define sysInByte(addr)         (*((UINT8  *) (addr)))#define sysInWord(addr)         (*((UINT16 *) (addr)))#define sysInLong(addr)         (*((UINT32 *) (addr)))#define INT_CONNECT(intNo, func, param)	\	intConnect (INUM_TO_IVEC(intNo), (VOIDFUNCPTR) (func), (int) (param))#define INT_DISCONNECT(intNo, func, param)#define INT_ENABLE(i)		intEnable(i)#define INT_DISABLE(i)		intDisable(i)/* Map I/O functions to underlying system functions. */#define	USB_IN_BYTE(a)		sysInByte ((a) + USB_BASE_ADDR)#define	USB_IN_WORD(a)		sysInWord ((a) + USB_BASE_ADDR)#define	USB_IN_DWORD(a)		sysInLong ((a) + USB_BASE_ADDR)#define	USB_OUT_BYTE(a,v)	sysOutByte ((a) + USB_BASE_ADDR, (v))#define	USB_OUT_WORD(a,v)	sysOutWord ((a) + USB_BASE_ADDR, (v))#define	USB_OUT_DWORD(a,v)	sysOutLong ((a) + USB_BASE_ADDR, (v))/* locals */LOCAL UINT32 sysUsbInitialised;/********************************************************************************* sysUsbPciInit - perform low level pci init of all Ohci class pci devices** This routine discovers and assigns PCI resources to all installed* USB class devices. In the case of the OPTI chip, it is one device* per chip. The 4 Port Lucent chip is a multi-function device with* 4 single port USB devices/functions.** NOTE: This routine should not be called directly by the user.** RETURNS: N/A*/void sysUsbPciInit()    {    /*     * Initialise only once     */    if( sysUsbInitialised )        return;     sysUsbInitialised = 1;    }/***************************************************************************** usbPciClassFind - Locates PCI devices by class.** RETURNS: TRUE if matching device found*	   FALSE if device not found*/BOOL usbPciClassFind    (    UINT8 pciClass,		/* PCI device class */    UINT8 subClass,		/* PCI device sub-class */    UINT8 pgmIf,		/* Programming interface */    UINT16 index,		/* Caller wants nth matching dev */    pUINT8 pBusNo,		/* Bus number of matching dev */    pUINT8 pDeviceNo,		/* Device number of matching dev */    pUINT8 pFuncNo		/* Function number of matching dev */    )    {    	if(index > 0)    		return FALSE;    	else    	{			*pBusNo = (UINT8) BUSNO;			*pDeviceNo = (UINT8) DEVNO;			*pFuncNo = (UINT8) FUNCNO;	 		return TRUE;    		    		  		    	}    		    }/***************************************************************************** usbPciByteGet - Returns a UINT8 configuration value** This function returns the UINT8 value at offset <regOffset> ** RETURNS: UINT8 value read from device configuration space*/UINT8 usbPciByteGet     (    UINT8 busNo,		/* Bus number of device */    UINT8 deviceNo,		/* Device number of device */    UINT8 funcNo,		/* Function number of device */    UINT16 regOffset		/* Offset into PCI config space */    )    {    UINT8 value;    value = USB_IN_BYTE(regOffset);    return value;    }/***************************************************************************** usbPciWordGet - Returns a UINT16 configuration value** RETURNS: UINT16 value read from device configuration space*/UINT32 usbPciWordGet    (    UINT8 busNo,		/* Bus number of device */    UINT8 deviceNo,		/* Device number of device */    UINT8 funcNo,		/* Function number of device */    UINT16 regOffset		/* Offset into PCI config space */    )    {    UINT16 value;    value = USB_IN_WORD(regOffset);    return value;    }/***************************************************************************** usbPciDwordGet - Returns a UINT32 configuration value** This function returns the UINT32 value at offset <regOffset> from * the PCI configuration space of the device identified by <busNo>, * <deviceNo>, and <funcNo>.** NOTE: This function adjusts for big vs. little endian environments.** RETURNS: UINT32 value read from device configuration space*/UINT32 usbPciDwordGet    (    UINT8 busNo,		/* Bus number of device */    UINT8 deviceNo,		/* Device number of device */    UINT8 funcNo,		/* Function number of device */    UINT16 regOffset		/* Offset into PCI config space */    )    {    UINT32 value;    value = USB_IN_DWORD(regOffset);    return value;    }/***************************************************************************** usbPciConfigHeaderGet - Reads a device's PCI configuration header** This function reads the PCI configuration header for the device* identified by <busNo>, <deviceNo>, and <funcNo>.  The configuration* header is stored in the <pCfgHdr> buffer provided by the caller.** This function initializes the <pCfgHdr> structure to zeros.  Any * fields which cannot be read from the device's configuration header * will remain zero upon return.  This function does not attempt to read* fields defined as "reserved" in the PCI configuration header.** RETURNS: N/A*/VOID usbPciConfigHeaderGet    (    UINT8 busNo,		/* Bus number of device */    UINT8 deviceNo,		/* Device number of device */    UINT8 funcNo,		/* Function number of device */    pPCI_CFG_HEADER pCfgHdr	/* Buffer provided by caller */    )    {    int i;    /* Do nothing if CfgHdr is NULL */    if (pCfgHdr == NULL)	return;    /* Initialize the buffer to zeros. some parameters have no means....*/    memset (pCfgHdr, 0, sizeof (*pCfgHdr));    pCfgHdr->vendorId	= 0x1234;    pCfgHdr->deviceId	= 0x1234;    pCfgHdr->command	= 0x1234;    pCfgHdr->status	= 0x1234;    pCfgHdr->revisionId = 0x12;    pCfgHdr->pgmIf	= 0x12;    pCfgHdr->subClass	= 0x12;    pCfgHdr->pciClass	= 0x12;    pCfgHdr->cacheLineSize = 8;    pCfgHdr->latencyTimer = 0x12;    pCfgHdr->headerType = 0;		/*type 0*/    pCfgHdr->bist	= 0x12;         for (i = 0; i < PCI_CFG_NUM_BASE_REG; i++)    {		pCfgHdr->baseReg [0] = USB_BASE_ADDR;		/*base addr ,mem map,32addrs*/	        }        pCfgHdr->romBase	= 0;    pCfgHdr->intLine	= USB_HOST_INT_NUM;	/*INT no of usb*/	    pCfgHdr->intPin	= 0;    pCfgHdr->minGrant	= 0x1;    pCfgHdr->maxLatency = 0x10;       }/***************************************************************************** usbPciByteIn - input a byte from PCI I/O space** Inputs a byte from a PCI I/O address <address>.** RETURNS: byte input from i/o address*/UINT8 usbPciByteIn    (    UINT32 address		/* PCI I/O address */    )    {    return USB_IN_BYTE (address);    }/***************************************************************************** usbPciWordIn - input a word from PCI I/O space** Inputs a word from a PCI I/O address <address>.** NOTE: This function adjusts for big vs. little endian environments.** RETURNS: word input from i/o address*/UINT16 usbPciWordIn    (    UINT32 address		/* PCI I/O address */    )    {    UINT16 w = USB_IN_WORD (address);    return FROM_LITTLEW (w);    }/***************************************************************************** usbPciDwordIn - input a dword from PCI I/O space** Inputs a dword from a PCI I/O address <address>.** NOTE: This function adjusts for big vs. little endian environments.** RETURNS: dword input from i/o address*/UINT32 usbPciDwordIn    (    UINT32 address		/* PCI I/O address */    )    {    UINT32 l = USB_IN_DWORD (address);    return FROM_LITTLEL (l);    }/***************************************************************************** usbPciByteOut - output a byte to PCI I/O space** Outputs <value> to the PCI I/O address <address>.** RETURNS: N/A*/VOID usbPciByteOut    (    UINT32 address,		/* PCI I/O address */    UINT8 value 		/* value */    )    {    USB_OUT_BYTE (address, value);    CACHE_PIPE_FLUSH ();    }/***************************************************************************** usbPciWordOut - outputs a word to PCI I/O space** Outputs <value> to the PCI I/O address <address>.** NOTE: This function adjusts for big vs. little endian environments.** RETURNS: N/A*/VOID usbPciWordOut    (    UINT32 address,		/* PCI I/O address */    UINT16 value		/* value */    )    {    UINT16 w = TO_LITTLEW (value);    USB_OUT_WORD (address, w);    CACHE_PIPE_FLUSH ();    }/***************************************************************************** usbPciDwordOut - outputs a dword to PCI I/O space** Outputs <value> to the PCI I/O address <address>.** NOTE: This function adjusts for big vs. little endian environments.** RETURNS: N/A*/VOID usbPciDwordOut    (    UINT32 address,		/* PCI I/O address */    UINT32 value		/* value */    )    {    UINT32 l = TO_LITTLEL (value);    USB_OUT_DWORD (address, l);    CACHE_PIPE_FLUSH ();    }/***************************************************************************** usbPciMemioOffset - Return PCI MEMIO to CPU MEMIO offset** For memory-mapped I/O, the CPU's view of a memory address may not be the* same as that programmed into the base address register of a PCI adapter.* The CPU should add the value returned by this function to the BAR in order* to produce the correct CPU-visible memory address.** RETURNS: PCI_MEMIO_OFFSET*/UINT32 usbPciMemioOffset (void)    {    return 0;    }/***************************************************************************** usbMemToPci - Convert a memory address to a PCI-reachable memory address** Converts <pMem> to an equivalent 32-bit memory address visible from the * PCI bus.  This conversion is necessary to allow PCI bus masters to address* the same memory viewed by the processor.** RETURNS: converted memory address*/UINT32 usbMemToPci    (    pVOID pMem			/* memory address to convert */    )    {    pVOID pPhys;        pPhys = CACHE_DRV_VIRT_TO_PHYS (&cacheUserFuncs, pMem);    return ((UINT32) pPhys) ;    }/***************************************************************************** usbPciToMem - Convert a PCI-reachable address to a CPU-reachable pointer** Converts <pciAdrs> to an equivalent CPU memory address.  ** RETURNS: pointer to PCI memory*/pVOID usbPciToMem    (    UINT32 pciAdrs		/* 32-bit PCI address to be converted */    )    {		    return CACHE_DRV_PHYS_TO_VIRT (&cacheUserFuncs, 		(void *) pciAdrs);    	    }/***************************************************************************** usbPciMemInvalidate - Invalidate cache for a region of memory** When another bus master, such as a PCI bus master, writes to memory, the* cache may need to be invalidated for that region of memory.** NOTE: Returns immediately if size == 0.** RETURNS: N/A*/VOID usbPciMemInvalidate    (    pVOID pMem, 		/* base of memory region to invalidate */    UINT32 size 		/* size of region to invalidate */    )    {    if (size != 0)	CACHE_USER_INVALIDATE (pMem, size);    }/***************************************************************************** usbPciMemFlush - Flush a region of memory through the cache** In systems which implement a non-write-thru cache, the processor may have* written data to memory which has not yet been flushed to the actual system* memory.  Before other bus masters may interrogate this memory, it may be* necessary to flush the cache.** NOTE: Returns immediately if size == 0.** RETURNS: N/A*/VOID usbPciMemFlush    (    pVOID pMem, 		/* base of memory region to invalidate */    UINT32 size 		/* size of region to invalidate */    )    {    if (size != 0)	CACHE_USER_FLUSH (pMem, size);    }/***************************************************************************** usbPciIntConnect - Connect to a interrupt vector** Connects the <func> to the interrupt number <intNo>.	<param> is an* application-specific value which will be passed to <func> each time* the interrupt handler is invoked.  ** RETURNS: OK, or ERROR if unable to connect/enable interrupt*/STATUS usbPciIntConnect    (    INT_HANDLER_PROTOTYPE func,     /* new interrupt handler */    pVOID param,		    /* parameter for int handler */    UINT16 intNo		    /* interrupt vector number */    )    {    if(intNo != USB_HOST_INT_NUM)	return ERROR;	    if (INT_CONNECT ((int) intNo, func, param) != OK)	return ERROR;    if (INT_ENABLE (intNo) != OK)	{	INT_DISCONNECT (intNo, func, param);	return ERROR;	}    return OK;    }/***************************************************************************** usbPciIntDisconnect - Removes an interrupt handler** Removes an interrupt handler installed by usbPciIntConnect().  <func>,* <param>, and <intNo> must match the corresponding parameters from an earlier * call to usbPciIntConnect().** RETURNS: N/A*/VOID usbPciIntRestore    (    INT_HANDLER_PROTOTYPE func,     /* int handler to be removed */    pVOID param,		    /* parameter for int handler */    UINT16 intNo		    /* interrupt vector number */    )    {    	if (intNo == USB_HOST_INT_NUM)			{				INT_DISABLE (intNo);    		INT_DISCONNECT (intNo, func, param);    	}        }/* End of file. */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美综合色免费| 亚洲女同女同女同女同女同69| 成人深夜在线观看| 国产福利电影一区二区三区| 国产在线不卡一卡二卡三卡四卡| 蜜乳av一区二区三区| 麻豆freexxxx性91精品| 久久se精品一区精品二区| 久久av老司机精品网站导航| 久久成人av少妇免费| 国产精品888| 99久久精品免费| 精品视频资源站| 日韩一级片在线播放| 国产亚洲va综合人人澡精品| 国产日韩精品一区二区浪潮av| 久久久91精品国产一区二区三区| 国产欧美精品一区二区三区四区| 国产精品伦一区二区三级视频| 亚洲美女在线国产| 亚洲成人动漫在线免费观看| 丝袜美腿一区二区三区| 激情小说亚洲一区| av在线不卡电影| 欧美日韩精品久久久| 精品国产一区久久| 中文字幕第一页久久| 一区二区三区欧美日韩| 日韩—二三区免费观看av| 国产精品一二三四区| 色成年激情久久综合| 欧美日本韩国一区二区三区视频| 亚洲精品在线免费播放| 亚洲视频一二三区| 久久精品国产网站| 91精彩视频在线| 久久精品夜色噜噜亚洲aⅴ| 一区二区三区日韩| 国产精品香蕉一区二区三区| 在线观看欧美日本| 久久九九99视频| 夜夜嗨av一区二区三区网页| 国产综合久久久久久鬼色| 色婷婷亚洲精品| 欧美国产激情一区二区三区蜜月| 亚洲制服欧美中文字幕中文字幕| 国产曰批免费观看久久久| 欧美色手机在线观看| 国产精品三级视频| 精品一区二区精品| 欧美日韩精品电影| 亚洲精品国产高清久久伦理二区| 老色鬼精品视频在线观看播放| 91麻豆蜜桃一区二区三区| 久久综合资源网| 麻豆极品一区二区三区| 欧美日韩国产一区二区三区地区| 国产精品久久久久一区二区三区| 国精产品一区一区三区mba视频 | jlzzjlzz亚洲日本少妇| 欧美mv日韩mv国产网站| 首页国产丝袜综合| 欧美三级中文字| 亚洲精选视频免费看| 成人国产在线观看| 中文字幕av一区二区三区免费看| 免费av成人在线| 欧美精品乱码久久久久久| 亚洲精选一二三| 色菇凉天天综合网| 一区二区三区av电影| 91在线免费视频观看| 欧美国产日本视频| 国产精品亚洲综合一区在线观看| 欧美成人女星排行榜| 日韩av一级电影| 日韩写真欧美这视频| 免费观看在线综合| 欧美成人激情免费网| 久久www免费人成看片高清| 精品对白一区国产伦| 国产又粗又猛又爽又黄91精品| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 不卡视频在线观看| 中文字幕乱码日本亚洲一区二区| 国产成人av自拍| 国产精品久久久久天堂| 99精品视频一区二区三区| 亚洲欧美一区二区三区极速播放 | 中文字幕一区在线观看视频| av电影天堂一区二区在线| 亚洲乱码国产乱码精品精小说 | 日韩一区二区三区视频在线| 美女爽到高潮91| 国产亚洲欧美日韩日本| 波多野结衣中文字幕一区二区三区 | 欧美日韩aaa| 久久精品国产亚洲5555| 国产精品午夜在线| 在线视频国产一区| 美女视频黄频大全不卡视频在线播放 | 亚洲综合成人网| 欧美一区欧美二区| 国产99久久久国产精品 | 6080亚洲精品一区二区| 国内精品久久久久影院色| 中文字幕中文字幕一区| 91久久奴性调教| 极品少妇一区二区三区精品视频| 国产午夜精品一区二区三区视频 | 亚洲欧美一区二区三区极速播放 | 日本在线不卡视频| 欧美激情综合五月色丁香小说| 日本高清不卡在线观看| 国产中文字幕精品| 樱桃视频在线观看一区| 日韩欧美久久久| 91成人免费网站| 国产高清在线精品| 日韩精品一级二级| 中文字幕一区二区三区乱码在线| 欧美精品粉嫩高潮一区二区| 成人一区二区三区中文字幕| 视频在线观看一区| 国产精品不卡在线| 久久免费电影网| 91麻豆精品国产自产在线| 色综合久久久久综合99| 国产精品自拍毛片| 免费av网站大全久久| 亚洲一区二区三区四区在线观看 | 亚洲精品免费在线| 久久久无码精品亚洲日韩按摩| 欧美天堂一区二区三区| 99麻豆久久久国产精品免费| 国产精品一级片在线观看| 久久国产夜色精品鲁鲁99| 亚洲成人精品影院| 亚洲欧美偷拍卡通变态| 中文字幕不卡在线播放| 亚洲精品在线观| 精品久久一区二区三区| 678五月天丁香亚洲综合网| 欧美午夜一区二区三区| 99国产精品久久久久久久久久| 国产一区二区三区黄视频| 久久国产婷婷国产香蕉| 日韩成人dvd| 日韩精品三区四区| 欧美aⅴ一区二区三区视频| 亚洲第一成人在线| 午夜激情久久久| 亚洲超丰满肉感bbw| 亚洲va欧美va人人爽| 日韩精品91亚洲二区在线观看| 亚洲成精国产精品女| 丝袜美腿亚洲一区| 人人精品人人爱| 久久综合综合久久综合| 韩国女主播成人在线观看| 久久国产日韩欧美精品| 国产乱人伦偷精品视频免下载| 国模大尺度一区二区三区| 国产成人免费av在线| 成人高清免费观看| 色婷婷精品久久二区二区蜜臂av| 91麻豆6部合集magnet| 在线一区二区观看| 91精品婷婷国产综合久久竹菊| 日韩欧美精品三级| 久久精品一区二区三区av | 欧美色倩网站大全免费| 3d成人动漫网站| 精品国产91洋老外米糕| 国产精品日日摸夜夜摸av| 亚洲激情图片一区| 日本伊人精品一区二区三区观看方式| 久久av资源网| 91一区二区三区在线播放| 欧美日韩一本到| 久久奇米777| 亚洲电影一级黄| 韩国三级电影一区二区| 99re这里只有精品视频首页| 欧美日韩精品欧美日韩精品一| 久久综合色天天久久综合图片| 日韩一区在线看| 麻豆国产欧美一区二区三区| www.av精品| 日韩午夜精品视频| 久久不见久久见中文字幕免费| 亚洲人成网站在线| 亚洲成人免费影院| 亚洲图片欧美色图| 国内外精品视频| 久久国产精品区| 在线免费观看日本一区| 国产婷婷色一区二区三区 | 国产精品国产自产拍高清av | 色婷婷综合中文久久一本|