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

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

?? usbpcistub.c

?? Vxworks下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一区二区三区免费野_久草精品视频
国产精品第四页| 在线观看免费成人| 欧美国产精品一区| av影院午夜一区| 一级中文字幕一区二区| 色婷婷香蕉在线一区二区| 一区二区三区中文字幕精品精品| 91蝌蚪国产九色| 亚洲高清免费一级二级三级| 欧美三级日韩三级国产三级| 久久精品99久久久| 欧美国产乱子伦| 欧美系列在线观看| 乱中年女人伦av一区二区| 国产喷白浆一区二区三区| 91免费看视频| 免费观看久久久4p| 国产精品麻豆视频| 欧美美女bb生活片| 国产精品亚洲专一区二区三区| 亚洲私人影院在线观看| 555夜色666亚洲国产免| 国产综合色产在线精品| 亚洲精品视频免费观看| 日韩欧美中文字幕公布| 不卡av免费在线观看| 日韩福利电影在线| 国产目拍亚洲精品99久久精品| 欧美亚洲另类激情小说| 久久99国产精品尤物| 亚洲精品中文在线| 精品久久五月天| 91精品91久久久中77777| 精品一区二区三区在线视频| 亚洲欧美日韩国产综合在线| 精品少妇一区二区三区视频免付费| 91小视频免费观看| 久久精品国产在热久久| 亚洲一区欧美一区| 18涩涩午夜精品.www| 欧美一卡二卡三卡| 欧洲av一区二区嗯嗯嗯啊| 国产激情精品久久久第一区二区 | 国产精品久久久久久久蜜臀| 538prom精品视频线放| 99精品国产热久久91蜜凸| 韩国视频一区二区| 婷婷成人激情在线网| 亚洲视频在线一区观看| 久久久高清一区二区三区| 91精品国产综合久久久久久久| 99久久99久久久精品齐齐| 国精产品一区一区三区mba桃花| 午夜久久久久久久久| 综合久久久久久久| 国产精品欧美经典| 国产免费观看久久| 国产欧美一区二区三区网站| 精品国产不卡一区二区三区| 欧美福利一区二区| 欧美三区在线观看| 欧美日韩一级二级三级| 色88888久久久久久影院野外| 成人综合日日夜夜| 国产精品123区| 国产99久久久国产精品潘金网站| 激情亚洲综合在线| 国产一区二区剧情av在线| 久久精品国产在热久久| 久久国产精品色婷婷| 久久草av在线| 国产精品亚洲第一| 国产精华液一区二区三区| 丰满岳乱妇一区二区三区| 国产成人精品亚洲午夜麻豆| 国产精品亚洲人在线观看| 风间由美一区二区三区在线观看| 极品美女销魂一区二区三区| 精品一区二区三区视频| 精品在线观看免费| 国产最新精品免费| 国产精品白丝av| www.99精品| 色欧美乱欧美15图片| 精品视频全国免费看| 欧美欧美欧美欧美首页| 欧美一卡2卡3卡4卡| 精品国产一区二区三区久久影院 | 欧美大片日本大片免费观看| 欧美一区二区三区精品| 精品免费日韩av| 国产网站一区二区三区| 国产精品不卡一区| 亚洲成va人在线观看| 青青草原综合久久大伊人精品优势| 麻豆精品新av中文字幕| 国产裸体歌舞团一区二区| www.亚洲精品| 欧美色欧美亚洲另类二区| 91精品国产免费| 亚洲国产成人午夜在线一区| 亚洲天堂久久久久久久| 丝袜国产日韩另类美女| 狠狠色丁香久久婷婷综| 色悠悠亚洲一区二区| 91精品国产一区二区| 久久久久久久国产精品影院| 亚洲精品国产视频| 免费av成人在线| 91视频一区二区三区| 欧美一级欧美一级在线播放| 中文乱码免费一区二区| 亚洲国产人成综合网站| 国产精品1024久久| 欧美日韩高清不卡| 日本一区二区视频在线| 亚洲成人免费看| 不卡的av中国片| 日韩一区二区精品葵司在线| 国产精品你懂的| 免费人成黄页网站在线一区二区| 国产69精品久久99不卡| 7777精品伊人久久久大香线蕉最新版 | 婷婷中文字幕一区三区| 国产乱人伦偷精品视频不卡| 欧美日韩精品欧美日韩精品一综合| 精品国产麻豆免费人成网站| 亚洲精选在线视频| 国产69精品久久777的优势| 欧美一区二区不卡视频| 亚洲激情校园春色| 国产精品一区专区| 日韩一区二区在线看片| 一区二区久久久| 国产成人在线视频网站| 日韩精品一区二| 亚洲一区二区三区四区五区中文 | 日韩国产高清影视| 91在线观看视频| 欧美激情在线一区二区| 九九九久久久精品| 555夜色666亚洲国产免| 爽好久久久欧美精品| 99re热这里只有精品免费视频| 欧美成人艳星乳罩| 日韩**一区毛片| 欧美日韩欧美一区二区| 亚洲美女偷拍久久| 99久久婷婷国产综合精品| 国产视频视频一区| 国产精一区二区三区| 精品久久久久香蕉网| 免费在线观看视频一区| 欧美一卡二卡在线观看| 婷婷夜色潮精品综合在线| 欧美揉bbbbb揉bbbbb| 亚洲精品成人少妇| 色丁香久综合在线久综合在线观看| 国产精品青草综合久久久久99| 国产精品77777| 中文字幕欧美激情| www.在线成人| 亚洲色图在线视频| 99久久伊人精品| 亚洲精品高清在线| 欧洲精品一区二区三区在线观看| 18欧美亚洲精品| 91福利视频在线| 午夜精品一区二区三区免费视频 | 欧美猛男超大videosgay| 亚洲福利一区二区三区| 欧美日韩性生活| 视频精品一区二区| 日韩一区二区视频在线观看| 久久99精品一区二区三区| 精品对白一区国产伦| 国产91精品一区二区| 亚洲色欲色欲www| 欧美调教femdomvk| 奇米影视一区二区三区小说| 久久综合色一综合色88| 国产成人免费视频网站| 亚洲欧美一区二区不卡| 欧美日韩一区二区电影| 捆绑紧缚一区二区三区视频| 国产午夜精品美女毛片视频| 成人av资源在线观看| 樱花草国产18久久久久| 制服丝袜av成人在线看| 激情文学综合网| 国产精品免费aⅴ片在线观看| 91小视频免费看| 日韩国产高清影视| 国产日产欧美一区| 91黄视频在线观看| 精品系列免费在线观看| 亚洲欧美综合在线精品| 欧美日韩一级片在线观看| 国产一区二区三区精品欧美日韩一区二区三区 | 五月天精品一区二区三区|