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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? isopnp.c

?? S3C2410X平臺(tái)下的USB驅(qū)動(dòng)程序
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
/*++

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);

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线免费观看视频一区| 亚洲精品一区二区在线观看| 欧美精品一区二区三区一线天视频| 国产suv一区二区三区88区| 欧美一区二区三区在线看| 一区二区三区四区亚洲| 国产成人精品三级| 久久婷婷一区二区三区| 国产福利精品一区| 日韩av网站免费在线| 91.com在线观看| 免费高清成人在线| 久久久亚洲精华液精华液精华液 | 精品理论电影在线| 日本一区二区视频在线| 日韩欧美区一区二| 夜夜亚洲天天久久| 国产视频不卡一区| 99久久777色| 综合婷婷亚洲小说| 在线欧美一区二区| 成人免费高清在线| 亚洲影院免费观看| 欧美一级黄色片| 国产suv一区二区三区88区| 免费观看一级欧美片| 亚洲电影一区二区| 不卡一区在线观看| 性感美女久久精品| 一级中文字幕一区二区| 亚洲色图欧美激情| 中文字幕一区在线观看视频| 欧美亚洲国产bt| 韩国女主播一区二区三区| 久久综合视频网| 日韩免费观看高清完整版| 制服丝袜日韩国产| 欧美高清视频一二三区 | 韩国三级在线一区| 老司机午夜精品| 国产精品麻豆久久久| 欧美日韩的一区二区| 国产 欧美在线| 国产成人午夜片在线观看高清观看| 久久www免费人成看片高清| 久久国产尿小便嘘嘘尿| 久久66热偷产精品| 亚洲成av人在线观看| 日韩极品在线观看| 国产精品久久久久久久午夜片| 欧美男男青年gay1069videost | 色欧美片视频在线观看在线视频| 青青草国产成人av片免费| 麻豆精品精品国产自在97香蕉| 亚洲精品中文在线影院| 久久久久国产精品免费免费搜索 | 亚洲香蕉伊在人在线观| 亚洲国产精品视频| 免费av成人在线| 国产米奇在线777精品观看| 亚洲bt欧美bt精品777| 天天射综合影视| 亚洲美女视频在线| 欧美激情一区二区三区蜜桃视频| 日韩一区二区在线看片| 精品国产一区二区三区四区四| 久久久久久97三级| 一区二区三区中文在线观看| 日韩中文字幕麻豆| 国产一区二区三区四区在线观看| 成人免费毛片高清视频| 欧美在线你懂的| 欧美成人官网二区| 国产精品白丝在线| 午夜精品久久久久久不卡8050| 麻豆国产精品一区二区三区| 成人h动漫精品一区二| 欧美日韩卡一卡二| 久久综合色8888| 亚洲精品视频在线| 黄一区二区三区| 91麻豆免费视频| 成年人国产精品| 欧美日韩国产精品自在自线| 欧美成人艳星乳罩| 中文字幕五月欧美| 久久精品国产99久久6| 97aⅴ精品视频一二三区| 欧美一区二区三区系列电影| 欧美国产精品一区二区| 丝袜亚洲另类丝袜在线| 国产成人亚洲综合色影视| 欧美日韩在线精品一区二区三区激情| 91成人国产精品| 欧美三级中文字| 欧美国产视频在线| 另类的小说在线视频另类成人小视频在线 | 日韩免费看网站| 一区二区三区日韩精品| 韩国毛片一区二区三区| 91黄色激情网站| 日本一区二区三区国色天香| 日韩国产精品久久| 色婷婷av一区二区三区大白胸 | 成人免费观看av| 这里只有精品视频在线观看| 亚洲欧美一区二区三区极速播放 | 七七婷婷婷婷精品国产| 91啪亚洲精品| 国产日韩精品视频一区| 久色婷婷小香蕉久久| 欧美日韩成人一区二区| 亚洲免费毛片网站| 99在线热播精品免费| 日本福利一区二区| 亚洲国产精品国自产拍av| 精品一区二区三区香蕉蜜桃| 3d成人动漫网站| 亚洲国产精品综合小说图片区| 99精品国产99久久久久久白柏| 欧美α欧美αv大片| 日本大胆欧美人术艺术动态| 欧美三级在线看| 亚洲另类春色国产| 99久久免费精品高清特色大片| 国产三级精品三级| 国产成人啪免费观看软件| 精品国产电影一区二区| 裸体健美xxxx欧美裸体表演| 欧美高清www午色夜在线视频| 亚洲一区二区三区在线看| 日本高清无吗v一区| 亚洲自拍偷拍av| 日本韩国欧美在线| 一区二区三区久久| 欧美日韩一二区| 偷窥少妇高潮呻吟av久久免费| 欧美三片在线视频观看| 石原莉奈在线亚洲三区| 欧美嫩在线观看| 免费观看30秒视频久久| 精品国产123| 国产福利精品一区| 亚洲欧洲日韩在线| 欧美在线一二三| 日韩高清不卡在线| 日韩欧美国产综合在线一区二区三区| 看电影不卡的网站| 国产三级一区二区| aaa亚洲精品| 亚洲女与黑人做爰| 欧美疯狂做受xxxx富婆| 美女mm1313爽爽久久久蜜臀| 精品国产伦一区二区三区免费 | 韩国欧美一区二区| 日本一区二区免费在线| 99国产欧美久久久精品| 亚洲午夜久久久久中文字幕久| 欧美日韩精品是欧美日韩精品| 日本在线播放一区二区三区| 精品国产人成亚洲区| www.欧美日韩国产在线| 夜夜操天天操亚洲| 精品国产免费久久| 91在线观看高清| 偷拍亚洲欧洲综合| 久久久99精品免费观看不卡| 一本色道久久综合亚洲91 | 97久久超碰精品国产| 亚欧色一区w666天堂| 久久精品欧美日韩精品| 色婷婷国产精品| 精品一区二区三区视频 | 午夜婷婷国产麻豆精品| 精品国偷自产国产一区| 99久久精品国产导航| 日日夜夜免费精品| 国产香蕉久久精品综合网| 在线观看免费视频综合| 国产一区二区三区日韩| 亚洲理论在线观看| 久久久久一区二区三区四区| 91成人在线精品| 国产成人精品三级| 午夜伊人狠狠久久| 国产精品灌醉下药二区| 欧美电影在哪看比较好| 成人在线综合网站| 男人的天堂亚洲一区| 亚洲欧洲中文日韩久久av乱码| 精品欧美黑人一区二区三区| 色视频成人在线观看免| 国产精品18久久久| 日韩一区精品字幕| ...中文天堂在线一区| 精品国产乱子伦一区| 欧美日韩高清一区| 91免费精品国自产拍在线不卡 | 欧美精品在欧美一区二区少妇| 国产成人av资源|