From f2ebac604ddaa56e9a413628b900123986d3df97 Mon Sep 17 00:00:00 2001 From: Tormod Volden Date: Thu, 30 Nov 2023 13:54:46 +0100 Subject: [PATCH] windows: Include enumeration details in debug output It doesn't add much extra noise and helps a lot to interpret the existing debug output. Change the wording slightly from the previous commented-out debug output. Grep for "ENUM" to find these in the logs. Signed-off-by: Tormod Volden --- libusb/os/windows_winusb.c | 11 +++++------ libusb/version_nano.h | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/libusb/os/windows_winusb.c b/libusb/os/windows_winusb.c index 3ea7f6c..bb3d41e 100644 --- a/libusb/os/windows_winusb.c +++ b/libusb/os/windows_winusb.c @@ -1605,7 +1605,9 @@ static int winusb_get_device_list(struct libusb_context *ctx, struct discovered_ unsigned long session_id; DWORD size, port_nr, install_state; uint8_t bus_number = 0; +#if defined(ENABLE_LOGGING) char guid_string[MAX_GUID_STRING_LENGTH]; +#endif GUID *if_guid; #define HUB_PASS 0 #define DEV_PASS 1 @@ -1674,10 +1676,9 @@ static int winusb_get_device_list(struct libusb_context *ctx, struct discovered_ for (pass = 0; ((pass < nb_guids) && (r == LIBUSB_SUCCESS)); pass++) { pass_type = MIN(pass, EXT_PASS); -//#define ENUM_DEBUG -#if defined(ENABLE_LOGGING) && defined(ENUM_DEBUG) +#if defined(ENABLE_LOGGING) const char * const passname[] = {"HUB", "DEV", "HCD", "GEN", "HID", "EXT"}; - usbi_dbg(ctx, "#### PROCESSING %ss %s", passname[pass_type], guid_to_string(guid_list[pass], guid_string)); + usbi_dbg(ctx, "ENUM pass %s %s", passname[pass_type], guid_to_string(guid_list[pass], guid_string)); #endif if ((pass == HID_PASS) && (guid_list[HID_PASS] == NULL)) continue; @@ -1723,9 +1724,7 @@ static int winusb_get_device_list(struct libusb_context *ctx, struct discovered_ continue; } -#ifdef ENUM_DEBUG - usbi_dbg(ctx, "PRO: %s", dev_id); -#endif + usbi_dbg(ctx, "ENUM processing %s", dev_id); // Set API to use or get additional data from generic pass api = USB_API_UNSUPPORTED; diff --git a/libusb/version_nano.h b/libusb/version_nano.h index aebba8c..99ee645 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 11832 +#define LIBUSB_NANO 11833