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

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

?? isopnp.c

?? linux環境下USB驅動程序,適用三星ARM2410B
?? 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一区二区三区免费野_久草精品视频
日韩亚洲欧美综合| 国产精品一二三四五| 色婷婷国产精品| 亚洲视频免费在线观看| 99久久免费精品高清特色大片| 国产精品久久久久影院亚瑟| 91性感美女视频| 亚洲午夜视频在线观看| 欧美精品123区| 国产一区二区久久| 国产精品高潮呻吟久久| 日本高清不卡aⅴ免费网站| 性久久久久久久| 欧美变态tickling挠脚心| 国产成人精品亚洲777人妖 | 91黄色免费版| 日韩**一区毛片| 国产亚洲精久久久久久| 91美女视频网站| 欧美aa在线视频| 国产精品免费观看视频| 欧美日韩你懂的| 国产一区日韩二区欧美三区| 综合av第一页| 日韩精品一区二区三区中文不卡 | 99精品视频在线观看| 亚洲图片一区二区| 精品电影一区二区| 色天使久久综合网天天| 麻豆91精品视频| 国产精品国产三级国产普通话三级 | 欧美成人综合网站| 91香蕉视频mp4| 激情综合五月婷婷| 亚洲一区二区三区在线播放| 精品少妇一区二区三区日产乱码| 色哟哟日韩精品| 韩国三级电影一区二区| 午夜影院久久久| 亚洲欧洲日韩在线| 欧美精品一区二区高清在线观看 | 青青草一区二区三区| 国产精品久久精品日日| 欧美成人一级视频| 欧美日韩精品一区二区三区四区 | 欧美日韩免费观看一区二区三区 | 国产日韩亚洲欧美综合| 欧美剧情片在线观看| 成人福利在线看| 黑人精品欧美一区二区蜜桃 | 成人一区二区三区视频| 午夜精品久久久久久久99樱桃 | 欧美极品少妇xxxxⅹ高跟鞋| 欧美一区二区三区四区五区 | 欧美一二三四区在线| 在线观看www91| 成人丝袜18视频在线观看| 久久99精品国产91久久来源| 天堂久久久久va久久久久| 一区二区久久久久久| 国产精品久久久久影院老司| 欧美精彩视频一区二区三区| 亚洲精品一线二线三线无人区| 8v天堂国产在线一区二区| 在线观看一区日韩| 91麻豆精东视频| av亚洲精华国产精华精| 成人理论电影网| 成人在线综合网站| 成人在线综合网| thepron国产精品| av成人动漫在线观看| 成人sese在线| 99久久免费精品| 99精品欧美一区二区三区综合在线| 成人综合在线观看| 99精品视频一区| 日本高清不卡一区| 欧美日韩高清在线| 7777精品伊人久久久大香线蕉 | 欧美日韩免费一区二区三区视频| 在线一区二区三区四区五区| 91毛片在线观看| 91黄色激情网站| 欧美性xxxxxxxx| 欧美日韩国产片| 欧美一区二区国产| 精品成人一区二区三区| 国产亚洲精久久久久久| 国产精品家庭影院| 亚洲激情一二三区| 午夜精彩视频在线观看不卡| 视频一区二区国产| 精东粉嫩av免费一区二区三区| 国产一区二区三区最好精华液| 国产精品一区二区男女羞羞无遮挡| 国产伦精一区二区三区| 成人午夜av影视| www.久久精品| 欧美写真视频网站| 日韩午夜av一区| 国产欧美精品区一区二区三区| 国产亚洲一二三区| 亚洲欧美韩国综合色| 日韩精品电影在线观看| 国产一区免费电影| 99re这里只有精品6| 欧美日韩国产在线观看| 精品999在线播放| 中文字幕一区二区日韩精品绯色| 亚洲一区二区中文在线| 毛片一区二区三区| av中文字幕在线不卡| 欧美日韩国产三级| 国产精品久久久久婷婷| 天天色综合天天| 国产suv精品一区二区883| 欧美丝袜自拍制服另类| 久久一区二区三区四区| 亚洲国产美国国产综合一区二区| 国产美女在线精品| 欧美人狂配大交3d怪物一区| 久久久精品黄色| 亚洲成va人在线观看| 福利91精品一区二区三区| 在线播放中文一区| 综合久久综合久久| 免费成人av在线播放| 91美女在线视频| 中文字幕av一区二区三区| 日本不卡123| 色婷婷综合久色| 久久久国产午夜精品| 人禽交欧美网站| 欧美最猛黑人xxxxx猛交| 欧美高清在线视频| 久久精品国产色蜜蜜麻豆| 欧美在线一区二区| 中文字幕中文在线不卡住| 精品中文av资源站在线观看| 欧美亚洲高清一区二区三区不卡| 日本一区二区免费在线观看视频| 捆绑紧缚一区二区三区视频| 欧美系列一区二区| 亚洲精品一二三区| 99免费精品在线| 国产精品毛片久久久久久久| 国产一区在线不卡| 日韩一区二区三区av| 五月激情六月综合| 91久久久免费一区二区| 亚洲色图制服诱惑| 91性感美女视频| 亚洲品质自拍视频| 91丝袜美腿高跟国产极品老师| 中文字幕巨乱亚洲| 粉嫩aⅴ一区二区三区四区| 精品久久五月天| 久久精品国产一区二区| 日韩欧美自拍偷拍| 蜜桃视频第一区免费观看| 日韩午夜在线观看视频| 日本不卡一区二区| 欧美精品日日鲁夜夜添| 亚洲高清免费一级二级三级| 91福利视频在线| 一区二区三区国产豹纹内裤在线| 色悠悠久久综合| 亚洲精品成人少妇| 色999日韩国产欧美一区二区| 亚洲色图制服丝袜| 欧美午夜电影在线播放| 午夜精品久久久久久久久| 91精品欧美一区二区三区综合在| 日韩av在线免费观看不卡| 在线不卡欧美精品一区二区三区| 蜜臀av性久久久久蜜臀aⅴ| 精品精品国产高清一毛片一天堂| 久久91精品久久久久久秒播| 精品福利视频一区二区三区| 国产成人免费视| 亚洲欧美在线aaa| 欧美调教femdomvk| 免费在线看成人av| 久久综合色一综合色88| 成人在线综合网站| 亚洲午夜免费福利视频| 欧美xxxxxxxx| caoporn国产精品| 亚洲国产成人高清精品| 欧美电视剧在线看免费| 高清不卡在线观看av| 一区二区日韩av| 337p日本欧洲亚洲大胆精品| 99久久99久久综合| 午夜精品一区二区三区三上悠亚| 日韩欧美高清一区| 99久久婷婷国产精品综合| 日韩电影在线观看电影| 国产亚洲一本大道中文在线|