aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_3ad.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bonding/bond_3ad.c')
-rw-r--r--drivers/net/bonding/bond_3ad.c42
1 files changed, 9 insertions, 33 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 94bd73941451..7a045a37056e 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -101,7 +101,6 @@ static u16 __get_link_speed(struct port *port);
101static u8 __get_duplex(struct port *port); 101static u8 __get_duplex(struct port *port);
102static inline void __initialize_port_locks(struct port *port); 102static inline void __initialize_port_locks(struct port *port);
103//conversions 103//conversions
104static void __htons_lacpdu(struct lacpdu *lacpdu);
105static u16 __ad_timer_to_ticks(u16 timer_type, u16 Par); 104static u16 __ad_timer_to_ticks(u16 timer_type, u16 Par);
106 105
107 106
@@ -420,26 +419,6 @@ static inline void __initialize_port_locks(struct port *port)
420} 419}
421 420
422//conversions 421//conversions
423/**
424 * __htons_lacpdu - convert the contents of a LACPDU to network byte order
425 * @lacpdu: the speicifed lacpdu
426 *
427 * For each multi-byte field in the lacpdu, convert its content
428 */
429static void __htons_lacpdu(struct lacpdu *lacpdu)
430{
431 if (lacpdu) {
432 lacpdu->actor_system_priority = htons(lacpdu->actor_system_priority);
433 lacpdu->actor_key = htons(lacpdu->actor_key);
434 lacpdu->actor_port_priority = htons(lacpdu->actor_port_priority);
435 lacpdu->actor_port = htons(lacpdu->actor_port);
436 lacpdu->partner_system_priority = htons(lacpdu->partner_system_priority);
437 lacpdu->partner_key = htons(lacpdu->partner_key);
438 lacpdu->partner_port_priority = htons(lacpdu->partner_port_priority);
439 lacpdu->partner_port = htons(lacpdu->partner_port);
440 lacpdu->collector_max_delay = htons(lacpdu->collector_max_delay);
441 }
442}
443 422
444/** 423/**
445 * __ad_timer_to_ticks - convert a given timer type to AD module ticks 424 * __ad_timer_to_ticks - convert a given timer type to AD module ticks
@@ -827,11 +806,11 @@ static inline void __update_lacpdu_from_port(struct port *port)
827 * lacpdu->actor_information_length initialized 806 * lacpdu->actor_information_length initialized
828 */ 807 */
829 808
830 lacpdu->actor_system_priority = port->actor_system_priority; 809 lacpdu->actor_system_priority = htons(port->actor_system_priority);
831 lacpdu->actor_system = port->actor_system; 810 lacpdu->actor_system = port->actor_system;
832 lacpdu->actor_key = port->actor_oper_port_key; 811 lacpdu->actor_key = htons(port->actor_oper_port_key);
833 lacpdu->actor_port_priority = port->actor_port_priority; 812 lacpdu->actor_port_priority = htons(port->actor_port_priority);
834 lacpdu->actor_port = port->actor_port_number; 813 lacpdu->actor_port = htons(port->actor_port_number);
835 lacpdu->actor_state = port->actor_oper_port_state; 814 lacpdu->actor_state = port->actor_oper_port_state;
836 815
837 /* lacpdu->reserved_3_1 initialized 816 /* lacpdu->reserved_3_1 initialized
@@ -839,11 +818,11 @@ static inline void __update_lacpdu_from_port(struct port *port)
839 * lacpdu->partner_information_length initialized 818 * lacpdu->partner_information_length initialized
840 */ 819 */
841 820
842 lacpdu->partner_system_priority = port->partner_oper_system_priority; 821 lacpdu->partner_system_priority = htons(port->partner_oper_system_priority);
843 lacpdu->partner_system = port->partner_oper_system; 822 lacpdu->partner_system = port->partner_oper_system;
844 lacpdu->partner_key = port->partner_oper_key; 823 lacpdu->partner_key = htons(port->partner_oper_key);
845 lacpdu->partner_port_priority = port->partner_oper_port_priority; 824 lacpdu->partner_port_priority = htons(port->partner_oper_port_priority);
846 lacpdu->partner_port = port->partner_oper_port_number; 825 lacpdu->partner_port = htons(port->partner_oper_port_number);
847 lacpdu->partner_state = port->partner_oper_port_state; 826 lacpdu->partner_state = port->partner_oper_port_state;
848 827
849 /* lacpdu->reserved_3_2 initialized 828 /* lacpdu->reserved_3_2 initialized
@@ -855,9 +834,6 @@ static inline void __update_lacpdu_from_port(struct port *port)
855 * terminator_length initialized 834 * terminator_length initialized
856 * reserved_50[50] initialized 835 * reserved_50[50] initialized
857 */ 836 */
858
859 /* Convert all non u8 parameters to Big Endian for transmit */
860 __htons_lacpdu(lacpdu);
861} 837}
862 838
863////////////////////////////////////////////////////////////////////////////////////// 839//////////////////////////////////////////////////////////////////////////////////////
@@ -1834,7 +1810,7 @@ static void ad_initialize_lacpdu(struct lacpdu *lacpdu)
1834 } 1810 }
1835 lacpdu->tlv_type_collector_info = 0x03; 1811 lacpdu->tlv_type_collector_info = 0x03;
1836 lacpdu->collector_information_length= 0x10; 1812 lacpdu->collector_information_length= 0x10;
1837 lacpdu->collector_max_delay = AD_COLLECTOR_MAX_DELAY; 1813 lacpdu->collector_max_delay = htons(AD_COLLECTOR_MAX_DELAY);
1838 for (index=0; index<=11; index++) { 1814 for (index=0; index<=11; index++) {
1839 lacpdu->reserved_12[index]=0; 1815 lacpdu->reserved_12[index]=0;
1840 } 1816 }