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