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

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

?? isopnp.c

?? 該代碼是基于S3C2410處理器上USB的驅動程序代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
/*++

Copyright (c) 1997-1998  Microsoft Corporation

Module Name:

    IsoPnp.c 

Abstract:

    Isochronous USB device driver for Intel 82930 USB test board
    Plug and Play module

Environment:

    kernel mode only

Notes:

  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.

  Copyright (c) 1997-1998 Microsoft Corporation.  All Rights Reserved.


Revision History:

    2/7/98: created

--*/


#include "wdm.h"
#include "stdarg.h"
#include "stdio.h"

#include "usbdi.h"
#include "usbdlib.h"
#include "Iso82930.h"



NTSTATUS
IsoUsb_ProcessPnPIrp(
    IN PDEVICE_OBJECT DeviceObject,
    IN PIRP           Irp
    )
/*++

Routine Description:

    Dispatch table routine for IRP_MJ_PNP.
    Process the Plug and Play IRPs sent to this device.

Arguments:

    DeviceObject - pointer to our FDO (Functional Device Object)

    Irp          - pointer to an I/O Request Packet

Return Value:

    NT status code

--*/
{

    PIO_STACK_LOCATION irpStack;
    PDEVICE_EXTENSION deviceExtension;
    NTSTATUS ntStatus = STATUS_SUCCESS;
    NTSTATUS waitStatus;
    PDEVICE_OBJECT stackDeviceObject;
    KEVENT startDeviceEvent;

    //
    // Get a pointer to the current location in the Irp. This is where
    //     the function codes and parameters are located.
    //
    irpStack = IoGetCurrentIrpStackLocation (Irp);

    //
    // Get a pointer to the device extension
    //
    deviceExtension = DeviceObject->DeviceExtension;
    stackDeviceObject = deviceExtension->TopOfStackDeviceObject;

    ISOUSB_KdPrint( DBGLVL_MEDIUM, ( "enter IsoUsb_ProcessPnPIrp() IRP_MJ_PNP, minor %s\n",
        ISOUSB_StringForPnpMnFunc( irpStack->MinorFunction ) ));

	// inc the FDO device extension's pending IO count for this Irp
    IsoUsb_IncrementIoCount(DeviceObject);

    ISOUSB_ASSERT( IRP_MJ_PNP == irpStack->MajorFunction );

    switch (irpStack->MinorFunction) {
    case IRP_MN_START_DEVICE:

		// The PnP Manager sends this IRP after it has assigned resources, 
		// if any, to the device. The device may have been recently enumerated
		// and is being started for the first time, or the device may be 
		// restarting after being stopped for resource reconfiguration. 

		// Initialize an event we can wait on for the PDO to be done with this irp
        KeInitializeEvent(&startDeviceEvent, NotificationEvent, FALSE);
        IoCopyCurrentIrpStackLocationToNext(Irp);

        // Set a completion routine so it can signal our event when
        //  the PDO is done with the Irp
        IoSetCompletionRoutine(Irp,
                               IsoUsb_IrpCompletionRoutine,
                               &startDeviceEvent,  // pass the event to the completion routine as the Context
                               TRUE,    // invoke on success
                               TRUE,    // invoke on error
                               TRUE);   // invoke on cancellation


        // let the PDO process the IRP
        ntStatus = IoCallDriver(stackDeviceObject,
                                Irp);

        // if PDO is not done yet, wait for the event to be set in our completion routine
        if (ntStatus == STATUS_PENDING) {
             // wait for irp to complete

            waitStatus = KeWaitForSingleObject(
                &startDeviceEvent,
                Suspended,
                KernelMode,
                FALSE,
                NULL);
        }

        // Now we're ready to do our own startup processing.
        // USB client drivers such as us set up URBs (USB Request Packets) to send requests
        // to the host controller driver (HCD). The URB structure defines a format for all
        // possible commands that can be sent to a USB device.
        // Here, we request the device descriptor and store it,
        // and configure the device.
        ntStatus = IsoUsb_StartDevice(DeviceObject);
        Irp->IoStatus.Status = ntStatus;

		IoCompleteRequest (Irp,
						   IO_NO_INCREMENT
						   );

		IsoUsb_DecrementIoCount(DeviceObject);
		return ntStatus;  // end, case IRP_MN_START_DEVICE

    case IRP_MN_QUERY_STOP_DEVICE:

		// The IRP_MN_QUERY_STOP_DEVICE/IRP_MN_STOP_DEVICE sequence only occurs
		// during "polite" shutdowns, such as the user explicitily requesting the
		// service be stopped in, or requesting unplug from the Pnp tray icon.
		// This sequence is NOT received during "impolite" shutdowns,
		// such as someone suddenly yanking the USB cord or otherwise 
		// unexpectedly disabling/resetting the device.

        // If a driver sets STATUS_SUCCESS for this IRP,
        // the driver must not start any operations on the device that
        // would prevent that driver from successfully completing an IRP_MN_STOP_DEVICE
        // for the device.
        // For mass storage devices such as disk drives, while the device is in the
        // stop-pending state,the driver holds IRPs that require access to the device,
        // but for most USB devices, there is no 'persistent storage', so we will just
        // refuse any more IO until restarted or the stop is cancelled

        // If a driver in the device stack determines that the device cannot be
        // stopped for resource reconfiguration, the driver is not required to pass
        // the IRP down the device stack. If a query-stop IRP fails,
        // the PnP Manager sends an IRP_MN_CANCEL_STOP_DEVICE to the device stack,
        // notifying the drivers for the device that the query has been cancelled
        // and that the device will not be stopped.


        // It is possible to receive this irp when the device has not been started
        //  ( as on a boot device )
        if (!deviceExtension->DeviceStarted) { // if get when never started, just pass on
            ISOUSB_KdPrint( DBGLVL_MEDIUM,("IsoUsb_ProcessPnPIrp() IRP_MN_QUERY_STOP_DEVICE when device not started\n"));
            IoSkipCurrentIrpStackLocation (Irp);
            ntStatus = IoCallDriver (deviceExtension->TopOfStackDeviceObject, Irp);
            IsoUsb_DecrementIoCount(DeviceObject);

            return ntStatus;
        }


        // fail the request if we have any read/write IRPS pending
        if( deviceExtension->PendingIoCount > 1 ) {
            ntStatus = STATUS_UNSUCCESSFUL;
        }
        else { 
			// We'll not veto it; pass it on and flag that stop was requested.
			// Once StopDeviceRequested is set no new IOCTL or read/write irps will be passed
			// down the stack to lower drivers; all will be quickly failed
             deviceExtension->StopDeviceRequested = TRUE;
             ntStatus = STATUS_SUCCESS;
        }
        Irp->IoStatus.Status = ntStatus;

        break; // end, case IRP_MN_QUERY_STOP_DEVICE

    case IRP_MN_CANCEL_STOP_DEVICE:

		// The PnP Manager uses this IRP to inform the drivers for a device
		// that the device will not be stopped for resource reconfiguration.
		// This should only be received after a successful IRP_MN_QUERY_STOP_DEVICE.

        // It is possible to receive this irp when the device has not been started
        if (!deviceExtension->DeviceStarted) { // if get when never started, just pass on
            ISOUSB_KdPrint( DBGLVL_MEDIUM,("IsoUsb_ProcessPnPIrp() IRP_MN_CANCEL_STOP_DEVICE when device not started\n"));
            IoSkipCurrentIrpStackLocation (Irp);
            ntStatus = IoCallDriver (deviceExtension->TopOfStackDeviceObject, Irp);
            IsoUsb_DecrementIoCount(DeviceObject);
            return ntStatus;
        }

		// Reset this flag so new IOCTL and IO Irp processing will be re-enabled
        deviceExtension->StopDeviceRequested = FALSE;
        break; // end, case IRP_MN_CANCEL_STOP_DEVICE

    case IRP_MN_STOP_DEVICE:

		// The PnP Manager sends this IRP to stop a device so it can reconfigure
		// its hardware resources. The PnP Manager only sends this IRP if a prior
		// IRP_MN_QUERY_STOP_DEVICE completed successfully.


        //
        // Send the select configuration urb with a NULL pointer for the configuration
        // handle, this closes the configuration and puts the device in the 'unconfigured'
        // state.
        //
        ntStatus = IsoUsb_StopDevice(DeviceObject);
        Irp->IoStatus.Status = ntStatus;

        break; // end, case IRP_MN_STOP_DEVICE
 

    case IRP_MN_QUERY_REMOVE_DEVICE:

        //  In response to this IRP, drivers indicate whether the device can be
        //  removed without disrupting the system.
        //  If a driver determines it is safe to remove the device,
        //  the driver completes any outstanding I/O requests, arranges to hold any subsequent
        //  read/write requests, and sets Irp->IoStatus.Status to STATUS_SUCCESS. Function
        //  and filter drivers then pass the IRP to the next-lower driver in the device stack.
        //  The underlying bus driver calls IoCompleteRequest.

        //  If a driver sets STATUS_SUCCESS for this IRP, the driver must not start any
        //  operations on the device that would prevent that driver from successfully completing
        //  an IRP_MN_REMOVE_DEVICE for the device. If a driver in the device stack determines
        //  that the device cannot be removed, the driver is not required to pass the
        //  query-remove IRP down the device stack. If a query-remove IRP fails, the PnP Manager
        //  sends an IRP_MN_CANCEL_REMOVE_DEVICE to the device stack, notifying the drivers for
        //  the device that the query has been cancelled and that the device will not be removed.

        // It is possible to receive this irp when the device has not been started
        if (!deviceExtension->DeviceStarted) { // if get when never started, just pass on
            ISOUSB_KdPrint( DBGLVL_MEDIUM,("IsoUsb_ProcessPnPIrp() IRP_MN_QUERY_STOP_DEVICE when device not started\n"));
            IoSkipCurrentIrpStackLocation (Irp);
            ntStatus = IoCallDriver (deviceExtension->TopOfStackDeviceObject, Irp);
            IsoUsb_DecrementIoCount(DeviceObject);

            return ntStatus;
        }

 		// Once RemoveDeviceRequested is set no new IOCTL or read/write irps will be passed
		// down the stack to lower drivers; all will be quickly failed
        deviceExtension->RemoveDeviceRequested = TRUE;

        // Wait for any io request pending in our driver to
        // complete before returning success.
		// This  event is set when deviceExtension->PendingIoCount goes to 1
        waitStatus = KeWaitForSingleObject(
                    &deviceExtension->NoPendingIoEvent,
                    Suspended,
                    KernelMode,
                    FALSE,
                    NULL);

        Irp->IoStatus.Status = ntStatus;

        break; // end, case IRP_MN_QUERY_REMOVE_DEVICE

    case IRP_MN_CANCEL_REMOVE_DEVICE:

		// The PnP Manager uses this IRP to inform the drivers
		// for a device that the device will not be removed.
		// It is sent only after a successful IRP_MN_QUERY_REMOVE_DEVICE.

        if (!deviceExtension->DeviceStarted) { // if get when never started, just pass on
            ISOUSB_KdPrint( DBGLVL_MEDIUM,("IsoUsb_ProcessPnPIrp() IRP_MN_CANCEL_REMOVE_DEVICE when device not started\n"));
            IoSkipCurrentIrpStackLocation (Irp);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品一区八戒影视| 99r国产精品| 亚洲欧洲三级电影| 精品久久久网站| 91精品啪在线观看国产60岁| 色8久久精品久久久久久蜜| 成人国产免费视频| 粉嫩嫩av羞羞动漫久久久| 国产毛片一区二区| 久久草av在线| 国产乱子轮精品视频| 精品一二线国产| 韩国理伦片一区二区三区在线播放| 舔着乳尖日韩一区| 美女一区二区三区在线观看| 男人操女人的视频在线观看欧美| 首页国产欧美久久| 亚洲国产精品一区二区www在线 | 久久精品欧美日韩精品 | 青青草精品视频| 日韩va欧美va亚洲va久久| 日韩在线卡一卡二| 免费人成精品欧美精品| 国产一区二区三区免费在线观看| 国产美女一区二区三区| 成人av动漫在线| 色视频欧美一区二区三区| 在线日韩一区二区| 欧美一区二区三区免费在线看 | 中文字幕五月欧美| 亚洲精品伦理在线| 五月天国产精品| 狠狠v欧美v日韩v亚洲ⅴ| 国产不卡在线播放| 色综合久久久久网| 欧美一区二区日韩| 中国av一区二区三区| 亚洲免费在线电影| 久久精品久久精品| 97久久超碰国产精品电影| 欧美亚洲尤物久久| 久久免费视频色| 亚洲精品国产成人久久av盗摄 | 欧美一区二区不卡视频| 精品福利在线导航| 一区二区三区四区国产精品| 久久99精品国产| 色94色欧美sute亚洲13| 久久久美女艺术照精彩视频福利播放| 国产精品久久久久久户外露出| 午夜精品爽啪视频| 波多野结衣欧美| 日韩精品资源二区在线| 亚洲免费观看高清| 国产精品一级在线| 欧美日韩和欧美的一区二区| 国产日韩av一区| 美女mm1313爽爽久久久蜜臀| 一本大道av一区二区在线播放| 欧美日韩电影一区| 亚洲欧洲av另类| 国产精一品亚洲二区在线视频| 欧洲国产伦久久久久久久| 欧美精品一区二区三区在线播放 | 亚洲猫色日本管| 国产一区二区三区四区五区美女| 欧美午夜精品久久久久久孕妇| 国产日韩精品一区二区三区| 久久精品国内一区二区三区| 欧美精品一二三区| 亚洲国产va精品久久久不卡综合| 不卡在线视频中文字幕| 久久综合国产精品| 麻豆视频一区二区| 欧美日本高清视频在线观看| 一区二区三区不卡在线观看 | 亚洲欧美偷拍另类a∨色屁股| 国产精品综合视频| 精品国产91久久久久久久妲己 | 日韩视频一区二区在线观看| 午夜免费久久看| 欧美日韩成人高清| 日韩中文字幕区一区有砖一区 | 欧美日韩在线综合| 亚洲综合成人在线| 欧美在线啊v一区| 一卡二卡欧美日韩| 91高清在线观看| 洋洋av久久久久久久一区| 色综合久久久久网| 亚洲国产成人91porn| 欧美日本一区二区| 青娱乐精品在线视频| 欧美成人精品1314www| 激情成人午夜视频| 久久久久久黄色| 成人动漫一区二区三区| 日韩一区欧美小说| 欧美亚男人的天堂| 青青草国产精品亚洲专区无| 精品久久久久久久久久久久久久久| 裸体歌舞表演一区二区| 欧美精品一区二区三区一线天视频| 国产制服丝袜一区| 中文字幕一区二区三区视频| 色婷婷亚洲精品| 日韩av成人高清| 国产欧美一区二区三区鸳鸯浴 | 亚洲精品国产视频| 91精品国产全国免费观看| 国产在线国偷精品产拍免费yy | av在线免费不卡| 亚洲一二三四在线| 精品国产自在久精品国产| 成人午夜私人影院| 亚洲主播在线观看| 日韩免费一区二区| 99国产精品久久久| 蜜桃久久久久久久| 中文字幕亚洲区| 精品少妇一区二区三区在线视频| www.亚洲色图.com| 美美哒免费高清在线观看视频一区二区 | 日韩欧美自拍偷拍| 成人教育av在线| 视频一区二区中文字幕| 国产日产亚洲精品系列| 欧美日韩电影在线| www.成人网.com| 青青青伊人色综合久久| 最新日韩在线视频| 亚洲精品在线电影| 欧美视频在线一区| 不卡av在线网| 黄色资源网久久资源365| 伊人一区二区三区| 日本一区二区久久| 日韩欧美色电影| 欧美日韩国产高清一区| 99久久精品免费看国产免费软件| 蜜桃久久精品一区二区| 亚洲成人一区二区| 亚洲欧洲一区二区在线播放| 久久亚洲私人国产精品va媚药| 精品视频999| 日本高清无吗v一区| 成人aa视频在线观看| 国产精品一区二区不卡| 麻豆91在线看| 天堂一区二区在线| 亚洲成年人影院| 亚洲资源在线观看| 一区二区三区四区在线播放| 日韩毛片高清在线播放| 国产精品久久久久天堂| 久久久亚洲欧洲日产国码αv| 在线综合亚洲欧美在线视频| 欧美精品777| 在线播放一区二区三区| 精品视频一区 二区 三区| 欧美性极品少妇| 欧美日韩一本到| 在线视频一区二区三区| 色先锋aa成人| 色88888久久久久久影院野外| 色八戒一区二区三区| 欧美亚洲国产怡红院影院| 欧美三级三级三级| 欧美高清视频在线高清观看mv色露露十八| 在线视频你懂得一区二区三区| 欧美在线视频你懂得| 欧美精品少妇一区二区三区| 9191久久久久久久久久久| 91精品国产综合久久久久久久| 欧美一级片免费看| 2020国产成人综合网| 中文字幕乱码亚洲精品一区| 国产精品不卡视频| 亚洲综合在线五月| 日韩电影在线免费观看| 精品一区二区三区久久| 成人免费视频一区| 欧美在线啊v一区| 日韩精品一区二区在线| 国产日本欧洲亚洲| 亚洲黄一区二区三区| 日本免费在线视频不卡一不卡二 | 日韩午夜精品电影| 国产日韩欧美制服另类| 亚洲日本韩国一区| 青青草伊人久久| 成人美女视频在线看| 欧美日韩在线三区| 久久伊人蜜桃av一区二区| 国产精品久久久99| 五月天婷婷综合| 不卡的av网站| 日韩精品在线一区二区| 亚洲婷婷国产精品电影人久久| 日韩电影在线观看一区|