diff options
author | Bandan Das <bandan.das@stratus.com> | 2010-10-16 16:19:58 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-10-21 06:09:49 -0400 |
commit | 128ea6c3eece8e87c05813d3a57f4ea079c3dbc7 (patch) | |
tree | 8ccdf5b26793039947df1b03628166e6371de9b6 /drivers/net/bonding/bond_3ad.c | |
parent | 7453da829786061e81c9c11b7a34a2834146894f (diff) |
bonding: cleanup : add space around operators
checkpatch.pl cleanup: Added spaces around operators at various places.
Also fixed some c99 style comments that I came across.
Signed-off-by: Bandan Das <bandan.das@stratus.com>
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 | 111 |
1 files changed, 67 insertions, 44 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index 079b9d1eead5..6b06b00af359 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c | |||
@@ -93,7 +93,7 @@ | |||
93 | // compare MAC addresses | 93 | // compare MAC addresses |
94 | #define MAC_ADDRESS_COMPARE(A, B) memcmp(A, B, ETH_ALEN) | 94 | #define MAC_ADDRESS_COMPARE(A, B) memcmp(A, B, ETH_ALEN) |
95 | 95 | ||
96 | static struct mac_addr null_mac_addr = {{0, 0, 0, 0, 0, 0}}; | 96 | static struct mac_addr null_mac_addr = { { 0, 0, 0, 0, 0, 0 } }; |
97 | static u16 ad_ticks_per_sec; | 97 | static u16 ad_ticks_per_sec; |
98 | static const int ad_delta_in_ticks = (AD_TIMER_INTERVAL * HZ) / 1000; | 98 | static const int ad_delta_in_ticks = (AD_TIMER_INTERVAL * HZ) / 1000; |
99 | 99 | ||
@@ -329,7 +329,7 @@ static u16 __get_link_speed(struct port *port) | |||
329 | * This is done in spite of the fact that the e100 driver reports 0 to be | 329 | * This is done in spite of the fact that the e100 driver reports 0 to be |
330 | * compatible with MVT in the future.*/ | 330 | * compatible with MVT in the future.*/ |
331 | if (slave->link != BOND_LINK_UP) { | 331 | if (slave->link != BOND_LINK_UP) { |
332 | speed=0; | 332 | speed = 0; |
333 | } else { | 333 | } else { |
334 | switch (slave->speed) { | 334 | switch (slave->speed) { |
335 | case SPEED_10: | 335 | case SPEED_10: |
@@ -376,17 +376,17 @@ static u8 __get_duplex(struct port *port) | |||
376 | // handling a special case: when the configuration starts with | 376 | // handling a special case: when the configuration starts with |
377 | // link down, it sets the duplex to 0. | 377 | // link down, it sets the duplex to 0. |
378 | if (slave->link != BOND_LINK_UP) { | 378 | if (slave->link != BOND_LINK_UP) { |
379 | retval=0x0; | 379 | retval = 0x0; |
380 | } else { | 380 | } else { |
381 | switch (slave->duplex) { | 381 | switch (slave->duplex) { |
382 | case DUPLEX_FULL: | 382 | case DUPLEX_FULL: |
383 | retval=0x1; | 383 | retval = 0x1; |
384 | pr_debug("Port %d Received status full duplex update from adapter\n", | 384 | pr_debug("Port %d Received status full duplex update from adapter\n", |
385 | port->actor_port_number); | 385 | port->actor_port_number); |
386 | break; | 386 | break; |
387 | case DUPLEX_HALF: | 387 | case DUPLEX_HALF: |
388 | default: | 388 | default: |
389 | retval=0x0; | 389 | retval = 0x0; |
390 | pr_debug("Port %d Received status NOT full duplex update from adapter\n", | 390 | pr_debug("Port %d Received status NOT full duplex update from adapter\n", |
391 | port->actor_port_number); | 391 | port->actor_port_number); |
392 | break; | 392 | break; |
@@ -419,7 +419,7 @@ static inline void __initialize_port_locks(struct port *port) | |||
419 | */ | 419 | */ |
420 | static u16 __ad_timer_to_ticks(u16 timer_type, u16 par) | 420 | static u16 __ad_timer_to_ticks(u16 timer_type, u16 par) |
421 | { | 421 | { |
422 | u16 retval=0; //to silence the compiler | 422 | u16 retval = 0; /* to silence the compiler */ |
423 | 423 | ||
424 | switch (timer_type) { | 424 | switch (timer_type) { |
425 | case AD_CURRENT_WHILE_TIMER: // for rx machine usage | 425 | case AD_CURRENT_WHILE_TIMER: // for rx machine usage |
@@ -653,7 +653,7 @@ static void __update_ntt(struct lacpdu *lacpdu, struct port *port) | |||
653 | */ | 653 | */ |
654 | static void __attach_bond_to_agg(struct port *port) | 654 | static void __attach_bond_to_agg(struct port *port) |
655 | { | 655 | { |
656 | port=NULL; // just to satisfy the compiler | 656 | port = NULL; /* just to satisfy the compiler */ |
657 | // This function does nothing since the parser/multiplexer of the receive | 657 | // This function does nothing since the parser/multiplexer of the receive |
658 | // and the parser/multiplexer of the aggregator are already combined | 658 | // and the parser/multiplexer of the aggregator are already combined |
659 | } | 659 | } |
@@ -668,7 +668,7 @@ static void __attach_bond_to_agg(struct port *port) | |||
668 | */ | 668 | */ |
669 | static void __detach_bond_from_agg(struct port *port) | 669 | static void __detach_bond_from_agg(struct port *port) |
670 | { | 670 | { |
671 | port=NULL; // just to satisfy the compiler | 671 | port = NULL; /* just to satisfy the compiler */ |
672 | // This function does nothing sience the parser/multiplexer of the receive | 672 | // This function does nothing sience the parser/multiplexer of the receive |
673 | // and the parser/multiplexer of the aggregator are already combined | 673 | // and the parser/multiplexer of the aggregator are already combined |
674 | } | 674 | } |
@@ -685,7 +685,9 @@ static int __agg_ports_are_ready(struct aggregator *aggregator) | |||
685 | 685 | ||
686 | if (aggregator) { | 686 | if (aggregator) { |
687 | // scan all ports in this aggregator to verfy if they are all ready | 687 | // scan all ports in this aggregator to verfy if they are all ready |
688 | for (port=aggregator->lag_ports; port; port=port->next_port_in_aggregator) { | 688 | for (port = aggregator->lag_ports; |
689 | port; | ||
690 | port = port->next_port_in_aggregator) { | ||
689 | if (!(port->sm_vars & AD_PORT_READY_N)) { | 691 | if (!(port->sm_vars & AD_PORT_READY_N)) { |
690 | retval = 0; | 692 | retval = 0; |
691 | break; | 693 | break; |
@@ -706,7 +708,8 @@ static void __set_agg_ports_ready(struct aggregator *aggregator, int val) | |||
706 | { | 708 | { |
707 | struct port *port; | 709 | struct port *port; |
708 | 710 | ||
709 | for (port=aggregator->lag_ports; port; port=port->next_port_in_aggregator) { | 711 | for (port = aggregator->lag_ports; port; |
712 | port = port->next_port_in_aggregator) { | ||
710 | if (val) { | 713 | if (val) { |
711 | port->sm_vars |= AD_PORT_READY; | 714 | port->sm_vars |= AD_PORT_READY; |
712 | } else { | 715 | } else { |
@@ -722,7 +725,7 @@ static void __set_agg_ports_ready(struct aggregator *aggregator, int val) | |||
722 | */ | 725 | */ |
723 | static u32 __get_agg_bandwidth(struct aggregator *aggregator) | 726 | static u32 __get_agg_bandwidth(struct aggregator *aggregator) |
724 | { | 727 | { |
725 | u32 bandwidth=0; | 728 | u32 bandwidth = 0; |
726 | u32 basic_speed; | 729 | u32 basic_speed; |
727 | 730 | ||
728 | if (aggregator->num_of_ports) { | 731 | if (aggregator->num_of_ports) { |
@@ -744,7 +747,7 @@ static u32 __get_agg_bandwidth(struct aggregator *aggregator) | |||
744 | bandwidth = aggregator->num_of_ports * 10000; | 747 | bandwidth = aggregator->num_of_ports * 10000; |
745 | break; | 748 | break; |
746 | default: | 749 | default: |
747 | bandwidth=0; // to silent the compilor .... | 750 | bandwidth = 0; /*to silence the compiler ....*/ |
748 | } | 751 | } |
749 | } | 752 | } |
750 | return bandwidth; | 753 | return bandwidth; |
@@ -1183,7 +1186,8 @@ static void ad_tx_machine(struct port *port) | |||
1183 | } | 1186 | } |
1184 | } | 1187 | } |
1185 | // restart tx timer(to verify that we will not exceed AD_MAX_TX_IN_SECOND | 1188 | // restart tx timer(to verify that we will not exceed AD_MAX_TX_IN_SECOND |
1186 | port->sm_tx_timer_counter=ad_ticks_per_sec/AD_MAX_TX_IN_SECOND; | 1189 | port->sm_tx_timer_counter = |
1190 | ad_ticks_per_sec/AD_MAX_TX_IN_SECOND; | ||
1187 | } | 1191 | } |
1188 | } | 1192 | } |
1189 | 1193 | ||
@@ -1294,20 +1298,24 @@ static void ad_port_selection_logic(struct port *port) | |||
1294 | // if the port is connected to other aggregator, detach it | 1298 | // if the port is connected to other aggregator, detach it |
1295 | if (port->aggregator) { | 1299 | if (port->aggregator) { |
1296 | // detach the port from its former aggregator | 1300 | // detach the port from its former aggregator |
1297 | temp_aggregator=port->aggregator; | 1301 | temp_aggregator = port->aggregator; |
1298 | for (curr_port=temp_aggregator->lag_ports; curr_port; last_port=curr_port, curr_port=curr_port->next_port_in_aggregator) { | 1302 | for (curr_port = temp_aggregator->lag_ports; curr_port; |
1303 | last_port = curr_port, | ||
1304 | curr_port = curr_port->next_port_in_aggregator) { | ||
1299 | if (curr_port == port) { | 1305 | if (curr_port == port) { |
1300 | temp_aggregator->num_of_ports--; | 1306 | temp_aggregator->num_of_ports--; |
1301 | if (!last_port) {// if it is the first port attached to the aggregator | 1307 | if (!last_port) {// if it is the first port attached to the aggregator |
1302 | temp_aggregator->lag_ports=port->next_port_in_aggregator; | 1308 | temp_aggregator->lag_ports = |
1309 | port->next_port_in_aggregator; | ||
1303 | } else {// not the first port attached to the aggregator | 1310 | } else {// not the first port attached to the aggregator |
1304 | last_port->next_port_in_aggregator=port->next_port_in_aggregator; | 1311 | last_port->next_port_in_aggregator = |
1312 | port->next_port_in_aggregator; | ||
1305 | } | 1313 | } |
1306 | 1314 | ||
1307 | // clear the port's relations to this aggregator | 1315 | // clear the port's relations to this aggregator |
1308 | port->aggregator = NULL; | 1316 | port->aggregator = NULL; |
1309 | port->next_port_in_aggregator=NULL; | 1317 | port->next_port_in_aggregator = NULL; |
1310 | port->actor_port_aggregator_identifier=0; | 1318 | port->actor_port_aggregator_identifier = 0; |
1311 | 1319 | ||
1312 | pr_debug("Port %d left LAG %d\n", | 1320 | pr_debug("Port %d left LAG %d\n", |
1313 | port->actor_port_number, | 1321 | port->actor_port_number, |
@@ -1334,7 +1342,7 @@ static void ad_port_selection_logic(struct port *port) | |||
1334 | // keep a free aggregator for later use(if needed) | 1342 | // keep a free aggregator for later use(if needed) |
1335 | if (!aggregator->lag_ports) { | 1343 | if (!aggregator->lag_ports) { |
1336 | if (!free_aggregator) { | 1344 | if (!free_aggregator) { |
1337 | free_aggregator=aggregator; | 1345 | free_aggregator = aggregator; |
1338 | } | 1346 | } |
1339 | continue; | 1347 | continue; |
1340 | } | 1348 | } |
@@ -1350,10 +1358,11 @@ static void ad_port_selection_logic(struct port *port) | |||
1350 | ) { | 1358 | ) { |
1351 | // attach to the founded aggregator | 1359 | // attach to the founded aggregator |
1352 | port->aggregator = aggregator; | 1360 | port->aggregator = aggregator; |
1353 | port->actor_port_aggregator_identifier=port->aggregator->aggregator_identifier; | 1361 | port->actor_port_aggregator_identifier = |
1354 | port->next_port_in_aggregator=aggregator->lag_ports; | 1362 | port->aggregator->aggregator_identifier; |
1363 | port->next_port_in_aggregator = aggregator->lag_ports; | ||
1355 | port->aggregator->num_of_ports++; | 1364 | port->aggregator->num_of_ports++; |
1356 | aggregator->lag_ports=port; | 1365 | aggregator->lag_ports = port; |
1357 | pr_debug("Port %d joined LAG %d(existing LAG)\n", | 1366 | pr_debug("Port %d joined LAG %d(existing LAG)\n", |
1358 | port->actor_port_number, | 1367 | port->actor_port_number, |
1359 | port->aggregator->aggregator_identifier); | 1368 | port->aggregator->aggregator_identifier); |
@@ -1370,7 +1379,8 @@ static void ad_port_selection_logic(struct port *port) | |||
1370 | if (free_aggregator) { | 1379 | if (free_aggregator) { |
1371 | // assign port a new aggregator | 1380 | // assign port a new aggregator |
1372 | port->aggregator = free_aggregator; | 1381 | port->aggregator = free_aggregator; |
1373 | port->actor_port_aggregator_identifier=port->aggregator->aggregator_identifier; | 1382 | port->actor_port_aggregator_identifier = |
1383 | port->aggregator->aggregator_identifier; | ||
1374 | 1384 | ||
1375 | // update the new aggregator's parameters | 1385 | // update the new aggregator's parameters |
1376 | // if port was responsed from the end-user | 1386 | // if port was responsed from the end-user |
@@ -1382,8 +1392,10 @@ static void ad_port_selection_logic(struct port *port) | |||
1382 | 1392 | ||
1383 | port->aggregator->actor_admin_aggregator_key = port->actor_admin_port_key; | 1393 | port->aggregator->actor_admin_aggregator_key = port->actor_admin_port_key; |
1384 | port->aggregator->actor_oper_aggregator_key = port->actor_oper_port_key; | 1394 | port->aggregator->actor_oper_aggregator_key = port->actor_oper_port_key; |
1385 | port->aggregator->partner_system=port->partner_oper.system; | 1395 | port->aggregator->partner_system = |
1386 | port->aggregator->partner_system_priority = port->partner_oper.system_priority; | 1396 | port->partner_oper.system; |
1397 | port->aggregator->partner_system_priority = | ||
1398 | port->partner_oper.system_priority; | ||
1387 | port->aggregator->partner_oper_aggregator_key = port->partner_oper.key; | 1399 | port->aggregator->partner_oper_aggregator_key = port->partner_oper.key; |
1388 | port->aggregator->receive_state = 1; | 1400 | port->aggregator->receive_state = 1; |
1389 | port->aggregator->transmit_state = 1; | 1401 | port->aggregator->transmit_state = 1; |
@@ -1785,13 +1797,16 @@ static void ad_marker_info_send(struct port *port) | |||
1785 | marker.requester_port = (((port->actor_port_number & 0xFF) << 8) |((u16)(port->actor_port_number & 0xFF00) >> 8)); | 1797 | marker.requester_port = (((port->actor_port_number & 0xFF) << 8) |((u16)(port->actor_port_number & 0xFF00) >> 8)); |
1786 | marker.requester_system = port->actor_system; | 1798 | marker.requester_system = port->actor_system; |
1787 | // convert requester_port(u32) to Big Endian | 1799 | // convert requester_port(u32) to Big Endian |
1788 | marker.requester_transaction_id = (((++port->transaction_id & 0xFF) << 24) |((port->transaction_id & 0xFF00) << 8) |((port->transaction_id & 0xFF0000) >> 8) |((port->transaction_id & 0xFF000000) >> 24)); | 1800 | marker.requester_transaction_id = |
1801 | (((++port->transaction_id & 0xFF) << 24) | ||
1802 | | ((port->transaction_id & 0xFF00) << 8) | ||
1803 | | ((port->transaction_id & 0xFF0000) >> 8) | ||
1804 | | ((port->transaction_id & 0xFF000000) >> 24)); | ||
1789 | marker.pad = 0; | 1805 | marker.pad = 0; |
1790 | marker.tlv_type_terminator = 0x00; | 1806 | marker.tlv_type_terminator = 0x00; |
1791 | marker.terminator_length = 0x00; | 1807 | marker.terminator_length = 0x00; |
1792 | for (index=0; index<90; index++) { | 1808 | for (index = 0; index < 90; index++) |
1793 | marker.reserved_90[index]=0; | 1809 | marker.reserved_90[index] = 0; |
1794 | } | ||
1795 | 1810 | ||
1796 | // send the marker information | 1811 | // send the marker information |
1797 | if (ad_marker_send(port, &marker) >= 0) { | 1812 | if (ad_marker_send(port, &marker) >= 0) { |
@@ -1816,7 +1831,7 @@ static void ad_marker_info_received(struct bond_marker *marker_info, | |||
1816 | //marker = *marker_info; | 1831 | //marker = *marker_info; |
1817 | memcpy(&marker, marker_info, sizeof(struct bond_marker)); | 1832 | memcpy(&marker, marker_info, sizeof(struct bond_marker)); |
1818 | // change the marker subtype to marker response | 1833 | // change the marker subtype to marker response |
1819 | marker.tlv_type=AD_MARKER_RESPONSE_SUBTYPE; | 1834 | marker.tlv_type = AD_MARKER_RESPONSE_SUBTYPE; |
1820 | // send the marker response | 1835 | // send the marker response |
1821 | 1836 | ||
1822 | if (ad_marker_send(port, &marker) >= 0) { | 1837 | if (ad_marker_send(port, &marker) >= 0) { |
@@ -1837,8 +1852,8 @@ static void ad_marker_info_received(struct bond_marker *marker_info, | |||
1837 | static void ad_marker_response_received(struct bond_marker *marker, | 1852 | static void ad_marker_response_received(struct bond_marker *marker, |
1838 | struct port *port) | 1853 | struct port *port) |
1839 | { | 1854 | { |
1840 | marker=NULL; // just to satisfy the compiler | 1855 | marker = NULL; /* just to satisfy the compiler */ |
1841 | port=NULL; // just to satisfy the compiler | 1856 | port = NULL; /* just to satisfy the compiler */ |
1842 | // DO NOTHING, SINCE WE DECIDED NOT TO IMPLEMENT THIS FEATURE FOR NOW | 1857 | // DO NOTHING, SINCE WE DECIDED NOT TO IMPLEMENT THIS FEATURE FOR NOW |
1843 | } | 1858 | } |
1844 | 1859 | ||
@@ -2037,8 +2052,9 @@ void bond_3ad_unbind_slave(struct slave *slave) | |||
2037 | new_aggregator->num_of_ports = aggregator->num_of_ports; | 2052 | new_aggregator->num_of_ports = aggregator->num_of_ports; |
2038 | 2053 | ||
2039 | // update the information that is written on the ports about the aggregator | 2054 | // update the information that is written on the ports about the aggregator |
2040 | for (temp_port=aggregator->lag_ports; temp_port; temp_port=temp_port->next_port_in_aggregator) { | 2055 | for (temp_port = aggregator->lag_ports; temp_port; |
2041 | temp_port->aggregator=new_aggregator; | 2056 | temp_port = temp_port->next_port_in_aggregator) { |
2057 | temp_port->aggregator = new_aggregator; | ||
2042 | temp_port->actor_port_aggregator_identifier = new_aggregator->aggregator_identifier; | 2058 | temp_port->actor_port_aggregator_identifier = new_aggregator->aggregator_identifier; |
2043 | } | 2059 | } |
2044 | 2060 | ||
@@ -2071,7 +2087,9 @@ void bond_3ad_unbind_slave(struct slave *slave) | |||
2071 | for (; temp_aggregator; temp_aggregator = __get_next_agg(temp_aggregator)) { | 2087 | for (; temp_aggregator; temp_aggregator = __get_next_agg(temp_aggregator)) { |
2072 | prev_port = NULL; | 2088 | prev_port = NULL; |
2073 | // search the port in the aggregator's related ports | 2089 | // search the port in the aggregator's related ports |
2074 | for (temp_port=temp_aggregator->lag_ports; temp_port; prev_port=temp_port, temp_port=temp_port->next_port_in_aggregator) { | 2090 | for (temp_port = temp_aggregator->lag_ports; temp_port; |
2091 | prev_port = temp_port, | ||
2092 | temp_port = temp_port->next_port_in_aggregator) { | ||
2075 | if (temp_port == port) { // the aggregator found - detach the port from this aggregator | 2093 | if (temp_port == port) { // the aggregator found - detach the port from this aggregator |
2076 | if (prev_port) { | 2094 | if (prev_port) { |
2077 | prev_port->next_port_in_aggregator = temp_port->next_port_in_aggregator; | 2095 | prev_port->next_port_in_aggregator = temp_port->next_port_in_aggregator; |
@@ -2079,7 +2097,7 @@ void bond_3ad_unbind_slave(struct slave *slave) | |||
2079 | temp_aggregator->lag_ports = temp_port->next_port_in_aggregator; | 2097 | temp_aggregator->lag_ports = temp_port->next_port_in_aggregator; |
2080 | } | 2098 | } |
2081 | temp_aggregator->num_of_ports--; | 2099 | temp_aggregator->num_of_ports--; |
2082 | if (temp_aggregator->num_of_ports==0) { | 2100 | if (temp_aggregator->num_of_ports == 0) { |
2083 | select_new_active_agg = temp_aggregator->is_active; | 2101 | select_new_active_agg = temp_aggregator->is_active; |
2084 | // clear the aggregator | 2102 | // clear the aggregator |
2085 | ad_clear_agg(temp_aggregator); | 2103 | ad_clear_agg(temp_aggregator); |
@@ -2094,7 +2112,7 @@ void bond_3ad_unbind_slave(struct slave *slave) | |||
2094 | } | 2112 | } |
2095 | } | 2113 | } |
2096 | } | 2114 | } |
2097 | port->slave=NULL; | 2115 | port->slave = NULL; |
2098 | } | 2116 | } |
2099 | 2117 | ||
2100 | /** | 2118 | /** |
@@ -2245,7 +2263,8 @@ void bond_3ad_adapter_speed_changed(struct slave *slave) | |||
2245 | } | 2263 | } |
2246 | 2264 | ||
2247 | port->actor_admin_port_key &= ~AD_SPEED_KEY_BITS; | 2265 | port->actor_admin_port_key &= ~AD_SPEED_KEY_BITS; |
2248 | port->actor_oper_port_key=port->actor_admin_port_key |= (__get_link_speed(port) << 1); | 2266 | port->actor_oper_port_key = port->actor_admin_port_key |= |
2267 | (__get_link_speed(port) << 1); | ||
2249 | pr_debug("Port %d changed speed\n", port->actor_port_number); | 2268 | pr_debug("Port %d changed speed\n", port->actor_port_number); |
2250 | // there is no need to reselect a new aggregator, just signal the | 2269 | // there is no need to reselect a new aggregator, just signal the |
2251 | // state machines to reinitialize | 2270 | // state machines to reinitialize |
@@ -2262,7 +2281,7 @@ void bond_3ad_adapter_duplex_changed(struct slave *slave) | |||
2262 | { | 2281 | { |
2263 | struct port *port; | 2282 | struct port *port; |
2264 | 2283 | ||
2265 | port=&(SLAVE_AD_INFO(slave).port); | 2284 | port = &(SLAVE_AD_INFO(slave).port); |
2266 | 2285 | ||
2267 | // if slave is null, the whole port is not initialized | 2286 | // if slave is null, the whole port is not initialized |
2268 | if (!port->slave) { | 2287 | if (!port->slave) { |
@@ -2272,7 +2291,8 @@ void bond_3ad_adapter_duplex_changed(struct slave *slave) | |||
2272 | } | 2291 | } |
2273 | 2292 | ||
2274 | port->actor_admin_port_key &= ~AD_DUPLEX_KEY_BITS; | 2293 | port->actor_admin_port_key &= ~AD_DUPLEX_KEY_BITS; |
2275 | port->actor_oper_port_key=port->actor_admin_port_key |= __get_duplex(port); | 2294 | port->actor_oper_port_key = port->actor_admin_port_key |= |
2295 | __get_duplex(port); | ||
2276 | pr_debug("Port %d changed duplex\n", port->actor_port_number); | 2296 | pr_debug("Port %d changed duplex\n", port->actor_port_number); |
2277 | // there is no need to reselect a new aggregator, just signal the | 2297 | // there is no need to reselect a new aggregator, just signal the |
2278 | // state machines to reinitialize | 2298 | // state machines to reinitialize |
@@ -2304,14 +2324,17 @@ void bond_3ad_handle_link_change(struct slave *slave, char link) | |||
2304 | if (link == BOND_LINK_UP) { | 2324 | if (link == BOND_LINK_UP) { |
2305 | port->is_enabled = true; | 2325 | port->is_enabled = true; |
2306 | port->actor_admin_port_key &= ~AD_DUPLEX_KEY_BITS; | 2326 | port->actor_admin_port_key &= ~AD_DUPLEX_KEY_BITS; |
2307 | port->actor_oper_port_key=port->actor_admin_port_key |= __get_duplex(port); | 2327 | port->actor_oper_port_key = port->actor_admin_port_key |= |
2328 | __get_duplex(port); | ||
2308 | port->actor_admin_port_key &= ~AD_SPEED_KEY_BITS; | 2329 | port->actor_admin_port_key &= ~AD_SPEED_KEY_BITS; |
2309 | port->actor_oper_port_key=port->actor_admin_port_key |= (__get_link_speed(port) << 1); | 2330 | port->actor_oper_port_key = port->actor_admin_port_key |= |
2331 | (__get_link_speed(port) << 1); | ||
2310 | } else { | 2332 | } else { |
2311 | /* link has failed */ | 2333 | /* link has failed */ |
2312 | port->is_enabled = false; | 2334 | port->is_enabled = false; |
2313 | port->actor_admin_port_key &= ~AD_DUPLEX_KEY_BITS; | 2335 | port->actor_admin_port_key &= ~AD_DUPLEX_KEY_BITS; |
2314 | port->actor_oper_port_key= (port->actor_admin_port_key &= ~AD_SPEED_KEY_BITS); | 2336 | port->actor_oper_port_key = (port->actor_admin_port_key &= |
2337 | ~AD_SPEED_KEY_BITS); | ||
2315 | } | 2338 | } |
2316 | //BOND_PRINT_DBG(("Port %d changed link status to %s", port->actor_port_number, ((link == BOND_LINK_UP)?"UP":"DOWN"))); | 2339 | //BOND_PRINT_DBG(("Port %d changed link status to %s", port->actor_port_number, ((link == BOND_LINK_UP)?"UP":"DOWN"))); |
2317 | // there is no need to reselect a new aggregator, just signal the | 2340 | // there is no need to reselect a new aggregator, just signal the |