From e79934f0f5f8ec07f87d93c3d09f368a3dd6336a 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 print 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 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/libusb/os/windows_winusb.c b/libusb/os/windows_winusb.c index 3ea7f6ca0..bb3d41ea3 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;