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

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

?? d12.c

?? 自己買的arms3c44b0開發板附帶的demo程序
?? 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一区二区三区免费野_久草精品视频
日韩精品一区二区三区在线| 亚洲高清一区二区三区| 欧美日韩日日骚| 成人手机在线视频| 国产精品一区二区三区四区 | 欧美激情一区二区三区不卡| 欧美顶级少妇做爰| 91精品国产一区二区三区蜜臀| 日本精品免费观看高清观看| 日本精品一区二区三区四区的功能| 不卡视频一二三| 97精品电影院| 在线区一区二视频| 欧美日韩国产经典色站一区二区三区| 欧美在线观看一区| 欧美乱妇15p| 日韩情涩欧美日韩视频| 337p粉嫩大胆噜噜噜噜噜91av| 精品日韩一区二区三区免费视频| 亚洲免费色视频| 久久久亚洲国产美女国产盗摄| 久久蜜桃香蕉精品一区二区三区| 国产亚洲精品bt天堂精选| 欧美极品aⅴ影院| 自拍偷拍国产精品| 亚洲国产精品久久久久婷婷884| 五月天久久比比资源色| 精品影视av免费| 成人18精品视频| 欧美性猛交xxxx乱大交退制版| 欧美喷潮久久久xxxxx| 日韩一级片网站| 国产日韩v精品一区二区| 亚洲少妇30p| 日本亚洲最大的色成网站www| 国产麻豆9l精品三级站| 一卡二卡欧美日韩| 免费人成网站在线观看欧美高清| 国产一区二区三区精品视频| 91香蕉视频mp4| 日韩三级视频中文字幕| **性色生活片久久毛片| 美腿丝袜一区二区三区| 91麻豆国产福利在线观看| 91 com成人网| 国产精品第四页| 轻轻草成人在线| 91色porny在线视频| 欧美电影免费观看高清完整版| 国产精品家庭影院| 日韩avvvv在线播放| 97超碰欧美中文字幕| 精品国产免费视频| 亚洲第一电影网| 国产成人精品免费| 日韩一区二区免费在线电影| 一区二区三区在线不卡| 国产成人在线观看免费网站| 在线播放欧美女士性生活| 亚洲欧美二区三区| 国产xxx精品视频大全| 欧美一区二区三区四区高清| 中文字幕一区二区在线观看| 国产乱码精品一区二区三区av | 精品国产91久久久久久久妲己 | 六月丁香综合在线视频| 日本韩国一区二区三区视频| 国产精品久久久久久户外露出| 奇米777欧美一区二区| 欧美性一二三区| 亚洲人成影院在线观看| 成人性生交大片免费看中文| 日韩一区二区三区在线观看| 亚洲一线二线三线视频| 色婷婷久久综合| 国产精品美女久久久久av爽李琼 | 成人午夜视频免费看| 精品国产免费人成在线观看| 蜜臂av日日欢夜夜爽一区| 91精品国产丝袜白色高跟鞋| 日韩精品一级二级| 欧美乱熟臀69xxxxxx| 男男视频亚洲欧美| 日韩免费观看高清完整版| 免费观看在线色综合| 日韩欧美成人一区| 韩国av一区二区三区在线观看| 欧美大片一区二区| 国产一区三区三区| 欧美激情中文不卡| 色综合天天综合给合国产| 一区二区三区日韩欧美精品| 欧美影院精品一区| 日本强好片久久久久久aaa| 日韩精品一区二区三区老鸭窝| 免费人成精品欧美精品| 久久综合九色综合97婷婷女人| 国产精品白丝av| 中文字幕亚洲一区二区va在线| 99久久国产综合精品色伊 | 在线成人小视频| 日日骚欧美日韩| www国产精品av| 成人久久久精品乱码一区二区三区| 亚洲欧洲一区二区在线播放| 在线一区二区三区做爰视频网站| 日日噜噜夜夜狠狠视频欧美人 | 欧美日韩精品系列| 久久国内精品自在自线400部| 久久久久国产一区二区三区四区| aaa国产一区| 婷婷六月综合网| 久久久99免费| 在线观看亚洲专区| 麻豆国产欧美一区二区三区| 国产精品女同一区二区三区| 欧美日韩黄色一区二区| 丁香五精品蜜臀久久久久99网站 | 26uuu另类欧美亚洲曰本| 成人av网在线| 日本不卡在线视频| 专区另类欧美日韩| 日韩免费高清视频| 色综合中文字幕国产| 免费看欧美女人艹b| 国产精品丝袜久久久久久app| 欧美日韩一区中文字幕| 成人黄色软件下载| 日本成人在线一区| 亚洲天堂成人在线观看| 精品国产乱码久久久久久图片 | 成人一区二区在线观看| 日韩一区精品字幕| 亚洲一区二区视频| 国产精品成人网| 久久久久久久久岛国免费| 91精品欧美久久久久久动漫| 91久久人澡人人添人人爽欧美| 国产成人久久精品77777最新版本| 亚洲第一av色| 一区二区三区四区蜜桃| 国产精品久久久久久久久图文区| 日韩一区二区三区免费看| 欧美日精品一区视频| 色综合久久久久| 成人午夜大片免费观看| 国产乱理伦片在线观看夜一区| 日本一道高清亚洲日美韩| 午夜激情久久久| 亚洲激情校园春色| 自拍偷在线精品自拍偷无码专区| 国产人成一区二区三区影院| 2020国产精品久久精品美国| 日韩欧美成人一区二区| 日韩欧美国产精品| 日韩欧美一级二级三级| 欧美精品xxxxbbbb| 欧美军同video69gay| 欧美日韩大陆在线| 欧美二区乱c少妇| 日韩午夜在线观看视频| 91麻豆精品国产综合久久久久久| 欧美日韩在线亚洲一区蜜芽| 欧美日韩综合在线免费观看| 欧美日韩色一区| 91精品视频网| 精品对白一区国产伦| 久久久久久久久久美女| 国产三级久久久| 国产精品毛片大码女人| 最新欧美精品一区二区三区| 亚洲精品美国一| 亚洲大片免费看| 久久精品久久精品| 丁香一区二区三区| 91成人看片片| 欧美一区二区三区在线| 久久婷婷成人综合色| 国产精品超碰97尤物18| 亚洲第一福利一区| 国产在线不卡一卡二卡三卡四卡| 国产精品综合网| 91美女片黄在线| 欧美日韩第一区日日骚| 久久精品亚洲乱码伦伦中文| 最好看的中文字幕久久| 午夜精品久久久久久久99樱桃| 久久成人羞羞网站| 丁香桃色午夜亚洲一区二区三区| 色综合天天综合在线视频| 欧美一区二区三区免费观看视频 | 免费看欧美女人艹b| 成人爱爱电影网址| 欧美美女激情18p| 中文字幕乱码久久午夜不卡 | 91麻豆精品国产91久久久久久 | 秋霞av亚洲一区二区三| 国产白丝网站精品污在线入口| 欧美综合一区二区三区| 26uuu亚洲综合色|