* Fix usb initialization link with n900 * minor syntax fixup

This commit is contained in:
pancake committed 2010-04-26 18:29:19 +02:00
1 parent e2aaa2cb40
commit 20eed53d8c
2 files changed
+15 -6

No files matched your search

+1
View File
@@ -103,6 +103,7 @@ int usb_device_found(struct usb_device_descriptor *udd, struct devices *it_devic
if ((dev_index = is_valid_device(udd))) {
device = dev;
printf("%s found!\n", dev->filename);
*it_device = supported_devices[dev_index];
return 1;
}
+14 -6
View File
@@ -231,24 +231,31 @@ int connect_via_usb()
return 1;
}
#if 1
{
char name[32];
name[0] = '\0';
usb_get_driver_np(dev, 2, name, sizeof(name));
printf ("Driver: %s\n", name);
usb_detach_kernel_driver_np(dev, 2);
}
#endif
if (usb_claim_interface(dev, 2) < 0) {
//device->config->interface->altsetting->bInterfaceNumber) < 0) { // 2 or 0
D perror("usb_claim_interface");
perror("usb_claim_interface");
// Something is broken if closing fails.
if(usb_close(dev)) {
perror("usb_close");
return 1;
}
dev = NULL;
// Try again later.
continue;
// Try again later.?
exit(1);
}
if (usb_set_altinterface(dev, 1) <0) { //device->config->interface->altsetting->bAlternateSetting) < 0) {
D perror("usb_set_altinterface");
perror("usb_set_altinterface");
// Something is broken if closing fails.
if(usb_close(dev)) {
@@ -260,6 +267,7 @@ int connect_via_usb()
// Try again later.
continue;
}
break;
}
printf("found %s (%04x:%04x)\n", it_device.name,