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

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

?? d12.c

?? 北京恒豐銳科科技有限公司三星arm7開發板s3c44b0的脫離操作系統的試驗代碼!
?? C
?? 第 1 頁 / 共 4 頁
字號:
        // 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;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品一区二区三区四区| 欧美在线观看禁18| 一区2区3区在线看| 欧美大片免费久久精品三p| 91蝌蚪porny成人天涯| 精彩视频一区二区三区| 一级日本不卡的影视| 久久久不卡网国产精品二区| 欧美片在线播放| 丝瓜av网站精品一区二区 | 亚洲一区二区黄色| 中文字幕在线一区二区三区| 亚洲va韩国va欧美va精品| 99精品桃花视频在线观看| 国产日韩精品久久久| www.亚洲在线| 欧美人与z0zoxxxx视频| 日本在线不卡视频| 亚洲三级电影全部在线观看高清| 精品1区2区在线观看| 国产亚洲制服色| 51久久夜色精品国产麻豆| 日本韩国欧美一区| 97久久超碰精品国产| 成人黄页在线观看| 国产精品一区专区| 国产精品99久久久| 精品在线一区二区| 精品一区二区三区影院在线午夜 | 国产主播一区二区| 蜜臀av性久久久久蜜臀aⅴ| 亚洲午夜在线电影| 亚洲午夜精品网| 亚洲高清免费观看| 亚洲18色成人| 日本伊人色综合网| 美腿丝袜亚洲综合| 久久99久久久久| 久久69国产一区二区蜜臀| 免费在线观看成人| 日本欧美一区二区三区| 免费观看91视频大全| 日本中文字幕一区二区视频| 麻豆一区二区三| 国产一区999| 成人一区二区三区| av在线不卡电影| 色婷婷久久久综合中文字幕| 色悠悠久久综合| 精品1区2区3区| 51午夜精品国产| 久久嫩草精品久久久精品| 国产精品久久久久久亚洲伦| 一区二区三区在线免费视频| 日韩精品电影在线观看| 麻豆精品国产91久久久久久 | 欧美在线999| 91麻豆精品国产91久久久资源速度 | 国产曰批免费观看久久久| 国产精品一区二区在线播放| 成人avav影音| 欧美制服丝袜第一页| 制服丝袜成人动漫| 久久久天堂av| 亚洲伦在线观看| 天天av天天翘天天综合网色鬼国产 | 欧美不卡激情三级在线观看| 国产亚洲美州欧州综合国| 中文字幕在线一区| 午夜电影网一区| 国产精品1区2区| 色婷婷狠狠综合| 日韩久久精品一区| 国产精品丝袜黑色高跟| 亚洲午夜精品网| 国产精品18久久久久久vr| 日本乱码高清不卡字幕| 精品久久五月天| 亚洲欧美另类久久久精品| 欧美aaa在线| 久久久www免费人成精品| 夜夜嗨av一区二区三区网页 | 在线视频你懂得一区| 欧美成人免费网站| 亚洲猫色日本管| 国产乱码精品一区二区三区av | 2024国产精品视频| 亚洲女与黑人做爰| 国内精品伊人久久久久影院对白| 91丝袜美女网| 欧美变态tickling挠脚心| 亚洲精品国产无天堂网2021| 国产一区二区三区在线观看免费 | 国产在线日韩欧美| 在线一区二区三区| 国产拍欧美日韩视频二区| 日本欧美在线观看| 一本一道久久a久久精品综合蜜臀| 精品少妇一区二区三区视频免付费| 亚洲人成电影网站色mp4| 国产一区二区三区香蕉| 欧美日韩大陆在线| 亚洲摸摸操操av| 国产成人午夜精品5599| 91精品国产一区二区人妖| 一区二区三区欧美视频| 国产成人精品在线看| 精品国偷自产国产一区| 五月天激情小说综合| 一本到一区二区三区| 中文字幕不卡在线| 国产尤物一区二区在线| 在线91免费看| 亚洲高清免费一级二级三级| 色诱视频网站一区| 最新国产の精品合集bt伙计| 国产福利精品导航| 亚洲精品一区二区精华| 麻豆久久久久久| 91精品国产乱码久久蜜臀| 午夜视频久久久久久| 欧美影片第一页| 亚洲精品国产视频| 91社区在线播放| 最新中文字幕一区二区三区| 风流少妇一区二区| 国产欧美一区二区三区在线老狼| 欧美精品久久久久久久多人混战| 亚洲精品日产精品乱码不卡| 成人污污视频在线观看| 国产日韩高清在线| 成人一区二区三区中文字幕| 欧美韩国日本综合| 国产成人在线视频播放| 欧美激情一区二区三区| 成人免费va视频| 中文字幕在线一区免费| 99视频有精品| 亚洲丝袜精品丝袜在线| 色先锋久久av资源部| 一区二区三区国产精华| 欧美综合欧美视频| 石原莉奈一区二区三区在线观看 | 欧美日韩一区二区欧美激情| 五月婷婷另类国产| 8x8x8国产精品| 精品在线你懂的| 久久久综合网站| 播五月开心婷婷综合| 亚洲三级在线免费| 欧美日韩激情在线| 美女视频网站久久| 国产午夜精品美女毛片视频| bt欧美亚洲午夜电影天堂| 亚洲精品ww久久久久久p站| 欧美少妇一区二区| 美女一区二区三区在线观看| 国产日产欧美精品一区二区三区| 成年人网站91| 香蕉乱码成人久久天堂爱免费| 日韩一级片在线观看| 国产精品一区在线观看你懂的| 最好看的中文字幕久久| 欧美日韩国产片| 国产主播一区二区| 亚洲精品成人在线| 精品国产制服丝袜高跟| 久久久不卡网国产精品一区| 99麻豆久久久国产精品免费| 午夜精品一区二区三区免费视频| 欧美成人一区二区三区在线观看| 成人av影院在线| 偷拍日韩校园综合在线| 国产欧美视频一区二区三区| 欧美一a一片一级一片| 久久电影网站中文字幕 | 久热成人在线视频| 亚洲欧洲成人精品av97| 欧美一区二区私人影院日本| 高清在线成人网| 舔着乳尖日韩一区| 国产精品美女久久久久久久久| 在线播放91灌醉迷j高跟美女| 国产乱理伦片在线观看夜一区| 亚洲桃色在线一区| 亚洲精品一线二线三线无人区| 99re热这里只有精品免费视频| 另类欧美日韩国产在线| 亚洲欧美精品午睡沙发| 久久久久久电影| 欧美群妇大交群中文字幕| www.一区二区| 国产真实乱子伦精品视频| 亚洲综合男人的天堂| xnxx国产精品| 欧美性大战久久| 成人免费视频视频在线观看免费| 日本色综合中文字幕| 亚洲欧美日韩系列| 欧美经典一区二区三区|