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

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

?? pcie.c

?? 基于xilinx vierex5得pci express dma設計實現。
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*++
Copyright (c) Microsoft Corporation.  All rights reserved.

    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
    KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
    IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
    PURPOSE.

Module Name:

    Pci9656.c

Abstract:

    This is a generic WDF sample driver for PCIE PCI9656RDK-Lite reference
    adapter. It illustrates how to use the WDF DmaObject to perform
    Scatter/Gather DMA operations.

Environment:

    Kernel mode

--*/

#include "precomp.h"
//
// The trace message header (.tmh) file must be included in a source file
// before any WPP macro calls and after defining a WPP_CONTROL_GUIDS
// macro (defined in toaster.h). During the compilation, WPP scans the source
// files for DoTraceMessage() calls and builds a .tmh file which stores a unique
// data GUID for each message, the text resource string for each message,
// and the data types of the variables passed in for each message.  This file
// is automatically generated by the WPP preprocessor.
//
#include "PCIE.tmh"


#ifdef ALLOC_PRAGMA
#pragma alloc_text (INIT, DriverEntry)
#pragma alloc_text (PAGE, PCIEEvtDeviceAdd)
#pragma alloc_text (PAGE, PCIEEvtDevicePrepareHardware)
#pragma alloc_text (PAGE, PCIEEvtDeviceReleaseHardware)
#pragma alloc_text (PAGE, PCIEEvtDeviceD0Exit)
#pragma alloc_text (PAGE, PCIEEvtDriverContextCleanup)
#pragma alloc_text (PAGE, PCIESetIdleAndWakeSettings)
#endif


NTSTATUS
DriverEntry(
    IN PDRIVER_OBJECT  DriverObject,
    IN PUNICODE_STRING RegistryPath
    )
/*++

Routine Description:

    Driver initialization entry point.
    This entry point is called directly by the I/O system.

Arguments:

    DriverObject - pointer to the driver object

    RegistryPath - pointer to a unicode string representing the path,
                   to driver-specific key in the registry.

Return Value:

    NTSTATUS    - if the status value is not STATUS_SUCCESS,
                        the driver will get unloaded immediately.

--*/
{
    NTSTATUS            status = STATUS_SUCCESS;
    WDF_DRIVER_CONFIG   config;
    WDF_OBJECT_ATTRIBUTES attributes;


    //
    // Initialize WDF WPP tracing.
    //
    WPP_INIT_TRACING( DriverObject, RegistryPath );


    //
    // TraceEvents function is mapped to DoTraceMessage provided by
    // WPP by using a directive in the sources file.
    //
    TraceEvents(TRACE_LEVEL_INFORMATION, DBG_INIT,
                "PCI Express Sample - Driver Framework Edition.");
    TraceEvents(TRACE_LEVEL_INFORMATION, DBG_INIT,
                "Built %s %s", __DATE__, __TIME__);

    //
    // Initialize the Driver Config structure.
    //
    WDF_DRIVER_CONFIG_INIT( &config, PCIEEvtDeviceAdd );

    //
    // Register a cleanup callback so that we can call WPP_CLEANUP when
    // the framework driver object is deleted during driver unload.
    //
    WDF_OBJECT_ATTRIBUTES_INIT(&attributes);
    attributes.EvtCleanupCallback = PCIEEvtDriverContextCleanup;

    status = WdfDriverCreate( DriverObject,
                              RegistryPath,
                              &attributes,
                              &config,
                              WDF_NO_HANDLE);

    if (!NT_SUCCESS(status)) {
        TraceEvents(TRACE_LEVEL_ERROR, DBG_PNP,
                    "WdfDriverCreate failed with status %!STATUS!", status);
        //
        // Cleanup tracing here because DriverContextCleanup will not be called
        // as we have failed to create WDFDRIVER object itself.
        // Please note that if your return failure from DriverEntry after the
        // WDFDRIVER object is created successfully, you don't have to
        // call WPP cleanup because in those cases DriverContextCleanup
        // will be executed when the framework deletes the DriverObject.
        //
        WPP_CLEANUP(DriverObject);
    }

    return status;
}


NTSTATUS
PCIEEvtDeviceAdd(
    IN WDFDRIVER        Driver,
    IN PWDFDEVICE_INIT  DeviceInit
    )
/*++

Routine Description:

    EvtDeviceAdd is called by the framework in response to AddDevice
    call from the PnP manager. Here the driver should register all the
    PNP, power and Io callbacks, register interfaces and allocate other
    software resources required by the device. The driver can query
    any interfaces or get the config space information from the bus driver
    but cannot access hardware registers or initialize the device.

Arguments:

Return Value:

--*/
{
    NTSTATUS                   status = STATUS_SUCCESS;
    WDF_PNPPOWER_EVENT_CALLBACKS pnpPowerCallbacks;
    WDF_OBJECT_ATTRIBUTES       attributes;
    WDFDEVICE                   device;
    PDEVICE_EXTENSION           devExt = NULL;

    UNREFERENCED_PARAMETER( Driver );


    TraceEvents(TRACE_LEVEL_INFORMATION, DBG_PNP,  "--> PCIEEvtDeviceAdd");


    PAGED_CODE();


    WdfDeviceInitSetIoType(DeviceInit, WdfDeviceIoDirect);

    //
    // Zero out the PnpPowerCallbacks structure.
    //
    WDF_PNPPOWER_EVENT_CALLBACKS_INIT(&pnpPowerCallbacks);

    //
    // Set Callbacks for any of the functions we are interested in.
    // If no callback is set, Framework will take the default action
    // by itself.
    //
    pnpPowerCallbacks.EvtDevicePrepareHardware = PCIEEvtDevicePrepareHardware;
    pnpPowerCallbacks.EvtDeviceReleaseHardware = PCIEEvtDeviceReleaseHardware;

    //
    // These two callbacks set up and tear down hardware state that must be
    // done every time the device moves in and out of the D0-working state.
    //
    pnpPowerCallbacks.EvtDeviceD0Entry         = PCIEEvtDeviceD0Entry;
    pnpPowerCallbacks.EvtDeviceD0Exit          = PCIEEvtDeviceD0Exit;

    //
    // Register the PnP Callbacks..
    //
    WdfDeviceInitSetPnpPowerEventCallbacks(DeviceInit, &pnpPowerCallbacks);

    //
    // Initialize Fdo Attributes.
    //
    WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&attributes, DEVICE_EXTENSION);
    //
    // By opting for SynchronizationScopeDevice, we tell the framework to
    // synchronize callbacks events of all the objects directly associated
    // with the device. In this driver, we will associate queues and
    // and DpcForIsr. By doing that we don't have to worrry about synchronizing
    // access to device-context by Io Events and DpcForIsr because they would
    // not concurrently ever. Framework will serialize them by using an
    // internal device-lock.
    //
    attributes.SynchronizationScope = WdfSynchronizationScopeDevice;

    //
    // Create the device
    //
    status = WdfDeviceCreate( &DeviceInit, &attributes, &device );


    if (!NT_SUCCESS(status)) {
        //
        // Device Initialization failed.
        //
        TraceEvents(TRACE_LEVEL_ERROR, DBG_PNP,
                    "DeviceCreate failed %!STATUS!", status);

        return status;
    }


    //
    // Get the DeviceExtension and initialize it. PCIEGetDeviceContext is an inline function
    // defined by WDF_DECLARE_CONTEXT_TYPE_WITH_NAME macro in the
    // private header file. This function will do the type checking and return
    // the device context. If you pass a wrong object a wrong object handle
    // it will return NULL and assert if run under framework verifier mode.
    //
    devExt = PCIEGetDeviceContext(device);

    devExt->Device = device;

    TraceEvents(TRACE_LEVEL_INFORMATION, DBG_PNP,
                "     AddDevice PDO (0x%p) FDO (0x%p), DevExt (0x%p)",
                WdfDeviceWdmGetPhysicalDevice(device),
                WdfDeviceWdmGetDeviceObject(device), devExt);

    //
    // Tell the Framework that this device will need an interface
    //
    // NOTE: See the note in Public.h concerning this GUID value.
    //
    status = WdfDeviceCreateDeviceInterface( device,
                                             (LPGUID) &GUID_PCIE_INTERFACE,
                                             NULL );



    if (!NT_SUCCESS(status)) {
        TraceEvents(TRACE_LEVEL_ERROR, DBG_PNP,
                    "<-- DeviceCreateDeviceInterface "
                    "failed %!STATUS!", status);

        KdPrint( ("PCIE: driverentry - step 19: status = %x", status) );
        return status;
    }


    //
    // Set the idle and wait-wake policy for this device.
    //
    status = PCIESetIdleAndWakeSettings(devExt);



    if (!NT_SUCCESS (status)) {
        //
        // NOTE: The attempt to set the Idle and Wake options
        //       is a best-effort try. Failure is probably due to
        //       the non-driver environmentals, such as the system,
        //       bus or OS indicating that Wake is not supported for
        //       this case.
        //       All that being said, it probably not desirable to
        //       return the failure code as it would cause the
        //       AddDevice to fail and Idle and Wake are probably not
        //       "must-have" options.
        //
        //       You must decide for your case whether Idle/Wake are
        //       "must-have" options...but my guess is probably not.
        //
#if 1
        status = STATUS_SUCCESS;
#else
        return status;
#endif
    }

    //
    // Initalize the Device Extension.
    //
    status = PCIEInitializeDeviceExtension(devExt);


    if (!NT_SUCCESS(status)) {        
        return status;
    }

    TraceEvents(TRACE_LEVEL_INFORMATION, DBG_PNP,
                "<-- PCIEEvtDeviceAdd %!STATUS!", status);

    return status;
}

NTSTATUS
PCIEEvtDevicePrepareHardware (
    WDFDEVICE       Device,
    WDFCMRESLIST   Resources,
    WDFCMRESLIST   ResourcesTranslated
    )
/*++

Routine Description:

    Performs whatever initialization is needed to setup the device, setting up
    a DMA channel or mapping any I/O port resources.  This will only be called
    as a device starts or restarts, not every time the device moves into the D0
    state.  Consequently, most hardware initialization belongs elsewhere.

Arguments:

    Device - A handle to the WDFDEVICE

    Resources - The raw PnP resources associated with the device.  Most of the
        time, these aren't useful for a PCI device.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
樱桃视频在线观看一区| 国产欧美日韩麻豆91| 日本道免费精品一区二区三区| 黑人巨大精品欧美一区| 久久精品国产999大香线蕉| 午夜视频一区二区| 日本不卡在线视频| 男人的j进女人的j一区| 日韩影院在线观看| 捆绑紧缚一区二区三区视频| 久久99精品国产麻豆婷婷洗澡| 免费三级欧美电影| 国产精品一区二区久久不卡| 国产一区二区在线影院| 成人网在线播放| 99精品视频免费在线观看| 91女神在线视频| 国产女同性恋一区二区| 91丨九色丨国产丨porny| 亚洲免费电影在线| 欧美日韩高清一区二区三区| 欧美精品黑人性xxxx| 欧美一区日韩一区| 久久九九全国免费| 亚洲丝袜制服诱惑| 日日夜夜免费精品| 黑人巨大精品欧美黑白配亚洲| 成人精品国产免费网站| 91免费看`日韩一区二区| 欧美裸体bbwbbwbbw| 久久久久久久久免费| 亚洲人精品一区| 久久se精品一区精品二区| 国v精品久久久网| 欧美性感一类影片在线播放| 欧美大白屁股肥臀xxxxxx| 国产免费久久精品| 日韩电影在线一区| jlzzjlzz国产精品久久| 欧美日韩大陆在线| 久久久精品综合| 亚洲大片在线观看| 国产91综合一区在线观看| 欧美日韩在线播放一区| 国产亚洲欧美日韩在线一区| 亚洲国产一区二区三区青草影视| 国产精品综合二区| 8x8x8国产精品| 亚洲欧洲日韩一区二区三区| 日韩av一级片| 91国模大尺度私拍在线视频| 久久久久9999亚洲精品| 国产精品18久久久久久vr| 欧美性猛交xxxxxxxx| 国产精品动漫网站| 国产在线视频一区二区三区| 在线观看一区不卡| 最近中文字幕一区二区三区| 久久99久久99| 欧美一区二区成人| 樱花草国产18久久久久| 成人一区在线观看| 欧美精品一区二区高清在线观看| 婷婷综合在线观看| 欧洲一区在线电影| 亚洲男人电影天堂| 99久久伊人精品| 国产精品电影一区二区| 国产超碰在线一区| 欧美国产日产图区| 国产高清精品网站| 久久久久久99精品| 国产在线播放一区| 久久影音资源网| 国产原创一区二区| 国产三级精品三级在线专区| 韩国视频一区二区| 久久精品视频在线免费观看| 久久91精品国产91久久小草| 欧美一区二区三区的| 日本不卡视频在线观看| 日韩欧美第一区| 国产一区二区三区免费看| 精品乱人伦小说| 国产米奇在线777精品观看| 精品久久一区二区| 国产毛片精品国产一区二区三区| 国产偷国产偷亚洲高清人白洁| 国产成人综合自拍| 国产精品久久久久久久久图文区| bt欧美亚洲午夜电影天堂| 亚洲另类在线视频| 欧美挠脚心视频网站| 免费人成精品欧美精品| 久久精品视频免费| 97se亚洲国产综合自在线| 亚洲一区av在线| 精品久久久久久久久久久久包黑料 | 国产欧美日韩另类视频免费观看| 在线观看三级视频欧美| 亚洲一区av在线| 精品国产1区2区3区| 成人国产精品免费| 亚洲va天堂va国产va久| 精品成人私密视频| 99久久精品免费看国产 | 7777精品伊人久久久大香线蕉最新版 | 欧美日韩国产高清一区二区| 日本欧洲一区二区| 亚洲国产成人私人影院tom| 91福利社在线观看| 国产乱国产乱300精品| 亚洲精品网站在线观看| 日韩欧美卡一卡二| 色婷婷综合久久久久中文一区二区 | 亚洲精品成人精品456| 欧美一区二区日韩| 93久久精品日日躁夜夜躁欧美| 日本亚洲视频在线| 樱桃国产成人精品视频| 精品99一区二区| 欧美日韩美少妇| 丁香五精品蜜臀久久久久99网站| 午夜视频一区二区三区| 中文字幕欧美日本乱码一线二线| 欧美福利视频一区| 色系网站成人免费| 高清在线成人网| 精油按摩中文字幕久久| 一区二区三区四区激情| 欧美韩日一区二区三区四区| 日韩亚洲欧美高清| 欧美日韩免费观看一区三区| 成人a免费在线看| 国产呦萝稀缺另类资源| 肉丝袜脚交视频一区二区| 国产精品久久久久9999吃药| 精品国产区一区| 欧美一区二区高清| 欧美欧美欧美欧美首页| 欧洲精品在线观看| 日本乱人伦aⅴ精品| 欧美一区二区在线不卡| 日本韩国一区二区| 99久久免费视频.com| 成人激情小说乱人伦| 国产精品 日产精品 欧美精品| 久久国产成人午夜av影院| 天堂av在线一区| 亚洲成年人影院| 亚洲国产成人高清精品| 亚洲精品免费播放| 国产精品传媒在线| 亚洲人亚洲人成电影网站色| 国产精品黄色在线观看| 国产精品乱码一区二区三区软件 | 99久久久无码国产精品| 成人夜色视频网站在线观看| 国产精品一区二区久激情瑜伽| 国产精品456露脸| 国产剧情一区二区三区| 国产成人高清在线| 9人人澡人人爽人人精品| 99久久精品免费看国产免费软件| 91蜜桃免费观看视频| 91国偷自产一区二区三区成为亚洲经典| 99国产精品一区| 91国偷自产一区二区开放时间| 欧美揉bbbbb揉bbbbb| 91精品免费观看| 久久综合一区二区| 国产精品第一页第二页第三页| 亚洲精品视频在线观看网站| 国产成人精品免费视频网站| 成人不卡免费av| 在线看国产一区二区| 欧美一区二区免费观在线| 久久这里只有精品6| 17c精品麻豆一区二区免费| 亚洲一区二区免费视频| 激情综合色丁香一区二区| 国产69精品久久久久毛片| 色综合夜色一区| 日韩欧美一级二级三级久久久| 国产人妖乱国产精品人妖| 亚洲免费观看高清在线观看| 日本欧美在线观看| 成人国产亚洲欧美成人综合网| 欧美亚洲综合色| 国产午夜精品久久久久久免费视 | av在线播放不卡| 欧美午夜精品一区二区三区| 欧美电视剧免费全集观看| 亚洲视频网在线直播| 青青草原综合久久大伊人精品| 丁香网亚洲国际| 日韩欧美黄色影院| 亚洲欧美一区二区三区孕妇| 免费人成在线不卡| 欧美亚洲高清一区二区三区不卡|