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

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? bulkpwr.c

?? 基于linux的s3c2410開發(fā)板usb驅(qū)動(dòng)程序
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
                                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;

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本道色综合久久| 欧美不卡视频一区| 国产在线看一区| 亚洲欧美日韩电影| 久久久亚洲国产美女国产盗摄 | 国产99久久久国产精品| 亚洲第一在线综合网站| 国产精品五月天| 日韩精品一区二区在线观看| 91欧美一区二区| 黄色日韩网站视频| 免费成人小视频| 亚洲电影在线免费观看| 亚洲欧美日韩国产综合| 欧美激情在线一区二区三区| 精品捆绑美女sm三区| 欧美裸体bbwbbwbbw| 色域天天综合网| 成人黄色综合网站| 国产成人综合视频| 国内精品视频666| 日本午夜一区二区| 午夜不卡av在线| 亚洲成人激情自拍| 亚洲国产精品久久不卡毛片| 亚洲欧美日韩一区| 中文字幕一区二区三区不卡 | 99久久99久久精品免费观看| 国产美女精品在线| 国内精品视频666| 久久97超碰色| 国内精品伊人久久久久av影院| 蜜臀久久99精品久久久久久9| 午夜精品久久久久久久久久久| 亚洲精品ww久久久久久p站 | 午夜精品一区二区三区电影天堂| 日韩伦理av电影| 亚洲丝袜美腿综合| 又紧又大又爽精品一区二区| 一区二区三区欧美日| 亚洲自拍偷拍九九九| 亚洲一区二区三区激情| 性久久久久久久| 免费在线观看视频一区| 麻豆精品久久久| 黄色日韩三级电影| 丁香五精品蜜臀久久久久99网站| 国产成人综合亚洲网站| 99在线视频精品| 91黄色免费看| 欧美精品丝袜中出| 精品少妇一区二区三区视频免付费| 欧美精品一区二区三区蜜臀| 欧美国产禁国产网站cc| 一区二区三区中文字幕在线观看| 亚洲高清不卡在线观看| 奇米一区二区三区| 国产精品白丝jk白祙喷水网站| 成年人国产精品| 欧美在线观看一区二区| 91精品国产欧美一区二区成人| 久久色视频免费观看| 国产精品久久久久一区 | 狠狠色丁香久久婷婷综| 国产成人日日夜夜| 91电影在线观看| 日韩免费性生活视频播放| 亚洲国产高清在线观看视频| 亚洲欧美激情视频在线观看一区二区三区| 亚洲综合激情另类小说区| 美女mm1313爽爽久久久蜜臀| 成人在线视频首页| 欧美性一二三区| 亚洲午夜精品在线| 久久国产精品露脸对白| 成人高清免费观看| 欧美日韩久久一区二区| 国产婷婷色一区二区三区在线| 亚洲激情网站免费观看| 久久不见久久见免费视频7| a4yy欧美一区二区三区| 91麻豆精品国产自产在线观看一区 | 欧美人狂配大交3d怪物一区| 2021久久国产精品不只是精品| 有坂深雪av一区二区精品| 精品一区二区久久久| 一本色道a无线码一区v| 日韩精品一区二区三区在线播放| 国产精品久久久久久久久久免费看| 天堂成人国产精品一区| 高清不卡一二三区| 日韩色视频在线观看| 亚洲欧美另类在线| 激情丁香综合五月| 欧美日韩国产综合视频在线观看| 欧美激情资源网| 毛片一区二区三区| 欧美日韩综合在线| 国产精品久久久久久久久图文区| 免费国产亚洲视频| 欧美羞羞免费网站| 亚洲欧美综合另类在线卡通| 国产一区二区三区在线看麻豆| 欧美视频在线不卡| 日韩一区日韩二区| 国产成人免费视频| 亚洲精品在线一区二区| 丝袜美腿亚洲综合| 欧美亚男人的天堂| 亚洲精品免费在线| 成人深夜在线观看| www久久久久| 麻豆精品视频在线观看视频| 在线不卡的av| 亚洲图片一区二区| 一本大道久久a久久精品综合| 国产视频视频一区| 国产精品中文字幕欧美| 欧美xxxxxxxx| 麻豆精品在线播放| 欧美成人video| 青青草一区二区三区| 欧美一区二区三区四区久久| 亚洲自拍偷拍图区| 欧日韩精品视频| 亚洲线精品一区二区三区八戒| 色婷婷香蕉在线一区二区| 1024成人网| 色视频成人在线观看免| 综合激情网...| 91麻豆视频网站| 亚洲天堂av老司机| 91在线精品秘密一区二区| 国产精品色婷婷久久58| 欧美成人精精品一区二区频| 奇米精品一区二区三区在线观看一| 欧美亚洲综合久久| 亚洲一区二区四区蜜桃| 欧美三级电影网| 日韩经典中文字幕一区| 欧美一级高清片| 看国产成人h片视频| 337p粉嫩大胆噜噜噜噜噜91av| 美女在线视频一区| 久久只精品国产| 成人动漫中文字幕| 亚洲女人****多毛耸耸8| 91看片淫黄大片一级| 亚洲夂夂婷婷色拍ww47| 9191精品国产综合久久久久久| 日韩中文欧美在线| 久久综合九色综合欧美98 | 99麻豆久久久国产精品免费优播| 国产精品国产三级国产有无不卡| 91在线免费看| 日韩**一区毛片| 国产欧美中文在线| 色婷婷亚洲精品| 久久精品国产一区二区三| 久久久久久免费毛片精品| 国产mv日韩mv欧美| 亚洲一区二区三区四区在线| 91精品国产色综合久久ai换脸| 久久99在线观看| 国产精品人妖ts系列视频| 色综合激情久久| 日本不卡高清视频| 中文字幕不卡在线观看| 欧美午夜影院一区| 国产精品一区二区在线播放| 亚洲视频香蕉人妖| 日韩一区二区三区电影在线观看| 国产精品一线二线三线| 亚洲人被黑人高潮完整版| 日韩视频在线观看一区二区| 粉嫩蜜臀av国产精品网站| 丝袜亚洲另类丝袜在线| 欧美国产日韩一二三区| 666欧美在线视频| 成人午夜激情在线| 免费亚洲电影在线| 亚洲欧美偷拍另类a∨色屁股| 日韩一区二区在线看片| www.日韩大片| 麻豆91精品视频| 亚洲免费观看在线观看| 久久亚洲欧美国产精品乐播| 91一区二区三区在线观看| 国产在线精品一区二区夜色 | 国产成+人+日韩+欧美+亚洲 | 成人91在线观看| 老司机免费视频一区二区三区| 亚洲你懂的在线视频| 欧美成人三级在线| 欧美午夜精品久久久久久孕妇| 国产精品一卡二卡| 日本vs亚洲vs韩国一区三区二区 | 亚洲在线观看免费| 国产精品麻豆一区二区 | 一区在线观看免费|