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

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

?? isopwr.c

?? 嵌入式系統的USB驅動(S3C2410)
?? C
?? 第 1 頁 / 共 3 頁
字號:

        // We do nothing special here, just let the PDO handle it
        IoCopyCurrentIrpStackLocationToNext(Irp);
        PoStartNextPowerIrp(Irp);
        ntStatus = PoCallDriver(deviceExtension->TopOfStackDeviceObject,
                                Irp);


        IsoUsb_DecrementIoCount(DeviceObject);

        break; /* IRP_MN_QUERY_POWER */

    default:

        ISOUSB_KdPrint( DBGLVL_MEDIUM,("IsoUsb_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);

        IsoUsb_DecrementIoCount(DeviceObject);

    } /* irpStack->MinorFunction */

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


NTSTATUS
IsoUsb_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 IsoUsb_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 IsoUsb_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;

    ISOUSB_KdPrint( DBGLVL_HIGH,("Enter IsoUsb_PoRequestCompletion()\n"));

    // we should not be in the midst of handling a self-generated power irp
    ISOUSB_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);

    IsoUsb_DecrementIoCount(deviceObject);

    ISOUSB_KdPrint( DBGLVL_MEDIUM,("IsoUsb_PoRequestCompletion() Exit IRP_MN_SET_POWER\n"));

    deviceExtension->PowerIrp = NULL;

    return ntStatus;
}




NTSTATUS
IsoUsb_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 IsoUsb_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;

    ISOUSB_KdPrint( DBGLVL_HIGH,("enter IsoUsb_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
    ISOUSB_ASSERT(irpStack->MajorFunction == IRP_MJ_POWER);
    ISOUSB_ASSERT(irpStack->MinorFunction == IRP_MN_SET_POWER);
    ISOUSB_ASSERT(irpStack->Parameters.Power.Type==DevicePowerState);
    ISOUSB_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;

    IsoUsb_DecrementIoCount(deviceObject);

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



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

Routine Description:

        Called on IsoUsb_PnPAddDevice() to power down until needed (i.e., till a pipe is actually opened).
        Called on IsoUsb_Create() to power up device to D0 before opening 1st pipe.
        Called on IsoUsb_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;
    ISOUSB_KdPrint( DBGLVL_MAXIMUM,("Enter IsoUsb_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 ( !IsoUsb_CanAcceptIoRequests( DeviceObject ) ) {
        ntStatus = STATUS_DELETE_PENDING;
        
		ISOUSB_KdPrint( DBGLVL_MEDIUM,("ABORTING IsoUsb_SelfSuspendOrActivate()\n"));
        return ntStatus;
    }
  

    // don't do anything if any System-generated Device Pnp irps are pending
    if ( NULL != deviceExtension->PowerIrp ) {
        ISOUSB_KdPrint( DBGLVL_MAXIMUM,("Exit IsoUsb_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 ) {
        ISOUSB_KdPrint( DBGLVL_MAXIMUM,("Exit IsoUsb_SelfSuspendOrActivate(),refusing on pending deviceExtension->SelfPowerIrp\n" ));
        return ntStatus;
    }

    // don't auto-suspend if any pipes are open
    if ( fSuspend && ( 0 != deviceExtension->OpenPipeCount ) ) {
        ISOUSB_KdPrint( DBGLVL_MAXIMUM,("Exit IsoUsb_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 ) ) {
        ISOUSB_KdPrint( DBGLVL_MAXIMUM,("Exit IsoUsb_SelfSuspendOrActivate(),refusing to self-activate, no pipes open\n"));
        return ntStatus;
    }

    // dont do anything if registry CurrentControlSet\Services\IsoUsb\Parameters\PowerDownLevel
    //  has been set to  zero, PowerDeviceD0 ( 1 ), or a bogus high value
    if ( ( deviceExtension->PowerDownLevel == PowerDeviceD0 ) || 
         ( deviceExtension->PowerDownLevel == PowerDeviceUnspecified)  ||
         ( deviceExtension->PowerDownLevel >= PowerDeviceMaximum ) ) {
        ISOUSB_KdPrint( DBGLVL_MAXIMUM,("Exit IsoUsb_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 = IsoUsb_SelfRequestPowerIrp( DeviceObject, PowerState );

    ISOUSB_KdPrint( DBGLVL_MAXIMUM,("IsoUsb_SelfSuspendOrActivate() status 0x%x on setting dev state %s\n", ntStatus, ISOUSB_StringForDevState(PowerState.DeviceState ) ));

    return ntStatus;

}


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

Routine Description:

    This routine is called by IsoUsb_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.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品高潮久久久久无| 国产日韩欧美精品综合| 日韩欧美国产电影| 国产精品久久一卡二卡| 蜜桃91丨九色丨蝌蚪91桃色| 99免费精品在线观看| 亚洲精品一区二区精华| 天堂av在线一区| 97久久精品人人做人人爽50路 | 欧美在线视频全部完| 欧美成人乱码一区二区三区| 亚洲一区国产视频| 成人app在线观看| 日韩三级.com| 亚洲国产日韩精品| 色丁香久综合在线久综合在线观看| 久久久久久免费网| 黄页视频在线91| 7777精品伊人久久久大香线蕉完整版 | 色婷婷国产精品| 国产欧美精品一区二区色综合朱莉| 日韩成人dvd| 欧美综合一区二区三区| 亚洲欧美日韩综合aⅴ视频| 成人午夜又粗又硬又大| 久久综合色婷婷| 激情综合色综合久久| 欧美一级欧美一级在线播放| 亚洲国产成人91porn| 91福利国产成人精品照片| 亚洲日本在线看| 色又黄又爽网站www久久| 亚洲品质自拍视频网站| 99久久国产综合精品色伊| 成人欧美一区二区三区黑人麻豆| 国产**成人网毛片九色 | 东方aⅴ免费观看久久av| 国产视频不卡一区| 国产传媒久久文化传媒| 欧美国产乱子伦| 成人aa视频在线观看| 最新不卡av在线| 一本色道亚洲精品aⅴ| 一区二区三区波多野结衣在线观看| 91女人视频在线观看| 一区二区日韩av| 欧美嫩在线观看| 麻豆精品在线观看| 亚洲国产成人午夜在线一区| 成年人网站91| 亚洲电影第三页| 日韩一区二区三区观看| 国产一区二区不卡| 亚洲欧美一区二区在线观看| 欧美午夜一区二区| 捆绑变态av一区二区三区| 久久婷婷一区二区三区| bt欧美亚洲午夜电影天堂| 亚洲精品高清在线| 欧美一区二区三区在线| 国产大片一区二区| 亚洲国产精品综合小说图片区| 69av一区二区三区| 国产v日产∨综合v精品视频| 亚洲免费av在线| 欧美精品一区二区高清在线观看| 成人av综合一区| 亚洲不卡av一区二区三区| 久久蜜桃av一区二区天堂| 色综合激情久久| 国产麻豆成人传媒免费观看| 一区二区三区日韩精品| 精品国产乱码久久久久久牛牛| 色播五月激情综合网| 精品综合免费视频观看| 亚洲精品一二三四区| 欧美成人video| 欧美无乱码久久久免费午夜一区| 国产黄色精品网站| 日本不卡一区二区| 亚洲精品日韩综合观看成人91| 精品久久久久久久久久久久久久久 | 91原创在线视频| 精品亚洲国产成人av制服丝袜| 亚洲美女屁股眼交3| 久久亚洲综合色| 欧美精品自拍偷拍| 91在线国内视频| 国产精品一区免费视频| 五月综合激情日本mⅴ| 亚洲欧洲av另类| 久久女同性恋中文字幕| 91精品国产麻豆国产自产在线| 色综合中文字幕国产 | 精品国产青草久久久久福利| 色综合久久66| 95精品视频在线| 国精产品一区一区三区mba视频| 午夜精品福利在线| 亚洲精品视频在线看| 国产午夜精品福利| 久久午夜国产精品| 久久综合色鬼综合色| 日韩一区二区三区视频在线观看 | 日本一区二区免费在线观看视频 | 成人综合激情网| 国产一区中文字幕| 久久er精品视频| 免费成人美女在线观看.| 亚洲综合免费观看高清完整版 | 2020国产成人综合网| 日韩一区二区精品葵司在线| 欧美色倩网站大全免费| 色综合久久中文综合久久牛| 99久久精品99国产精品 | 免费成人av资源网| 一区二区不卡在线播放 | 在线精品视频免费播放| 成人激情小说网站| 盗摄精品av一区二区三区| 国产麻豆精品视频| 国产一区二区0| 福利电影一区二区| 处破女av一区二区| 97se狠狠狠综合亚洲狠狠| 91老司机福利 在线| 91黄色免费网站| 欧美日韩大陆一区二区| 欧美高清dvd| 久久久噜噜噜久久中文字幕色伊伊 | 一区二区在线看| 亚洲成av人片一区二区三区| 视频一区二区三区中文字幕| 蜜臀久久99精品久久久久久9 | 欧美亚一区二区| 欧美精品色综合| 日韩欧美不卡在线观看视频| 国产视频一区在线播放| 亚洲欧美日韩国产一区二区三区 | 亚洲精品国产无天堂网2021| 亚洲不卡在线观看| 韩日精品视频一区| 成人精品视频一区| 欧美三级日韩在线| 久久精品亚洲精品国产欧美kt∨| 国产欧美精品区一区二区三区| 亚洲色图视频免费播放| 奇米精品一区二区三区在线观看 | 99国产精品一区| 欧美偷拍一区二区| 久久综合久色欧美综合狠狠| 最新中文字幕一区二区三区| 亚洲成人7777| 成人激情文学综合网| 91精品黄色片免费大全| 国产精品天干天干在线综合| 午夜精品久久久久久久久久| 国产a精品视频| 欧美日韩一卡二卡| 国产精品国模大尺度视频| 亚洲不卡在线观看| 成人免费观看视频| 欧美va天堂va视频va在线| 综合久久久久综合| 精品一区二区三区免费| 欧美影院一区二区三区| 久久久久久久综合日本| 天天操天天色综合| 91一区二区三区在线播放| 日韩欧美视频一区| 亚洲国产欧美在线人成| 成人av免费在线观看| 精品久久久三级丝袜| 亚洲高清久久久| 色呦呦一区二区三区| 国产女主播在线一区二区| 日本亚洲免费观看| 在线观看一区二区精品视频| 久久精品一区二区三区不卡 | 日韩一区二区三区四区五区六区| 亚洲欧洲av在线| 夫妻av一区二区| 欧美精品一区二区三区四区| 日韩高清电影一区| 欧洲视频一区二区| 亚洲欧美日本在线| 菠萝蜜视频在线观看一区| 欧美精品一区二区久久久| 毛片一区二区三区| 在线播放/欧美激情| 一级特黄大欧美久久久| 91麻豆免费在线观看| 国产精品的网站| 99久久亚洲一区二区三区青草| 国产午夜亚洲精品不卡| 麻豆成人久久精品二区三区红| 欧美日韩国产综合一区二区三区| 亚洲国产视频直播| 欧美视频中文一区二区三区在线观看| 亚洲私人影院在线观看|