Lines Matching refs:lacpdu

113 static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port);
419 static void __choose_matched(struct lacpdu *lacpdu, struct port *port) in __choose_matched() argument
425 if (((ntohs(lacpdu->partner_port) == port->actor_port_number) && in __choose_matched()
426 (ntohs(lacpdu->partner_port_priority) == port->actor_port_priority) && in __choose_matched()
427 MAC_ADDRESS_EQUAL(&(lacpdu->partner_system), &(port->actor_system)) && in __choose_matched()
428 (ntohs(lacpdu->partner_system_priority) == port->actor_system_priority) && in __choose_matched()
429 (ntohs(lacpdu->partner_key) == port->actor_oper_port_key) && in __choose_matched()
430 …((lacpdu->partner_state & AD_STATE_AGGREGATION) == (port->actor_oper_port_state & AD_STATE_AGGREGA… in __choose_matched()
431 ((lacpdu->actor_state & AD_STATE_AGGREGATION) == 0) in __choose_matched()
448 static void __record_pdu(struct lacpdu *lacpdu, struct port *port) in __record_pdu() argument
450 if (lacpdu && port) { in __record_pdu()
453 __choose_matched(lacpdu, port); in __record_pdu()
457 partner->port_number = ntohs(lacpdu->actor_port); in __record_pdu()
458 partner->port_priority = ntohs(lacpdu->actor_port_priority); in __record_pdu()
459 partner->system = lacpdu->actor_system; in __record_pdu()
460 partner->system_priority = ntohs(lacpdu->actor_system_priority); in __record_pdu()
461 partner->key = ntohs(lacpdu->actor_key); in __record_pdu()
462 partner->port_state = lacpdu->actor_state; in __record_pdu()
471 (lacpdu->actor_state & AD_STATE_SYNCHRONIZATION)) { in __record_pdu()
514 static void __update_selected(struct lacpdu *lacpdu, struct port *port) in __update_selected() argument
516 if (lacpdu && port) { in __update_selected()
522 if (ntohs(lacpdu->actor_port) != partner->port_number || in __update_selected()
523 ntohs(lacpdu->actor_port_priority) != partner->port_priority || in __update_selected()
524 !MAC_ADDRESS_EQUAL(&lacpdu->actor_system, &partner->system) || in __update_selected()
525 ntohs(lacpdu->actor_system_priority) != partner->system_priority || in __update_selected()
526 ntohs(lacpdu->actor_key) != partner->key || in __update_selected()
527 … (lacpdu->actor_state & AD_STATE_AGGREGATION) != (partner->port_state & AD_STATE_AGGREGATION)) { in __update_selected()
578 static void __update_ntt(struct lacpdu *lacpdu, struct port *port) in __update_ntt() argument
581 if (lacpdu && port) { in __update_ntt()
585 if ((ntohs(lacpdu->partner_port) != port->actor_port_number) || in __update_ntt()
586 (ntohs(lacpdu->partner_port_priority) != port->actor_port_priority) || in __update_ntt()
587 !MAC_ADDRESS_EQUAL(&(lacpdu->partner_system), &(port->actor_system)) || in __update_ntt()
588 (ntohs(lacpdu->partner_system_priority) != port->actor_system_priority) || in __update_ntt()
589 (ntohs(lacpdu->partner_key) != port->actor_oper_port_key) || in __update_ntt()
590 …((lacpdu->partner_state & AD_STATE_LACP_ACTIVITY) != (port->actor_oper_port_state & AD_STATE_LACP_… in __update_ntt()
591 …((lacpdu->partner_state & AD_STATE_LACP_TIMEOUT) != (port->actor_oper_port_state & AD_STATE_LACP_T… in __update_ntt()
592 …((lacpdu->partner_state & AD_STATE_SYNCHRONIZATION) != (port->actor_oper_port_state & AD_STATE_SYN… in __update_ntt()
593 …((lacpdu->partner_state & AD_STATE_AGGREGATION) != (port->actor_oper_port_state & AD_STATE_AGGREGA… in __update_ntt()
716 struct lacpdu *lacpdu = &port->lacpdu; in __update_lacpdu_from_port() local
726 lacpdu->actor_system_priority = htons(port->actor_system_priority); in __update_lacpdu_from_port()
727 lacpdu->actor_system = port->actor_system; in __update_lacpdu_from_port()
728 lacpdu->actor_key = htons(port->actor_oper_port_key); in __update_lacpdu_from_port()
729 lacpdu->actor_port_priority = htons(port->actor_port_priority); in __update_lacpdu_from_port()
730 lacpdu->actor_port = htons(port->actor_port_number); in __update_lacpdu_from_port()
731 lacpdu->actor_state = port->actor_oper_port_state; in __update_lacpdu_from_port()
740 lacpdu->partner_system_priority = htons(partner->system_priority); in __update_lacpdu_from_port()
741 lacpdu->partner_system = partner->system; in __update_lacpdu_from_port()
742 lacpdu->partner_key = htons(partner->key); in __update_lacpdu_from_port()
743 lacpdu->partner_port_priority = htons(partner->port_priority); in __update_lacpdu_from_port()
744 lacpdu->partner_port = htons(partner->port_number); in __update_lacpdu_from_port()
745 lacpdu->partner_state = partner->port_state; in __update_lacpdu_from_port()
793 lacpdu_header->lacpdu = port->lacpdu; in ad_lacpdu_send()
1004 static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port) in ad_rx_machine() argument
1024 else if (lacpdu && ((port->sm_rx_state == AD_RX_EXPIRED) || in ad_rx_machine()
1068 if ((port->sm_rx_state != last_state) || (lacpdu)) { in ad_rx_machine()
1120 if (MAC_ADDRESS_EQUAL(&(lacpdu->actor_system), in ad_rx_machine()
1127 __update_selected(lacpdu, port); in ad_rx_machine()
1128 __update_ntt(lacpdu, port); in ad_rx_machine()
1129 __record_pdu(lacpdu, port); in ad_rx_machine()
1746 static const struct lacpdu lacpdu = { in ad_initialize_port() local
1794 memcpy(&port->lacpdu, &lacpdu, sizeof(lacpdu)); in ad_initialize_port()
2247 static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, in bond_3ad_rx_indication() argument
2253 if (length >= sizeof(struct lacpdu)) { in bond_3ad_rx_indication()
2263 switch (lacpdu->subtype) { in bond_3ad_rx_indication()
2272 ad_rx_machine(lacpdu, port); in bond_3ad_rx_indication()
2282 switch (((struct bond_marker *)lacpdu)->tlv_type) { in bond_3ad_rx_indication()
2286 ad_marker_info_received((struct bond_marker *)lacpdu, port); in bond_3ad_rx_indication()
2292 ad_marker_response_received((struct bond_marker *)lacpdu, port); in bond_3ad_rx_indication()
2522 struct lacpdu *lacpdu, _lacpdu; in bond_3ad_lacpdu_recv() local
2530 lacpdu = skb_header_pointer(skb, 0, sizeof(_lacpdu), &_lacpdu); in bond_3ad_lacpdu_recv()
2531 if (!lacpdu) in bond_3ad_lacpdu_recv()
2534 return bond_3ad_rx_indication(lacpdu, slave, skb->len); in bond_3ad_lacpdu_recv()