mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
Fix: send_counters(), port-argument have to be physical port number.
Not the physical port index!
This commit is contained in:
+1
-1
@@ -180,7 +180,7 @@ function fillStats() {
|
|||||||
td = tr.insertCell(); td.appendChild(document.createTextNode(`${txB[i]}` + t('common_pkts')));
|
td = tr.insertCell(); td.appendChild(document.createTextNode(`${txB[i]}` + t('common_pkts')));
|
||||||
td = tr.insertCell(); td.appendChild(document.createTextNode(`${rxG[i]}` + t('common_pkts')));
|
td = tr.insertCell(); td.appendChild(document.createTextNode(`${rxG[i]}` + t('common_pkts')));
|
||||||
td = tr.insertCell(); td.appendChild(document.createTextNode(`${rxB[i]}` + t('common_pkts')));
|
td = tr.insertCell(); td.appendChild(document.createTextNode(`${rxB[i]}` + t('common_pkts')));
|
||||||
var button = '<button type="button" style="margin: 0 0 0 24px" onclick="getCounters(' + i + ');">' + t('stat_show') + '</button>';
|
var button = '<button type="button" style="margin: 0 0 0 24px" onclick="getCounters(' + (i + 1) + ');">' + t('stat_show') + '</button>';
|
||||||
td = tr.insertCell(); td.innerHTML = button;
|
td = tr.insertCell(); td.innerHTML = button;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -290,11 +290,12 @@ void send_vlan(uint16_t vlan)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Send counters
|
/* Send counters
|
||||||
* Only accepts physical port idx to 0-8.
|
* Only accepts physical port 1..9.
|
||||||
* Returns an error if the port physical don't exists.
|
* Returns an error if the port physical don't exists.
|
||||||
*/
|
*/
|
||||||
bool send_counters(uint8_t phys_port_idx)
|
bool send_counters(uint8_t phys_port)
|
||||||
{
|
{
|
||||||
|
uint8_t phys_port_idx = phys_port - 1;
|
||||||
if (phys_port_idx > 8)
|
if (phys_port_idx > 8)
|
||||||
goto err;
|
goto err;
|
||||||
uint8_t log_port = machine.phys_to_log_port[phys_port_idx];
|
uint8_t log_port = machine.phys_to_log_port[phys_port_idx];
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
bool send_counters(uint8_t phys_port_idx);
|
bool send_counters(uint8_t phys_port);
|
||||||
void send_status(void);
|
void send_status(void);
|
||||||
void send_vlan(uint16_t vlan);
|
void send_vlan(uint16_t vlan);
|
||||||
void send_basic_info(void);
|
void send_basic_info(void);
|
||||||
|
|||||||
Reference in New Issue
Block a user