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

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

?? rwbulk.c

?? s3c2440開發(fā)板的usb驅(qū)動程序經(jīng)過測試完全適用
?? C
?? 第 1 頁 / 共 2 頁
字號:
Arguments:

	PUSB_ENDPOINT_DESCRIPTOR->bDescriptorType or
	PUSB_DEVICE_DESCRIPTOR->bDescriptorType or
	PUSB_INTERFACE_DESCRIPTOR->bDescriptorType or
	PUSB_STRING_DESCRIPTOR->bDescriptorType or
	PUSB_POWER_DESCRIPTOR->bDescriptorType or
	PUSB_CONFIGURATION_DESCRIPTOR->bDescriptorType

Return Value:

    ptr to string

--*/{

	switch(bDescriptorType) {

	case USB_DEVICE_DESCRIPTOR_TYPE:
		return "USB_DEVICE_DESCRIPTOR_TYPE";

	case USB_CONFIGURATION_DESCRIPTOR_TYPE:
		return "USB_CONFIGURATION_DESCRIPTOR_TYPE";
		

	case USB_STRING_DESCRIPTOR_TYPE:
		return "USB_STRING_DESCRIPTOR_TYPE";
		

	case USB_INTERFACE_DESCRIPTOR_TYPE:
		return "USB_INTERFACE_DESCRIPTOR_TYPE";
		

	case USB_ENDPOINT_DESCRIPTOR_TYPE:
		return "USB_ENDPOINT_DESCRIPTOR_TYPE";
		

#ifdef USB_POWER_DESCRIPTOR_TYPE // this is the older definintion which is actually obsolete
    // workaround for temporary bug in 98ddk, older USB100.h file
	case USB_POWER_DESCRIPTOR_TYPE:
		return "USB_POWER_DESCRIPTOR_TYPE";
#endif
		
#ifdef USB_RESERVED_DESCRIPTOR_TYPE  // this is the current version of USB100.h as in NT5DDK

	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 "rwbulk -u" )

Arguments:

    handle to device

Return Value:

    none

--*/
{
	UINT 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_BULKUSB_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 "rwbulk -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 "rwbulk -u" )



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

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

Arguments:

    argc, argv  standard console  'c' app arguments

Return Value:

    Zero

--*/

{
    char *pinBuf = NULL, *poutBuf = NULL;
    int nBytesRead, nBytesWrite, nBytes;
	ULONG i, j;
    int ok;
    UINT 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);

    }		

	return 0;
}


?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
免费日本视频一区| 亚洲一区二区在线视频| 一本久久综合亚洲鲁鲁五月天| 亚洲一本大道在线| 国产精品免费视频观看| 欧美人与性动xxxx| 91国偷自产一区二区三区成为亚洲经典| 丝袜亚洲另类丝袜在线| 亚洲免费观看高清完整| 国产欧美1区2区3区| 日韩一区二区三区av| 91成人免费网站| 成人精品电影在线观看| 国产一区二区三区av电影 | 美女久久久精品| 亚洲综合丝袜美腿| 亚洲欧美日韩国产另类专区| 国产精品成人网| 亚洲电影视频在线| 日韩一区二区免费高清| 欧美日韩国产免费一区二区| 91在线观看免费视频| 99精品欧美一区二区蜜桃免费| 国产不卡高清在线观看视频| 黄色精品一二区| 国产寡妇亲子伦一区二区| 麻豆视频观看网址久久| 国产裸体歌舞团一区二区| 国产精品自拍在线| 岛国一区二区在线观看| 91亚洲精品一区二区乱码| 在线视频欧美精品| 欧美久久一二三四区| 日韩欧美一区中文| 中文字幕av资源一区| ...xxx性欧美| 亚洲国产欧美在线人成| 秋霞电影网一区二区| 成人网男人的天堂| 欧美三级一区二区| 2023国产精华国产精品| 综合av第一页| 久久se这里有精品| 色婷婷综合久久久中文一区二区| 欧美精品乱码久久久久久| 精品少妇一区二区三区| 国产精品视频一二三| 一区二区三区欧美视频| 免费观看一级特黄欧美大片| 色综合亚洲欧洲| 欧美精品一区二区精品网| 亚洲理论在线观看| 成人一区二区三区视频| 欧美成人乱码一区二区三区| 日韩美女啊v在线免费观看| 国产在线不卡一卡二卡三卡四卡| 91麻豆swag| 中文子幕无线码一区tr| 久久成人免费电影| 69堂国产成人免费视频| 中文字幕色av一区二区三区| 久久精品国产免费看久久精品| 欧美综合一区二区| 亚洲欧洲日韩av| 成人av动漫在线| 国产精品美女久久久久久久久久久| 男人的天堂亚洲一区| 欧美一二三在线| 日韩国产欧美在线播放| 欧美日韩一区二区三区视频 | 亚洲图片另类小说| 99久久精品费精品国产一区二区| 久久人人97超碰com| 91同城在线观看| 国产欧美日产一区| 成人精品一区二区三区四区| 国产三级精品视频| 99麻豆久久久国产精品免费优播| 国产精品高潮呻吟| 色综合婷婷久久| 日韩一区精品视频| 久久综合久久鬼色中文字| 春色校园综合激情亚洲| 亚洲欧美福利一区二区| 欧美色偷偷大香| 麻豆91在线播放免费| 国产精品美女久久久久久久久久久| 波多野结衣一区二区三区| 亚洲精品高清在线| 精品久久久久久最新网址| 岛国精品在线播放| 午夜精品福利一区二区蜜股av| 欧美精品一区视频| 色综合天天天天做夜夜夜夜做| 视频一区视频二区中文| 国产亚洲欧美一区在线观看| 色综合久久88色综合天天6| 三级欧美韩日大片在线看| 日韩精品一区二区三区在线观看 | 91高清在线观看| 麻豆成人av在线| 亚洲精品免费电影| 精品福利一区二区三区| 欧美性受xxxx黑人xyx| 九一久久久久久| 亚洲综合成人网| 国产欧美精品一区| 欧美xxxxxxxx| 欧美日韩一区 二区 三区 久久精品| 国产成人综合精品三级| 日韩av在线播放中文字幕| 中文字幕日本不卡| 久久伊人蜜桃av一区二区| 7777精品伊人久久久大香线蕉完整版 | 成人午夜电影网站| 国产一区二区三区久久悠悠色av| 日韩国产在线一| 亚洲国产美女搞黄色| 一区二区三区日韩欧美精品 | 中文字幕精品—区二区四季| 日韩精品在线一区| 日韩西西人体444www| 555夜色666亚洲国产免| 在线播放亚洲一区| 欧美精品第一页| 久久精品免视看| 久久精品在这里| 国产精品毛片大码女人| 欧美经典一区二区三区| 国产日韩综合av| **性色生活片久久毛片| 亚洲柠檬福利资源导航| 亚洲免费伊人电影| 亚洲三级在线观看| 亚洲国产日韩a在线播放性色| 日韩电影在线免费观看| 久久不见久久见免费视频7| 国产一区美女在线| 9人人澡人人爽人人精品| 欧美色综合网站| 久久综合久久久久88| 伊人夜夜躁av伊人久久| 免费观看91视频大全| 成人激情av网| 欧美性色黄大片| 久久综合中文字幕| 亚洲一区国产视频| 国产老肥熟一区二区三区| 色哟哟国产精品| 精品久久久久久久人人人人传媒| 国产精品久久国产精麻豆99网站 | 在线成人免费视频| 久久色在线视频| 亚洲国产综合人成综合网站| 九九视频精品免费| 精品视频一区二区不卡| 久久人人爽爽爽人久久久| 亚洲va韩国va欧美va精品 | 欧美一区二区福利视频| 中文字幕在线不卡| 国产乱码精品一区二区三区忘忧草| 欧美亚洲一区二区在线观看| 欧美激情一区二区三区在线| 七七婷婷婷婷精品国产| 在线观看日韩电影| 亚洲欧美一区二区三区孕妇| 国产在线精品视频| 日韩欧美中文字幕制服| 五月天亚洲婷婷| 欧美午夜电影网| 最近中文字幕一区二区三区| 国产99久久精品| 亚洲国产精品av| 国产91富婆露脸刺激对白| 久久网这里都是精品| 国产一区二区视频在线| 精品国产1区二区| 国产成人免费av在线| 国产午夜久久久久| 成人理论电影网| 18成人在线视频| 欧美伊人久久大香线蕉综合69| 亚欧色一区w666天堂| 国产在线一区二区综合免费视频| 色欧美乱欧美15图片| 亚洲成人一区二区在线观看| 欧美日韩亚洲综合| 日韩综合一区二区| 337p日本欧洲亚洲大胆精品| 国产精品一区二区视频| 亚洲欧洲国产日韩| 欧美日韩一区二区不卡| 久久精工是国产品牌吗| 国产免费观看久久| 色婷婷av一区二区三区大白胸 | 91一区二区三区在线观看| 亚洲精品国产a| 欧美tk—视频vk| 91传媒视频在线播放| 裸体在线国模精品偷拍|