- //HID only!
-#define GET_PROTOCOL 0x03
-#define SET_PROTOCOL 0x0b
-#define GETit 0xa1
-#define SETit 0x21
-
-
- u8 buf[255];
-#if 1
- /* select configuration */
- wait_ms(500);
- ret = usb_set_configuration(dev, 1);
- printf("=============\nusb_set_configuration(ret: %d): %d\n", ret, dev->conf->bConfigurationValue);
- wait_ms(500);
- printf("=============\nusb_get_configuration: %d (should be 1 here)\n", usb_get_configuration(dev));
-#endif
-
-#if 0
- memset(buf, 0, 0xff);
- usb_control_msg(dev, 0x81, GET_DESCRIPTOR, 0x2200, 0x0, 0x41, buf, 0);
- printf("wtf request\n");
- hexdump((void*)buf, 0x41);
-#endif
-
-#if 0
- /* set protocol */
- /* see p48 in HID spec */
- memset(buf, 0, 8);
- usb_control_msg(dev, SETit, SET_PROTOCOL, 0, 0, 0, buf, 0);
- printf("=============\nhid_set_protocol %d\n", 0);
- hexdump((void*)buf, 8);
-#endif
-#if 0
- memset(buf, 0, 8);
- usb_control_msg(dev, GETit, GET_PROTOCOL, 0, 0, 4, buf, 0);
- printf("=============\nusb_get_interface: %d\n", buf[0]);
- hexdump((void*)buf, 8);
-#endif
-
-#if 0
- /* I just don't know why on some devices
- * {s,g}et_{configuration,interface} won't work.
- * may the setter works and getter are poorly implemented?
- * however, I try here some interrupt inputs, assuming
- * the setters are fine*/
-
- memset(buf, 0, 8);
- s8 epnum = dev->conf->intf->endp->bEndpointAddress & 0xf;
- printf("epnum: 0x%04X\n", epnum);
- u8 muh = 10;
- while(muh--) {
- (void) usb_interrupt_read(dev, epnum, buf, 8, 0);
- printf("============\nusb_interrupt_read:\n");
- hexdump((void*)buf, 8);
- udelay(2000000);
- }
-#endif
-
-#if 0