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

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

?? isopnp.c

?? s3c2440的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一区二区三区免费野_久草精品视频
欧美日韩精品综合在线| 欧美在线free| 美女在线视频一区| 亚洲国产aⅴ天堂久久| 亚洲乱码一区二区三区在线观看| 国产精品视频看| 国产精品久久久爽爽爽麻豆色哟哟 | 亚洲手机成人高清视频| 日本一区二区三区dvd视频在线| 久久久久久99精品| 中文字幕高清不卡| 亚洲日本一区二区| 亚洲成人中文在线| 久久精品国产网站| 国产福利91精品一区二区三区| 国产一区二区三区免费| 懂色av一区二区三区蜜臀| aaa国产一区| 欧美精品日韩一区| 久久精品一区四区| 亚洲猫色日本管| 奇米色一区二区| 成人午夜精品一区二区三区| 一本色道久久加勒比精品| 制服丝袜亚洲精品中文字幕| 2020国产精品自拍| 亚洲视频图片小说| 青娱乐精品视频| 不卡视频在线看| 欧美一区二区观看视频| 国产三级三级三级精品8ⅰ区| 1000精品久久久久久久久| 午夜影院久久久| 国产精品一级片在线观看| 在线精品亚洲一区二区不卡| 日韩视频永久免费| 亚洲天堂av一区| 国精产品一区一区三区mba桃花 | 91精品国产福利| 中文字幕二三区不卡| 五月天激情小说综合| 国产成人精品免费看| 欧美精品国产精品| 亚洲美女屁股眼交| 国产一区二区三区不卡在线观看 | 亚洲三级在线免费| 精品一区免费av| 在线观看亚洲精品| 国产精品久久久久影院| 麻豆极品一区二区三区| 欧美在线看片a免费观看| 国产喂奶挤奶一区二区三区| 日本中文一区二区三区| 色综合久久久久综合体| 亚洲视频免费观看| 国产一区二区在线观看免费| 欧美丰满高潮xxxx喷水动漫| 中文字幕制服丝袜一区二区三区| 极品少妇一区二区| 欧美一级片免费看| 三级欧美在线一区| 欧洲一区二区av| 亚洲精品欧美在线| av福利精品导航| 国产精品色在线观看| 国产一区久久久| 26uuu亚洲综合色欧美| 蜜桃视频在线观看一区二区| 欧美日韩视频专区在线播放| 一区二区高清在线| 在线观看成人免费视频| 亚洲图片有声小说| 欧美色窝79yyyycom| 亚洲高清在线视频| 欧美日韩国产综合一区二区| 亚洲一区二区精品视频| 91久久精品一区二区三| 亚洲精品写真福利| 91黄色免费版| 午夜不卡av免费| 欧美一区二区视频在线观看2020 | 欧美挠脚心视频网站| 亚洲成av人片在www色猫咪| 在线一区二区视频| 亚洲高清在线视频| 日韩午夜激情免费电影| 精品一区二区三区视频在线观看 | 欧美视频一区在线| 手机精品视频在线观看| 欧美一级在线视频| 国产一区二区精品久久99| 久久精品亚洲麻豆av一区二区| 国产成人激情av| 亚洲欧美一区二区三区久本道91| 欧美综合天天夜夜久久| 首页国产丝袜综合| 国产欧美一区二区精品性| 99久久精品免费看| 午夜激情久久久| 久久嫩草精品久久久精品| 97国产一区二区| 日韩精品一区第一页| 久久久久九九视频| 91麻豆精东视频| 免费成人你懂的| 国产精品蜜臀在线观看| 欧美日韩大陆在线| 国产精品亚洲一区二区三区在线| 亚洲视频一区二区在线| 日韩欧美国产麻豆| 色综合色综合色综合色综合色综合| 视频一区二区三区中文字幕| 国产三级精品三级| 欧美精品乱人伦久久久久久| 国产宾馆实践打屁股91| 亚洲亚洲精品在线观看| 久久精品视频一区二区| 欧美日韩1区2区| 波多野结衣中文一区| 老司机精品视频一区二区三区| 日韩美女啊v在线免费观看| 日韩西西人体444www| 91久久精品午夜一区二区| 国产美女精品在线| 日产国产欧美视频一区精品| 亚洲欧美国产毛片在线| 国产亚洲欧美在线| 日韩午夜激情电影| 欧美日韩视频不卡| 色婷婷亚洲婷婷| 成人不卡免费av| 国产成人自拍高清视频在线免费播放| 亚洲v日本v欧美v久久精品| 亚洲国产岛国毛片在线| 精品美女在线观看| 91精品国产福利| 欧美高清一级片在线| 在线视频国内一区二区| 成人av资源站| 成人免费av资源| 粉嫩在线一区二区三区视频| 国产综合色视频| 久草精品在线观看| 另类小说图片综合网| 蜜臀99久久精品久久久久久软件| 亚洲电影中文字幕在线观看| 一区二区三区欧美亚洲| 亚洲日本成人在线观看| 最新国产精品久久精品| 国产精品美女久久福利网站| 国产欧美中文在线| 亚洲国产精品成人综合| 国产精品卡一卡二卡三| 中文字幕一区二区三区乱码在线| 国产精品久久久久久久久图文区| 国产天堂亚洲国产碰碰| 中文字幕乱码一区二区免费| 国产亚洲综合av| 欧美国产激情一区二区三区蜜月| 久久精品夜色噜噜亚洲aⅴ| 国产免费成人在线视频| 中文字幕亚洲电影| 亚洲最色的网站| 日韩国产成人精品| 国产一区二区三区免费在线观看| 国产高清视频一区| 91在线你懂得| 欧美群妇大交群的观看方式| 欧美不卡一区二区三区四区| 精品成a人在线观看| 国产精品视频一二三区| 亚洲狠狠丁香婷婷综合久久久| 亚洲午夜免费福利视频| 秋霞国产午夜精品免费视频 | 国产日产欧美一区二区三区| 国产欧美1区2区3区| 樱花草国产18久久久久| 日韩精品电影一区亚洲| 国产又粗又猛又爽又黄91精品| 成人免费毛片aaaaa**| 欧美在线免费观看亚洲| 精品免费视频一区二区| 国产精品国产三级国产aⅴ入口 | 国产亚洲成av人在线观看导航| 国产精品视频免费| 性做久久久久久免费观看| 国产在线精品免费av| 在线观看不卡视频| 精品国产一区二区国模嫣然| 亚洲视频一区二区在线| 精品伊人久久久久7777人| 一道本成人在线| 欧美精品一区二区三区很污很色的 | 中国色在线观看另类| 亚洲成人免费影院| 波多野结衣中文一区| 欧美精品一区二| 午夜精品在线看| 91在线国内视频| 国产亚洲欧洲一区高清在线观看|