@@ -281,6 +281,13 @@ static void enumerate_host_controller(struct sp_port *port,
281281{
282282 char * root_hub_name ;
283283
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+
284291 if ((root_hub_name = get_root_hub_name (host_controller_device ))) {
285292 enumerate_hub (port , root_hub_name , "" , dev_inst , fetchDescriptors );
286293 free (root_hub_name );
@@ -369,6 +376,7 @@ SP_PRIV enum sp_return get_port_details(struct sp_port *port, bool fetchDescript
369376 char value [8 ], class [16 ];
370377 DWORD size , type ;
371378 CONFIGRET cr ;
379+ port -> composite = FALSE;
372380
373381 /* Check if this is the device we are looking for. */
374382 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
430438 & compat_ids ,
431439 & size , 0 ) == CR_SUCCESS ) {
432440 while (* p ) {
433- if (!strncmp (p , "USB\\COMPOSITE" , 13 ))
441+ if (!strncmp (p , "USB\\COMPOSITE" , 13 )) {
442+ port -> composite = TRUE;
434443 break ;
444+ }
435445 p += strlen (p ) + 1 ;
436446 }
437- if (* p )
438- continue ;
439447 }
440448
441449 /* Stop the recursion when reaching the USB root. */
0 commit comments