Skip to content

Commit

Permalink
windows: Include enumeration details in debug print
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
tormodvolden committed Nov 30, 2023
1 parent b17687e commit e79934f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions libusb/os/windows_winusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit e79934f

Please sign in to comment.