• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/net/bonding/

Lines Matching refs:lacpdu

106 static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port);
454 * __choose_matched - update a port's matched variable from a received lacpdu
455 * @lacpdu: the lacpdu we've received
459 * newly received lacpdu. Parameter values for the partner carried in the
476 static void __choose_matched(struct lacpdu *lacpdu, struct port *port)
479 if (((ntohs(lacpdu->partner_port) == port->actor_port_number) &&
480 (ntohs(lacpdu->partner_port_priority) == port->actor_port_priority) &&
481 !MAC_ADDRESS_COMPARE(&(lacpdu->partner_system), &(port->actor_system)) &&
482 (ntohs(lacpdu->partner_system_priority) == port->actor_system_priority) &&
483 (ntohs(lacpdu->partner_key) == port->actor_oper_port_key) &&
484 ((lacpdu->partner_state & AD_STATE_AGGREGATION) == (port->actor_oper_port_state & AD_STATE_AGGREGATION))) ||
486 ((lacpdu->actor_state & AD_STATE_AGGREGATION) == 0)
496 * __record_pdu - record parameters from a received lacpdu
497 * @lacpdu: the lacpdu we've received
500 * Record the parameter values for the Actor carried in a received lacpdu as
504 static void __record_pdu(struct lacpdu *lacpdu, struct port *port)
506 if (lacpdu && port) {
509 __choose_matched(lacpdu, port);
511 partner->port_number = ntohs(lacpdu->actor_port);
512 partner->port_priority = ntohs(lacpdu->actor_port_priority);
513 partner->system = lacpdu->actor_system;
514 partner->system_priority = ntohs(lacpdu->actor_system_priority);
515 partner->key = ntohs(lacpdu->actor_key);
516 partner->port_state = lacpdu->actor_state;
522 if ((port->sm_vars & AD_PORT_MATCHED) && (lacpdu->actor_state & AD_STATE_SYNCHRONIZATION)) {
551 * __update_selected - update a port's Selected variable from a received lacpdu
552 * @lacpdu: the lacpdu we've received
556 * newly received lacpdu. The parameter values for the Actor carried in the
563 static void __update_selected(struct lacpdu *lacpdu, struct port *port)
565 if (lacpdu && port) {
569 if (ntohs(lacpdu->actor_port) != partner->port_number ||
570 ntohs(lacpdu->actor_port_priority) != partner->port_priority ||
571 MAC_ADDRESS_COMPARE(&lacpdu->actor_system, &partner->system) ||
572 ntohs(lacpdu->actor_system_priority) != partner->system_priority ||
573 ntohs(lacpdu->actor_key) != partner->key ||
574 (lacpdu->actor_state & AD_STATE_AGGREGATION) != (partner->port_state & AD_STATE_AGGREGATION)) {
614 * __update_ntt - update a port's ntt variable from a received lacpdu
615 * @lacpdu: the lacpdu we've received
619 * received lacpdu. The parameter values for the partner carried in the
625 static void __update_ntt(struct lacpdu *lacpdu, struct port *port)
627 // validate lacpdu and port
628 if (lacpdu && port) {
630 if ((ntohs(lacpdu->partner_port) != port->actor_port_number) ||
631 (ntohs(lacpdu->partner_port_priority) != port->actor_port_priority) ||
632 MAC_ADDRESS_COMPARE(&(lacpdu->partner_system), &(port->actor_system)) ||
633 (ntohs(lacpdu->partner_system_priority) != port->actor_system_priority) ||
634 (ntohs(lacpdu->partner_key) != port->actor_oper_port_key) ||
635 ((lacpdu->partner_state & AD_STATE_LACP_ACTIVITY) != (port->actor_oper_port_state & AD_STATE_LACP_ACTIVITY)) ||
636 ((lacpdu->partner_state & AD_STATE_LACP_TIMEOUT) != (port->actor_oper_port_state & AD_STATE_LACP_TIMEOUT)) ||
637 ((lacpdu->partner_state & AD_STATE_SYNCHRONIZATION) != (port->actor_oper_port_state & AD_STATE_SYNCHRONIZATION)) ||
638 ((lacpdu->partner_state & AD_STATE_AGGREGATION) != (port->actor_oper_port_state & AD_STATE_AGGREGATION))
773 * __update_lacpdu_from_port - update a port's lacpdu fields
779 struct lacpdu *lacpdu = &port->lacpdu;
783 /* lacpdu->subtype initialized
784 * lacpdu->version_number initialized
785 * lacpdu->tlv_type_actor_info initialized
786 * lacpdu->actor_information_length initialized
789 lacpdu->actor_system_priority = htons(port->actor_system_priority);
790 lacpdu->actor_system = port->actor_system;
791 lacpdu->actor_key = htons(port->actor_oper_port_key);
792 lacpdu->actor_port_priority = htons(port->actor_port_priority);
793 lacpdu->actor_port = htons(port->actor_port_number);
794 lacpdu->actor_state = port->actor_oper_port_state;
796 /* lacpdu->reserved_3_1 initialized
797 * lacpdu->tlv_type_partner_info initialized
798 * lacpdu->partner_information_length initialized
801 lacpdu->partner_system_priority = htons(partner->system_priority);
802 lacpdu->partner_system = partner->system;
803 lacpdu->partner_key = htons(partner->key);
804 lacpdu->partner_port_priority = htons(partner->port_priority);
805 lacpdu->partner_port = htons(partner->port_number);
806 lacpdu->partner_state = partner->port_state;
808 /* lacpdu->reserved_3_2 initialized
809 * lacpdu->tlv_type_collector_info initialized
810 * lacpdu->collector_information_length initialized
824 * ad_lacpdu_send - send out a lacpdu packet on a given port
856 lacpdu_header->lacpdu = port->lacpdu; // struct copy
1025 * @lacpdu: the lacpdu we've received
1028 * If lacpdu arrived, stop previous timer (if exists) and set the next state as
1032 static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port)
1051 // check if new lacpdu arrived
1052 else if (lacpdu && ((port->sm_rx_state == AD_RX_EXPIRED) || (port->sm_rx_state == AD_RX_DEFAULTED) || (port->sm_rx_state == AD_RX_CURRENT))) {
1069 // if no lacpdu arrived and no timer is on
1087 // check if the State machine was changed or new lacpdu arrived
1088 if ((port->sm_rx_state != last_state) || (lacpdu)) {
1136 if (!MAC_ADDRESS_COMPARE(&(lacpdu->actor_system), &(port->actor_system))) {
1144 __update_selected(lacpdu, port);
1145 __update_ntt(lacpdu, port);
1146 __record_pdu(lacpdu, port);
1194 * Turn ntt flag on priodically to perform periodic transmission of lacpdu's.
1281 * and after every lacpdu receive (if selected is off).
1658 static const struct lacpdu lacpdu = {
1705 memcpy(&port->lacpdu, &lacpdu, sizeof(lacpdu));
1877 // tx timer(to verify that no more than MAX_TX_IN_SECOND lacpdu's are sent in one second)
2112 * @lacpdu: received lacpdu
2120 static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u16 length)
2124 if (length >= sizeof(struct lacpdu)) {
2134 switch (lacpdu->subtype) {
2138 ad_rx_machine(lacpdu, port);
2144 switch (((struct bond_marker *)lacpdu)->tlv_type) {
2148 ad_marker_info_received((struct bond_marker *)lacpdu, port);
2154 ad_marker_response_received((struct bond_marker *)lacpdu, port);
2406 if (!pskb_may_pull(skb, sizeof(struct lacpdu)))
2415 bond_3ad_rx_indication((struct lacpdu *) skb->data, slave, skb->len);