|
|
@ -89,16 +89,12 @@ void usb_init() |
|
|
|
struct libusb_device_descriptor desc; |
|
|
|
struct libusb_device_descriptor desc; |
|
|
|
libusb_get_device_descriptor(current, &desc); |
|
|
|
libusb_get_device_descriptor(current, &desc); |
|
|
|
|
|
|
|
|
|
|
|
// printf("Found usb device %04x:%04x\n", desc.idVendor, desc.idProduct);
|
|
|
|
uint32_t key = (desc.idVendor << 16) | desc.idProduct; |
|
|
|
// array_t* array = device_get_array();
|
|
|
|
void* driver = hashmap_get(usb_drivers, key); |
|
|
|
// array_add(array, 0);
|
|
|
|
if(!driver) continue; |
|
|
|
|
|
|
|
|
|
|
|
// libusb_device_handle* handle;
|
|
|
|
printf("Found driver for usb device %04x:%04x\n", desc.idVendor, desc.idProduct); |
|
|
|
// libusb_open(current, &handle);
|
|
|
|
|
|
|
|
// char buf[4096] = {0};
|
|
|
|
device_register(driver, current); |
|
|
|
// libusb_get_string_descriptor_ascii(handle, 1, buf, 4096);
|
|
|
|
|
|
|
|
// printf("Device desc (1): %s\n", buf);
|
|
|
|
|
|
|
|
// libusb_get_string_descriptor_ascii(handle, 2, buf, 4096);
|
|
|
|
|
|
|
|
// printf("Device desc (2): %s\n", buf);
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|