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

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

?? usbpcistub.c

?? SL811 USB接口芯片用于VxWorks系統的驅動源代碼
?? 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久久久久久久久 | 欧美怡红院视频| 亚洲黄色尤物视频| 国产成都精品91一区二区三| 国产日产欧产精品推荐色 | 亚洲第四色夜色| 欧美三级在线看| 亚洲综合色婷婷| 91国内精品野花午夜精品| 伊人性伊人情综合网| 在线免费不卡视频| 亚洲一区在线视频观看| 色国产精品一区在线观看| 免费看日韩a级影片| 久久综合九色综合97_久久久| 国产一区二区三区不卡在线观看| 中文字幕免费观看一区| 99vv1com这只有精品| 亚洲动漫第一页| 韩国午夜理伦三级不卡影院| 亚洲三级电影网站| 免费一级片91| 成人毛片在线观看| 日韩欧美视频一区| 久久精品视频免费| 亚洲欧美综合色| 国产精品久久99| 久久久三级国产网站| 国产精品久久久久久久久久久免费看| 亚洲素人一区二区| 亚洲欧美日韩国产另类专区| 一区二区三区四区乱视频| 欧美高清性hdvideosex| 久久精品国产在热久久| 国产精品久久久久久久久图文区 | 东方aⅴ免费观看久久av| 日韩午夜激情电影| 成人网页在线观看| 亚洲成人免费影院| 欧美极品aⅴ影院| 在线播放日韩导航| 色综合久久久久久久久久久| 蜜臀久久99精品久久久画质超高清| 欧美激情一区三区| jlzzjlzz国产精品久久| 蜜臀av一级做a爰片久久| 国产精品美女www爽爽爽| 欧美精选在线播放| 色综合色综合色综合| 国模套图日韩精品一区二区| 一区二区三区在线看| 国产人伦精品一区二区| 亚洲精品一区在线观看| 色婷婷久久久亚洲一区二区三区 | 91精品国产综合久久国产大片| 国产一区二区看久久| 午夜精品久久久久久久蜜桃app| 欧美一级电影网站| 欧美在线影院一区二区| 久久国产精品第一页| 五月综合激情婷婷六月色窝| ㊣最新国产の精品bt伙计久久| 精品欧美一区二区在线观看| 欧美性感一区二区三区| 国产精品小仙女| 久久福利视频一区二区| 一区二区三区欧美日韩| **网站欧美大片在线观看| 国产精品视频yy9299一区| 亚洲一二三四在线观看| 色婷婷av一区二区三区软件| 亚洲国产裸拍裸体视频在线观看乱了| 91免费观看视频| 欧美色图天堂网| 亚洲激情网站免费观看| 国产suv一区二区三区88区| 欧美日韩一区久久| 欧美丰满少妇xxxxx高潮对白| 日韩三级精品电影久久久 | 成人一区在线观看| 亚洲美女淫视频| 日韩欧美一级二级| 处破女av一区二区| 久久精品国产精品亚洲综合| 欧美国产国产综合| 日韩一区二区三区观看| 国产98色在线|日韩| 日韩电影一区二区三区| 国产亚洲欧美日韩在线一区| 色哟哟日韩精品| 国产一区二区精品久久99| 青青草视频一区| 欧美一卡在线观看| 国产大陆亚洲精品国产| 午夜精品久久久久影视| 国产精品美女久久久久aⅴ | 1区2区3区精品视频| 成人免费一区二区三区视频 | 日韩国产欧美三级| 国产综合色在线| 精品国产成人在线影院| 日韩一级精品视频在线观看| 在线国产亚洲欧美| 欧美午夜精品久久久久久超碰| 欧美日韩国产小视频| 欧美一区二区三区色| 久久人人97超碰com| 国产精品人妖ts系列视频| 91精品国产一区二区三区 | www.色精品| 九九精品视频在线看| 亚洲欧美另类图片小说| 美女被吸乳得到大胸91| 日韩国产在线观看| 国产亚洲午夜高清国产拍精品| 久久精品亚洲乱码伦伦中文 | 亚洲自拍偷拍麻豆| 亚洲第一综合色| 国产成人精品亚洲日本在线桃色| av一区二区久久| 精品av久久707| 中文字幕一区二区三区四区不卡| 天天色天天操综合| 国产成人日日夜夜| 欧美挠脚心视频网站| 国产无人区一区二区三区| 日本午夜一区二区| 99国产麻豆精品| 中文在线一区二区| 日韩—二三区免费观看av| 91免费看视频| 国产视频一区二区在线| 九九热在线视频观看这里只有精品| 91免费视频观看| 亚洲欧洲美洲综合色网| 久久精品国产在热久久| 欧美日韩高清影院| 国产精品的网站| 成人激情动漫在线观看| 欧美精品一区视频| 亚洲欧美另类小说| 粉嫩13p一区二区三区| 欧美mv日韩mv| 日本中文一区二区三区| 欧美日本精品一区二区三区| 亚洲视频综合在线| 国产一区二区视频在线| 日韩欧美在线123| 爽好多水快深点欧美视频| 91在线丨porny丨国产| 欧美激情一区二区三区不卡 | 丁香亚洲综合激情啪啪综合| 日韩欧美一区二区三区在线| 亚洲一区中文日韩| 91欧美一区二区| 国产精品福利在线播放| 国产精品1024| xnxx国产精品| 老司机免费视频一区二区| 欧美日韩黄视频| 亚洲二区在线视频| 91农村精品一区二区在线| 中文字幕中文字幕中文字幕亚洲无线| 天堂蜜桃一区二区三区 | 国产在线播放一区| 欧美一级二级三级乱码| 国产专区综合网| 久久久精品免费免费| 国产91精品一区二区麻豆网站| 久久综合久久综合久久| 国产成人午夜电影网| 欧美国产激情二区三区| 色综合天天综合给合国产| 亚洲人成亚洲人成在线观看图片| 在线观看区一区二| 亚洲国产视频在线| 日韩精品在线一区二区| 国内精品免费**视频| 日本一区二区三区免费乱视频| 国产91精品精华液一区二区三区 | 亚洲女同ⅹxx女同tv| 国产一区福利在线| 国产精品成人在线观看| 国产白丝精品91爽爽久久| 亚洲人吸女人奶水| 欧美色区777第一页| 欧美aaa在线| 精品国产成人在线影院| 91麻豆免费在线观看| 亚洲一区自拍偷拍| 2023国产精华国产精品|