File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -672,7 +672,19 @@ static int usb_find_hubs()
672
672
if (hubs [i ].nports != hubs [j ].nports )
673
673
continue ;
674
674
675
- /* Provisionally we choose this one as dual: */
675
+ /* If description is the same, provisionally we choose this one as dual.
676
+ * If description contained serial number, this will be most reliable matching.
677
+ */
678
+ if (strlen (hubs [i ].description ) == strlen (hubs [j ].description )) {
679
+ /* strlen("vvvv:pppp ") + strlen(", USB x.yz, N ports") = 10+19 = 29 */
680
+ if (strlen (hubs [i ].description ) >= 29 ) {
681
+ if (strncmp (hubs [i ].description + 10 , hubs [j ].description + 10 , strlen (hubs [i ].description )- 29 ) == 0 ) {
682
+ match = j ;
683
+ }
684
+ }
685
+ }
686
+
687
+ /* Running out of options - provisionally we choose this one as dual: */
676
688
if (match < 0 && !hubs [j ].actionable )
677
689
match = j ;
678
690
You can’t perform that action at this time.
0 commit comments