@@ -281,6 +281,13 @@ static void enumerate_host_controller(struct sp_port *port,
281
281
{
282
282
char * root_hub_name ;
283
283
284
+ if (port -> composite ) {
285
+ //remove last part of the path
286
+ char * pch ;
287
+ pch = strrchr (port -> usb_path ,'.' );
288
+ port -> usb_path [pch - port -> usb_path ] = '\0' ;
289
+ }
290
+
284
291
if ((root_hub_name = get_root_hub_name (host_controller_device ))) {
285
292
enumerate_hub (port , root_hub_name , "" , dev_inst , fetchDescriptors );
286
293
free (root_hub_name );
@@ -369,6 +376,7 @@ SP_PRIV enum sp_return get_port_details(struct sp_port *port, bool fetchDescript
369
376
char value [8 ], class [16 ];
370
377
DWORD size , type ;
371
378
CONFIGRET cr ;
379
+ port -> composite = FALSE;
372
380
373
381
/* Check if this is the device we are looking for. */
374
382
device_key = SetupDiOpenDevRegKey (device_info , & device_info_data ,
@@ -430,12 +438,12 @@ SP_PRIV enum sp_return get_port_details(struct sp_port *port, bool fetchDescript
430
438
& compat_ids ,
431
439
& size , 0 ) == CR_SUCCESS ) {
432
440
while (* p ) {
433
- if (!strncmp (p , "USB\\COMPOSITE" , 13 ))
441
+ if (!strncmp (p , "USB\\COMPOSITE" , 13 )) {
442
+ port -> composite = TRUE;
434
443
break ;
444
+ }
435
445
p += strlen (p ) + 1 ;
436
446
}
437
- if (* p )
438
- continue ;
439
447
}
440
448
441
449
/* Stop the recursion when reaching the USB root. */
0 commit comments