Lines Matching refs:lacpdu
106 static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port);
467 static void __choose_matched(struct lacpdu *lacpdu, struct port *port) in __choose_matched() argument
470 if (((ntohs(lacpdu->partner_port) == port->actor_port_number) && in __choose_matched()
471 (ntohs(lacpdu->partner_port_priority) == port->actor_port_priority) && in __choose_matched()
472 !MAC_ADDRESS_COMPARE(&(lacpdu->partner_system), &(port->actor_system)) && in __choose_matched()
473 (ntohs(lacpdu->partner_system_priority) == port->actor_system_priority) && in __choose_matched()
474 (ntohs(lacpdu->partner_key) == port->actor_oper_port_key) && in __choose_matched()
475 …((lacpdu->partner_state & AD_STATE_AGGREGATION) == (port->actor_oper_port_state & AD_STATE_AGGREGA… in __choose_matched()
477 ((lacpdu->actor_state & AD_STATE_AGGREGATION) == 0) in __choose_matched()
495 static void __record_pdu(struct lacpdu *lacpdu, struct port *port) in __record_pdu() argument
497 if (lacpdu && port) { in __record_pdu()
500 __choose_matched(lacpdu, port); in __record_pdu()
502 partner->port_number = ntohs(lacpdu->actor_port); in __record_pdu()
503 partner->port_priority = ntohs(lacpdu->actor_port_priority); in __record_pdu()
504 partner->system = lacpdu->actor_system; in __record_pdu()
505 partner->system_priority = ntohs(lacpdu->actor_system_priority); in __record_pdu()
506 partner->key = ntohs(lacpdu->actor_key); in __record_pdu()
507 partner->port_state = lacpdu->actor_state; in __record_pdu()
514 && (lacpdu->actor_state & AD_STATE_SYNCHRONIZATION)) in __record_pdu()
554 static void __update_selected(struct lacpdu *lacpdu, struct port *port) in __update_selected() argument
556 if (lacpdu && port) { in __update_selected()
560 if (ntohs(lacpdu->actor_port) != partner->port_number || in __update_selected()
561 ntohs(lacpdu->actor_port_priority) != partner->port_priority || in __update_selected()
562 MAC_ADDRESS_COMPARE(&lacpdu->actor_system, &partner->system) || in __update_selected()
563 ntohs(lacpdu->actor_system_priority) != partner->system_priority || in __update_selected()
564 ntohs(lacpdu->actor_key) != partner->key || in __update_selected()
565 … (lacpdu->actor_state & AD_STATE_AGGREGATION) != (partner->port_state & AD_STATE_AGGREGATION)) { in __update_selected()
616 static void __update_ntt(struct lacpdu *lacpdu, struct port *port) in __update_ntt() argument
619 if (lacpdu && port) { in __update_ntt()
621 if ((ntohs(lacpdu->partner_port) != port->actor_port_number) || in __update_ntt()
622 (ntohs(lacpdu->partner_port_priority) != port->actor_port_priority) || in __update_ntt()
623 MAC_ADDRESS_COMPARE(&(lacpdu->partner_system), &(port->actor_system)) || in __update_ntt()
624 (ntohs(lacpdu->partner_system_priority) != port->actor_system_priority) || in __update_ntt()
625 (ntohs(lacpdu->partner_key) != port->actor_oper_port_key) || in __update_ntt()
626 …((lacpdu->partner_state & AD_STATE_LACP_ACTIVITY) != (port->actor_oper_port_state & AD_STATE_LACP_… in __update_ntt()
627 …((lacpdu->partner_state & AD_STATE_LACP_TIMEOUT) != (port->actor_oper_port_state & AD_STATE_LACP_T… in __update_ntt()
628 …((lacpdu->partner_state & AD_STATE_SYNCHRONIZATION) != (port->actor_oper_port_state & AD_STATE_SYN… in __update_ntt()
629 …((lacpdu->partner_state & AD_STATE_AGGREGATION) != (port->actor_oper_port_state & AD_STATE_AGGREGA… in __update_ntt()
770 struct lacpdu *lacpdu = &port->lacpdu; in __update_lacpdu_from_port() local
780 lacpdu->actor_system_priority = htons(port->actor_system_priority); in __update_lacpdu_from_port()
781 lacpdu->actor_system = port->actor_system; in __update_lacpdu_from_port()
782 lacpdu->actor_key = htons(port->actor_oper_port_key); in __update_lacpdu_from_port()
783 lacpdu->actor_port_priority = htons(port->actor_port_priority); in __update_lacpdu_from_port()
784 lacpdu->actor_port = htons(port->actor_port_number); in __update_lacpdu_from_port()
785 lacpdu->actor_state = port->actor_oper_port_state; in __update_lacpdu_from_port()
792 lacpdu->partner_system_priority = htons(partner->system_priority); in __update_lacpdu_from_port()
793 lacpdu->partner_system = partner->system; in __update_lacpdu_from_port()
794 lacpdu->partner_key = htons(partner->key); in __update_lacpdu_from_port()
795 lacpdu->partner_port_priority = htons(partner->port_priority); in __update_lacpdu_from_port()
796 lacpdu->partner_port = htons(partner->port_number); in __update_lacpdu_from_port()
797 lacpdu->partner_state = partner->port_state; in __update_lacpdu_from_port()
846 lacpdu_header->lacpdu = port->lacpdu; // struct copy in ad_lacpdu_send()
1022 static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port) in ad_rx_machine() argument
1040 …else if (lacpdu && ((port->sm_rx_state == AD_RX_EXPIRED) || (port->sm_rx_state == AD_RX_DEFAULTED)… in ad_rx_machine()
1079 if ((port->sm_rx_state != last_state) || (lacpdu)) { in ad_rx_machine()
1126 if (!MAC_ADDRESS_COMPARE(&(lacpdu->actor_system), &(port->actor_system))) { in ad_rx_machine()
1133 __update_selected(lacpdu, port); in ad_rx_machine()
1134 __update_ntt(lacpdu, port); in ad_rx_machine()
1135 __record_pdu(lacpdu, port); in ad_rx_machine()
1674 static const struct lacpdu lacpdu = { in ad_initialize_port() local
1720 memcpy(&port->lacpdu, &lacpdu, sizeof(lacpdu)); in ad_initialize_port()
2175 static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u16 length) in bond_3ad_rx_indication() argument
2180 if (length >= sizeof(struct lacpdu)) { in bond_3ad_rx_indication()
2190 switch (lacpdu->subtype) { in bond_3ad_rx_indication()
2197 ad_rx_machine(lacpdu, port); in bond_3ad_rx_indication()
2205 switch (((struct bond_marker *)lacpdu)->tlv_type) { in bond_3ad_rx_indication()
2209 ad_marker_info_received((struct bond_marker *)lacpdu, port); in bond_3ad_rx_indication()
2215 ad_marker_response_received((struct bond_marker *)lacpdu, port); in bond_3ad_rx_indication()
2479 struct lacpdu *lacpdu, _lacpdu; in bond_3ad_lacpdu_recv() local
2484 lacpdu = skb_header_pointer(skb, 0, sizeof(_lacpdu), &_lacpdu); in bond_3ad_lacpdu_recv()
2485 if (!lacpdu) in bond_3ad_lacpdu_recv()
2489 ret = bond_3ad_rx_indication(lacpdu, slave, skb->len); in bond_3ad_lacpdu_recv()