diff options
author | Holger Eitzenberger <holger@eitzenberger.org> | 2008-12-26 14:18:15 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-26 14:18:15 -0500 |
commit | d238d458a70ad134cb421c3ffc66242277f30dda (patch) | |
tree | 2dd5311883e58ce341dd338aa40abc434ab57771 /drivers/net/bonding/bond_3ad.c | |
parent | d3fa4721456226d77475181a4bfbe5b3d899d65c (diff) |
802.3ad: make ntt bool
Turn Need-To-Transmit port variable into a bool. There is no
functional change.
Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_3ad.c')
-rw-r--r-- | drivers/net/bonding/bond_3ad.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index b9dd4091ede..4fa92cce1bd 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c | |||
@@ -629,8 +629,8 @@ static void __update_ntt(struct lacpdu *lacpdu, struct port *port) | |||
629 | ((lacpdu->partner_state & AD_STATE_SYNCHRONIZATION) != (port->actor_oper_port_state & AD_STATE_SYNCHRONIZATION)) || | 629 | ((lacpdu->partner_state & AD_STATE_SYNCHRONIZATION) != (port->actor_oper_port_state & AD_STATE_SYNCHRONIZATION)) || |
630 | ((lacpdu->partner_state & AD_STATE_AGGREGATION) != (port->actor_oper_port_state & AD_STATE_AGGREGATION)) | 630 | ((lacpdu->partner_state & AD_STATE_AGGREGATION) != (port->actor_oper_port_state & AD_STATE_AGGREGATION)) |
631 | ) { | 631 | ) { |
632 | // set ntt to be TRUE | 632 | |
633 | port->ntt = 1; | 633 | port->ntt = true; |
634 | } | 634 | } |
635 | } | 635 | } |
636 | } | 636 | } |
@@ -987,7 +987,7 @@ static void ad_mux_machine(struct port *port) | |||
987 | ad_disable_collecting_distributing(port); | 987 | ad_disable_collecting_distributing(port); |
988 | port->actor_oper_port_state &= ~AD_STATE_COLLECTING; | 988 | port->actor_oper_port_state &= ~AD_STATE_COLLECTING; |
989 | port->actor_oper_port_state &= ~AD_STATE_DISTRIBUTING; | 989 | port->actor_oper_port_state &= ~AD_STATE_DISTRIBUTING; |
990 | port->ntt = 1; | 990 | port->ntt = true; |
991 | break; | 991 | break; |
992 | case AD_MUX_WAITING: | 992 | case AD_MUX_WAITING: |
993 | port->sm_mux_timer_counter = __ad_timer_to_ticks(AD_WAIT_WHILE_TIMER, 0); | 993 | 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 | port->actor_oper_port_state &= ~AD_STATE_COLLECTING; | 998 | port->actor_oper_port_state &= ~AD_STATE_COLLECTING; |
999 | port->actor_oper_port_state &= ~AD_STATE_DISTRIBUTING; | 999 | port->actor_oper_port_state &= ~AD_STATE_DISTRIBUTING; |
1000 | ad_disable_collecting_distributing(port); | 1000 | ad_disable_collecting_distributing(port); |
1001 | port->ntt = 1; | 1001 | port->ntt = true; |
1002 | break; | 1002 | break; |
1003 | case AD_MUX_COLLECTING_DISTRIBUTING: | 1003 | case AD_MUX_COLLECTING_DISTRIBUTING: |
1004 | port->actor_oper_port_state |= AD_STATE_COLLECTING; | 1004 | port->actor_oper_port_state |= AD_STATE_COLLECTING; |
1005 | port->actor_oper_port_state |= AD_STATE_DISTRIBUTING; | 1005 | port->actor_oper_port_state |= AD_STATE_DISTRIBUTING; |
1006 | ad_enable_collecting_distributing(port); | 1006 | ad_enable_collecting_distributing(port); |
1007 | port->ntt = 1; | 1007 | port->ntt = true; |
1008 | break; | 1008 | break; |
1009 | default: //to silence the compiler | 1009 | default: //to silence the compiler |
1010 | break; | 1010 | break; |
@@ -1163,11 +1163,13 @@ static void ad_tx_machine(struct port *port) | |||
1163 | // check if there is something to send | 1163 | // check if there is something to send |
1164 | if (port->ntt && (port->sm_vars & AD_PORT_LACP_ENABLED)) { | 1164 | if (port->ntt && (port->sm_vars & AD_PORT_LACP_ENABLED)) { |
1165 | __update_lacpdu_from_port(port); | 1165 | __update_lacpdu_from_port(port); |
1166 | // send the lacpdu | 1166 | |
1167 | if (ad_lacpdu_send(port) >= 0) { | 1167 | if (ad_lacpdu_send(port) >= 0) { |
1168 | pr_debug("Sent LACPDU on port %d\n", port->actor_port_number); | 1168 | pr_debug("Sent LACPDU on port %d\n", port->actor_port_number); |
1169 | // mark ntt as false, so it will not be sent again until demanded | 1169 | |
1170 | port->ntt = 0; | 1170 | /* mark ntt as false, so it will not be sent again until |
1171 | demanded */ | ||
1172 | port->ntt = false; | ||
1171 | } | 1173 | } |
1172 | } | 1174 | } |
1173 | // restart tx timer(to verify that we will not exceed AD_MAX_TX_IN_SECOND | 1175 | // 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 | 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 | 1252 | 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 |
1251 | break; | 1253 | break; |
1252 | case AD_PERIODIC_TX: | 1254 | case AD_PERIODIC_TX: |
1253 | port->ntt = 1; | 1255 | port->ntt = true; |
1254 | break; | 1256 | break; |
1255 | default: //to silence the compiler | 1257 | default: //to silence the compiler |
1256 | break; | 1258 | break; |
@@ -1664,7 +1666,7 @@ static void ad_initialize_port(struct port *port, int lacp_fast) | |||
1664 | port->actor_system = null_mac_addr; | 1666 | port->actor_system = null_mac_addr; |
1665 | port->actor_system_priority = 0xffff; | 1667 | port->actor_system_priority = 0xffff; |
1666 | port->actor_port_aggregator_identifier = 0; | 1668 | port->actor_port_aggregator_identifier = 0; |
1667 | port->ntt = 0; | 1669 | port->ntt = false; |
1668 | port->actor_admin_port_key = 1; | 1670 | port->actor_admin_port_key = 1; |
1669 | port->actor_oper_port_key = 1; | 1671 | port->actor_oper_port_key = 1; |
1670 | port->actor_admin_port_state = AD_STATE_AGGREGATION | AD_STATE_LACP_ACTIVITY; | 1672 | port->actor_admin_port_state = AD_STATE_AGGREGATION | AD_STATE_LACP_ACTIVITY; |