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

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

?? d12.c

?? PHILIPS USB芯片 D12 的通用驅動,VC++ 平臺
?? 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一区二区三区免费野_久草精品视频
精品日韩成人av| 色天使久久综合网天天| 日本一二三不卡| 久久精品理论片| 欧美成人精品福利| 紧缚奴在线一区二区三区| 日韩欧美在线影院| 国产乱子伦视频一区二区三区| 欧美不卡一区二区三区| 韩国理伦片一区二区三区在线播放 | 色狠狠综合天天综合综合| 综合久久国产九一剧情麻豆| 91精品1区2区| 日韩高清国产一区在线| 精品国产一区二区三区久久影院 | 成人一区在线看| ...xxx性欧美| 欧美一区二区视频网站| 国产一区二区福利| 国产精品久久久久aaaa| 色综合久久久久久久久久久| 丝袜美腿一区二区三区| www久久久久| 97久久精品人人做人人爽| 午夜精品福利一区二区三区蜜桃| 日韩视频免费观看高清完整版在线观看 | 国产一区二区免费视频| 国产精品素人视频| 精品视频在线视频| 日本精品一区二区三区高清| 日本大胆欧美人术艺术动态| 国产日本欧洲亚洲| 在线观看免费成人| 国产一区二区导航在线播放| 亚洲人成网站在线| 精品国产91乱码一区二区三区| 99国产精品久久久久久久久久 | 国产乱人伦精品一区二区在线观看| 国产精品视频在线看| 欧美色男人天堂| 国产69精品久久久久毛片| 一区二区国产视频| 国产午夜精品一区二区三区嫩草| 在线日韩国产精品| 精品一区二区三区免费观看| 亚洲欧美日韩在线播放| 久久综合色天天久久综合图片| 色婷婷精品大视频在线蜜桃视频| 久久99精品视频| 夜夜操天天操亚洲| 日本一区二区三级电影在线观看 | 午夜精品久久久久久不卡8050| 久久久久久久综合色一本| 欧美日韩电影在线播放| 成人av网站免费观看| 精品夜夜嗨av一区二区三区| 亚洲一区在线免费观看| 国产精品久久看| 久久久精品欧美丰满| 91精品国产综合久久精品麻豆| 99re热视频这里只精品 | 成人久久18免费网站麻豆| 蜜臀av在线播放一区二区三区| 亚洲一区视频在线| 亚洲欧美一区二区久久| 国产精品午夜久久| 久久久久久久久久久久久夜| 91精品国产综合久久福利软件| 欧美又粗又大又爽| 日本韩国精品在线| 色久优优欧美色久优优| 91免费版在线| 91成人在线精品| 色婷婷亚洲一区二区三区| 91影院在线免费观看| 91丨porny丨首页| 91免费精品国自产拍在线不卡| 成人午夜精品一区二区三区| 国产激情精品久久久第一区二区| 国产在线精品一区在线观看麻豆| 久久激情综合网| 国产一区二区三区免费看 | 国产丝袜在线精品| 中文字幕精品一区二区三区精品| 久久先锋影音av鲁色资源| 精品国偷自产国产一区| 久久品道一品道久久精品| 国产亚洲综合色| 性做久久久久久久久| 日韩va亚洲va欧美va久久| 午夜精品影院在线观看| 免费观看日韩av| 国产一区999| 99视频一区二区三区| 色呦呦国产精品| 欧美绝品在线观看成人午夜影视| 欧美电影影音先锋| 欧美成人vps| 国产欧美精品一区二区色综合| 中文字幕在线视频一区| 亚洲激情一二三区| 日本亚洲欧美天堂免费| 国产一区二区三区免费播放| 成人动漫视频在线| 欧美日韩一区二区在线观看视频| 欧美一区二区在线免费播放| 精品国产一区二区三区久久久蜜月 | 成人网页在线观看| 91久久奴性调教| 日韩欧美色综合| 国产精品理论片在线观看| 亚洲另类在线制服丝袜| 日韩国产在线一| 国产乱理伦片在线观看夜一区| 成人高清av在线| 91精品综合久久久久久| 久久精品综合网| 夜夜嗨av一区二区三区中文字幕| 久久精品国产第一区二区三区| 波多野结衣亚洲| 欧美精品久久天天躁| 精品国产乱码久久久久久影片| 亚洲人成精品久久久久| 九九视频精品免费| 欧美午夜电影一区| 欧美国产精品专区| 日本人妖一区二区| 91麻豆产精品久久久久久| 欧美一区二区私人影院日本| 国产精品久久午夜| 麻豆国产精品视频| 欧美中文字幕一区二区三区| 久久精品视频在线免费观看 | 日韩精品一区二区三区在线 | 成人动漫一区二区三区| 欧美精品xxxxbbbb| 国产精品国产三级国产专播品爱网| 日本亚洲视频在线| 在线精品视频免费播放| 久久久久国产精品免费免费搜索 | 丝袜美腿亚洲一区二区图片| 大白屁股一区二区视频| 精品欧美乱码久久久久久1区2区| 亚洲精品免费视频| av电影在线观看完整版一区二区| 日韩欧美激情四射| 亚洲午夜影视影院在线观看| 国产成人8x视频一区二区| 欧美大片在线观看一区| 日日摸夜夜添夜夜添精品视频| 91免费看片在线观看| 国产精品你懂的| 懂色av一区二区在线播放| 欧美白人最猛性xxxxx69交| 日韩经典一区二区| 欧美日韩视频在线第一区 | 亚洲18女电影在线观看| 91网站最新网址| 国产精品视频一二三| 国产精品一区2区| 久久久亚洲午夜电影| 精品一区二区精品| 91精品国产欧美日韩| 婷婷久久综合九色综合伊人色| 欧美在线免费观看亚洲| 一区二区成人在线| 色噜噜狠狠色综合欧洲selulu| 亚洲色图在线视频| 色偷偷久久人人79超碰人人澡 | 亚洲另类在线一区| 欧美在线免费视屏| 五月开心婷婷久久| 91精品久久久久久久99蜜桃| 日韩成人精品在线观看| 7777精品伊人久久久大香线蕉| 亚洲成人av中文| 在线播放91灌醉迷j高跟美女| 亚洲va欧美va人人爽午夜| 欧美另类z0zxhd电影| 日本人妖一区二区| 26uuu精品一区二区在线观看| 国产精品一区专区| 中文字幕欧美三区| 色香蕉成人二区免费| 亚洲国产美国国产综合一区二区| 欧美日韩视频一区二区| 欧美aaa在线| 国产欧美日韩不卡| 91在线国产福利| 亚洲1区2区3区4区| 日韩欧美国产一区二区在线播放| 久久99精品久久久久久国产越南 | 国产91在线观看丝袜| ...av二区三区久久精品| 在线影院国内精品| 丝瓜av网站精品一区二区| 欧美videos中文字幕| 成人午夜视频网站| 亚洲第一会所有码转帖| 精品国产成人系列|