faking USB_GET_DEVICE_DATA
unique: 110, bytes: 276, options: 0
Vendor: 3fd
Calling setinterface num=0, alternate=0.
DeviceAttach: received and accepted attach for:
vendor id 0x3fd, product id 0x8, device handle 0x8215178
Cable PID = 0008.
Max current requested during enumeration is 280 mA.
in USB_TRANSFER unique: 110, pipe: 0, read: 1, options: 0, size: 1, timeout: bb8
setup packet: c0 b0 20 00 00 00 01 00
Transferred: 0 (read)
Loopback test failed. Sent character = 00, Received character = 1A.
Cable connection failed.
return (*ioctl_func) (fd, request, wdioctl);
}
return (*ioctl_func) (fd, request, wdioctl);
}
- fprintf(stderr,"PID %d: ",getpid());
switch(request) {
case VERSION:
version = (struct version_struct*)(wdheader->data);
switch(request) {
case VERSION:
version = (struct version_struct*)(wdheader->data);
{
struct interrupt *it = (struct interrupt*)(wdheader->data);
{
struct interrupt *it = (struct interrupt*)(wdheader->data);
- hexdump(wdheader->data, wdheader->size);
fprintf(stderr,"Handle: %lu, Options: %lx, ncmds: %lu, enableok: %lu, count: %lu, lost: %lu, stopped: %lu\n", it->hInterrupt, it->dwOptions, it->dwCmds, it->fEnableOk, it->dwCounter, it->dwLost, it->fStopped);
it->fEnableOk = 1;
fprintf(stderr,"Handle: %lu, Options: %lx, ncmds: %lu, enableok: %lu, count: %lu, lost: %lu, stopped: %lu\n", it->hInterrupt, it->dwOptions, it->dwCmds, it->fEnableOk, it->dwCounter, it->dwLost, it->fStopped);
it->fEnableOk = 1;
ret = (*ioctl_func) (fd, request, wdioctl);
#else
if (usbdevice) {
ret = (*ioctl_func) (fd, request, wdioctl);
#else
if (usbdevice) {
if (!usb_devhandle)
usb_devhandle = usb_open(usbdevice);
if (!usb_devhandle)
usb_devhandle = usb_open(usbdevice);
-//MGMG
- ret = usb_claim_interface(usb_devhandle, iface);
+
+ /* FIXME: Select right interface! */
+ ret = usb_claim_interface(usb_devhandle, usbdevice->config[0].interface[usi->dwInterfaceNum].altsetting[usi->dwAlternateSetting].bInterfaceNumber);
+ if (!ret) {
+ ret = usb_set_altinterface(usb_devhandle, usi->dwAlternateSetting);
+ if (ret)
+ fprintf(stderr, "usb_set_altinterface: %d\n", ret);
+ } else {
+ fprintf(stderr, "usb_claim_interface: %d -> %d (%s)\n", usbdevice->config[0].interface[usi->dwInterfaceNum].altsetting[usi->dwAlternateSetting].bInterfaceNumber, ret, usb_strerror());
+ }
}
#endif
fprintf(stderr,"unique: %lu, interfacenum: %lu, alternatesetting: %lu, options: %lx\n", usi->dwUniqueID, usi->dwInterfaceNum, usi->dwAlternateSetting, usi->dwOptions);
}
#endif
fprintf(stderr,"unique: %lu, interfacenum: %lu, alternatesetting: %lu, options: %lx\n", usi->dwUniqueID, usi->dwInterfaceNum, usi->dwAlternateSetting, usi->dwOptions);
{
struct interrupt *it = (struct interrupt*)(wdheader->data);
{
struct interrupt *it = (struct interrupt*)(wdheader->data);
- hexdump(wdheader->data, wdheader->size);
fprintf(stderr,"Handle: %lu, Options: %lx, ncmds: %lu, enableok: %lu, count: %lu, lost: %lu, stopped: %lu\n", it->hInterrupt, it->dwOptions, it->dwCmds, it->fEnableOk, it->dwCounter, it->dwLost, it->fStopped);
#ifndef NO_WINDRVR
fprintf(stderr,"Handle: %lu, Options: %lx, ncmds: %lu, enableok: %lu, count: %lu, lost: %lu, stopped: %lu\n", it->hInterrupt, it->dwOptions, it->dwCmds, it->fEnableOk, it->dwCounter, it->dwLost, it->fStopped);
#ifndef NO_WINDRVR