mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
Rename print_port() to print_phys_port()
This commit is contained in:
+8
-8
@@ -381,7 +381,7 @@ void parse_lag(void)
|
||||
print_string(" member ports: ");
|
||||
for (uint8_t j = 0; j < 10; j++) {
|
||||
if (members & 1) {
|
||||
print_port(j);
|
||||
print_phys_port(j);
|
||||
write_char(' ');
|
||||
}
|
||||
members >>= 1;
|
||||
@@ -569,7 +569,7 @@ void parse_isolate(void)
|
||||
members = port_isolation_get(port_configured);
|
||||
for (uint8_t i = 0; i < 10; i++) {
|
||||
if (members & 1) {
|
||||
print_port(i);
|
||||
print_phys_port(i);
|
||||
write_char(' ');
|
||||
}
|
||||
members >>= 1;
|
||||
@@ -634,7 +634,7 @@ void parse_ingress(void)
|
||||
// Setting mode for all ports at once
|
||||
for (log_port = machine.min_port; log_port <= machine.max_port; log_port++) {
|
||||
if (!port_ingress_filter(log_port, mode)) {
|
||||
print_string("Error setting ingress filter for port "); print_port(log_port); write_char('\n');
|
||||
print_string("Error setting ingress filter for port "); print_phys_port(log_port); write_char('\n');
|
||||
return;
|
||||
}
|
||||
print_string("All ports ingress filter set to: ");
|
||||
@@ -652,14 +652,14 @@ void parse_ingress(void)
|
||||
idx += ret;
|
||||
|
||||
if (!vlan_ingress_mode_parse(cmd_buffer[idx++], &mode) || !cmd_is_space_or_nul(idx)) {
|
||||
print_string("Invalid ingress mode for port "); print_port(log_port); print_string(" in ingress command\n");
|
||||
print_string("Invalid ingress mode for port "); print_phys_port(log_port); print_string(" in ingress command\n");
|
||||
goto err;
|
||||
}
|
||||
if (!port_ingress_filter(log_port, mode)) {
|
||||
print_string("Error setting ingress filter for port "); print_port(log_port); write_char('\n');
|
||||
print_string("Error setting ingress filter for port "); print_phys_port(log_port); write_char('\n');
|
||||
return;
|
||||
}
|
||||
print_string("Port "); print_port(log_port);
|
||||
print_string("Port "); print_phys_port(log_port);
|
||||
print_string(" ingress filter set to: ");
|
||||
print_port_ingress_filter_mode(mode); write_char('\n');
|
||||
}
|
||||
@@ -684,7 +684,7 @@ void parse_mirror(void)
|
||||
print_string("NOT Enabled: ");
|
||||
}
|
||||
print_string("Mirroring port: ");
|
||||
print_port(mirroring_port);
|
||||
print_phys_port(mirroring_port);
|
||||
reg_read_m(RTL837x_MIRROR_CONF);
|
||||
uint16_t m = sfr_data[0];
|
||||
m = (m << 8) | sfr_data[1];
|
||||
@@ -838,7 +838,7 @@ void parse_mtu(void)
|
||||
for (p = machine.min_port; p <= machine.max_port; p++) {
|
||||
reg_read_m(RTL8373_REG_MAC_L2_PORT_MAX_LEN + ((uint16_t) p << 8));
|
||||
uint16_t mtu = SFR_DATA_U16 & 0x3fff;
|
||||
print_string("Port "); print_port(p);
|
||||
print_string("Port "); print_phys_port(p);
|
||||
write_char(' '); print_short(mtu); write_char('\n');
|
||||
}
|
||||
return;
|
||||
|
||||
+1
-1
@@ -136,7 +136,7 @@ void itoa(uint8_t v);
|
||||
void print_sfr_data(void);
|
||||
void print_phy_data(void);
|
||||
void print_cmd_prompt(void);
|
||||
void print_port(uint8_t port);
|
||||
void print_phys_port(uint8_t port);
|
||||
void phy_write_mask(uint16_t phy_mask, uint8_t dev_id, uint16_t reg, uint16_t v);
|
||||
void phy_write(uint8_t phy_id, uint8_t dev_id, uint16_t reg, uint16_t v);
|
||||
void phy_read(uint8_t phy_id, uint8_t dev_id, uint16_t reg);
|
||||
|
||||
+2
-2
@@ -262,7 +262,7 @@ void phy_set_speed(void) __banked
|
||||
{
|
||||
uint16_t v;
|
||||
|
||||
print_string("Setting port "); print_port(phy_settings.port);
|
||||
print_string("Setting port "); print_phys_port(phy_settings.port);
|
||||
if (machine.n_10g && phy_settings.port == 3)
|
||||
phy_settings.is10g_port = 1;
|
||||
if (machine.n_10g == 2 && phy_settings.port == 8)
|
||||
@@ -381,7 +381,7 @@ void phy_set_duplex(void) __banked
|
||||
{
|
||||
uint16_t v;
|
||||
|
||||
print_string("Setting port "); print_port(phy_settings.port);
|
||||
print_string("Setting port "); print_phys_port(phy_settings.port);
|
||||
if (phy_settings.duplex)
|
||||
print_string(" to full duplex");
|
||||
else
|
||||
|
||||
+4
-4
@@ -390,7 +390,7 @@ void port_l2_learned(void) __banked
|
||||
print_string("\tlearned\t");
|
||||
|
||||
port |= (sfr_data[3] & 0x3) << 2;
|
||||
print_port(port);
|
||||
print_phys_port(port);
|
||||
}
|
||||
|
||||
entry++;
|
||||
@@ -428,7 +428,7 @@ void port_stats_print(void) __banked
|
||||
{
|
||||
print_string("\nPort\tState\tLink\tTxGood\t\tTxBad\t\tRxGood\t\tRxBad\n");
|
||||
for (uint8_t i = machine.min_port; i <= machine.max_port; i++) {
|
||||
print_port(i); write_char('\t');
|
||||
print_phys_port(i); write_char('\t');
|
||||
|
||||
if (!machine.is_sfp[i]) {
|
||||
phy_read(i, PHY_MMD31, 0xa610);
|
||||
@@ -603,7 +603,7 @@ void port_eee_disable(uint8_t port) __banked
|
||||
|
||||
void port_eee_status(uint8_t port) __banked
|
||||
{
|
||||
print_string("Port: "); print_port(port);
|
||||
print_string("Port: "); print_phys_port(port);
|
||||
print_string(": ");
|
||||
if (machine.is_sfp[port]) {
|
||||
print_string("SFP\n");
|
||||
@@ -800,7 +800,7 @@ void print_port_ingress_filter_mode(vlan_ingress_mode_t mode) __banked
|
||||
|
||||
void print_vlan_ingress_port(uint8_t log_port) __banked
|
||||
{
|
||||
print_port(log_port);write_char('\t');
|
||||
print_phys_port(log_port);write_char('\t');
|
||||
print_short(port_pvid_get(log_port));write_char('\t');
|
||||
print_port_ingress_filter_mode(port_ingress_filter_get(log_port));write_char('\t');
|
||||
port_ingress_vlan_filter_get(log_port) ? print_string("Enabled") : print_string("Disabled");
|
||||
|
||||
+2
-2
@@ -813,8 +813,8 @@ void print_reg(uint16_t reg)
|
||||
print_sfr_data();
|
||||
}
|
||||
|
||||
// Print the phy port for a log port number.
|
||||
void print_port(uint8_t port)
|
||||
// Print the physical port of a logical port number.
|
||||
void print_phys_port(uint8_t port)
|
||||
{
|
||||
if (port < CPU_PORT)
|
||||
write_char(machine.log_to_phys_port[port] + '0');
|
||||
|
||||
Reference in New Issue
Block a user