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

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

?? rwusb.c

?? HomePNA的Usb網(wǎng)卡驅(qū)動
?? C
?? 第 1 頁 / 共 5 頁
字號:
            {

                pRecBuf->dataLen = (UINT)pIrp->IoStatus.Information;

                //
                // We don't need to synchronously wait here
                // for the packet to be processed and sent to the protocol
                //
             #if 1 // BUGBUG?  EXPERIMENT
                 if ( FALSE == ScheduleWorkItem(device,ProcessDataCallBack,pRecBuf,sizeof(RCV_BUFFER)))
				 {
                     status = STATUS_INSUFFICIENT_RESOURCES;

				 }
        

             #else
                  device->pCurrentRcvBuf = pRecBuf; // do it in polling loop (at PASSIVE_LEVEL)
                  //    ProcessData(
                  //                device,
                  //                pRecBuf
                  //                );

             #endif

            }

            break; // STATUS_SUCCESS

        case STATUS_TIMEOUT:
            device->NumDataErrors++;
            DEBUGMSG(DBG_FUNC, (" UsbIoCompleteRead STATUS_TIMEOUT\n"));
            break;

        case STATUS_PENDING:
            DEBUGMSG(DBG_FUNC, (" UsbIoCompleteRead STATUS_PENDING\n"));
            break;

        case STATUS_DEVICE_DATA_ERROR:
        // can get during shutdown
            device->NumDataErrors++;
            DEBUGMSG(DBG_FUNC, (" UsbIoCompleteRead STATUS_DEVICE_DATA_ERROR\n"));
            break;

        case STATUS_UNSUCCESSFUL:
            device->NumDataErrors++;
            DEBUGMSG(DBG_ERR, (" UsbIoCompleteRead STATUS_UNSUCCESSFUL\n"));
            break;

        case STATUS_INSUFFICIENT_RESOURCES:
            device->NumDataErrors++;
            DEBUGMSG(DBG_ERR, (" UsbIoCompleteRead STATUS_INSUFFICIENT_RESOURCES\n"));
            break;
        case STATUS_INVALID_PARAMETER:
            device->NumDataErrors++;
            DEBUGMSG(DBG_ERR, (" UsbIoCompleteRead STATUS_INVALID_PARAMETER\n"));
            break;

        case STATUS_CANCELLED:
            DEBUGMSG(DBG_FUNC, (" UsbIoCompleteRead STATUS_CANCELLED\n"));
            break;

        case STATUS_DEVICE_NOT_CONNECTED:
        // can get during shutdown
            device->NumDataErrors++;
            DEBUGMSG(DBG_ERR, (" UsbIoCompleteRead STATUS_DEVICE_NOT_CONNECTED\n"));
            break;

        case STATUS_DEVICE_POWER_FAILURE:
        // can get during shutdown
            device->NumDataErrors++;
            DEBUGMSG(DBG_ERR, (" UsbIoCompleteRead STATUS_DEVICE_POWER_FAILURE\n"));
            break;

        default:
            device->NumDataErrors++;
            DEBUGMSG(DBG_ERR, (" UsbIoCompleteRead UNKNOWN WEIRD STATUS = 0x%x, dec %d\n",status,status ));

            break;
    }


    // if we were not successful, we need to free the recv buffer for future use right here
    if ( STATUS_SUCCESS != status ) {

        pRecBuf->state = STATE_FREE;
    }

    //
    // Free the IRP  and its mdl because they were  alloced by us
    //

    IoFreeIrp( pIrp );

    pRecBuf->Irp = NULL;

    device->NumReads++;


    UsbDecIoCount( device ); // we will track count of pending irps


    if (( STATUS_SUCCESS != status )  && ( STATUS_CANCELLED != status )) {

        PURB urb = (PURB) pRecBuf->Urb;

        DEBUGMSG(DBG_ERR, (" UsbIoCompleteRead error, will schedule a clear stall via URB_FUNCTION_RESET_PIPE\n"));

        DEBUGMSG(DBG_ERR, (" USBD status = 0x%x\n", urb->UrbHeader.Status));

        DEBUGMSG(DBG_ERR, (" NT status = 0x%x\n",  status));

    
        //read nothing ,reset pipe
        InterlockedExchange( &device->fPendingReadClearStall, TRUE );

        ScheduleWorkItem( device,
          ResetPipeCallback, device->BulkInPipeHandle, 0);
    }


    KeSetEvent(&pRecBuf->Event, 0, FALSE);  //signal polling thread

    //
    // We return STATUS_MORE_PROCESSING_REQUIRED so that the completion
    // routine (IofCompleteRequest) will stop working on the irp.
    //

    status = STATUS_MORE_PROCESSING_REQUIRED;

    DEBUGMSG(DBG_FUNC, ("-UsbIoCompleteRead\n"));

    return status;
}

VOID
ProcessDataCallBack( PUSB_WORK_ITEM pWorkItem )
{
    PUSB_DEVICE device;
    PRCV_BUFFER pRecBuf;

    device = (PUSB_DEVICE) pWorkItem->pDevice;
    pRecBuf = ( PRCV_BUFFER ) pWorkItem->InfoBuf;

    ProcessData(
                device,
                pRecBuf
                );

    FreeWorkItem( pWorkItem );

}


NTSTATUS
ConfigureDevice(
    IN  PUSB_DEVICE DeviceExt
    )
/*++

Routine Description:

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


Return Value:

    NT status code

--*/
{
    PUSB_DEVICE device;
    NTSTATUS ntStatus = STATUS_SUCCESS;
    PURB urb;
    ULONG siz;

    DEBUGMSG(DBG_FUNC,(" +ConfigureDevice()\n"));

    device = DeviceExt;

    ASSERT( ((PUSB_INFO) device->pUsbInfo)->UsbConfigurationDescriptor == NULL );


    urb = (PURB)  &((PUSB_INFO) device->pUsbInfo)->DescriptorUrb;

    // When USB_CONFIGURATION_DESCRIPTOR_TYPE is specified for DescriptorType
    // in a call to UsbBuildGetDescriptorRequest(),
    // all interface, endpoint, class-specific, and vendor-specific descriptors
    // for the configuration also are retrieved.
    // The caller must allocate a buffer large enough to hold all of this
    // information or the data is truncated without error.
    // Therefore the 'siz' set below is just a 'good guess', and we may have to retry

    siz = sizeof(USB_CONFIGURATION_DESCRIPTOR) + 40;  // Store size, may need to free

    // We will break out of this 'retry loop' when UsbBuildGetDescriptorRequest()
    // has a big enough device->UsbConfigurationDescriptor buffer not to truncate
    while( 1 ) 
	{
        ((PUSB_INFO) device->pUsbInfo)->UsbConfigurationDescriptor = MemAlloc( siz);
       
        if ( !((PUSB_INFO) device->pUsbInfo)->UsbConfigurationDescriptor ) 
		{
            MemFree(urb, sizeof(struct _URB_CONTROL_DESCRIPTOR_REQUEST));
            return STATUS_INSUFFICIENT_RESOURCES;
        }

        UsbBuildGetDescriptorRequest(urb,
                                     (USHORT) sizeof (struct _URB_CONTROL_DESCRIPTOR_REQUEST),
                                     USB_CONFIGURATION_DESCRIPTOR_TYPE,
                                     0,
                                     0,
                                     ((PUSB_INFO) device->pUsbInfo)->UsbConfigurationDescriptor,
                                     NULL,
                                     siz,
                                     NULL);

        ntStatus = CallUSBD(DeviceExt, urb); //Get Usb Config Descriptor; done in main thread

        DEBUGMSG(DBG_OUT,(" ConfigureDevice() Configuration Descriptor = %x, len %x\n",
                        ((PUSB_INFO) device->pUsbInfo)->UsbConfigurationDescriptor,
                        urb->UrbControlDescriptorRequest.TransferBufferLength));
        //
        // if we got some data see if it was enough.
        // NOTE: we may get an error in URB because of buffer overrun
        if (urb->UrbControlDescriptorRequest.TransferBufferLength>0 &&
                ((PUSB_INFO) device->pUsbInfo)->UsbConfigurationDescriptor->wTotalLength > siz) 
		{
            MemFree(((PUSB_INFO) device->pUsbInfo)->UsbConfigurationDescriptor, siz);
            siz = ((PUSB_INFO) device->pUsbInfo)->UsbConfigurationDescriptor->wTotalLength;
            ((PUSB_INFO) device->pUsbInfo)->UsbConfigurationDescriptor = NULL;
        }
		else
		{
            break;  // we got it on the first try
        }

    } // end, while (retry loop )


    ASSERT( ((PUSB_INFO) device->pUsbInfo)->UsbConfigurationDescriptor );


    if (!NT_SUCCESS(ntStatus)) {

        DEBUGMSG( DBG_ERR,(" ConfigureDevice() Get Config Descriptor FAILURE (%x)\n", ntStatus));
        goto done;
    }

    //
    // 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 = SelectInterface(DeviceExt,
               ((PUSB_INFO) device->pUsbInfo)->UsbConfigurationDescriptor
			   );


    if (!NT_SUCCESS(ntStatus)) 
	{
        DEBUGMSG( DBG_ERR,(" ConfigureDevice() SelectInterface() FAILURE (%x)\n", ntStatus));
    }
	/*else
	{
        //
        // Next we must get the Class-Specific Descriptor
        // Get the USB dongle's Class-Specific descriptor; this has many
        // characterisitics we must tell Ndis about, such as supported speeds,
        // BOFS required, rate sniff-supported flag, turnaround time, window size,
        // data size.
        //
        ntStatus = GetClassDescriptor( device, &(device->ClassDesc));
        if (NT_SUCCESS(ntStatus)) 
		{
            // fill out device from class-specific descriptor info
        }
    }*/

done:

    DEBUGMSG(DBG_FUNC,(" -ConfigureDevice (%x)\n", ntStatus));

    return ntStatus;
}


NTSTATUS
SelectInterface(
    IN PUSB_DEVICE DeviceExt,
    IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor
    )
/*++

Routine Description:

    Initializes an 8511 with (only) one interfaces;
    This minidriver only supports one interface (with two bulk and one interrupt endpoints).

Arguments:

    DeviceExt - pointer to the device ext for this instance of the 82930
                    device.

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

Return Value:

    NT status code

--*/
{
    PUSB_DEVICE device;
    NTSTATUS ntStatus;
    PURB selurb = NULL;
    ULONG i;
    PUSB_INTERFACE_DESCRIPTOR interfaceDescriptor = NULL;
	PUSBD_INTERFACE_INFORMATION Interface = NULL;
    //USHORT siz;

    DEBUGMSG(DBG_FUNC,(" +SelectInterface\n"));

    device = DeviceExt;
    //
    // USB driver only supports one interface, we must parse
    // the configuration descriptor for the interface
    // and remember the pipes.
    //
    // USBD_ParseConfigurationDescriptorEx searches a given configuration
    // descriptor and returns a pointer to an interface that matches the
     //  given search criteria. We only support one interface on this device
     //
     interfaceDescriptor =
            USBD_ParseConfigurationDescriptorEx(ConfigurationDescriptor,
                                  ConfigurationDescriptor, //search from start of config  descriptro
                                  -1,    // interface number not a criteria; we only support one interface
                                  -1,   // not interested in alternate setting here either
                                  -1,   // interface class not a criteria
                                  -1,   // interface subclass not a criteria
                                  -1    // interface protocol not a criteria
                                  );

        if ( !interfaceDescriptor) 
		{
            DEBUGMSG(DBG_ERR,("SelectInterface() ParseConfigurationDescriptorEx() failed\n  returning STATUS_INSUFFICIENT_RESOURCES\n"));
            return STATUS_INSUFFICIENT_RESOURCES;
        } 
		
    if ( interfaceDescriptor )
	{
		USBD_INTERFACE_LIST_ENTRY interfaces[2] = {
		{interfaceDescriptor,NULL},
		{NULL, NULL},		// fence to terminate the array
		};

 		selurb = USBD_CreateConfigurationRequestEx(ConfigurationDescriptor, interfaces);
        if(!selurb)
		{
		    DEBUGMSG(DBG_ERR,("SelectInterface()::USBD_CreateConfigurationRequest() failed\n  returning STATUS_INSUFFICIENT_RESOURCES\n"));
			// don't call the MemFree since the buffer was
            //  alloced by USBD_CreateConfigurationRequest, not MemAlloc()
            ExFreePool(selurb);
			return STATUS_INSUFFICIENT_RESOURCES;
		}	
		DEBUGMSG(DBG_OUT,(" USBD_CreateConfigurationRequest created the urb\n"));
        
		Interface = &selurb->UrbSelectConfiguration.Interface;
        
		DEBUGMSG(DBG_OUT,(" Afer USBD_CreateConfigurationRequest, before CallUBD\n"));

	/*	if (Interface)
		{
	    	for (i = 0; i < Interface->NumberOfPipes; ++i)
			{
             	if(!(Interface->Pipes[i].EndpointAddress ==(UCHAR) 0x81) && (Interface->Pipes[i].MaximumPacketSize == 64))
				{
				 DEBUGMSG(DBG_OUT,(" - Bulk in Endpoint has wrong attributes\n"));
				   return STATUS_DEVICE_CONFIGURATION_ERROR;
				}  
			 	if(!(Interface->Pipes[i].EndpointAddress ==(UCHAR) 0x02) && (Interface->Pipes[i].MaximumPacketSize == 64))
				{
				   DEBUGMSG(DBG_OUT,(" - Bulk out Endpoint has wrong attributes\n"));
				   return STATUS_DEVICE_CONFIGURATION_ERROR;
				}  
				if(!(Interface->Pipes[i].EndpointAddress ==(UCHAR) 0x83) && (Interface->Pipes[i].MaximumPacketSize == 8))
				{
				   DEBUGMSG(DBG_OUT,(" - Bulk out Endpoint has wrong attributes\n"));
				   return STATUS_DEVICE_CONFIGURATION_ERROR;
				}  
			}
		}
		else//如果If(Interface)失敗
		{
        DEBUGMSG(DBG_ERR,("SelectInterface()::Interface=&selurb->UrbSelectConfiguration.Interface failed\n  returning STATUS_INSUFFICIENT_RESOURCES\n"));
        ntStatus = STATUS_INSUFFICIENT_RESOURCES;
		}*/
        
		for (i=0; i< Interface->NumberOfPipes; i++) 
		{
            //
            // perform any pipe initialization here; mainly set max xfer size
            // But Watch out! USb may change these when you select the interface;
            // In general USB doesn;t seem to like differing max transfer sizes on the pipes
            if(Interface->Pipes[i].PipeType==UsbdPipeTypeBulk ) 
			  {
				  Interface->Pipes[i].MaximumTransferSize = MAX_PACKET_SIZE;
			  }
			  
        }
 /*  
        UsbBuildSelectConfigurationRequest(selurb,
                                          (USHORT)sizeof(selurb),
                                          ConfigurationDescriptor);*/
     
        ntStatus = CallUSBD(DeviceExt, selurb); //select config; done in main thread

        ((PUSB_INFO) device->pUsbInfo)->UsbConfigurationHandle =
            selurb->UrbSelectConfiguration.ConfigurationHandle;

    } 
	else

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产真实乱对白精彩久久| 国产精品白丝jk黑袜喷水| 91麻豆精品视频| 一区二区三区中文在线| 波多野结衣精品在线| 国产精品久久久久久久久久久免费看 | 全部av―极品视觉盛宴亚洲| 欧美三电影在线| 奇米影视7777精品一区二区| 欧美不卡一区二区三区| 欧美日韩在线播放三区四区| 蜜臀va亚洲va欧美va天堂| 精品国产一区二区三区四区四| 国产乱码精品一区二区三区av| 国产精品久久久久精k8| 欧美丰满高潮xxxx喷水动漫| 蜜桃久久久久久久| 国产精品女同一区二区三区| 欧美午夜片在线看| 国产精品中文字幕欧美| 国产精品免费视频一区| 欧美日韩极品在线观看一区| 成人黄色国产精品网站大全在线免费观看| 亚洲欧美一区二区三区久本道91| 欧美日韩精品一区二区三区四区| 久久66热偷产精品| 亚洲午夜久久久久中文字幕久| 2023国产精品自拍| 欧美日韩激情一区二区三区| 成人黄色在线视频| 精品一区二区久久| 免费在线看成人av| 亚洲第一狼人社区| 亚洲免费av在线| 亚洲精品中文在线| 亚洲欧美日韩中文播放| 国产精品久久久久7777按摩| 日韩精品一区二区三区视频| 欧美日本免费一区二区三区| 91精品福利视频| 91啪在线观看| 精品国产91洋老外米糕| 91精品综合久久久久久| 欧美日韩一区视频| 欧美日韩成人一区二区| 欧美日韩日本视频| 制服丝袜日韩国产| 欧美一区二区三区影视| 欧美喷潮久久久xxxxx| 欧美日韩国产另类不卡| 在线电影院国产精品| 欧美一级专区免费大片| 欧美大度的电影原声| 26uuu色噜噜精品一区二区| 欧美精品一区二区三区蜜桃| 中文字幕av一区二区三区免费看| 中文字幕av资源一区| 亚洲国产综合91精品麻豆| 天堂成人免费av电影一区| 国内精品在线播放| 一本在线高清不卡dvd| 91精品国产色综合久久ai换脸| 欧美sm极限捆绑bd| 亚洲久草在线视频| 国产精品一区二区x88av| 91丨九色porny丨蝌蚪| 欧美伦理电影网| 国产精品免费久久久久| 有坂深雪av一区二区精品| 久久成人18免费观看| 在线观看国产91| 国产亲近乱来精品视频 | 亚洲三级在线免费| 美女一区二区在线观看| 97久久超碰精品国产| 日韩一区二区免费在线电影| 欧美国产乱子伦 | 欧日韩精品视频| 国产欧美日韩在线视频| 午夜久久久久久久久久一区二区| 国产丶欧美丶日本不卡视频| 欧美一区二区三区在线观看视频 | 亚洲国产综合人成综合网站| 国产福利91精品一区二区三区| 欧美一区二区在线观看| 亚洲已满18点击进入久久| av在线不卡电影| 国产精品久久综合| 成人免费va视频| 久久日一线二线三线suv| 国内精品在线播放| 精品国产成人在线影院 | 国产精品国模大尺度视频| 国产一区二区在线观看免费| 7777精品伊人久久久大香线蕉超级流畅| 亚洲精品国产视频| 色婷婷狠狠综合| 夜夜嗨av一区二区三区网页| 在线观看日韩电影| 亚洲国产精品一区二区久久恐怖片| 在线观看日韩精品| 日精品一区二区| 欧美tickling网站挠脚心| 国产一区二区三区国产| 国产精品女同一区二区三区| 99久久777色| 日日夜夜精品视频天天综合网| 日韩精品专区在线影院重磅| 国产精品系列在线观看| 亚洲激情图片qvod| 日韩你懂的电影在线观看| 丰满少妇久久久久久久| 亚洲国产精品久久不卡毛片| 日韩精品一区二区三区老鸭窝| 国产一区二区三区av电影| 最新国产精品久久精品| 欧美日韩一区视频| 3d动漫精品啪啪1区2区免费 | 一区二区三区欧美| 欧美电影精品一区二区| 在线观看日韩电影| 不卡高清视频专区| 另类欧美日韩国产在线| 亚洲欧洲中文日韩久久av乱码| 日韩午夜激情电影| 欧美日韩免费视频| 成人激情视频网站| 国产一区二区三区日韩| 六月丁香婷婷色狠狠久久| 亚洲午夜一区二区三区| 亚洲欧美自拍偷拍色图| 亚洲国产中文字幕在线视频综合| 国产精品久久久久一区二区三区 | 精品在线免费观看| 婷婷久久综合九色综合伊人色| 中文字幕一区二区三| 久久人人爽爽爽人久久久| 91麻豆精品国产自产在线| 欧洲一区在线观看| 欧洲av一区二区嗯嗯嗯啊| 色琪琪一区二区三区亚洲区| 91亚洲精品久久久蜜桃网站| 粉嫩绯色av一区二区在线观看 | 丝袜国产日韩另类美女| 一区二区三区免费在线观看| 中文乱码免费一区二区| 国产欧美一区二区三区在线看蜜臀| 久久久美女毛片| 国产精品热久久久久夜色精品三区| 久久精品一区蜜桃臀影院| 国产喷白浆一区二区三区| 中文字幕不卡在线播放| 夜夜嗨av一区二区三区四季av| 亚洲一二三级电影| 日本色综合中文字幕| 高清视频一区二区| 日本韩国一区二区三区| 777亚洲妇女| 欧美精彩视频一区二区三区| 亚洲免费观看高清完整版在线 | 亚洲精选一二三| 韩国欧美国产1区| 91亚洲精品乱码久久久久久蜜桃 | 久久精品人人爽人人爽| 亚洲三级在线免费| 久久国产精品72免费观看| gogogo免费视频观看亚洲一| 欧美日精品一区视频| 国产亚洲一区二区三区四区| 亚洲一区二区在线播放相泽| 精品在线一区二区三区| 色综合欧美在线视频区| 久久久久国产精品人| 亚洲尤物视频在线| 成人久久视频在线观看| 777午夜精品视频在线播放| 国产精品美女久久久久久久网站| 天堂在线亚洲视频| 91成人看片片| 国产精品久久久久久久久快鸭| 麻豆精品一区二区三区| 欧美日韩精品电影| 亚洲综合色区另类av| 国产suv精品一区二区883| 精品国产91亚洲一区二区三区婷婷| 亚洲自拍另类综合| 91激情五月电影| 亚洲精品日日夜夜| 波多野结衣视频一区| 99久久精品国产一区| 国产目拍亚洲精品99久久精品| 91麻豆6部合集magnet| 婷婷丁香激情综合| 日韩欧美的一区二区| 国产在线不卡一区| 国产欧美一区二区在线观看| 99久久国产综合精品女不卡| 亚洲第一狼人社区| 日韩美女视频在线| 91视频xxxx|