mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
use macro for min_port and max_port for code optimization
This commit is contained in:
1 parent
c9e8403c6e
commit
7346977f91
12 files changed
+64
-61
No files matched your search
+3
-3
@@ -126,7 +126,7 @@ void igmp_setup(void) __banked
|
||||
* For now the IGMP protocols are flooded (01), MLD which MAC-based is handled by ASIC
|
||||
* All messages are allowed and maximum MC group is 0xff
|
||||
*/
|
||||
for (i = machine.min_port; i <= machine.max_port; i++)
|
||||
for (i = MACHINE_MIN_PORT; i <= MACHINE_MAX_PORT; i++)
|
||||
REG_SET(RTL837X_IGMP_PORT_CFG + (i << 2), IGMP_MAX_GROUP | IGMP_PROTOCOL_ENABLE | IGMP_FLOOD);
|
||||
|
||||
/* // Allow all physical ports to be dynamic router ports
|
||||
@@ -155,7 +155,7 @@ void igmp_enable(void) __banked
|
||||
|
||||
// Configure per-port IGMP configuration, bits 0-10 enable MC protocol snooping,
|
||||
// bits 16-24 configure max MC group used by that port. Trap to CPU (10)
|
||||
for (uint8_t i = machine.min_port; i <= machine.max_port; i++) {
|
||||
for (uint8_t i = MACHINE_MIN_PORT; i <= MACHINE_MAX_PORT; i++) {
|
||||
REG_SET(RTL837X_IGMP_PORT_CFG + (i << 2), IGMP_MAX_GROUP | IGMP_PROTOCOL_ENABLE | IGMP_TRAP);
|
||||
}
|
||||
}
|
||||
@@ -180,7 +180,7 @@ void igmp_router_port_set(uint16_t pmask) __banked
|
||||
void igmp_show(void) __banked
|
||||
{
|
||||
print_string("igmp_show called\n");
|
||||
for (uint8_t i = machine.min_port; i <= machine.max_port; i++) {
|
||||
for (uint8_t i = MACHINE_MIN_PORT; i <= MACHINE_MAX_PORT; i++) {
|
||||
write_char('0' + i); write_char(':');
|
||||
reg_read_m(RTL837X_IGMP_PORT_CFG + (i << 2));
|
||||
print_sfr_data();
|
||||
|
||||
Reference in new issue
Block a user