Commit d238d458 authored by Holger Eitzenberger's avatar Holger Eitzenberger Committed by David S. Miller

802.3ad: make ntt bool

Turn Need-To-Transmit port variable into a bool.  There is no
functional change.
Signed-off-by: default avatarHolger Eitzenberger <holger@eitzenberger.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d3fa4721
...@@ -629,8 +629,8 @@ static void __update_ntt(struct lacpdu *lacpdu, struct port *port) ...@@ -629,8 +629,8 @@ static void __update_ntt(struct lacpdu *lacpdu, struct port *port)
((lacpdu->partner_state & AD_STATE_SYNCHRONIZATION) != (port->actor_oper_port_state & AD_STATE_SYNCHRONIZATION)) || ((lacpdu->partner_state & AD_STATE_SYNCHRONIZATION) != (port->actor_oper_port_state & AD_STATE_SYNCHRONIZATION)) ||
((lacpdu->partner_state & AD_STATE_AGGREGATION) != (port->actor_oper_port_state & AD_STATE_AGGREGATION)) ((lacpdu->partner_state & AD_STATE_AGGREGATION) != (port->actor_oper_port_state & AD_STATE_AGGREGATION))
) { ) {
// set ntt to be TRUE
port->ntt = 1; port->ntt = true;
} }
} }
} }
...@@ -987,7 +987,7 @@ static void ad_mux_machine(struct port *port) ...@@ -987,7 +987,7 @@ static void ad_mux_machine(struct port *port)
ad_disable_collecting_distributing(port); ad_disable_collecting_distributing(port);
port->actor_oper_port_state &= ~AD_STATE_COLLECTING; port->actor_oper_port_state &= ~AD_STATE_COLLECTING;
port->actor_oper_port_state &= ~AD_STATE_DISTRIBUTING; port->actor_oper_port_state &= ~AD_STATE_DISTRIBUTING;
port->ntt = 1; port->ntt = true;
break; break;
case AD_MUX_WAITING: case AD_MUX_WAITING:
port->sm_mux_timer_counter = __ad_timer_to_ticks(AD_WAIT_WHILE_TIMER, 0); port->sm_mux_timer_counter = __ad_timer_to_ticks(AD_WAIT_WHILE_TIMER, 0);
...@@ -998,13 +998,13 @@ static void ad_mux_machine(struct port *port) ...@@ -998,13 +998,13 @@ static void ad_mux_machine(struct port *port)
port->actor_oper_port_state &= ~AD_STATE_COLLECTING; port->actor_oper_port_state &= ~AD_STATE_COLLECTING;
port->actor_oper_port_state &= ~AD_STATE_DISTRIBUTING; port->actor_oper_port_state &= ~AD_STATE_DISTRIBUTING;
ad_disable_collecting_distributing(port); ad_disable_collecting_distributing(port);
port->ntt = 1; port->ntt = true;
break; break;
case AD_MUX_COLLECTING_DISTRIBUTING: case AD_MUX_COLLECTING_DISTRIBUTING:
port->actor_oper_port_state |= AD_STATE_COLLECTING; port->actor_oper_port_state |= AD_STATE_COLLECTING;
port->actor_oper_port_state |= AD_STATE_DISTRIBUTING; port->actor_oper_port_state |= AD_STATE_DISTRIBUTING;
ad_enable_collecting_distributing(port); ad_enable_collecting_distributing(port);
port->ntt = 1; port->ntt = true;
break; break;
default: //to silence the compiler default: //to silence the compiler
break; break;
...@@ -1163,11 +1163,13 @@ static void ad_tx_machine(struct port *port) ...@@ -1163,11 +1163,13 @@ static void ad_tx_machine(struct port *port)
// check if there is something to send // check if there is something to send
if (port->ntt && (port->sm_vars & AD_PORT_LACP_ENABLED)) { if (port->ntt && (port->sm_vars & AD_PORT_LACP_ENABLED)) {
__update_lacpdu_from_port(port); __update_lacpdu_from_port(port);
// send the lacpdu
if (ad_lacpdu_send(port) >= 0) { if (ad_lacpdu_send(port) >= 0) {
pr_debug("Sent LACPDU on port %d\n", port->actor_port_number); pr_debug("Sent LACPDU on port %d\n", port->actor_port_number);
// mark ntt as false, so it will not be sent again until demanded
port->ntt = 0; /* mark ntt as false, so it will not be sent again until
demanded */
port->ntt = false;
} }
} }
// restart tx timer(to verify that we will not exceed AD_MAX_TX_IN_SECOND // restart tx timer(to verify that we will not exceed AD_MAX_TX_IN_SECOND
...@@ -1250,7 +1252,7 @@ static void ad_periodic_machine(struct port *port) ...@@ -1250,7 +1252,7 @@ static void ad_periodic_machine(struct port *port)
port->sm_periodic_timer_counter = __ad_timer_to_ticks(AD_PERIODIC_TIMER, (u16)(AD_SLOW_PERIODIC_TIME))-1; // decrement 1 tick we lost in the PERIODIC_TX cycle port->sm_periodic_timer_counter = __ad_timer_to_ticks(AD_PERIODIC_TIMER, (u16)(AD_SLOW_PERIODIC_TIME))-1; // decrement 1 tick we lost in the PERIODIC_TX cycle
break; break;
case AD_PERIODIC_TX: case AD_PERIODIC_TX:
port->ntt = 1; port->ntt = true;
break; break;
default: //to silence the compiler default: //to silence the compiler
break; break;
...@@ -1664,7 +1666,7 @@ static void ad_initialize_port(struct port *port, int lacp_fast) ...@@ -1664,7 +1666,7 @@ static void ad_initialize_port(struct port *port, int lacp_fast)
port->actor_system = null_mac_addr; port->actor_system = null_mac_addr;
port->actor_system_priority = 0xffff; port->actor_system_priority = 0xffff;
port->actor_port_aggregator_identifier = 0; port->actor_port_aggregator_identifier = 0;
port->ntt = 0; port->ntt = false;
port->actor_admin_port_key = 1; port->actor_admin_port_key = 1;
port->actor_oper_port_key = 1; port->actor_oper_port_key = 1;
port->actor_admin_port_state = AD_STATE_AGGREGATION | AD_STATE_LACP_ACTIVITY; port->actor_admin_port_state = AD_STATE_AGGREGATION | AD_STATE_LACP_ACTIVITY;
......
...@@ -215,7 +215,7 @@ typedef struct port { ...@@ -215,7 +215,7 @@ typedef struct port {
struct mac_addr actor_system; // This parameter is added here although it is not specified in the standard, just for simplification struct mac_addr actor_system; // This parameter is added here although it is not specified in the standard, just for simplification
u16 actor_system_priority; // This parameter is added here although it is not specified in the standard, just for simplification u16 actor_system_priority; // This parameter is added here although it is not specified in the standard, just for simplification
u16 actor_port_aggregator_identifier; u16 actor_port_aggregator_identifier;
u16 ntt; // BOOLEAN bool ntt;
u16 actor_admin_port_key; u16 actor_admin_port_key;
u16 actor_oper_port_key; u16 actor_oper_port_key;
u8 actor_admin_port_state; u8 actor_admin_port_state;
......
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