void usb_host_info(Monitor *mon, const QDict *qdict)

{

    libusb_device **devs;

    struct libusb_device_descriptor ddesc;

    char port[16];

    int i, n;



    if (usb_host_init() != 0) {

        return;

    }



    n = libusb_get_device_list(ctx, &devs);

    for (i = 0; i < n; i++) {

        if (libusb_get_device_descriptor(devs[i], &ddesc) != 0) {

            continue;

        }

        if (ddesc.bDeviceClass == LIBUSB_CLASS_HUB) {

            continue;

        }

        usb_host_get_port(devs[i], port, sizeof(port));

        monitor_printf(mon, "  Bus %d, Addr %d, Port %s, Speed %s Mb/s\n",

                       libusb_get_bus_number(devs[i]),

                       libusb_get_device_address(devs[i]),

                       port,

                       speed_name[libusb_get_device_speed(devs[i])]);

        monitor_printf(mon, "    Class %02x:", ddesc.bDeviceClass);

        monitor_printf(mon, " USB device %04x:%04x",

                       ddesc.idVendor, ddesc.idProduct);

        if (ddesc.iProduct) {

            libusb_device_handle *handle;

            if (libusb_open(devs[i], &handle) == 0) {

                unsigned char name[64] = "";

                libusb_get_string_descriptor_ascii(handle,

                                                   ddesc.iProduct,

                                                   name, sizeof(name));

                libusb_close(handle);

                monitor_printf(mon, ", %s", name);

            }

        }

        monitor_printf(mon, "\n");

    }

    libusb_free_device_list(devs, 1);

}

void usb_host_info(Monitor *mon, const QDict *qdict)

{

    libusb_device **devs;

    struct libusb_device_descriptor ddesc;

    char port[16];

    int i, n;



    if (usb_host_init() != 0) {

        return;

    }



    n = libusb_get_device_list(ctx, &devs);

    for (i = 0; i < n; i++) {

        if (libusb_get_device_descriptor(devs[i], &ddesc) != 0) {

            continue;

        }

        if (ddesc.bDeviceClass == LIBUSB_CLASS_HUB) {

            continue;

        }

        usb_host_get_port(devs[i], port, sizeof(port));

        monitor_printf(mon, "  Bus %d, Addr %d, Port %s, Speed %s Mb/s\n",

                       libusb_get_bus_number(devs[i]),

                       libusb_get_device_address(devs[i]),

                       port,

                       speed_name[libusb_get_device_speed(devs[i])]);

        monitor_printf(mon, "    Class %02x:", ddesc.bDeviceClass);

        monitor_printf(mon, " USB device %04x:%04x",

                       ddesc.idVendor, ddesc.idProduct);

        if (ddesc.iProduct) {

            libusb_device_handle *handle;

            if (libusb_open(devs[i], &handle) == 0) {

                unsigned char name[64] = "";

                libusb_get_string_descriptor_ascii(handle,

                                                   ddesc.iProduct,

                                                   name, sizeof(name));

                libusb_close(handle);

                monitor_printf(mon, ", %s", name);

            }

        }

        monitor_printf(mon, "\n");

    }

    libusb_free_device_list(devs, 1);

}

    libusb_device **devs;     libusb_device **devs;
void FUNC_0(Monitor *VAR_0, const QDict *VAR_1)

{

    libusb_device **devs;

    struct libusb_device_descriptor VAR_2;

    char VAR_3[16];

    int VAR_4, VAR_5;



    if (usb_host_init() != 0) {

        return;

    }



    VAR_5 = libusb_get_device_list(ctx, &devs);

    for (VAR_4 = 0; VAR_4 < VAR_5; VAR_4++) {

        if (libusb_get_device_descriptor(devs[VAR_4], &VAR_2) != 0) {

            continue;

        }

        if (VAR_2.bDeviceClass == LIBUSB_CLASS_HUB) {

            continue;

        }

        usb_host_get_port(devs[VAR_4], VAR_3, sizeof(VAR_3));

        monitor_printf(VAR_0, "  Bus %d, Addr %d, Port %s, Speed %s Mb/s\VAR_5",

                       libusb_get_bus_number(devs[VAR_4]),

                       libusb_get_device_address(devs[VAR_4]),

                       VAR_3,

                       speed_name[libusb_get_device_speed(devs[VAR_4])]);

        monitor_printf(VAR_0, "    Class %02x:", VAR_2.bDeviceClass);

        monitor_printf(VAR_0, " USB device %04x:%04x",

                       VAR_2.idVendor, VAR_2.idProduct);

        if (VAR_2.iProduct) {

            libusb_device_handle *handle;

            if (libusb_open(devs[VAR_4], &handle) == 0) {

                unsigned char VAR_6[64] = "";

                libusb_get_string_descriptor_ascii(handle,

                                                   VAR_2.iProduct,

                                                   VAR_6, sizeof(VAR_6));

                libusb_close(handle);

                monitor_printf(VAR_0, ", %s", VAR_6);

            }

        }

        monitor_printf(VAR_0, "\VAR_5");

    }

    libusb_free_device_list(devs, 1);

}

void FUNC_0(Monitor *VAR_0, const QDict *VAR_1)
{ libusb_device **devs; struct libusb_device_descriptor VAR_2; char VAR_3[16]; int VAR_4, VAR_5; if (usb_host_init() != 0) { return; } VAR_5 = libusb_get_device_list(ctx, &devs); for (VAR_4 = 0; VAR_4 < VAR_5; VAR_4++) { if (libusb_get_device_descriptor(devs[VAR_4], &VAR_2) != 0) { continue; } if (VAR_2.bDeviceClass == LIBUSB_CLASS_HUB) { continue; } usb_host_get_port(devs[VAR_4], VAR_3, sizeof(VAR_3)); monitor_printf(VAR_0, "  Bus %d, Addr %d, Port %s, Speed %s Mb/s\VAR_5",
libusb_get_bus_number(devs[VAR_4]),
libusb_get_device_address(devs[VAR_4]),
VAR_3,
speed_name[libusb_get_device_speed(devs[VAR_4])]); monitor_printf(VAR_0, "    Class %02x:", VAR_2.bDeviceClass); monitor_printf(VAR_0, " USB device %04x:%04x",
VAR_2.idVendor, VAR_2.idProduct); if (VAR_2.iProduct) { libusb_device_handle *handle; if (libusb_open(devs[VAR_4], &handle) == 0) { unsigned char VAR_6[64] = ""; libusb_get_string_descriptor_ascii(handle,
VAR_2.iProduct,
VAR_6, sizeof(VAR_6)); libusb_close(handle); monitor_printf(VAR_0, ", %s", VAR_6); } } monitor_printf(VAR_0, "\VAR_5"); } libusb_free_device_list(devs, 1); }