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

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

?? isopnp.c

?? ARM2410的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一区二区三区免费野_久草精品视频
色婷婷精品久久二区二区蜜臀av| 久久久久免费观看| 久久影音资源网| 一区二区三区波多野结衣在线观看 | 高清beeg欧美| 欧美疯狂性受xxxxx喷水图片| 国产精品午夜免费| 国产一区在线精品| 日韩一区二区三区av| 亚洲高清在线精品| 色综合视频一区二区三区高清| 久久久久成人黄色影片| 久久成人麻豆午夜电影| 欧美精三区欧美精三区| 亚洲二区在线视频| 在线观看欧美日本| 亚洲激情网站免费观看| 成人av在线播放网站| 久久久久国产精品麻豆 | 亚洲国产一区二区三区青草影视| 大白屁股一区二区视频| 91精品国产福利在线观看| 亚洲国产欧美一区二区三区丁香婷| 成人av在线电影| 国产精品日日摸夜夜摸av| 国产精品996| 国产喷白浆一区二区三区| 国产一区二区久久| 国产三级欧美三级日产三级99 | 欧美日韩国产经典色站一区二区三区| 综合色中文字幕| 一本大道久久a久久综合| 亚洲色欲色欲www| 91小视频在线观看| 亚洲综合在线五月| 欧美情侣在线播放| 美国三级日本三级久久99| 精品国产乱码久久久久久久久| 久久精品噜噜噜成人av农村| 欧美电影免费观看完整版| 国产综合久久久久久鬼色| 日韩精品中文字幕一区二区三区 | 久久久久久久性| www.久久久久久久久| 亚洲欧美一区二区不卡| 欧美日韩亚洲综合在线| 日韩精品一卡二卡三卡四卡无卡| 日韩精品在线一区| 国产成人综合视频| 亚洲欧美日韩国产手机在线| 欧美高清视频在线高清观看mv色露露十八 | 日韩电影在线观看一区| 日韩精品中文字幕一区| 成人毛片在线观看| 亚洲精品日韩一| 欧美一级黄色大片| 国产一区二区三区美女| 亚洲欧洲日韩在线| 欧美日韩久久一区| 国产一区三区三区| 亚洲女爱视频在线| 欧美一级久久久久久久大片| 成人av网站在线观看免费| 一二三区精品福利视频| 久久久久久免费网| 欧美亚洲禁片免费| 国产成人综合视频| 亚洲 欧美综合在线网络| 久久精品人人做人人爽人人| 欧美专区亚洲专区| 国产高清久久久久| 亚洲国产成人porn| 国产精品美女一区二区三区| 91麻豆精品国产自产在线| 成人av在线资源网站| 日本不卡一区二区| 中文字幕一区二区三区精华液| 欧美一级日韩免费不卡| 色偷偷一区二区三区| 国产精品亚洲综合一区在线观看| 亚洲成人动漫精品| 日韩理论片在线| 国产嫩草影院久久久久| 91麻豆精品国产91久久久使用方法| av亚洲产国偷v产偷v自拍| 捆绑调教美女网站视频一区| 性做久久久久久久免费看| 国产精品国产三级国产普通话99| 精品国产三级电影在线观看| 欧美日韩精品高清| 一本高清dvd不卡在线观看| 激情国产一区二区 | 波多野结衣一区二区三区 | 免费观看日韩电影| 亚洲国产精品综合小说图片区| 国产女同互慰高潮91漫画| 精品处破学生在线二十三| 6080国产精品一区二区| 在线观看亚洲一区| 色综合久久久久综合99| 91影院在线观看| 成人97人人超碰人人99| 大美女一区二区三区| 国产精品系列在线播放| 国产精品自拍在线| 国产曰批免费观看久久久| 免费日本视频一区| 琪琪一区二区三区| 日本不卡一区二区| 麻豆久久一区二区| 麻豆精品在线看| 久久精工是国产品牌吗| 麻豆一区二区三| 久久99国产精品尤物| 激情av综合网| 成人理论电影网| jlzzjlzz国产精品久久| www.激情成人| 色噜噜狠狠成人中文综合 | 久久久亚洲高清| 国产天堂亚洲国产碰碰| 中文一区二区在线观看| 国产精品久久久久久久久动漫 | 亚洲精品乱码久久久久久| 亚洲欧美日韩国产中文在线| 亚洲综合精品自拍| 亚洲成人av电影| 久久99国产乱子伦精品免费| 国产精品一二三| 97久久人人超碰| 欧美日韩一区高清| 91麻豆精品91久久久久久清纯 | 欧美乱妇一区二区三区不卡视频| 欧美精品一二三四| 精品国产精品一区二区夜夜嗨| 久久九九国产精品| 亚洲美女精品一区| 男人的j进女人的j一区| 国产乱码一区二区三区| 91麻豆精品视频| 欧美精品三级日韩久久| 国产午夜一区二区三区| 怡红院av一区二区三区| 日本 国产 欧美色综合| 大胆亚洲人体视频| 欧美老女人第四色| 国产婷婷色一区二区三区四区 | 69堂国产成人免费视频| 久久精品一二三| 亚洲自拍都市欧美小说| 久久精品二区亚洲w码| 成人av电影在线观看| 欧美日韩成人一区| 国产精品伦理一区二区| 视频一区二区欧美| a级精品国产片在线观看| 911精品国产一区二区在线| 国产亚洲综合色| 亚洲成av人在线观看| 成人激情综合网站| 欧美一区二区三区四区久久| 国产精品久久久爽爽爽麻豆色哟哟 | 亚洲狠狠丁香婷婷综合久久久| 蜜臀av一级做a爰片久久| 成年人午夜久久久| 精品欧美乱码久久久久久 | 国产69精品久久99不卡| 91精品一区二区三区久久久久久| 欧美激情综合五月色丁香小说| 青青青爽久久午夜综合久久午夜| 91尤物视频在线观看| 国产日韩欧美一区二区三区乱码 | 日日噜噜夜夜狠狠视频欧美人| 波多野结衣91| 久久婷婷色综合| 天天综合色天天综合色h| 91丨porny丨户外露出| 久久精品欧美一区二区三区麻豆| 午夜婷婷国产麻豆精品| 色呦呦一区二区三区| 欧美激情一区二区| 国产精品亚洲人在线观看| 日韩欧美色电影| 丝瓜av网站精品一区二区| 欧美在线短视频| 夜夜操天天操亚洲| 91蜜桃婷婷狠狠久久综合9色| 国产午夜精品在线观看| 老司机免费视频一区二区| 88在线观看91蜜桃国自产| 亚洲动漫第一页| 欧美性受xxxx| 午夜久久电影网| 在线免费观看日本欧美| 亚洲码国产岛国毛片在线| 91在线免费视频观看| 国产欧美日韩三区| 国产不卡视频一区| 国产精品女人毛片| 99久久久国产精品免费蜜臀|