亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
波波电影院一区二区三区| 久久人人爽人人爽| 一区二区三区四区蜜桃| 99久久精品免费看国产 | 成人精品免费网站| 国产精品久久毛片a| 色婷婷精品大在线视频| 一区二区欧美国产| 欧美一级二级三级蜜桃| 国内精品视频一区二区三区八戒| 久久青草国产手机看片福利盒子 | 久久se精品一区二区| 国产欧美一区二区精品忘忧草| 99久久婷婷国产综合精品电影| 亚洲一区二区三区视频在线| 精品日韩一区二区| av电影在线观看一区| 香蕉av福利精品导航 | 国产午夜久久久久| 97久久超碰国产精品| 婷婷六月综合网| 久久久噜噜噜久久中文字幕色伊伊| 97久久超碰国产精品| 美女视频黄a大片欧美| 国产欧美一区二区三区网站| 欧美吞精做爰啪啪高潮| 国产一区二区免费看| 亚洲精品视频在线观看网站| 日韩亚洲欧美中文三级| jiyouzz国产精品久久| 天天操天天干天天综合网| 国产欧美久久久精品影院| 欧美日高清视频| 国产·精品毛片| 丝袜美腿一区二区三区| 欧美国产一区在线| 日韩午夜精品视频| 欧洲视频一区二区| 成人午夜免费av| 蜜臀91精品一区二区三区| 国产精品麻豆视频| 日韩无一区二区| 欧美系列日韩一区| 波多野结衣中文字幕一区 | 欧美一区二区视频观看视频| 精彩视频一区二区三区| 亚洲免费色视频| 久久理论电影网| 91精品国产一区二区三区| 成人h版在线观看| 精品一区二区三区蜜桃| 爽好多水快深点欧美视频| 国产精品久久免费看| 精品乱码亚洲一区二区不卡| 欧美日韩精品福利| 色乱码一区二区三区88| 99re这里只有精品6| 国产一区二区成人久久免费影院 | 中文字幕在线不卡视频| 欧美r级电影在线观看| 欧美喷水一区二区| 一本久久综合亚洲鲁鲁五月天| 精品无码三级在线观看视频| 日日噜噜夜夜狠狠视频欧美人 | 欧美激情一区在线观看| 日韩欧美亚洲一区二区| 7777精品伊人久久久大香线蕉经典版下载 | 一本一道久久a久久精品 | 亚洲v精品v日韩v欧美v专区| 亚洲人被黑人高潮完整版| 国产精品污网站| 国产欧美一区二区精品秋霞影院| 精品国产123| 26uuu色噜噜精品一区二区| 欧美一级搡bbbb搡bbbb| 91麻豆精品国产综合久久久久久| 欧美午夜宅男影院| 欧美日韩精品福利| 欧美一级视频精品观看| 精品成人一区二区三区| 久久综合久久99| 欧美激情在线观看视频免费| 国产精品久线在线观看| 亚洲视频香蕉人妖| 亚洲自拍偷拍图区| 五月天亚洲婷婷| 蜜桃av噜噜一区二区三区小说| 青青草91视频| 国产精品影视在线| 成人免费黄色大片| 色综合天天综合色综合av| 在线亚洲+欧美+日本专区| 欧美日韩在线播放一区| 欧美一区二区性放荡片| 精品国产一区二区三区久久影院| 久久看人人爽人人| 国产精品久久福利| 亚洲观看高清完整版在线观看 | 日产国产欧美视频一区精品| 亚洲超丰满肉感bbw| 国产偷国产偷亚洲高清人白洁| 久久综合一区二区| 99久久99久久精品免费观看| 精品一区二区三区香蕉蜜桃| 精品一区二区三区在线视频| 久久精品999| 色综合久久综合中文综合网| 日韩视频一区二区在线观看| 国产清纯白嫩初高生在线观看91| 捆绑变态av一区二区三区 | 3atv一区二区三区| 免费不卡在线观看| 国产精品午夜电影| 欧美疯狂做受xxxx富婆| 国产中文字幕一区| 亚洲精品国产精华液| 欧美色电影在线| 国产精品久久久久精k8| 韩国三级中文字幕hd久久精品| 欧美日韩免费一区二区三区视频| 亚洲欧美日韩国产一区二区三区 | 午夜精品免费在线观看| 麻豆精品视频在线观看视频| 精品av久久707| 韩国精品主播一区二区在线观看| 成人精品高清在线| 亚洲成人av电影| 国产精一品亚洲二区在线视频| 成人sese在线| 欧美久久久久久久久| 国产性色一区二区| 亚洲国产人成综合网站| 国产精品一线二线三线| 9191成人精品久久| 综合在线观看色| 精品一区在线看| 欧美三级三级三级爽爽爽| 国产欧美日韩综合| 免费的国产精品| 日本黄色一区二区| 中文字幕国产一区| 精品一区二区免费| 精品视频在线看| 亚洲同性gay激情无套| 国产乱对白刺激视频不卡| 欧美一区二区三区啪啪| 亚洲一区二区黄色| 一本一道久久a久久精品综合蜜臀| 久久婷婷国产综合精品青草| 日韩国产在线一| 欧美无砖专区一中文字| 一区二区三区不卡视频| 337p日本欧洲亚洲大胆精品| 秋霞电影网一区二区| 欧美特级限制片免费在线观看| 综合自拍亚洲综合图不卡区| 成人中文字幕电影| 国产午夜精品一区二区| 久久激情综合网| 欧美一区二区三区在线看| 亚洲成人资源网| 色婷婷综合久久久久中文一区二区| 欧美国产成人在线| 岛国精品在线观看| 国产精品久久毛片av大全日韩| 国产不卡视频一区二区三区| 久久久久久久综合| 国产成人av在线影院| 国产精品欧美一级免费| 成人精品高清在线| 国产亚洲一本大道中文在线| 国产福利一区二区| 中文字幕av一区 二区| 成人h版在线观看| 亚洲免费高清视频在线| 色婷婷久久综合| 国产精品传媒在线| 欧美影视一区在线| 天堂久久久久va久久久久| 欧美一区二区精品| 国产一区二区三区蝌蚪| 欧美经典三级视频一区二区三区| 成人国产免费视频| 亚洲理论在线观看| 欧美美女喷水视频| 日本aⅴ亚洲精品中文乱码| 欧美一级精品在线| 国产精品一区二区在线看| 国产欧美综合在线| 91麻豆精品视频| 日韩va亚洲va欧美va久久| 久久久一区二区三区捆绑**| 99视频一区二区三区| 国产精品私人影院| 亚洲三级电影全部在线观看高清| www.欧美.com| 日日噜噜夜夜狠狠视频欧美人| 久久综合丝袜日本网| 色嗨嗨av一区二区三区| 九九国产精品视频|