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

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

?? usbpcistub.c

?? sl811hs_vxworks_host_driver_v1_0_13 sl811的主驅動
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* usbPciStub.c - System-specific PCI Functions */

/* Copyright 2000 Wind River Systems, Inc. */

/*
Modification history
--------------------
01a,22nov00,wef  First, created from 01h of the mcp750 bsp stub
*/

/*
DESCRIPTION

This file defines a skeleton of functions to be used for accessing 
the PCI bus capabilities.  These functions allow PCI device drivers 
to be written independent of the underlying O/S's PCI access mechanisms.

The name of each function in this group begins with "usb" to represent
"Device Driver Services."
*/

/* 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 */



/*  #error "usbPciStub.c: Customize the USB PCI macros before first use" */

/*
 * TODO: Read and update this stub file to customize it for this
 * BSP.  Delete the #error statement above afterwards. Look for
 * TODO references in this file.
 */

/*
 * TODO: Adjust the 3 macros below as needed.
 *
 * USB_PCI_IO_OFFSET is the offset between a physical PCI IO address
 * and the virtual address used to access it.  In this example code,
 * PCI IO addresses map one-to-one with virtual IO addresses used
 * by the sysInByte() and sysOutByte() routines.  In a memory
 * mapped system it would be very unlikely for this value to be zero.
 *
 * USB_PCI_MEMIO_OFFSET is the offset between Memory IO (non prefetch)
 * PCI physical addresses and the local virtual address that corresponds
 * to it.
 *
 * USB_PCI_MEM_OFFSET is the offset between Memory (prefetchable) PCI
 * physical addresses and the local virtual address that corresponds
 * to it.
 */

#ifdef INCLUDE_USB_PCI
#define PCI_IO_OFFSET		PLB_PCI_IO_REGION_2_START
#define PCI_MEMIO_OFFSET	PLB_PCI_IO_REGION_1_START
#define PCI_MEM_OFFSET		PCI_MEMORY_START
#else
#define PCI_IO_OFFSET		0
#define PCI_MEMIO_OFFSET	0
#define PCI_MEM_OFFSET		0
#endif

/*
 * TODO: Define the following macros to describe how to connect
 * and disconnect interrupts on your hardware.  This should
 * normally be mapped to the pciIntLib functions.
 */

/* Interrupt enable/disable mappings */

#define USB_INT_CONNECT(intNo, func, param) \
    pciIntConnect (INUM_TO_IVEC(intNo), (VOIDFUNCPTR) func, (int) param)

#define USB_INT_DISCONNECT(intNo, func, param) \
    pciIntDisconnect (INUM_TO_IVEC(intNo), (VOIDFUNCPTR) func)

#define USB_INT_ENABLE(i)	intEnable (i)
#define USB_INT_DISABLE(i)	intDisable (i)

/*
 * TODO: Define the following macros to read/write data
 * to/from PCI I/O space as needed.  This may be I/O
 * mapped accesses or memory accesses.  This example
 * code assumes I/O mapped accesses using sysInByte
 * functions provided by the BSP sysLib module.
 */

/* Map I/O functions to underlying system functions. */

#define	USB_PCI_IN_BYTE(a)	sysInByte ((a) + PCI_IO_OFFSET)
#define	USB_PCI_IN_WORD(a)	sysInWord ((a) + PCI_IO_OFFSET)
#define	USB_PCI_IN_DWORD(a)	sysInLong ((a) + PCI_IO_OFFSET)
#define	USB_PCI_OUT_BYTE(a,v)	sysOutByte ((a) + PCI_IO_OFFSET, (v))
#define	USB_PCI_OUT_WORD(a,v)	sysOutWord ((a) + PCI_IO_OFFSET, (v))
#define	USB_PCI_OUT_DWORD(a,v)	sysOutLong ((a) + PCI_IO_OFFSET, (v))

/* code tracks usage count for interrupts 0..USB_MAX_INT_NO-1. */

#define USB_MAX_INT_NO		16




/* TODO: Leave the code below this point alone. */




/* locals */

LOCAL UINT16 intUsage [USB_MAX_INT_NO] = {0};


#ifdef INCLUDE_USB_PCI
/***************************************************************************
*
* usbPciClassFind - Locates PCI devices by class.
*
* A caller uses this function to locate a PCI device by its PCI class.
* The caller must specify the <pciClass>, <subClass>, and <pgmIf> for the
* device being sought.	The function returns the first matching device
* for <index> = 0, the second for <index> = 1, and so forth.  The
* bus number, device number, and function number for the matching device 
* are returned in the <pBusNo>, <pDeviceNo>, and <pFuncNo> buffers provided 
* by the caller. 
*
*
* RETURNS:
* 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 */
    )
    {
    int intBusNo;		/* VxWorks returns "int" values */
    int intDeviceNo;
    int intFuncNo;

    
    /* Use the VxWorks PCI config. library to find a device within the
    specified class. */

    if (pciFindClass ((pciClass << 16) | (subClass << 8) | pgmIf, index,
	&intBusNo, &intDeviceNo, &intFuncNo) != OK)
	{
	return FALSE;
	}
    else
	{
	if (pBusNo)
	     *pBusNo = (UINT8) intBusNo;
	if (pDeviceNo)
	     *pDeviceNo = (UINT8) intDeviceNo;
	if (pFuncNo)
	     *pFuncNo = (UINT8) intFuncNo;
	}

    return TRUE;
    }


/***************************************************************************
*
* usbPciByteGet - Returns a UINT8 configuration value
*
* This function returns the UINT8 value at offset <regOffset> from 
* the PCI configuration space of the device identified by <busNo>, 
* <deviceNo>, and <funcNo>.
*
* 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;

    if (pciConfigInByte (busNo, deviceNo, funcNo, regOffset, &value) != OK)
	return 0;

    return value;
    }


/***************************************************************************
*
* usbPciWordGet - Returns a UINT16 configuration value
*
* This function returns the UINT16 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: 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;

    if (pciConfigInWord (busNo, deviceNo, funcNo, regOffset, &value) != OK)
	return 0;

    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;

    if (pciConfigInLong (busNo, deviceNo, funcNo, regOffset, &value) != OK)
	return 0;

    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. */

    memset (pCfgHdr, 0, sizeof (*pCfgHdr));


    /* Read and store each field in the PCI configuration header. */

    pCfgHdr->vendorId	= usbPciWordGet (busNo, deviceNo, funcNo, PCI_CFG_VENDOR_ID);
    pCfgHdr->deviceId	= usbPciWordGet (busNo, deviceNo, funcNo, PCI_CFG_DEVICE_ID);
    pCfgHdr->command	= usbPciWordGet (busNo, deviceNo, funcNo, PCI_CFG_COMMAND);
    pCfgHdr->status	= usbPciWordGet (busNo, deviceNo, funcNo, PCI_CFG_STATUS);
    pCfgHdr->revisionId = usbPciByteGet (busNo, deviceNo, funcNo, PCI_CFG_REVISION);
    pCfgHdr->pgmIf	= usbPciByteGet (busNo, deviceNo, funcNo, PCI_CFG_PROGRAMMING_IF);
    pCfgHdr->subClass	= usbPciByteGet (busNo, deviceNo, funcNo, PCI_CFG_SUBCLASS);
    pCfgHdr->pciClass	= usbPciByteGet (busNo, deviceNo, funcNo, PCI_CFG_CLASS);
    pCfgHdr->cacheLineSize = usbPciByteGet (busNo, deviceNo, funcNo, PCI_CFG_CACHE_LINE_SIZE);
    pCfgHdr->latencyTimer = usbPciByteGet (busNo, deviceNo, funcNo, PCI_CFG_LATENCY_TIMER);
    pCfgHdr->headerType = usbPciByteGet (busNo, deviceNo, funcNo, PCI_CFG_HEADER_TYPE);
    pCfgHdr->bist	= usbPciByteGet (busNo, deviceNo, funcNo, PCI_CFG_BIST);

    for (i = 0; i < PCI_CFG_NUM_BASE_REG; i++)
	pCfgHdr->baseReg [i] = usbPciDwordGet (busNo, deviceNo, funcNo, 
	    PCI_CFG_BASE_ADDRESS_0 + i * sizeof (UINT32));

    pCfgHdr->romBase	= usbPciDwordGet (busNo, deviceNo, funcNo, PCI_CFG_EXPANSION_ROM);
    pCfgHdr->intLine	= usbPciByteGet (busNo, deviceNo, funcNo, PCI_CFG_DEV_INT_LINE);
    pCfgHdr->intPin	= usbPciByteGet (busNo, deviceNo, funcNo, PCI_CFG_DEV_INT_PIN);
    pCfgHdr->minGrant	= usbPciByteGet (busNo, deviceNo, funcNo, PCI_CFG_MIN_GRANT);
    pCfgHdr->maxLatency = usbPciByteGet (busNo, deviceNo, funcNo, PCI_CFG_MAX_LATENCY);
    }


/***************************************************************************
*
* usbPciByteIn - input a byte from PCI I/O space

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲三级视频在线观看| 久久久精品蜜桃| 91精品国产综合久久香蕉的特点| 欧美日韩一区久久| 91麻豆精品国产91久久久更新时间 | 26uuuu精品一区二区| 日本怡春院一区二区| 免费一级片91| 在线视频综合导航| 国产精品欧美综合在线| 日韩—二三区免费观看av| 93久久精品日日躁夜夜躁欧美| 欧美大片日本大片免费观看| 依依成人综合视频| 91在线丨porny丨国产| 精品久久一二三区| 秋霞电影网一区二区| 91精品福利在线| 亚洲精品国产一区二区精华液| 国产一区二区影院| 久久亚洲精品小早川怜子| 日本欧洲一区二区| 欧美久久高跟鞋激| 天堂av在线一区| 欧美军同video69gay| 亚洲一区二区偷拍精品| 91天堂素人约啪| 国产精品国产自产拍高清av| 国产精品中文有码| 日韩高清中文字幕一区| 97久久精品人人做人人爽50路| 国产欧美日本一区二区三区| 国产美女久久久久| 日本一区免费视频| 国产精品一卡二| 日本一区二区不卡视频| 国产成人精品aa毛片| 久久精品一级爱片| 国产毛片精品国产一区二区三区| 日韩一级成人av| 国产麻豆精品在线观看| 久久夜色精品国产欧美乱极品| 老司机一区二区| 亚洲精品一线二线三线| 国产馆精品极品| 中文字幕中文字幕一区二区| av网站免费线看精品| 亚洲欧美一区二区三区极速播放| 色av综合在线| 日本中文在线一区| 国产亚洲成aⅴ人片在线观看| 国产超碰在线一区| 一区二区三区欧美视频| 色婷婷精品久久二区二区蜜臂av| 亚洲一级电影视频| 日韩欧美国产一二三区| 国产精品中文字幕一区二区三区| 欧美国产日韩一二三区| 色欧美片视频在线观看| 日韩av一区二区在线影视| 欧美成人一区二区三区片免费| 国产一区久久久| 中文字幕一区二区日韩精品绯色| 欧美怡红院视频| 九色|91porny| 国产精品久久久久婷婷| 欧美猛男超大videosgay| 久久99精品国产麻豆婷婷 | 欧美撒尿777hd撒尿| 男人的天堂久久精品| 久久久久综合网| 在线免费观看视频一区| 久久国产精品99久久人人澡| 中文字幕在线播放不卡一区| 69p69国产精品| 不卡的电视剧免费网站有什么| 亚洲成a人片综合在线| 国产偷国产偷精品高清尤物| 欧美色涩在线第一页| 成人中文字幕在线| 另类专区欧美蜜桃臀第一页| 亚洲精品你懂的| 日本一区二区视频在线| 91麻豆精品91久久久久久清纯 | 国产精品萝li| 91精品国产91久久久久久一区二区 | 色一区在线观看| 激情图区综合网| 日韩不卡一区二区| 一区二区久久久久| 国产精品成人在线观看| 欧美成人aa大片| 欧美日韩免费观看一区二区三区| 国产成人av电影| 国模套图日韩精品一区二区| 亚洲国产精品一区二区尤物区| 中文av一区二区| 精品少妇一区二区三区 | 91在线国产观看| 国产精品综合一区二区三区| 性做久久久久久久久| 亚洲欧美日韩国产成人精品影院| 国产欧美日韩在线看| 精品国产一区二区三区久久久蜜月| 欧美午夜精品久久久久久孕妇| 国产成人福利片| 国产精品一级片在线观看| 男女视频一区二区| 日本成人在线看| 丝袜诱惑制服诱惑色一区在线观看| 亚洲精品乱码久久久久久| 国产精品久久777777| 国产精品国产a级| 亚洲欧美怡红院| 亚洲精品一二三四区| 亚洲素人一区二区| 亚洲欧美日韩国产综合| 亚洲人一二三区| 亚洲女同女同女同女同女同69| 亚洲精品视频在线观看免费| 最新不卡av在线| 亚洲午夜激情网站| 天天av天天翘天天综合网| 亚洲va韩国va欧美va| 亚洲成人手机在线| 日韩高清在线不卡| 久久av资源网| 成人免费高清在线| 一本色道久久加勒比精品| 色综合久久88色综合天天6| 欧美无砖专区一中文字| 欧美精品日韩一区| 欧美电视剧在线看免费| 久久久www成人免费无遮挡大片 | 国产suv精品一区二区6| 国产成人精品综合在线观看| 不卡在线观看av| 欧美日韩小视频| 久久久综合激的五月天| 18欧美乱大交hd1984| 亚洲影院久久精品| 日本aⅴ亚洲精品中文乱码| 韩国女主播一区| 色悠悠久久综合| 日韩一区二区三区视频| 国产精品色在线| 偷拍日韩校园综合在线| 国产久卡久卡久卡久卡视频精品| av在线不卡电影| 制服.丝袜.亚洲.中文.综合| 久久综合久久综合九色| 一区二区免费看| 国产精品99久久久久久似苏梦涵| 99久久免费精品高清特色大片| 欧美一区二区精品| 亚洲三级电影网站| 美女国产一区二区| 一本色道**综合亚洲精品蜜桃冫| 日韩一级免费一区| 亚洲欧洲成人精品av97| 老司机免费视频一区二区| 成人福利在线看| 日韩免费看网站| 亚洲一区二区三区四区五区中文 | 日本午夜精品一区二区三区电影| 国产成人精品在线看| 9191成人精品久久| 综合自拍亚洲综合图不卡区| 久久99久久99精品免视看婷婷 | 日韩一区欧美二区| av一二三不卡影片| 欧美成人一区二区| 天天av天天翘天天综合网| 91在线精品一区二区| 久久精品综合网| 美日韩黄色大片| 欧美日韩亚洲综合一区| 国产精品传媒视频| 国产a精品视频| 欧美成人女星排行榜| 亚洲成人免费视| 91在线免费播放| 1000部国产精品成人观看| 国产乱人伦精品一区二区在线观看| 欧美日韩专区在线| 亚洲激情图片一区| 波多野结衣中文字幕一区二区三区 | 国产精品美女www爽爽爽| 精品中文av资源站在线观看| 欧美日韩三级在线| 亚洲妇女屁股眼交7| 色综合天天狠狠| 成人欧美一区二区三区视频网页| 国产成人在线视频网站| 欧美成人福利视频| 国内精品伊人久久久久av影院 | 国产欧美精品日韩区二区麻豆天美| 青青草精品视频| 日韩三级高清在线| 九色综合国产一区二区三区|