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

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

?? rwiso.c

?? s3c2440的usb驅動代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
	case USB_RESERVED_DESCRIPTOR_TYPE:
		return "USB_RESERVED_DESCRIPTOR_TYPE";

	case USB_CONFIG_POWER_DESCRIPTOR_TYPE:
		return "USB_CONFIG_POWER_DESCRIPTOR_TYPE";

	case USB_INTERFACE_POWER_DESCRIPTOR_TYPE:
		return "USB_INTERFACE_POWER_DESCRIPTOR_TYPE";
#endif // for current nt5ddk version of USB100.h
		
	default:
		return "??? UNKNOWN!!";	
	}
}


char
*usbEndPointTypeString(UCHAR bmAttributes)
/*++
Routine Description:

    Called to get ascii string of endpt descriptor type

Arguments:

	PUSB_ENDPOINT_DESCRIPTOR->bmAttributes

Return Value:

    ptr to string

--*/
{
	UINT typ = bmAttributes & USB_ENDPOINT_TYPE_MASK;


	switch( typ) {
	case USB_ENDPOINT_TYPE_INTERRUPT:
		return "USB_ENDPOINT_TYPE_INTERRUPT";

	case USB_ENDPOINT_TYPE_BULK:
		return "USB_ENDPOINT_TYPE_BULK";	

	case USB_ENDPOINT_TYPE_ISOCHRONOUS:
		return "USB_ENDPOINT_TYPE_ISOCHRONOUS";	
		
	case USB_ENDPOINT_TYPE_CONTROL:
		return "USB_ENDPOINT_TYPE_CONTROL";	
		
	default:
		return "??? UNKNOWN!!";	
	}
}


char
*usbConfigAttributesString(UCHAR bmAttributes)
/*++
Routine Description:

    Called to get ascii string of USB_CONFIGURATION_DESCRIPTOR attributes

Arguments:

	PUSB_CONFIGURATION_DESCRIPTOR->bmAttributes

Return Value:

    ptr to string

--*/
{
	UINT typ = bmAttributes & USB_CONFIG_POWERED_MASK;


	switch( typ) {

	case USB_CONFIG_BUS_POWERED:
		return "USB_CONFIG_BUS_POWERED";

	case USB_CONFIG_SELF_POWERED:
		return "USB_CONFIG_SELF_POWERED";
		
	case USB_CONFIG_REMOTE_WAKEUP:
		return "USB_CONFIG_REMOTE_WAKEUP";

		
	default:
		return "??? UNKNOWN!!";	
	}
}


void
print_USB_CONFIGURATION_DESCRIPTOR(PUSB_CONFIGURATION_DESCRIPTOR cd)
/*++
Routine Description:

    Called to do formatted ascii dump to console of a USB config descriptor

Arguments:

    ptr to USB configuration descriptor

Return Value:

    none

--*/
{
    printf("\n===================\nUSB_CONFIGURATION_DESCRIPTOR\n");

    printf(
    "bLength = 0x%x, decimal %d\n", cd->bLength, cd->bLength
    );

    printf(
    "bDescriptorType = 0x%x ( %s )\n", cd->bDescriptorType, usbDescriptorTypeString( cd->bDescriptorType )
    );

    printf(
    "wTotalLength = 0x%x, decimal %d\n", cd->wTotalLength, cd->wTotalLength
    );

    printf(
    "bNumInterfaces = 0x%x, decimal %d\n", cd->bNumInterfaces, cd->bNumInterfaces
    );

    printf(
    "bConfigurationValue = 0x%x, decimal %d\n", cd->bConfigurationValue, cd->bConfigurationValue
    );

    printf(
    "iConfiguration = 0x%x, decimal %d\n", cd->iConfiguration, cd->iConfiguration
    );

    printf(
    "bmAttributes = 0x%x ( %s )\n", cd->bmAttributes, usbConfigAttributesString( cd->bmAttributes )
    );

    printf(
    "MaxPower = 0x%x, decimal %d\n", cd->MaxPower, cd->MaxPower
    );
}


void
print_USB_INTERFACE_DESCRIPTOR(PUSB_INTERFACE_DESCRIPTOR id, UINT ix)
/*++
Routine Description:

    Called to do formatted ascii dump to console of a USB interface descriptor

Arguments:

    ptr to USB interface descriptor

Return Value:

    none

--*/
{
    printf("\n-----------------------------\nUSB_INTERFACE_DESCRIPTOR #%d\n", ix);


    printf(
    "bLength = 0x%x\n", id->bLength
    );


    printf(
    "bDescriptorType = 0x%x ( %s )\n", id->bDescriptorType, usbDescriptorTypeString( id->bDescriptorType )
    );


    printf(
    "bInterfaceNumber = 0x%x\n", id->bInterfaceNumber
    );
    printf(
    "bAlternateSetting = 0x%x\n", id->bAlternateSetting
    );
    printf(
    "bNumEndpoints = 0x%x\n", id->bNumEndpoints
    );
    printf(
    "bInterfaceClass = 0x%x\n", id->bInterfaceClass
    );
    printf(
    "bInterfaceSubClass = 0x%x\n", id->bInterfaceSubClass
    );
    printf(
    "bInterfaceProtocol = 0x%x\n", id->bInterfaceProtocol
    );
    printf(
    "bInterface = 0x%x\n", id->iInterface
    );
}


void
print_USB_ENDPOINT_DESCRIPTOR(PUSB_ENDPOINT_DESCRIPTOR ed, int i)
/*++
Routine Description:

    Called to do formatted ascii dump to console of a USB endpoint descriptor

Arguments:

    ptr to USB endpoint descriptor,
	index of this endpt in interface desc

Return Value:

    none

--*/
{
    printf(
	"------------------------------\nUSB_ENDPOINT_DESCRIPTOR for Pipe%02d\n", i
	);

    printf(
    "bLength = 0x%x\n", ed->bLength
    );

    printf(
    "bDescriptorType = 0x%x ( %s )\n", ed->bDescriptorType, usbDescriptorTypeString( ed->bDescriptorType )
    );


	if ( USB_ENDPOINT_DIRECTION_IN( ed->bEndpointAddress ) ) {
		printf(
		"bEndpointAddress= 0x%x ( INPUT )\n", ed->bEndpointAddress
		);
	} else {
		printf(
		"bEndpointAddress= 0x%x ( OUTPUT )\n", ed->bEndpointAddress
		);
	}

    printf(
    "bmAttributes= 0x%x ( %s )\n", ed->bmAttributes, usbEndPointTypeString ( ed->bmAttributes )
    );


    printf(
    "wMaxPacketSize= 0x%x, decimal %d\n", ed->wMaxPacketSize, ed->wMaxPacketSize
    );
    printf(
    "bInterval = 0x%x, decimal %d\n", ed->bInterval, ed->bInterval
    );
}

void
rw_dev( HANDLE hDEV )
/*++
Routine Description:

    Called to do formatted ascii dump to console of  USB
    configuration, interface, and endpoint descriptors
    (Cmdline "rwiso -u" )

Arguments:

    handle to device

Return Value:

    none

--*/
{
	ULONG success;
	int siz, nBytes;
	char buf[256];
    PUSB_CONFIGURATION_DESCRIPTOR cd;
    PUSB_INTERFACE_DESCRIPTOR id;
    PUSB_ENDPOINT_DESCRIPTOR ed;

	siz = sizeof(buf);

	if (hDEV == INVALID_HANDLE_VALUE) {
		NOISY(("DEV not open"));
		return;
	}
	
	success = DeviceIoControl(hDEV,
			IOCTL_ISOUSB_GET_CONFIG_DESCRIPTOR,
			buf,
			siz,
			buf,
			siz,
			&nBytes,
			NULL);

	NOISY(("request complete, success = %d nBytes = %d\n", success, nBytes));
	
	if (success) {
        ULONG i;
		UINT  j, n;
        char *pch;

        pch = buf;
		n = 0;

        cd = (PUSB_CONFIGURATION_DESCRIPTOR) pch;

        print_USB_CONFIGURATION_DESCRIPTOR( cd );

        pch += cd->bLength;

        do {

            id = (PUSB_INTERFACE_DESCRIPTOR) pch;

            print_USB_INTERFACE_DESCRIPTOR(id, n++);

            pch += id->bLength;
            for (j=0; j<id->bNumEndpoints; j++) {

                ed = (PUSB_ENDPOINT_DESCRIPTOR) pch;

                print_USB_ENDPOINT_DESCRIPTOR(ed,j);

                pch += ed->bLength;
            }
            i = (ULONG)(pch - buf);
        } while (i<cd->wTotalLength);

	}
	
	return;

}


int  dumpUsbConfig()
/*++
Routine Description:

    Called to do formatted ascii dump to console of  USB
    configuration, interface, and endpoint descriptors
    (Cmdline "rwiso -u" )

Arguments:

    none

Return Value:

    none

--*/
{

	HANDLE hDEV = open_dev();

	if ( hDEV )
	{
		rw_dev( hDEV );
		CloseHandle(hDEV);
	}

	return 0;
}
//  End, routines for USB configuration and pipe info dump  (Cmdline "rwiso -u" )

// Begin, routines for Iso Streaming



void
IsoStream( HANDLE hDEV, BOOL fStop )
/*++
Routine Description:

    Called to start or stop an iso stream
    (Cmdline "RwIso -g" )

Arguments:

    handle to device

Return Value:

    none

--*/
{
	ULONG success;
	int nBytes;
	DWORD ioctl;
	char i;

	if ( fStop )
	{
		ioctl = IOCTL_ISOUSB_STOP_ISO_STREAM;
		
		for ( i = 0; i < sizeof( gbuf ); i ++ )
			gbuf[ i ] = 0; // init outbuf to 0's to make sure read was good

		success = DeviceIoControl(hDEV,
				ioctl,
				&gpStreamObj, //pointer to stream object initted when stream was started
				sizeof( PVOID),
				gbuf, // output buffer gets back from kernel mode
				sizeof(gbuf),
				&nBytes,
				NULL);

		NOISY(("DeviceIoControl STOP_ISO_STREAM complete, success = %d\n", success));
	}
	else
	{
		ioctl = IOCTL_ISOUSB_START_ISO_STREAM;
		//input is our 256-byte buffer, binary char 0-255
		for ( i = 0; i < sizeof( gbuf ); i ++ )
			gbuf[ i ] = i;

		success = DeviceIoControl(hDEV,
				ioctl,
				gbuf,
				sizeof(gbuf),
				&gpStreamObj, // will receive pointer to stream object
				sizeof( PVOID),
				&nBytes,
				NULL);

		NOISY(("DeviceIoControl START_ISO_STREAM complete, success = %d\n", success));
	}



	if (hDEV == INVALID_HANDLE_VALUE) {
		NOISY(("DEV not open"));
		return;
	}
	

	

}

void StartIsoStream( void )
{
	if ( !ghStreamDev ) {

		ghStreamDev = open_dev();

		if ( ghStreamDev != INVALID_HANDLE_VALUE ) {
			IsoStream(  ghStreamDev , FALSE );

			Sleep( gMS );

			StopIsoStream();
		}
	}
}

void StopIsoStream( void )
{
	if ( ghStreamDev ) {
		IsoStream(  ghStreamDev , TRUE );
		ghStreamDev = NULL;
	}
}

// End, routines for Iso Streaming

int _cdecl main(
    int argc,
	char *argv[])
/*++
Routine Description:

    Entry point to RwIso.exe
    Parses cmdline, performs user-requested tests

Arguments:

    argc, argv  standard console  'c' app arguments

Return Value:

    Zero

--*/

{
    char *pinBuf = NULL, *poutBuf = NULL;
    ULONG nBytesRead, nBytesWrite, nBytes;
	ULONG i, j;
    int ok;
    ULONG success;
    HANDLE hRead = INVALID_HANDLE_VALUE, hWrite = INVALID_HANDLE_VALUE;
	char buf[1024];
	clock_t	start, finish;
	ULONG totalBytes = 0L;
	double seconds;
	ULONG fail = 0L;

    parse(argc, argv );

	// dump USB configuation and pipe info
	if( fDumpUsbConfig ) {
		dumpUsbConfig();
	}


	// doing a read, write, or both test
	if ((fRead) || (fWrite)) {

	    if (fRead) {
            //
            // open the output file
            //
			if ( fDumpReadData ) { // round size to sizeof ULONG for readable dumping
				while( ReadLen % sizeof( ULONG ) )
						ReadLen++;
			}

            hRead = open_file( inPipe);
	
	        pinBuf = malloc(ReadLen);

	    }

	    if (fWrite) {

			if ( fDumpReadData ) { // round size to sizeof ULONG for readable dumping
				while( WriteLen % sizeof( ULONG ) )
						WriteLen++;
			}

	        hWrite = open_file( outPipe);
	        poutBuf = malloc(WriteLen);
	    }


        for (i=0; i<IterationCount; i++) {

    	    if (fWrite && poutBuf && hWrite != INVALID_HANDLE_VALUE) {

				PULONG pOut = (PULONG) poutBuf;
				ULONG  numLongs = WriteLen / sizeof( ULONG );
                //
                // put some data in the output buffer
                //

    	        for (j=0; j<numLongs; j++) {
    	            *(pOut+j) = j;
    	        }

                //
                // send the write
                //

	            WriteFile(hWrite,
	                      poutBuf,
	                      WriteLen,
	                      &nBytesWrite,
	                      NULL);

	            printf("<%s> W (%04.4d) : request %06.6d bytes -- %06.6d bytes written\n",
	                    outPipe, i, WriteLen, nBytesWrite);
                assert(nBytesWrite == WriteLen);
	        }

	        if (fRead && pinBuf) {

	            success = ReadFile(hRead,
	                          pinBuf,
                              ReadLen,
	                          &nBytesRead,
	                          NULL);

	            printf("<%s> R (%04.4d) : request %06.6d bytes -- %06.6d bytes read\n",
	                inPipe, i, ReadLen, nBytesRead);

                if (fWrite) {

                    //
                    // validate the input buffer against what
                    // we sent to the 82930 (loopback test)
                    //

                    ok = compare_buffs(pinBuf, poutBuf,  nBytesRead);

					if( fDumpReadData ) {
						printf("Dumping read buffer\n");
						dump( pinBuf, nBytesRead );	
						printf("Dumping write buffer\n");
						dump( poutBuf, nBytesRead );

					}

                    assert(ok);

					if(ok != 1)
						fail++;

                    assert(ReadLen == WriteLen);
                    assert(nBytesRead == ReadLen);
                    assert(nBytesWrite == WriteLen);
                }
	        }
	
        }


        if (pinBuf) {
            free(pinBuf);
        }

        if (poutBuf) {
            free(poutBuf);
        }


		// close devices if needed
		if(hRead != INVALID_HANDLE_VALUE)
			CloseHandle(hRead);
		if(hWrite != INVALID_HANDLE_VALUE)
			CloseHandle(hWrite);

    }
	
	StopIsoStream(); // stop iso stream if we started one

	return 0;
}


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲免费观看在线视频| 日韩一区二区三区在线| 国产激情视频一区二区三区欧美| 裸体歌舞表演一区二区| 成人午夜激情在线| 91麻豆免费看| 久久久精品tv| 亚洲色图制服诱惑 | 在线不卡免费欧美| 7777精品伊人久久久大香线蕉 | 欧美不卡一区二区三区四区| 国产人久久人人人人爽| 国产精品另类一区| 日本视频在线一区| 欧美最猛性xxxxx直播| 亚洲国产wwwccc36天堂| 精品一区二区久久久| 色哟哟精品一区| 国产精品久久久久久久蜜臀| 久久99九九99精品| 91精品国产一区二区三区香蕉| 最近日韩中文字幕| 91色乱码一区二区三区| 国产精品国产精品国产专区不蜜| 国模娜娜一区二区三区| 欧美草草影院在线视频| 蜜臀91精品一区二区三区 | 91麻豆国产香蕉久久精品| 亚洲精品一区二区三区蜜桃下载| 日韩av午夜在线观看| 欧美另类高清zo欧美| 亚洲国产成人91porn| 91精品国产综合久久婷婷香蕉| 亚洲国产精品久久人人爱| 欧美日韩国产另类不卡| 夜夜嗨av一区二区三区| 欧美性猛片aaaaaaa做受| 亚洲成人www| 久久色中文字幕| 在线免费观看成人短视频| 亚洲成人资源网| 久久久久久久综合色一本| 在线视频国内一区二区| 视频一区二区三区入口| 日韩一级二级三级精品视频| 成人午夜视频在线观看| 亚洲一区二区不卡免费| 日韩一级黄色大片| 91极品视觉盛宴| 成人av网站免费| 日韩精品乱码免费| 1024精品合集| 久久精品免视看| 911国产精品| 成人动漫av在线| 精品在线免费视频| 亚欧色一区w666天堂| 国产精品久久看| 国产偷国产偷精品高清尤物| 91精品在线一区二区| 欧美日韩国产一区二区三区地区| 99精品视频在线免费观看| 国产精品影音先锋| 蜜桃视频免费观看一区| 亚洲国产综合视频在线观看| 亚洲日本在线天堂| 亚洲激情图片qvod| 亚洲制服欧美中文字幕中文字幕| 日韩一区欧美一区| 中文字幕一区在线| 国产精品不卡一区二区三区| 中文字幕不卡在线播放| 久久精品免费在线观看| 国产三级久久久| 亚洲欧洲精品一区二区三区 | 欧美精品在线一区二区三区| 欧美系列日韩一区| 日韩视频一区二区三区| 精品国产123| 日本在线观看不卡视频| 国产一区二区主播在线| 色综合久久久久久久久久久| 欧美日韩一区二区三区在线看 | 欧美日韩中文字幕精品| 精品少妇一区二区三区在线播放 | 麻豆一区二区99久久久久| 精品无人码麻豆乱码1区2区 | 国产欧美日韩精品一区| 中文字幕在线一区二区三区| 日韩电影在线免费观看| 99久久婷婷国产综合精品| 欧美一级片在线观看| 一区二区三区在线免费视频| 国产在线国偷精品免费看| 欧美日韩精品一区二区天天拍小说 | 国产福利91精品| 欧美亚洲动漫精品| 最新不卡av在线| 99视频精品在线| 综合久久国产九一剧情麻豆| 国产成人免费在线| 欧美一区二区视频在线观看2022| 亚洲毛片av在线| 91福利小视频| 丝袜亚洲另类欧美| 一区二区三区免费| 日产精品久久久久久久性色 | 亚洲电影中文字幕在线观看| 色综合中文综合网| 不卡影院免费观看| 中文字幕欧美日韩一区| 成人免费视频播放| 久久精品人人做人人综合| 国产在线视频不卡二| 久久久久9999亚洲精品| eeuss国产一区二区三区| 中文字幕亚洲精品在线观看| 97国产一区二区| 偷拍亚洲欧洲综合| 日韩免费成人网| 国产精品主播直播| 一区二区三区.www| 欧美成人vps| 欧美日韩中文字幕一区二区| 洋洋av久久久久久久一区| 欧美午夜不卡在线观看免费| 日韩av成人高清| 国产精品高潮久久久久无| av毛片久久久久**hd| 日日欢夜夜爽一区| 中文字幕一区二区三区在线不卡 | 精品久久人人做人人爰| 国产综合久久久久久鬼色| 亚洲日本在线视频观看| 久久奇米777| 欧美一区二区三区视频在线| 色偷偷成人一区二区三区91| 国产一区二区精品久久99| 亚洲国产视频一区二区| 国产精品视频一区二区三区不卡| 在线观看日韩av先锋影音电影院| 国产精品123区| 国产一区二区三区四区五区入口| 日本伊人色综合网| 亚洲乱码一区二区三区在线观看| 久久亚区不卡日本| 综合久久综合久久| 亚洲欧美日韩在线播放| 一区二区三区在线免费视频| 中文字幕视频一区二区三区久| 国产精品久久久一区麻豆最新章节| 久久久久久久久久久久电影| 国产午夜精品一区二区三区视频 | 91亚洲永久精品| 91蜜桃网址入口| 欧美日韩成人综合在线一区二区| 精品视频一区三区九区| 欧美日本在线播放| 精品国产成人系列| 中文字幕一区二区三区在线播放 | 美女高潮久久久| 国产成人精品免费| 成人在线视频一区二区| 在线精品国精品国产尤物884a| 欧美日韩国产影片| 国产精品毛片久久久久久久| 亚洲成人777| jizzjizzjizz欧美| 欧美一级二级三级蜜桃| 综合在线观看色| 激情图片小说一区| 欧美日韩久久一区| 一区二区三区国产| 99精品一区二区三区| 久久久国产精华| 日韩高清一区二区| 欧美日韩免费电影| 樱桃视频在线观看一区| 国产.欧美.日韩| 国产亚洲精品中文字幕| 日本va欧美va瓶| 欧美日韩国产大片| 天堂成人国产精品一区| 91一区二区在线观看| 亚洲乱码国产乱码精品精可以看 | 国产成人小视频| 久久噜噜亚洲综合| 国产精品综合一区二区| 国产午夜精品久久久久久久| 国产91精品精华液一区二区三区| 国产婷婷色一区二区三区| 国产一区二区三区日韩 | 亚洲成av人片在线观看| 欧美日韩免费一区二区三区 | 欧美精品一区二区三区高清aⅴ | 亚洲国产视频在线| 日韩亚洲欧美一区| 97精品超碰一区二区三区| 亚洲第一综合色| 久久综合中文字幕|