]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
add check for active ports
authorhadaq <hadaq@hades33.gsi.de>
Tue, 5 Jan 2021 13:22:18 +0000 (14:22 +0100)
committerhadaq <hadaq@hades33.gsi.de>
Tue, 5 Jan 2021 13:22:18 +0000 (14:22 +0100)
web/htdocs/network/map.pl

index 73c6f83ca46fe586633cc8555891c667553bb7b3..736a773686ffaaa80e96a7e91c849a2165496679 100755 (executable)
@@ -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;
     }