From 103ef6e032324c4f6f5591e47bbd9380f7c7cee5 Mon Sep 17 00:00:00 2001 From: hadaq Date: Tue, 5 Jan 2021 14:22:18 +0100 Subject: [PATCH] add check for active ports --- web/htdocs/network/map.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web/htdocs/network/map.pl b/web/htdocs/network/map.pl index 73c6f83..736a773 100755 --- a/web/htdocs/network/map.pl +++ b/web/htdocs/network/map.pl @@ -41,6 +41,7 @@ if($ENV{'QUERY_STRING'} =~ /getmap/) { my $hardware = trb_register_read(0xffff,0x42); my $inclHigh = trb_register_read(0xffff,0x43); my $hubbusy = trb_register_read(0xfffe,0x81); + my $portactive = trb_register_read(0xfffe,0x84); my $hubbusy1 = trb_register_read_mem(0xfffe,0x4030,0,16); my $gbebusy1 = trb_register_read(0xff7f,0x83e2); @@ -69,6 +70,11 @@ if($ENV{'QUERY_STRING'} =~ /getmap/) { else { $parent = $path[-1][-1]->{address}; $port = $path[-1][-1]->{port}; + while ($activeports->{$parent} & (1<<$port) == 0 && scalar @path > 1) { + pop(@path); + $parent = $path[-1][-1]->{address}; + $port = $path[-1][-1]->{port}; + } } $tree->{$parent}->[$port]->{addr} = $addr; } -- 2.43.0