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

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

?? isopnp.c

?? 嵌入式系統的USB驅動(S3C2410)
?? 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一区二区三区免费野_久草精品视频
国产精品国产馆在线真实露脸| 日韩一级黄色片| 正在播放亚洲一区| 国产欧美一区二区在线| 欧美三级电影一区| 欧美日韩mp4| 欧美午夜电影一区| 2023国产一二三区日本精品2022| 亚洲欧洲综合另类| 久久国产精品第一页| 色狠狠色噜噜噜综合网| 日本一区免费视频| 久久国产剧场电影| 正在播放一区二区| 亚洲国产精品欧美一二99| 国产成人在线网站| 日韩一区二区三区视频在线| 亚洲精品成人a在线观看| 懂色av中文一区二区三区| 欧美精品一二三四| 一区二区三区在线视频免费观看 | 奇米精品一区二区三区在线观看| 99久久99久久久精品齐齐| 精品国产凹凸成av人导航| 日韩精品一级二级| 欧美亚洲一区二区在线| 亚洲综合色丁香婷婷六月图片| 99国产欧美另类久久久精品| 国产精品福利一区二区三区| 成人一区在线看| 日本一区二区三区久久久久久久久不| 激情五月婷婷综合网| 日韩免费观看高清完整版 | 成人教育av在线| 国产色爱av资源综合区| 国产一区二区三区在线观看免费| 日韩精品最新网址| 九色porny丨国产精品| 精品久久免费看| 韩国av一区二区三区在线观看| 久久久午夜精品| 99久久婷婷国产| 一区二区三区欧美在线观看| 欧美婷婷六月丁香综合色| 日日摸夜夜添夜夜添亚洲女人| 亚洲女子a中天字幕| 中文字幕精品一区| 国产电影精品久久禁18| 亚洲国产精品ⅴa在线观看| 国产91高潮流白浆在线麻豆| 国产精品高潮呻吟| 色吊一区二区三区| 日韩精品亚洲一区| 久久蜜臀精品av| 国产剧情一区二区| 日韩毛片高清在线播放| 欧美日韩1区2区| 精品一区二区三区免费播放| 国产丝袜美腿一区二区三区| 91偷拍与自偷拍精品| 无吗不卡中文字幕| 久久久久久久电影| 色中色一区二区| 免费成人在线视频观看| 国产精品毛片a∨一区二区三区| 一本一道波多野结衣一区二区| 午夜亚洲福利老司机| 不卡av在线网| 欧美日韩免费不卡视频一区二区三区| 五月婷婷欧美视频| 久久综合九色综合97婷婷女人 | 亚洲欧美日韩国产手机在线| 8v天堂国产在线一区二区| 精品一区二区三区久久| 一区二区不卡在线视频 午夜欧美不卡在 | 欧美视频中文一区二区三区在线观看 | 国产福利91精品一区| 亚洲综合图片区| 精品国产青草久久久久福利| 91免费看片在线观看| 国产一区二区看久久| 午夜av区久久| 中文字幕亚洲区| 精品日韩成人av| 日本成人在线视频网站| 日韩一区二区三区免费看| 岛国精品在线观看| 日日夜夜精品免费视频| 亚洲欧美日韩一区二区| 日韩午夜激情电影| 色中色一区二区| 国产盗摄视频一区二区三区| 五月婷婷综合激情| 亚洲欧美日韩电影| 日本一区二区免费在线观看视频 | 秋霞电影一区二区| 综合网在线视频| 国产亚洲欧美中文| 欧美va天堂va视频va在线| 欧美三级中文字幕在线观看| 91在线视频播放地址| 国产精品一二二区| 婷婷国产v国产偷v亚洲高清| 一色屋精品亚洲香蕉网站| 久久亚洲影视婷婷| 久久综合狠狠综合久久激情| 91麻豆精品国产91久久久久久| 91久久国产最好的精华液| 91亚洲国产成人精品一区二区三| 国产九色sp调教91| 狠狠色丁香九九婷婷综合五月| 日韩高清不卡在线| 三级久久三级久久久| 日韩不卡一二三区| 视频一区在线视频| 日本不卡视频在线| 蜜臀精品一区二区三区在线观看| 亚洲午夜久久久久久久久电影网 | 欧美日韩一区二区欧美激情| 91国产免费观看| 在线观看视频欧美| 欧美日韩精品系列| 777xxx欧美| 欧美精品一区二区三区在线播放| 日韩欧美一二三四区| 精品99999| 亚洲国产成人私人影院tom| 国产精品久久久久久久久搜平片| 中文字幕在线观看一区二区| **欧美大码日韩| 亚洲一区二区三区免费视频| 天天亚洲美女在线视频| 日本不卡的三区四区五区| 国产精品资源在线观看| 9久草视频在线视频精品| 色狠狠综合天天综合综合| 7777精品伊人久久久大香线蕉完整版 | 国产不卡在线播放| 色哟哟欧美精品| 欧美精品123区| 日韩女优av电影| 国产精品日韩成人| 久久精品无码一区二区三区| 国产喷白浆一区二区三区| 中文字幕在线不卡视频| 日韩成人一区二区三区在线观看| 蜜臀久久99精品久久久画质超高清| 国产盗摄一区二区| 欧美在线观看视频一区二区| 91精品一区二区三区在线观看| 久久综合色鬼综合色| 中文字幕一区二区三区蜜月| 日本不卡在线视频| 国产99久久久国产精品免费看| 日本乱人伦aⅴ精品| 日韩一区二区在线观看视频播放| 国产日产欧产精品推荐色| 樱桃国产成人精品视频| 国产一区二区影院| 91啪九色porn原创视频在线观看| 欧美久久久久久久久久| 欧美激情在线免费观看| 日本vs亚洲vs韩国一区三区| 99国产麻豆精品| 久久久噜噜噜久噜久久综合| 一区二区成人在线| 成人久久18免费网站麻豆| 4438x亚洲最大成人网| 中文字幕日本不卡| 国产在线日韩欧美| 国产精品家庭影院| 日本成人在线电影网| 91女人视频在线观看| 精品国产区一区| 青青草国产精品97视觉盛宴| 一本到三区不卡视频| 国产欧美日韩激情| 久久国产夜色精品鲁鲁99| 在线观看国产精品网站| 国产欧美日本一区二区三区| 麻豆精品视频在线观看视频| 欧美亚洲禁片免费| 亚洲欧美一区二区三区久本道91| 狠狠色丁香久久婷婷综合_中| 精品视频999| 亚洲欧洲一区二区在线播放| 国产一级精品在线| 久久免费精品国产久精品久久久久| 日本一不卡视频| 日韩欧美国产一区在线观看| 亚洲综合视频在线观看| 99精品国产热久久91蜜凸| 国产精品私人影院| 国产盗摄一区二区三区| 国产午夜精品久久| 国产电影一区在线| 国产精品日产欧美久久久久| 国产成人小视频| 国产精品久久久久影视| 成人天堂资源www在线|