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

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

?? d12.c

?? s3c44b0的USB測(cè)試源碼
?? C
?? 第 1 頁 / 共 4 頁
字號(hào):
        // We have the configuration descriptor for the configuration
        // we want.
        //
        // Now we issue the select configuration command to get
        // the  pipes associated with this configuration.
        //

        ntStatus = D12_SelectInterface(DeviceObject,
            configurationDescriptor, NULL);

        ExFreePool(configurationDescriptor);

    }



    D12_KdPrint (("D12TEST.SYS: exit D12_ConfigureDevice (%x)\n", ntStatus));

    return ntStatus;
}


NTSTATUS
D12_SelectInterface(
    IN PDEVICE_OBJECT DeviceObject,
    IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor,
    PUSBD_INTERFACE_INFORMATION Interface
    )
/*++

Routine Description:

    Initializes an 82930 with multiple interfaces

Arguments:

    DeviceObject - pointer to the device object for this instance of the 82930
                    devcice.

    ConfigurationDescriptor - pointer to the USB configuration
                    descriptor containing the interface and endpoint
                    descriptors.

Return Value:

    NT status code

--*/
{
    PDEVICE_EXTENSION deviceExtension;
    NTSTATUS ntStatus;
    PURB urb = NULL;
    ULONG i;
    UCHAR alternateSetting, interfaceNumber;
    PUSB_INTERFACE_DESCRIPTOR interfaceDescriptor = NULL;
    USHORT siz;

    D12_KdPrint (("D12TEST.SYS: enter D12_SelectInterface\n"));

    deviceExtension = DeviceObject->DeviceExtension;

    if (Interface == NULL) {

        //
        // D12 driver only supports one interface, we must search
        // the configuration descriptor for the interface we want
        // and remember the pipes.
        //

        urb = USBD_CreateConfigurationRequest(ConfigurationDescriptor, &siz);

        if (urb) {

            //
            // search thru all the interfaces
            // and find any we are interested in
            //

            interfaceNumber = 0;
            alternateSetting = 0;
//            alternateSetting = 3;

            interfaceDescriptor =
                USBD_ParseConfigurationDescriptor(ConfigurationDescriptor,
                                                  interfaceNumber,
                                                  alternateSetting);

            Interface = &urb->UrbSelectConfiguration.Interface;
            
            for (i=0; i< Interface->NumberOfPipes; i++) {
                //
                // perform any pipe initialization here
                //
                Interface->Pipes[i].MaximumTransferSize = 64*1024-1;
            }

            UsbBuildSelectConfigurationRequest(urb,
                                              (USHORT) siz,
                                              ConfigurationDescriptor);

//            Interface->AlternateSetting = 3;
            
            ntStatus = D12_CallUSBD(DeviceObject, urb);

            deviceExtension->ConfigurationHandle =
                urb->UrbSelectConfiguration.ConfigurationHandle;

        } else {
            ntStatus = STATUS_INSUFFICIENT_RESOURCES;
        }

    } else {
        //
        // we were give an interface already set up
        //
        // do a selectinterface here if we want to change any of the
        // pipe parameters.
        //

        TRAP();

    }

    ASSERT(Interface != NULL);

    if (NT_SUCCESS(ntStatus)) {

        //
        // Save the configuration handle for this device
        //

        deviceExtension->ConfigurationHandle =
            urb->UrbSelectConfiguration.ConfigurationHandle;

        deviceExtension->Interface = ExAllocatePool(NonPagedPool,
                                                    Interface->Length);

        if (deviceExtension->Interface) {
            ULONG j;

            //
            // save a copy of the interface information returned
            //
            RtlCopyMemory(deviceExtension->Interface, Interface, Interface->Length);

            //
            // Dump the interface to the debugger
            //
            D12_KdPrint (("D12TEST.SYS: ---------\n"));
            D12_KdPrint (("D12TEST.SYS: NumberOfPipes 0x%x\n", deviceExtension->Interface->NumberOfPipes));
            D12_KdPrint (("D12TEST.SYS: Length 0x%x\n", deviceExtension->Interface->Length));
            D12_KdPrint (("D12TEST.SYS: Alt Setting 0x%x\n", deviceExtension->Interface->AlternateSetting));
            D12_KdPrint (("D12TEST.SYS: Interface Number 0x%x\n", deviceExtension->Interface->InterfaceNumber));
            D12_KdPrint (("D12TEST.SYS: Class, subclass, protocol 0x%x 0x%x 0x%x\n",
                deviceExtension->Interface->Class,
                deviceExtension->Interface->SubClass,
                deviceExtension->Interface->Protocol));

            // Dump the pipe info

            for (j=0; j<Interface->NumberOfPipes; j++) {
                PUSBD_PIPE_INFORMATION pipeInformation;

                pipeInformation = &deviceExtension->Interface->Pipes[j];

                D12_KdPrint (("D12TEST.SYS: ---------\n"));
                D12_KdPrint (("D12TEST.SYS: PipeType 0x%x\n", pipeInformation->PipeType));
                D12_KdPrint (("D12TEST.SYS: EndpointAddress 0x%x\n", pipeInformation->EndpointAddress));
                D12_KdPrint (("D12TEST.SYS: MaxPacketSize 0x%x\n", pipeInformation->MaximumPacketSize));
                D12_KdPrint (("D12TEST.SYS: Interval 0x%x\n", pipeInformation->Interval));
                D12_KdPrint (("D12TEST.SYS: Handle 0x%x\n", pipeInformation->PipeHandle));
                D12_KdPrint (("D12TEST.SYS: MaximumTransferSize 0x%x\n", pipeInformation->MaximumTransferSize));
            }

            D12_KdPrint (("D12TEST.SYS: ---------\n"));
        }
    }

    if (urb) {
        ExFreePool(urb);
        urb = NULL;
    }

    // Retrieve the selected Configuration and Interface setting from the
    // device.  (The only purpose of doing this here is to exercise the
    // URB_FUNCTION_GET_CONFIGURATION and URB_FUNCTION_GET_INTERFACE
    // requests).
    //
    if (NT_SUCCESS(ntStatus)) {

        urb = ExAllocatePool(
                  NonPagedPool,
                  sizeof(struct _URB_CONTROL_GET_CONFIGURATION_REQUEST) + 1);

        if (urb)
        {
            PUCHAR configuration;

            configuration = (PUCHAR)urb + sizeof(struct _URB_CONTROL_GET_CONFIGURATION_REQUEST);
            *configuration = 0xFF;

            urb->UrbHeader.Function = URB_FUNCTION_GET_CONFIGURATION;
            urb->UrbHeader.Length = sizeof(struct _URB_CONTROL_GET_CONFIGURATION_REQUEST);
            urb->UrbControlGetConfigurationRequest.TransferBufferLength = 1;
            urb->UrbControlGetConfigurationRequest.TransferBuffer = configuration;
            urb->UrbControlGetConfigurationRequest.TransferBufferMDL = NULL;
            urb->UrbControlGetConfigurationRequest.UrbLink = NULL;

            ntStatus = D12_CallUSBD(DeviceObject, urb);

            D12_KdPrint (("D12TEST.SYS: Configuration %d (%x)\n",
                             *configuration, ntStatus));

            ExFreePool(urb);
            urb = NULL;
        }

        urb = ExAllocatePool(
                  NonPagedPool,
                  sizeof(struct _URB_CONTROL_GET_INTERFACE_REQUEST) + 1);

        if (urb)
        {
            PUCHAR interface;

            interface = (PUCHAR)urb + sizeof(struct _URB_CONTROL_GET_INTERFACE_REQUEST);
            *interface = 0xFF;

            urb->UrbHeader.Function = URB_FUNCTION_GET_INTERFACE;
            urb->UrbHeader.Length = sizeof(struct _URB_CONTROL_GET_INTERFACE_REQUEST);
            urb->UrbControlGetInterfaceRequest.TransferBufferLength = 1;
            urb->UrbControlGetInterfaceRequest.TransferBuffer = interface;
            urb->UrbControlGetInterfaceRequest.TransferBufferMDL = NULL;
            urb->UrbControlGetInterfaceRequest.UrbLink = NULL;
            urb->UrbControlGetInterfaceRequest.Interface =
                deviceExtension->Interface->InterfaceNumber;

            ntStatus = D12_CallUSBD(DeviceObject, urb);

            D12_KdPrint (("D12TEST.SYS: Interface %d (%x)\n",
                             *interface, ntStatus));

            ExFreePool(urb);
            urb = NULL;
        }
    }

    D12_KdPrint (("D12TEST.SYS: exit D12_SelectInterface (%x)\n", ntStatus));

    return ntStatus;
}


NTSTATUS
D12_BuildPipeList(
    IN  PDEVICE_OBJECT DeviceObject
    )
/*++

Routine Description:

Arguments:

    DeviceObject - pointer to the device object for this instance of the 82930
                    devcice.


Return Value:

    NT status code

--*/
{
    PDEVICE_EXTENSION deviceExtension;
    ULONG i;
    WCHAR Name[] = L"\\PIPE00";
    PUSBD_INTERFACE_INFORMATION interface;

    deviceExtension = DeviceObject->DeviceExtension;
    interface = deviceExtension->Interface;

    D12_KdPrint (("D12TEST.SYS: enter D12_BuildPipeList\n"));

    deviceExtension = DeviceObject->DeviceExtension;

    for (i=0; i<D12_MAX_PIPES; i++) {

        Name[6] = 'X';
        RtlCopyMemory(deviceExtension->PipeList[i].Name,
                      Name,
                      sizeof(Name));

    }

    //
    // build a list of pipe names based on the interface
    //

    for (i=0; i<interface->NumberOfPipes; i++) {

        Name[6] = '0' + (USHORT) i;
        RtlCopyMemory(deviceExtension->PipeList[i].Name,
                      Name,
                      sizeof(Name));

        deviceExtension->PipeList[i].PipeInfo =
            &interface->Pipes[i];

        deviceExtension->PipeList[i].Opened = FALSE;
    }

    return STATUS_SUCCESS;
}


NTSTATUS
D12_ResetPipe(
    IN PDEVICE_OBJECT DeviceObject,
    IN PD12_PIPE Pipe,
    IN BOOLEAN IsoClearStall
    )
/*++

Routine Description:

    Reset a given USB pipe.
    
    NOTES:

    This will reset the host to Data0 and should also reset the device
    to Data0 for Bulk and Interrupt pipes.

    For Iso pipes this will set the virgin state of pipe so that ASAP
    transfers begin with the current bus frame instead of the next frame
    after the last transfer occurred.

Arguments:

Return Value:


--*/
{
    NTSTATUS ntStatus;
    PURB urb;

    D12_KdPrint (("D12TEST.SYS: Reset Pipe %x\n", Pipe));

    urb = ExAllocatePool(NonPagedPool,
                         sizeof(struct _URB_PIPE_REQUEST));

    if (urb) {

        urb->UrbHeader.Length = (USHORT) sizeof (struct _URB_PIPE_REQUEST);
        urb->UrbHeader.Function = URB_FUNCTION_RESET_PIPE;
        urb->UrbPipeRequest.PipeHandle =
            Pipe->PipeInfo->PipeHandle;

        ntStatus = D12_CallUSBD(DeviceObject, urb);

        ExFreePool(urb);

    } else {
        ntStatus = STATUS_INSUFFICIENT_RESOURCES;
    }

    //
    // Memphis RESET_PIPE will send a Clear-Feature Endpoint Stall to
    // reset the data toggle of non-Iso pipes as part of a RESET_PIPE
    // request.  It does not do this for Iso pipes as Iso pipes do not use
    // the data toggle (all Iso packets are Data0).  However, we also use
    // the Clear-Feature Endpoint Stall request in our device firmware to
    // reset data buffer points inside the device so we explicitly send
    // this request to the device for Iso pipes if desired.
    //
    if (NT_SUCCESS(ntStatus) && IsoClearStall &&
        (Pipe->PipeInfo->PipeType == UsbdPipeTypeIsochronous)) {
        
        urb = ExAllocatePool(NonPagedPool,
                             sizeof(struct _URB_CONTROL_FEATURE_REQUEST));

        if (urb) {

            UsbBuildFeatureRequest(urb,
                                   URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT,
                                   USB_FEATURE_ENDPOINT_STALL,
                                   Pipe->PipeInfo->EndpointAddress,
                                   NULL);

            ntStatus = D12_CallUSBD(DeviceObject, urb);

            ExFreePool(urb);
        } else {
            ntStatus = STATUS_INSUFFICIENT_RESOURCES;
        }
    }

    return ntStatus;
}


LONG
D12_DecrementIoCount(
    IN PDEVICE_OBJECT DeviceObject
    )
/*++

Routine Description:

Arguments:

Return Value:


--*/
{
    PDEVICE_EXTENSION deviceExtension;
    LONG ioCount;

    deviceExtension = DeviceObject->DeviceExtension;

    ioCount = InterlockedDecrement(&deviceExtension->PendingIoCount);

    D12_KdPrint (("D12TEST.SYS: Pending io count = %x\n", ioCount));

    if (ioCount==0) {
        KeSetEvent(&deviceExtension->RemoveEvent,
                   1,
                   FALSE);
    }

    return ioCount;
}


VOID
D12_IncrementIoCount(
    IN PDEVICE_OBJECT DeviceObject
    )
/*++

Routine Description:

Arguments:

Return Value:


--*/
{
    PDEVICE_EXTENSION deviceExtension;

    deviceExtension = DeviceObject->DeviceExtension;

    InterlockedIncrement(&deviceExtension->PendingIoCount);
}


NTSTATUS
D12_ReconfigureDevice(
    IN  PDEVICE_OBJECT DeviceObject
    )
/*++

Routine Description:

    Initializes a given instance of the device on the USB and selects the
    configuration.

Arguments:

    DeviceObject - pointer to the device object for this instance of the 82930
                    devcice.


Return Value:

    NT status code

--*/
{
    PDEVICE_EXTENSION deviceExtension;
    NTSTATUS ntStatus = STATUS_SUCCESS;
    PUSBD_INTERFACE_INFORMATION interface;
    ULONG i;

    D12_KdPrint (("D12TEST.SYS: enter D12_ReconfigureDevice\n"));

    deviceExtension = DeviceObject->DeviceExtension;

    if (NT_SUCCESS(ntStatus)) {
        ntStatus = D12_ConfigureDevice(DeviceObject);
    }

    //
    // new interface structure is now set up
    //

    interface = deviceExtension->Interface;

    //
    // set up the pipe handles again
    //

    for (i=0; i<interface->NumberOfPipes; i++) {

        D12_KdPrint (("D12TEST.SYS: pipe list = %x\n", &deviceExtension->PipeList[i]));

        deviceExtension->PipeList[i].PipeInfo =
            &interface->Pipes[i];

        //deviceExtension->PipeList[i].Opened = FALSE;
    }

    return ntStatus;
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲高清免费观看高清完整版在线观看| 午夜视黄欧洲亚洲| 欧美日韩国产影片| 国产一区二区不卡| 亚洲自拍另类综合| 久久麻豆一区二区| 国产福利不卡视频| 午夜精品成人在线| 亚洲免费色视频| 欧美极品另类videosde| 欧美乱熟臀69xxxxxx| eeuss鲁片一区二区三区| 国产欧美一二三区| 国产老女人精品毛片久久| 5566中文字幕一区二区电影| 亚洲图片你懂的| 国产成人高清视频| 91精品国模一区二区三区| 亚洲欧洲精品成人久久奇米网| 捆绑调教美女网站视频一区| 成人精品免费视频| 成人激情免费网站| 99久久久免费精品国产一区二区| 日韩精品成人一区二区在线| 中文字幕日韩av资源站| www国产亚洲精品久久麻豆| 777精品伊人久久久久大香线蕉| 91影院在线观看| 国产成人精品亚洲777人妖| 日韩精品一级中文字幕精品视频免费观看 | 国产成人在线免费| 久久97超碰国产精品超碰| 日韩制服丝袜先锋影音| 亚洲午夜精品17c| 亚洲天堂a在线| 亚洲视频每日更新| 亚洲欧洲日韩女同| 亚洲欧美视频在线观看| 最新高清无码专区| 中文字幕中文字幕一区二区| 日韩精品福利网| 亚洲第一搞黄网站| 亚洲高清一区二区三区| 五月天久久比比资源色| 亚洲电影一级黄| 丝袜亚洲另类欧美综合| 五月婷婷激情综合| 蜜臀国产一区二区三区在线播放| 免费黄网站欧美| 麻豆一区二区三| 国内成人免费视频| 国产成人午夜精品影院观看视频| 国产精品888| fc2成人免费人成在线观看播放| 成人三级伦理片| 91亚洲精华国产精华精华液| 色狠狠色噜噜噜综合网| 欧美午夜电影网| 91精品国产综合久久久久久久久久| 欧美一区二区三区视频在线观看| 欧美一级高清片| 久久久99精品免费观看不卡| 国产精品久久久久久久第一福利| √…a在线天堂一区| 亚洲风情在线资源站| 琪琪一区二区三区| 国产米奇在线777精品观看| 99久久精品一区二区| 在线观看视频一区| 制服丝袜亚洲色图| 国产亚洲一区二区三区| 亚洲日穴在线视频| 日韩中文欧美在线| 成人综合在线视频| 欧美日韩一区二区在线视频| 欧美刺激脚交jootjob| 亚洲国产成人在线| 午夜欧美在线一二页| 国产精品影视网| 在线观看成人小视频| 欧美一区二区成人6969| 国产精品天干天干在线综合| 亚洲一区二三区| 精久久久久久久久久久| 97se亚洲国产综合在线| 日韩欧美一级精品久久| 亚洲天堂精品视频| 激情综合色丁香一区二区| 99九九99九九九视频精品| 337p亚洲精品色噜噜| 国产精品私人影院| 美洲天堂一区二卡三卡四卡视频| 国产白丝精品91爽爽久久| 欧美丰满一区二区免费视频| 久久精品一区二区三区不卡| 亚洲.国产.中文慕字在线| 国产成人鲁色资源国产91色综| 欧美日韩综合色| 国产精品九色蝌蚪自拍| 免费在线看一区| 色94色欧美sute亚洲13| 国产午夜精品一区二区三区视频 | 日本三级亚洲精品| av高清久久久| 久久夜色精品一区| 91色视频在线| 2023国产精品| 视频一区二区中文字幕| 91老师片黄在线观看| 国产亚洲欧美在线| 免费黄网站欧美| 欧美日韩二区三区| 亚洲精选一二三| 成人丝袜视频网| 欧美精品一区二区三区一线天视频 | 精品国产乱码久久久久久图片 | 国产丝袜在线精品| 日本美女一区二区| 91成人国产精品| 国产精品狼人久久影院观看方式| 久久99国产精品尤物| 欧美精品精品一区| 亚州成人在线电影| 欧美视频一二三区| 玉米视频成人免费看| 色综合久久久久| 自拍偷自拍亚洲精品播放| 波多野结衣中文一区| 国产婷婷色一区二区三区四区| 麻豆91小视频| 日韩欧美在线网站| 免费日韩伦理电影| 日韩一区二区三区视频在线| 日韩不卡在线观看日韩不卡视频| 欧美又粗又大又爽| 一区二区久久久久久| 91久久精品网| 亚洲一卡二卡三卡四卡无卡久久 | 久久久无码精品亚洲日韩按摩| 男人的天堂亚洲一区| 欧美一区二区三区视频在线| 日本大胆欧美人术艺术动态| 91精品国产欧美一区二区| 午夜影院在线观看欧美| 日韩一区二区视频| 国产麻豆午夜三级精品| 久久久精品综合| av在线免费不卡| 亚洲免费电影在线| 欧美日韩精品一区二区在线播放| 午夜欧美在线一二页| 欧美成人一区二区三区在线观看| 国内精品伊人久久久久影院对白| 欧美精品一区二区三区蜜臀| 国产激情一区二区三区四区| 国产精品日日摸夜夜摸av| 99精品国产99久久久久久白柏| 一二三四区精品视频| 欧美精品自拍偷拍动漫精品| 另类调教123区 | 国产丝袜欧美中文另类| 99久久精品免费看国产| 亚洲永久免费视频| 91精品久久久久久久久99蜜臂| 激情六月婷婷久久| 中文字幕av一区二区三区高 | 久久综合九色欧美综合狠狠| 成人免费高清在线| 一区二区三区四区五区视频在线观看| 欧美在线free| 国产综合一区二区| 最新中文字幕一区二区三区| 精品视频免费看| 国产真实精品久久二三区| 最新中文字幕一区二区三区| 欧美丰满少妇xxxbbb| 国产精品羞羞答答xxdd | 精品一区二区精品| 中文字幕字幕中文在线中不卡视频| 欧美在线免费视屏| 国内欧美视频一区二区 | 国产电影一区在线| 一区二区三区在线免费播放| 欧美成人一区二区三区| 91啪九色porn原创视频在线观看| 日韩中文字幕不卡| 国产精品国产自产拍在线| 欧美老人xxxx18| 成人动漫中文字幕| 日韩经典一区二区| 国产精品白丝在线| 精品国精品自拍自在线| 色中色一区二区| 国产美女在线精品| 天堂在线一区二区| 亚洲码国产岛国毛片在线| 欧美精品一区二区高清在线观看| 一本久久综合亚洲鲁鲁五月天 | 欧美日韩免费观看一区二区三区| 国产在线视视频有精品|