亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
在线亚洲+欧美+日本专区| 国产精品久久久久aaaa樱花| 国产女主播一区| 午夜精品久久一牛影视| 成人福利在线看| 精品国产区一区| 天天色 色综合| 欧美在线高清视频| 日韩理论电影院| 国产成人免费视频网站| 欧美一区二区三区视频在线观看| 亚洲欧洲国产日韩| 国产成人免费av在线| 日韩欧美国产一二三区| 天天操天天综合网| 欧美猛男gaygay网站| 亚洲日本一区二区| www.欧美日韩| 国产精品久久久久影院亚瑟| 国产一区二区三区四区在线观看| 91精品国产综合久久香蕉的特点 | 成人黄色777网| 精品久久久三级丝袜| 美国av一区二区| 91精品国产乱| 蜜臀久久99精品久久久久久9| 欧美日韩一本到| 亚洲成av人片观看| 精品视频在线看| 亚洲电影你懂得| 欧美福利一区二区| 日韩av中文在线观看| 欧美肥妇毛茸茸| 久久99久久99精品免视看婷婷| 欧美一级日韩一级| 麻豆精品一区二区| 久久久噜噜噜久久人人看| 国产精品一区免费在线观看| 久久久久久久综合| av电影一区二区| 亚洲精品视频一区| 欧美一区二区三级| 国内精品国产成人国产三级粉色| 国产亚洲精品精华液| 91首页免费视频| 亚洲成av人片| 精品国产123| yourporn久久国产精品| 亚洲制服欧美中文字幕中文字幕| 欧美老女人第四色| 国产一区美女在线| 亚洲视频一区在线| 欧美精品久久久久久久久老牛影院| 日本va欧美va瓶| 欧美高清在线一区二区| 欧美最猛性xxxxx直播| 蜜桃视频一区二区三区| 国产欧美日韩另类视频免费观看| 色香蕉成人二区免费| 日本视频一区二区| 亚洲色欲色欲www在线观看| 色视频成人在线观看免| 国产精品一级二级三级| 18成人在线观看| 日韩一卡二卡三卡国产欧美| 丁香另类激情小说| 亚洲bt欧美bt精品| 欧美国产欧美综合| 欧美人与禽zozo性伦| 国产高清不卡一区二区| 亚洲已满18点击进入久久| 日韩欧美亚洲国产另类| 91在线porny国产在线看| 日日夜夜一区二区| 国产精品欧美久久久久一区二区| 欧美二区三区91| 北条麻妃一区二区三区| 久久99国产精品尤物| 一区二区在线观看不卡| 久久精品亚洲乱码伦伦中文| 欧美日韩国产区一| 成人综合激情网| 国产尤物一区二区| 日本成人超碰在线观看| 一区二区三区四区精品在线视频| 日韩女优制服丝袜电影| 欧美性色综合网| www.亚洲人| 岛国一区二区三区| 国产一区二区毛片| 美女性感视频久久| 亚洲va欧美va天堂v国产综合| 国产精品久久久久久久蜜臀| 精品国产乱码91久久久久久网站| 欧洲视频一区二区| 日本韩国欧美三级| 91丨九色丨黑人外教| 国产成人在线观看| 国产在线日韩欧美| 韩国三级在线一区| 美日韩一区二区| 日本va欧美va精品| 美女诱惑一区二区| 欧美aⅴ一区二区三区视频| 视频一区国产视频| 日本三级亚洲精品| 三级在线观看一区二区| 视频在线观看一区| 日本vs亚洲vs韩国一区三区| 日韩国产欧美在线观看| 丝袜美腿一区二区三区| 日韩精品久久久久久| 日韩在线a电影| 日韩高清在线不卡| 美女视频黄久久| 久久国产三级精品| 国产裸体歌舞团一区二区| 国产成人欧美日韩在线电影| 成人福利在线看| 91浏览器打开| 欧美日韩亚洲综合在线| 91精品国产91热久久久做人人| 欧美日本精品一区二区三区| 日韩视频不卡中文| 欧美大片免费久久精品三p| 精品sm捆绑视频| 中文字幕乱码亚洲精品一区| 国产精品国产自产拍在线| 亚洲精品国产精品乱码不99| 亚洲国产成人av| 国模娜娜一区二区三区| 成人丝袜18视频在线观看| 成人av电影观看| 欧美色倩网站大全免费| 日韩欧美高清dvd碟片| 国产精品入口麻豆原神| 一区二区三区日韩在线观看| 日本亚洲天堂网| 国产传媒日韩欧美成人| 91国在线观看| 精品国产sm最大网站免费看| 亚洲人被黑人高潮完整版| 日韩电影免费一区| av中文字幕亚洲| 538在线一区二区精品国产| 久久久久久久国产精品影院| 亚洲人精品午夜| 久草精品在线观看| 97国产精品videossex| 日韩一区二区免费在线观看| 国产精品久久久久一区二区三区共 | 中文字幕在线不卡一区二区三区| 亚洲一二三四区| 国内成人免费视频| 欧美在线综合视频| 国产欧美一区二区三区沐欲 | 免费欧美高清视频| 99久久精品免费| 欧美电影免费观看高清完整版在| 亚洲精品乱码久久久久久| 日韩国产欧美三级| 色网综合在线观看| 国产亚洲一区二区在线观看| 亚洲成人资源网| a在线欧美一区| 久久这里只有精品视频网| 亚洲成av人在线观看| av高清久久久| 精品美女一区二区三区| 亚洲国产精品人人做人人爽| 国产成人av福利| 日韩免费视频线观看| 亚洲免费观看视频| 成人一区二区三区中文字幕| 日韩一区二区精品| 香蕉加勒比综合久久| 91久久精品一区二区| 久久精品这里都是精品| 蜜臀av性久久久久蜜臀aⅴ四虎| 91国偷自产一区二区开放时间| 久久久噜噜噜久噜久久综合| 麻豆精品一二三| 欧美男女性生活在线直播观看| 亚洲欧美aⅴ...| 97se狠狠狠综合亚洲狠狠| 国产丝袜欧美中文另类| 精品一区免费av| 日韩三级.com| 日本欧美在线观看| 日韩一级成人av| 免费在线观看一区| 欧美一区二区美女| 青草av.久久免费一区| 欧美精品丝袜久久久中文字幕| 亚洲欧美激情一区二区| 91丨porny丨蝌蚪视频| 亚洲视频在线观看三级| 色综合久久综合网欧美综合网| 亚洲日韩欧美一区二区在线| 色婷婷激情久久|