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

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

?? bulkpwr.c

?? S3C2410X平臺下的USB驅動程序
?? C
?? 第 1 頁 / 共 3 頁
字號:
                                Irp);


        BulkUsb_DecrementIoCount(DeviceObject);

        break; /* IRP_MN_QUERY_POWER */

    default:

        BULKUSB_KdPrint( DBGLVL_MEDIUM,("BulkUsb_ProcessPowerIrp() UNKNOWN POWER MESSAGE (%x)\n", irpStack->MinorFunction));

        //
        // All unhandled power messages are passed on to the PDO
        //

        IoCopyCurrentIrpStackLocationToNext(Irp);
        PoStartNextPowerIrp(Irp);
        ntStatus = PoCallDriver(deviceExtension->TopOfStackDeviceObject, Irp);

        BulkUsb_DecrementIoCount(DeviceObject);

    } /* irpStack->MinorFunction */

    BULKUSB_KdPrint( DBGLVL_MEDIUM,  ( "Exit BulkUsb_ProcessPowerIrp()  ntStatus = 0x%x\n", ntStatus ) );
    return ntStatus;
}


NTSTATUS
BulkUsb_PoRequestCompletion(
    IN PDEVICE_OBJECT       DeviceObject,
    IN UCHAR                MinorFunction,
    IN POWER_STATE          PowerState,
    IN PVOID                Context,
    IN PIO_STATUS_BLOCK     IoStatus
    )
/*++

Routine Description:

        This is the completion routine set in a call to PoRequestPowerIrp()
        that was made in BulkUsb_ProcessPowerIrp() in response to receiving
    an IRP_MN_SET_POWER of type 'SystemPowerState' when the device was
        not in a compatible device power state. In this case, a pointer to
        the IRP_MN_SET_POWER Irp is saved into the FDO device extension
        (deviceExtension->PowerIrp), and then a call must be
        made to PoRequestPowerIrp() to put the device into a proper power state,
        and this routine is set as the completion routine.

    We decrement our pending io count and pass the saved IRP_MN_SET_POWER Irp
        on to the next driver

Arguments:

    DeviceObject - Pointer to the device object for the class device.
        Note that we must get our own device object from the Context

    Context - Driver defined context, in this case our own functional device object ( FDO )

Return Value:

    The function value is the final status from the operation.

--*/
{
    PIRP irp;
    PDEVICE_EXTENSION deviceExtension;
    PDEVICE_OBJECT deviceObject = Context;
    NTSTATUS ntStatus;

    deviceExtension = deviceObject->DeviceExtension;

        // Get the Irp we saved for later processing in BulkUsb_ProcessPowerIrp()
        // when we decided to request the Power Irp that this routine
        // is the completion routine for.
    irp = deviceExtension->PowerIrp;

        // We will return the status set by the PDO for the power request we're completing
    ntStatus = IoStatus->Status;

    BULKUSB_KdPrint( DBGLVL_HIGH,("Enter BulkUsb_PoRequestCompletion()\n"));

    // we should not be in the midst of handling a self-generated power irp
    BULKUSB_ASSERT( !deviceExtension->SelfPowerIrp );

    // we must pass down to the next driver in the stack
    IoCopyCurrentIrpStackLocationToNext(irp);

    // Calling PoStartNextPowerIrp() indicates that the driver is finished
    // with the previous power IRP, if any, and is ready to handle the next power IRP.
    // It must be called for every power IRP.Although power IRPs are completed only once,
    // typically by the lowest-level driver for a device, PoStartNextPowerIrp must be called
    // for every stack location. Drivers must call PoStartNextPowerIrp while the current IRP
    // stack location points to the current driver. Therefore, this routine must be called
    // before IoCompleteRequest, IoSkipCurrentStackLocation, and PoCallDriver.

    PoStartNextPowerIrp(irp);

    // PoCallDriver is used to pass any power IRPs to the PDO instead of IoCallDriver.
    // When passing a power IRP down to a lower-level driver, the caller should use
    // IoSkipCurrentIrpStackLocation or IoCopyCurrentIrpStackLocationToNext to copy the IRP to
    // the next stack location, then call PoCallDriver. Use IoCopyCurrentIrpStackLocationToNext
    // if processing the IRP requires setting a completion routine, or IoSkipCurrentStackLocation
    // if no completion routine is needed.

    PoCallDriver(deviceExtension->TopOfStackDeviceObject,
                 irp);

    BulkUsb_DecrementIoCount(deviceObject);

    BULKUSB_KdPrint( DBGLVL_MEDIUM,("BulkUsb_PoRequestCompletion() Exit IRP_MN_SET_POWER\n"));

    deviceExtension->PowerIrp = NULL;

    return ntStatus;
}




NTSTATUS
BulkUsb_PowerIrp_Complete(
    IN PDEVICE_OBJECT NullDeviceObject,
    IN PIRP Irp,
    IN PVOID Context
    )
/*++

Routine Description:

    This routine is called when An IRP_MN_SET_POWER of type 'DevicePowerState'
    has been received by BulkUsb_ProcessPowerIrp(), and that routine has  determined
        1) the request is for full powerup ( to PowerDeviceD0 ), and
        2) We are not already in that state
    A call is then made to PoRequestPowerIrp() with this routine set as the completion routine.


Arguments:

    DeviceObject - Pointer to the device object for the class device.

    Irp - Irp completed.

    Context - Driver defined context.

Return Value:

    The function value is the final status from the operation.

--*/
{
    NTSTATUS ntStatus = STATUS_SUCCESS;
    PDEVICE_OBJECT deviceObject;
    PIO_STACK_LOCATION irpStack;
    PDEVICE_EXTENSION deviceExtension;

    BULKUSB_KdPrint( DBGLVL_HIGH,("enter BulkUsb_PowerIrp_Complete\n"));

    deviceObject = (PDEVICE_OBJECT) Context;

    deviceExtension = (PDEVICE_EXTENSION) deviceObject->DeviceExtension;

    //  If the lower driver returned PENDING, mark our stack location as pending also.
    if (Irp->PendingReturned) {
        IoMarkIrpPending(Irp);
    }

    irpStack = IoGetCurrentIrpStackLocation (Irp);

    // We can assert that we're a  device powerup-to D0 request,
    // because that was the only type of request we set a completion routine
    // for in the first place
    BULKUSB_ASSERT(irpStack->MajorFunction == IRP_MJ_POWER);
    BULKUSB_ASSERT(irpStack->MinorFunction == IRP_MN_SET_POWER);
    BULKUSB_ASSERT(irpStack->Parameters.Power.Type==DevicePowerState);
    BULKUSB_ASSERT(irpStack->Parameters.Power.State.DeviceState==PowerDeviceD0);

    // Now that we know we've let the lower drivers do what was needed to power up,
    //  we can set our device extension flags accordingly
    deviceExtension->CurrentDevicePowerState = PowerDeviceD0;

    Irp->IoStatus.Status = ntStatus;

    BulkUsb_DecrementIoCount(deviceObject);

    BULKUSB_KdPrint( DBGLVL_MEDIUM,("exit BulkUsb_PowerIrp_Complete Exit IRP_MN_SET_POWER D0 complete\n"));
    return ntStatus;
}



NTSTATUS
BulkUsb_SelfSuspendOrActivate(
    IN PDEVICE_OBJECT DeviceObject,
    IN BOOLEAN fSuspend
    )
/*++

Routine Description:

        Called on BulkUsb_PnPAddDevice() to power down until needed (i.e., till a pipe is actually opened).
        Called on BulkUsb_Create() to power up device to D0 before opening 1st pipe.
        Called on BulkUsb_Close() to power down device if this is the last pipe.

Arguments:

    DeviceObject - Pointer to the device object

    fSuspend; TRUE to Suspend, FALSE to acivate.


Return Value:

    If the operation is not attemtped, SUCCESS is returned.
    If the operation is attemtped, the value is the final status from the operation.

--*/
{
    NTSTATUS ntStatus = STATUS_SUCCESS;

    POWER_STATE PowerState;
    PDEVICE_EXTENSION deviceExtension;


    deviceExtension = DeviceObject->DeviceExtension;
    BULKUSB_KdPrint( DBGLVL_MAXIMUM,("Enter BulkUsb_SelfSuspendOrActivate(),fSuspend = %d\n", fSuspend));


        // Can't accept request if:
    //  1) device is removed,
    //  2) has never been started,
    //  3) is stopped,
    //  4) has a remove request pending,
    //  5) has a stop device pending
    if ( !BulkUsb_CanAcceptIoRequests( DeviceObject ) ) {
        ntStatus = STATUS_DELETE_PENDING;

                BULKUSB_KdPrint( DBGLVL_MEDIUM,("ABORTING BulkUsb_SelfSuspendOrActivate()\n"));
        return ntStatus;
    }


    // don't do anything if any System-generated Device Pnp irps are pending
    if ( NULL != deviceExtension->PowerIrp ) {
        BULKUSB_KdPrint( DBGLVL_MAXIMUM,("Exit BulkUsb_SelfSuspendOrActivate(),refusing on pending deviceExtension->PowerIrp 0x%x\n", deviceExtension->PowerIrp));
        return ntStatus;
    }

    // don't do anything if any self-generated Device Pnp irps are pending
    if ( deviceExtension->SelfPowerIrp ) {
        BULKUSB_KdPrint( DBGLVL_MAXIMUM,("Exit BulkUsb_SelfSuspendOrActivate(),refusing on pending deviceExtension->SelfPowerIrp\n" ));
        return ntStatus;
    }

    // don't auto-suspend if any pipes are open
    if ( fSuspend && ( 0 != deviceExtension->OpenPipeCount ) ) {
        BULKUSB_KdPrint( DBGLVL_MAXIMUM,("Exit BulkUsb_SelfSuspendOrActivate(),refusing to self-suspend on OpenPipeCount %d\n", deviceExtension->OpenPipeCount));
        return ntStatus;
    }

    // don't auto-activate if no pipes are open
    if ( !fSuspend && ( 0 == deviceExtension->OpenPipeCount ) ) {
        BULKUSB_KdPrint( DBGLVL_MAXIMUM,("Exit BulkUsb_SelfSuspendOrActivate(),refusing to self-activate, no pipes open\n"));
        return ntStatus;
    }

    // dont do anything if registry CurrentControlSet\Services\BulkUsb\Parameters\PowerDownLevel
    //  has been set to  zero, PowerDeviceD0 ( 1 ), or a bogus high value
    if ( ( deviceExtension->PowerDownLevel == PowerDeviceD0 ) ||
         ( deviceExtension->PowerDownLevel == PowerDeviceUnspecified)  ||
         ( deviceExtension->PowerDownLevel >= PowerDeviceMaximum ) ) {
        BULKUSB_KdPrint( DBGLVL_MAXIMUM,("Exit BulkUsb_SelfSuspendOrActivate(), refusing on deviceExtension->PowerDownLevel == %d\n", deviceExtension->PowerDownLevel));
        return ntStatus;
    }

    if ( fSuspend )
        PowerState.DeviceState = deviceExtension->PowerDownLevel;
    else
        PowerState.DeviceState = PowerDeviceD0;  // power up all the way; we're probably just about to do some IO

    ntStatus = BulkUsb_SelfRequestPowerIrp( DeviceObject, PowerState );

    BULKUSB_KdPrint( DBGLVL_MAXIMUM,("BulkUsb_SelfSuspendOrActivate() status 0x%x on setting dev state %s\n", ntStatus, BULKUSB_StringForDevState(PowerState.DeviceState ) ));

    return ntStatus;

}


NTSTATUS
BulkUsb_SelfRequestPowerIrp(
    IN PDEVICE_OBJECT DeviceObject,
    IN POWER_STATE PowerState
    )
/*++

Routine Description:

    This routine is called by BulkUsb_SelfSuspendOrActivate() to
    actually make the system request for a powerdown/up to PowerState.
    It first checks to see if we are already in Powerstate and immediately
    returns  SUCCESS with no further processing if so


Arguments:

    DeviceObject - Pointer to the device object

    PowerState. power state requested, e.g PowerDeviceD0.


Return Value:

    The function value is the final status from the operation.

--*/
{
    NTSTATUS ntStatus = STATUS_SUCCESS;
    PDEVICE_EXTENSION deviceExtension;
    PIRP pIrp = NULL;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区av在线播放| 久久色成人在线| 99视频精品在线| gogogo免费视频观看亚洲一| 国产酒店精品激情| 国产成人精品www牛牛影视| 国产在线看一区| 国产在线不卡一区| 国产999精品久久| av毛片久久久久**hd| 成人app软件下载大全免费| gogogo免费视频观看亚洲一| av在线不卡免费看| 欧美在线视频你懂得| 欧美色图12p| 欧美一级黄色大片| 国产午夜精品一区二区三区视频| 精品国产电影一区二区| 久久久www免费人成精品| 国产精品麻豆视频| 综合欧美亚洲日本| 丝袜美腿亚洲综合| 免费观看日韩av| 成人小视频免费在线观看| 成人av在线资源| 欧美三级蜜桃2在线观看| 日韩免费视频一区| 国产精品美女www爽爽爽| 亚洲国产欧美在线人成| 奇米影视在线99精品| 成人亚洲精品久久久久软件| 国模一区二区三区白浆| 色综合久久88色综合天天 | 久久精品亚洲精品国产欧美kt∨| 国产精品丝袜久久久久久app| 自拍偷拍亚洲综合| 青娱乐精品视频| 92精品国产成人观看免费| 欧美久久久影院| 欧美经典一区二区| 午夜精品一区二区三区三上悠亚| 国产电影一区二区三区| 欧美无砖砖区免费| 日本一区二区三区在线不卡| 亚洲第一福利视频在线| 国产激情一区二区三区| 欧美日本国产视频| 国产精品久久久久久久蜜臀| 免费观看日韩电影| 欧美日韩在线免费视频| 国产精品进线69影院| 免费高清不卡av| 欧美视频一区二区三区四区| 亚洲国产成人午夜在线一区 | 麻豆精品一区二区综合av| 成人在线一区二区三区| 日韩视频免费观看高清完整版| 亚洲天堂精品在线观看| 国产成人免费视频网站| 日韩欧美高清一区| 午夜激情综合网| 色88888久久久久久影院按摩| 久久这里只有精品首页| 青青草原综合久久大伊人精品优势 | 久久成人免费网| 欧美福利视频一区| 亚洲精品成人在线| av中文字幕在线不卡| 国产三级三级三级精品8ⅰ区| 国产最新精品免费| 欧美一区永久视频免费观看| 亚洲第一主播视频| 欧美在线一二三| 亚洲国产精品久久人人爱蜜臀| 日本道色综合久久| 一区二区三区四区国产精品| 91国产福利在线| 亚洲综合色视频| 欧美私模裸体表演在线观看| 亚洲一区二区三区精品在线| 欧美视频在线播放| 亚洲不卡av一区二区三区| 7777精品伊人久久久大香线蕉的 | 国产精品欧美久久久久无广告 | 国产盗摄一区二区三区| 5858s免费视频成人| 亚洲精品中文字幕乱码三区| 国产盗摄一区二区| 亚洲精品一区二区三区精华液| 久久se这里有精品| 日韩欧美综合一区| 青椒成人免费视频| 欧美乱熟臀69xxxxxx| 午夜精品爽啪视频| 欧美日韩精品欧美日韩精品一综合| 欧美va亚洲va| 成人精品电影在线观看| 国产精品理伦片| 色婷婷激情综合| 视频在线在亚洲| 678五月天丁香亚洲综合网| 丝袜a∨在线一区二区三区不卡| 99久久精品情趣| 日本欧美一区二区三区| 日韩视频免费观看高清完整版在线观看| 亚洲一区二区精品久久av| 欧美日韩综合在线| 日韩成人一级片| 久久综合久久综合亚洲| 国产一区久久久| 亚洲丝袜另类动漫二区| 91久久精品一区二区三| 图片区日韩欧美亚洲| 欧美一级精品在线| 国模少妇一区二区三区| 国产精品第13页| 欧美日韩亚洲国产综合| 国产自产高清不卡| 国产精品福利影院| 91麻豆精品国产| 国产成+人+日韩+欧美+亚洲| 一区二区欧美在线观看| 日韩三级在线免费观看| 国产一区二区三区香蕉| 五月天中文字幕一区二区| 精品国产精品网麻豆系列| 91在线精品一区二区三区| 亚洲h在线观看| 日本一区二区三区四区在线视频 | 欧美一区二区三级| 国产精品一二三四| 亚洲乱码国产乱码精品精小说| 91精品国产手机| 色综合天天综合网天天看片| 性欧美大战久久久久久久久| 国产欧美一区二区精品秋霞影院| 色天天综合色天天久久| 国产一区二区三区四| 午夜精品久久久久久久99樱桃| 国产亚洲午夜高清国产拍精品 | 欧美日韩三级视频| 国产精品一卡二卡在线观看| 一区二区三区中文字幕电影| 国产精品久久久久三级| 日韩精品一区二区三区视频播放 | 蜜臀av一区二区在线观看| 综合电影一区二区三区| 日韩一区二区不卡| 91精品国产免费| 在线一区二区视频| 99久久久无码国产精品| 国产一区二区在线影院| 日韩精品每日更新| 亚洲电影视频在线| 亚洲成人免费影院| 一区二区在线观看视频在线观看| 日韩欧美成人一区| 欧美日韩国产天堂| 色狠狠色狠狠综合| eeuss影院一区二区三区| 午夜精品久久一牛影视| 天堂午夜影视日韩欧美一区二区| 亚洲欧美日韩在线| 国产欧美一区二区在线| 久久精品亚洲乱码伦伦中文| 久久先锋影音av| 777午夜精品视频在线播放| 日韩午夜电影av| 91精品国产一区二区| 91精品综合久久久久久| 9191久久久久久久久久久| 欧美三级日本三级少妇99| va亚洲va日韩不卡在线观看| 色综合久久综合中文综合网| 99视频精品在线| 91美女在线视频| 欧美在线免费观看亚洲| 欧美性受xxxx黑人xyx性爽| 91亚洲精品久久久蜜桃| 69堂国产成人免费视频| 日韩久久精品一区| 日本韩国精品一区二区在线观看| 国产精品国产精品国产专区不片| 欧美性欧美巨大黑白大战| 99riav一区二区三区| 色香蕉成人二区免费| 91黄视频在线观看| 欧美岛国在线观看| 国产人久久人人人人爽| 自拍偷拍亚洲综合| 亚洲精品中文字幕在线观看| 久久精品国产网站| 国产成人亚洲综合a∨婷婷| 成人免费黄色在线| 精品视频色一区| 在线不卡欧美精品一区二区三区| 精品福利视频一区二区三区| 国产精品美女久久久久久久久久久 | 国产欧美日产一区| 亚洲欧美成人一区二区三区|