Commit c0e34f70 authored by Alessandro Rubini's avatar Alessandro Rubini

general: rename wrsw_pstats, wrsw_vlans, wrsw_version to be "wrs_"

Inconsistent naming has always been a problem for me. Since other
developers agree, we chose to rename all stuff to be wrs_ or wr_
for switch-specific stuff and generic WR functionality.  Ok, the
split is not very clear-cut, I agree.

This commit only fixes the tools and their users:
     wrs_version
     wrs_vlan
     wrs_pstats

It doesn't touch wrsw_hal and wrsw_rtud (nor it adds any prefix to
non-prefixed tools like load-lm32 and so on).
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 02af3a95
...@@ -630,7 +630,7 @@ approach like the global PPSi values described in @ref{wrsPpsi}. ...@@ -630,7 +630,7 @@ approach like the global PPSi values described in @ref{wrsPpsi}.
The implementation is easier, because I rely on the fact that versions The implementation is easier, because I rely on the fact that versions
never change while the process runs. So I retrieve the version strings never change while the process runs. So I retrieve the version strings
at initialization time, by calling ``@t{wrsw_version -t}'' (tagged) at initialization time, by calling ``@t{wrs_version -t}'' (tagged)
and parsing its @i{stdout}. Parsing is easier than what we have in and parsing its @i{stdout}. Parsing is easier than what we have in
@i{wrsPpsi}, but my plan is having a unified parser overall, and eventually @i{wrsPpsi}, but my plan is having a unified parser overall, and eventually
get rid of this simplified special case. get rid of this simplified special case.
......
...@@ -366,7 +366,7 @@ All these tools are found in `/wr/bin/` which is included in the `$PATH`. ...@@ -366,7 +366,7 @@ All these tools are found in `/wr/bin/` which is included in the `$PATH`.
The following list resumes the most interesting commands: The following list resumes the most interesting commands:
* `wrsw_version`: Print information about the SW & HW version of the [WRS]. * `wrs_version`: Print information about the SW & HW version of the [WRS].
* `rtu_stat`: Routing Table Unit Statistic, returns the routing table information where we can find which MAC needs to be forwarded to which port. It also allows to add and delete entries. * `rtu_stat`: Routing Table Unit Statistic, returns the routing table information where we can find which MAC needs to be forwarded to which port. It also allows to add and delete entries.
* `wr_mon`: WR Switch Sync Monitor, outputs information about the state of WR syncrhonisation such as Phase Tracking, Master-Slave delay, link asymmetry, etc... * `wr_mon`: WR Switch Sync Monitor, outputs information about the state of WR syncrhonisation such as Phase Tracking, Master-Slave delay, link asymmetry, etc...
* `spll_dbg_proxy`: SoftPLL debug proxy, reads out the debug FIFO datastream from the SoftPLL and proxies it via TCP connection to the application running on an outside host, where it can be plotted, analyzed, etc. * `spll_dbg_proxy`: SoftPLL debug proxy, reads out the debug FIFO datastream from the SoftPLL and proxies it via TCP connection to the application running on an outside host, where it can be plotted, analyzed, etc.
...@@ -686,7 +686,7 @@ executing the following command: ...@@ -686,7 +686,7 @@ executing the following command:
~~~~~{.bash} ~~~~~{.bash}
#On the WRS #On the WRS
wrsw_version > /tmp/bug_report.txt wrs_version > /tmp/bug_report.txt
rtu_stat >> /tmp/bug_report.txt rtu_stat >> /tmp/bug_report.txt
dmesg >> /tmp/bug_report.txt dmesg >> /tmp/bug_report.txt
......
...@@ -1414,13 +1414,13 @@ The most important tools in @file{userspace/tools} are the following: ...@@ -1414,13 +1414,13 @@ The most important tools in @file{userspace/tools} are the following:
inconsistent with anything else in the switch, so it is being inconsistent with anything else in the switch, so it is being
replaces. replaces.
@item wrsw_vlans @item wrs_vlans
The tool allows to configure and unconfigure the VLAN settings The tool allows to configure and unconfigure the VLAN settings
for each port and for the RTU daemon. The @t{--help} option for each port and for the RTU daemon. The @t{--help} option
lists all configuration items of the tool. lists all configuration items of the tool.
@c FIXME: document lm32-vuart rtu_stat spll_dbg_proxy wr_management @c FIXME: document lm32-vuart rtu_stat spll_dbg_proxy wr_management
@c FIXME: document wrsw_pstats @c FIXME: document wrs_pstats
@end table @end table
Please note that to compile the applications and tools outside of the build Please note that to compile the applications and tools outside of the build
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<?php $_SESSION['advance']=""; ?> <?php $_SESSION['advance']=""; ?>
<p><strong>WRSW OS: <?php $str = shell_exec("uname -r"); echo $str; ?> </strong></p> <p><strong>WRSW OS: <?php $str = shell_exec("uname -r"); echo $str; ?> </strong></p>
<p><strong><?php $str = shell_exec("/wr/bin/wrsw_version -g"); $str = str_replace("\n","<br>",$str); <p><strong><?php $str = shell_exec("/wr/bin/wrs_version -g"); $str = str_replace("\n","<br>",$str);
$str=str_replace("Reading GW info","",$str); echo $str; ?></strong></p><p>&nbsp;</p> $str=str_replace("Reading GW info","",$str); echo $str; ?></strong></p><p>&nbsp;</p>
<br> <br>
<center><p align=right><strong>Open Hardware Repository <a href="http://www.ohwr.org/projects/white-rabbit/wiki">http://www.ohwr.org/projects/white-rabbit/wiki</a> </strong></p></strong></p><p>&nbsp;</p> <center><p align=right><strong>Open Hardware Repository <a href="http://www.ohwr.org/projects/white-rabbit/wiki">http://www.ohwr.org/projects/white-rabbit/wiki</a> </strong></p></strong></p><p>&nbsp;</p>
......
...@@ -26,10 +26,10 @@ ...@@ -26,10 +26,10 @@
<?php <?php
if(!strcmp($_GET['vlan'],"all")){ // Delete all vlans and free ports if(!strcmp($_GET['vlan'],"all")){ // Delete all vlans and free ports
shell_exec("/wr/bin/wrsw_vlans --clear"); shell_exec("/wr/bin/wrs_vlans --clear");
}else{ }else{
shell_exec("/wr/bin/wrsw_vlans --rvid ".$_GET['vlan']." --del"); shell_exec("/wr/bin/wrs_vlans --rvid ".$_GET['vlan']." --del");
} }
......
...@@ -109,7 +109,7 @@ function wrs_header_ports(){ ...@@ -109,7 +109,7 @@ function wrs_header_ports(){
* @author José Luis Gutiérrez <jlgutierrez@ugr.es> * @author José Luis Gutiérrez <jlgutierrez@ugr.es>
* *
* Displays the info comming from the following commands: * Displays the info comming from the following commands:
* uname, wrsw_version, wr_date and php.ini * uname, wrs_version, wr_date and php.ini
* *
*/ */
function wrs_main_info(){ function wrs_main_info(){
...@@ -140,13 +140,13 @@ function wrs_main_info(){ ...@@ -140,13 +140,13 @@ function wrs_main_info(){
//echo '<tr><th> <b>OS name:</b> </th><th><center>'; $str = shell_exec("uname -s"); echo $str; echo '</center></th></tr>'; //echo '<tr><th> <b>OS name:</b> </th><th><center>'; $str = shell_exec("uname -s"); echo $str; echo '</center></th></tr>';
echo '<tr><th align=center> <b><font color="darkblue">Kernel Version</font></b> </th><th><center>'; $str = shell_exec("uname -r"); echo $str; $str = shell_exec("uname -v"); echo $str; echo '</center></th></tr>'; echo '<tr><th align=center> <b><font color="darkblue">Kernel Version</font></b> </th><th><center>'; $str = shell_exec("uname -r"); echo $str; $str = shell_exec("uname -v"); echo $str; echo '</center></th></tr>';
echo '<tr><th align=center> <b><font color="darkblue">Firmware Version</font></b> </th><th><center> '; $str = shell_exec("/wr/bin/wrsw_version | awk '{print $4}'"); echo '<tr><th align=center> <b><font color="darkblue">Firmware Version</font></b> </th><th><center> '; $str = shell_exec("/wr/bin/wrs_version | awk '{print $4}'");
echo '<a href="showfile.php?help_id=gateware&name=GateWare Info" onClick="showPopup(this.href);return(false);"</a>'; echo '<a href="showfile.php?help_id=gateware&name=GateWare Info" onClick="showPopup(this.href);return(false);"</a>';
echo $str; echo '</center></th></tr>'; echo $str; echo '</center></th></tr>';
echo '<tr><th align=center> <b><font color="darkblue">PCB Version</font></b> </th><th><center>'; $str = shell_exec("/wr/bin/wrsw_version -p"); echo $str; echo '</center></th></tr>'; echo '<tr><th align=center> <b><font color="darkblue">PCB Version</font></b> </th><th><center>'; $str = shell_exec("/wr/bin/wrs_version -p"); echo $str; echo '</center></th></tr>';
echo '<tr><th align=center> <b><font color="darkblue">FPGA</font></b> </th><th><center>'; $str = shell_exec("/wr/bin/wrsw_version -f"); echo $str; echo '</center></th></tr>'; echo '<tr><th align=center> <b><font color="darkblue">FPGA</font></b> </th><th><center>'; $str = shell_exec("/wr/bin/wrs_version -f"); echo $str; echo '</center></th></tr>';
echo '<tr><th align=center> <b><font color="darkblue">Compiling Date</font></b> </th><th><center>'; $str = shell_exec("/wr/bin/wrsw_version -c"); echo $str; echo '</center></th></tr>'; echo '<tr><th align=center> <b><font color="darkblue">Compiling Date</font></b> </th><th><center>'; $str = shell_exec("/wr/bin/wrs_version -c"); echo $str; echo '</center></th></tr>';
echo '<tr><th align=center> <b><font color="darkblue">White-Rabbit Date</font></b></th><th><center>'; $str = shell_exec("export TZ=".$_SESSION['utc']." /wr/bin/wr_date -n get"); echo str_replace("\n","<br>",$str); echo '</center></th></tr>'; echo '<tr><th align=center> <b><font color="darkblue">White-Rabbit Date</font></b></th><th><center>'; $str = shell_exec("export TZ=".$_SESSION['utc']." /wr/bin/wr_date -n get"); echo str_replace("\n","<br>",$str); echo '</center></th></tr>';
echo '<tr><th align=center> <b><font color="darkblue">PPSi</font></b> </th><th><center>'; echo wrs_check_ptp_status() ? '[<A HREF="ptp.php">on</A>]' : '[<A HREF="ptp.php">off</A>]'; echo '</center></th></tr>'; echo '<tr><th align=center> <b><font color="darkblue">PPSi</font></b> </th><th><center>'; echo wrs_check_ptp_status() ? '[<A HREF="ptp.php">on</A>]' : '[<A HREF="ptp.php">off</A>]'; echo '</center></th></tr>';
echo '<tr><th align=center> <b><font color="darkblue">Net-SNMP Server</font></b> </th><th><center>'; echo check_snmp_status() ? '[on] ' : '[off] '; echo '&nbsp;&nbsp;ver. '; echo shell_exec("snmpd -v | grep version | awk '{print $3}'"); echo '<tr><th align=center> <b><font color="darkblue">Net-SNMP Server</font></b> </th><th><center>'; echo check_snmp_status() ? '[on] ' : '[off] '; echo '&nbsp;&nbsp;ver. '; echo shell_exec("snmpd -v | grep version | awk '{print $3}'");
...@@ -1051,7 +1051,7 @@ function wrs_display_help($help_id, $name){ ...@@ -1051,7 +1051,7 @@ function wrs_display_help($help_id, $name){
$message = "<p>This is a switch console emulator windows. Use it as if you were using a ssh session.</p>"; $message = "<p>This is a switch console emulator windows. Use it as if you were using a ssh session.</p>";
} else if (!strcmp($help_id, "gateware")){ } else if (!strcmp($help_id, "gateware")){
$msg = shell_exec("/wr/bin/wrsw_version -g"); $msg = shell_exec("/wr/bin/wrs_version -g");
$msg = explode("\n", $msg); $msg = explode("\n", $msg);
for($i=0; $i<5; $i++){ for($i=0; $i<5; $i++){
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<?php <?php
$vlan_cmd = "/wr/bin/wrsw_vlans "; $vlan_cmd = "/wr/bin/wrs_vlans ";
if(!empty($_POST['vid'])){ $vlan_cmd .= " --rvid ".$_POST['vid'];} if(!empty($_POST['vid'])){ $vlan_cmd .= " --rvid ".$_POST['vid'];}
if(!empty($_POST['fid'])){$vlan_cmd .= " --rfid ".$_POST['fid'];} if(!empty($_POST['fid'])){$vlan_cmd .= " --rfid ".$_POST['fid'];}
if(!empty($_POST['mask'])){$vlan_cmd .= " --rmask ".$_POST['mask'];} if(!empty($_POST['mask'])){$vlan_cmd .= " --rmask ".$_POST['mask'];}
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
// Get VLANS // Get VLANS
echo '<center><strong>Port-VLAN List</strong></center><hr>'; echo '<center><strong>Port-VLAN List</strong></center><hr>';
$tmp_vlan_file="/tmp/vlans.conf"; $tmp_vlan_file="/tmp/vlans.conf";
$vlans = shell_exec("/wr/bin/wrsw_vlans --list >".$tmp_vlan_file); $vlans = shell_exec("/wr/bin/wrs_vlans --list >".$tmp_vlan_file);
$vlans = shell_exec("cat ".$tmp_vlan_file." | sed -n '/ /s/ \+/ /gp'"); $vlans = shell_exec("cat ".$tmp_vlan_file." | sed -n '/ /s/ \+/ /gp'");
$vlans = explode("\n", $vlans); $vlans = explode("\n", $vlans);
$name_vlans=""; $name_vlans="";
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
// Get Previous assignment // Get Previous assignment
$tmp_assign_file="/tmp/port2vlan.conf"; $tmp_assign_file="/tmp/port2vlan.conf";
$vlans_assignment = shell_exec("/wr/bin/wrsw_vlans --elist >".$tmp_assign_file); $vlans_assignment = shell_exec("/wr/bin/wrs_vlans --elist >".$tmp_assign_file);
$vlans_assignment = shell_exec("cat ".$tmp_assign_file." | sed -n '/ /s/ \+/ /gp'"); $vlans_assignment = shell_exec("cat ".$tmp_assign_file." | sed -n '/ /s/ \+/ /gp'");
$vlans_assignment = explode("\n", $vlans_assignment); $vlans_assignment = explode("\n", $vlans_assignment);
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
echo '<br>'.$_POST['mode0']; echo '<br>'.$_POST['mode0'];
//Parse input and run the command //Parse input and run the command
if (!empty($_POST['updatevlan'])){ if (!empty($_POST['updatevlan'])){
$vlan_cmd= "/wr/bin/wrsw_vlans "; $vlan_cmd= "/wr/bin/wrs_vlans ";
for($i = 0; $i < 18; $i++){ for($i = 0; $i < 18; $i++){
//if(strcmp($_POST['vlan'.$i],"disabled")){ //VLAN selected //if(strcmp($_POST['vlan'.$i],"disabled")){ //VLAN selected
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
//} //}
$vlan_cmd= "/wr/bin/wrsw_vlans "; $vlan_cmd= "/wr/bin/wrs_vlans ";
} }
header('Location: vlan.php'); header('Location: vlan.php');
} }
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
echo '<center><strong>Existing VLANs</strong></center><hr>'; echo '<center><strong>Existing VLANs</strong></center><hr>';
$tmp_vlan_file="/tmp/vlans.conf"; $tmp_vlan_file="/tmp/vlans.conf";
$vlans = shell_exec("/wr/bin/wrsw_vlans --list >".$tmp_vlan_file); $vlans = shell_exec("/wr/bin/wrs_vlans --list >".$tmp_vlan_file);
$vlans = shell_exec("cat ".$tmp_vlan_file." | sed -n '/ /s/ \+/ /gp'"); $vlans = shell_exec("cat ".$tmp_vlan_file." | sed -n '/ /s/ \+/ /gp'");
$vlans = explode("\n", $vlans); $vlans = explode("\n", $vlans);
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
echo '<tr align=center><th><font color="blue">Port</font></strong></th><th><font color="blue">QMode</font></th><th><font color="blue">Priority</font></th><th><font color="blue">VLAN ID</font></th><th><font color="blue">MAC Address</font></th></tr>'; echo '<tr align=center><th><font color="blue">Port</font></strong></th><th><font color="blue">QMode</font></th><th><font color="blue">Priority</font></th><th><font color="blue">VLAN ID</font></th><th><font color="blue">MAC Address</font></th></tr>';
$tmp_vlan_file="/tmp/port2vlan.conf"; $tmp_vlan_file="/tmp/port2vlan.conf";
$vlans = shell_exec("/wr/bin/wrsw_vlans --elist >".$tmp_vlan_file); $vlans = shell_exec("/wr/bin/wrs_vlans --elist >".$tmp_vlan_file);
$vlans = shell_exec("cat ".$tmp_vlan_file." | sed -n '/ /s/ \+/ /gp'"); $vlans = shell_exec("cat ".$tmp_vlan_file." | sed -n '/ /s/ \+/ /gp'");
$vlans = explode("\n", $vlans); $vlans = explode("\n", $vlans);
......
wrs_pstats
\ No newline at end of file
wrs_version
\ No newline at end of file
wrs_vlans
\ No newline at end of file
...@@ -10,7 +10,7 @@ for arg in $(cat /proc/cmdline); do ...@@ -10,7 +10,7 @@ for arg in $(cat /proc/cmdline); do
done done
# Obtain the type of FPGA (LX130XT or LX240XT) # Obtain the type of FPGA (LX130XT or LX240XT)
tfpga=$($WR_HOME/bin/wrsw_version -F) tfpga=$($WR_HOME/bin/wrs_version -F)
$WR_HOME/bin/load-virtex $WR_HOME/lib/firmware/18p_mb-${tfpga}.bin $WR_HOME/bin/load-virtex $WR_HOME/lib/firmware/18p_mb-${tfpga}.bin
$WR_HOME/bin/load-lm32 $WR_HOME/lib/firmware/rt_cpu.bin $WR_HOME/bin/load-lm32 $WR_HOME/lib/firmware/rt_cpu.bin
......
...@@ -65,7 +65,7 @@ static int version_group(netsnmp_mib_handler *handler, ...@@ -65,7 +65,7 @@ static int version_group(netsnmp_mib_handler *handler,
static void wrs_v_init(void) static void wrs_v_init(void)
{ {
char s[80], key[40], value[40]; char s[80], key[40], value[40];
FILE *f = popen("/wr/bin/wrsw_version -t", "r"); FILE *f = popen("/wr/bin/wrs_version -t", "r");
int i; int i;
if (!f) { if (!f) {
......
...@@ -7,11 +7,11 @@ wr_phytool ...@@ -7,11 +7,11 @@ wr_phytool
com com
mapper mapper
wmapper wmapper
wrsw_version wrs_version
wr_date wr_date
fix_tai_offset fix_tai_offset
wr_management wr_management
lm32-vuart lm32-vuart
tru_mon tru_mon
wrsw_pstats wrs_pstats
wrsw_vlans wrs_vlans
TOOLS = rtu_stat wr_mon wr_phytool spll_dbg_proxy load-lm32 load-virtex com TOOLS = rtu_stat wr_mon wr_phytool spll_dbg_proxy load-lm32 load-virtex com
TOOLS += mapper wmapper TOOLS += mapper wmapper
TOOLS += wrsw_version wr_date wr_management lm32-vuart wrsw_pstats TOOLS += wrs_version wr_date wr_management lm32-vuart wrs_pstats
TOOLS += wrsw_vlans TOOLS += wrs_vlans
# # Standard stanza for cross-compilation (courtesy of the linux makefile) # # Standard stanza for cross-compilation (courtesy of the linux makefile)
...@@ -62,11 +62,11 @@ load-virtex: load-virtex.o load-fpga.o ...@@ -62,11 +62,11 @@ load-virtex: load-virtex.o load-fpga.o
load-lm32: load-lm32.o load-lm32: load-lm32.o
${CC} -o $@ $^ $(LDFLAGS) ${CC} -o $@ $^ $(LDFLAGS)
wrsw_version.o: wrsw_version.c wrs_version.o: wrs_version.c
${CC} ${CFLAGS} -D__GIT_USR__="\"${GIT_USR}\"" \ ${CC} ${CFLAGS} -D__GIT_USR__="\"${GIT_USR}\"" \
-D__GIT_VER__="\"${GIT_VER}\"" $(LDFLAGS) -c -o $@ $^ -D__GIT_VER__="\"${GIT_VER}\"" $(LDFLAGS) -c -o $@ $^
wrsw_version: wrsw_version.o wrs_version: wrs_version.o
${CC} -o $@ $^ $(LDFLAGS) ${CC} -o $@ $^ $(LDFLAGS)
test_rt: test_rt.o ../wrsw_hal/rt_client.o test_rt: test_rt.o ../wrsw_hal/rt_client.o
...@@ -77,13 +77,13 @@ test_ts: test_ts.o ../wrsw_hal/rt_client.o ...@@ -77,13 +77,13 @@ test_ts: test_ts.o ../wrsw_hal/rt_client.o
port_calibrator: port_calibrator.o ../wrsw_hal/rt_client.o port_calibrator: port_calibrator.o ../wrsw_hal/rt_client.o
${CC} -o $@ $^ $(LDFLAGS) ${CC} -o $@ $^ $(LDFLAGS)
wrsw_pstats: wrsw_pstats.o wrs_pstats: wrs_pstats.o
${CC} -o $@ $^ $(LDFLAGS) ${CC} -o $@ $^ $(LDFLAGS)
lm32-vuart: lm32-vuart.o lm32-vuart: lm32-vuart.o
${CC} -o $@ $^ $(LDFLAGS) ${CC} -o $@ $^ $(LDFLAGS)
wrsw_vlans: wrsw_vlans.o wrs_vlans: wrs_vlans.o
${CC} -o $@ $^ $(LDFLAGS) ${CC} -o $@ $^ $(LDFLAGS)
clean: clean:
......
/* /*
* wrsw_version.c * wrs_version.c
* *
* Obtain the HW version and FPGA type. * Obtain the HW version and FPGA type.
* *
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include "switch_hw.h" #include "switch_hw.h"
#include "fpga_io.h" #include "fpga_io.h"
#include "wrsw_vlans.h" #include "wrs_vlans.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment