diff options
author | Holger Eitzenberger <holger@eitzenberger.org> | 2008-12-17 22:12:07 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-17 22:12:07 -0500 |
commit | c7e703d01ecfb8db1557090938f0eabb51ebe3a1 (patch) | |
tree | f391f78e64c1f4ee0c4f4c98b56101ac169f577f /drivers | |
parent | 5eefd1adceb49cada224a383f4a36c2f27fe4968 (diff) |
bonding: init port_params from template
Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/bonding/bond_3ad.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index 0674d4149808..f659f97140c7 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c | |||
@@ -1675,6 +1675,14 @@ static void ad_initialize_agg(struct aggregator *aggregator) | |||
1675 | */ | 1675 | */ |
1676 | static void ad_initialize_port(struct port *port, int lacp_fast) | 1676 | static void ad_initialize_port(struct port *port, int lacp_fast) |
1677 | { | 1677 | { |
1678 | static const struct port_params tmpl = { | ||
1679 | .system_priority = 0xffff, | ||
1680 | .key = 1, | ||
1681 | .port_number = 1, | ||
1682 | .port_priority = 0xff, | ||
1683 | .port_state = 1, | ||
1684 | }; | ||
1685 | |||
1678 | if (port) { | 1686 | if (port) { |
1679 | port->actor_port_number = 1; | 1687 | port->actor_port_number = 1; |
1680 | port->actor_port_priority = 0xff; | 1688 | port->actor_port_priority = 0xff; |
@@ -1691,18 +1699,9 @@ static void ad_initialize_port(struct port *port, int lacp_fast) | |||
1691 | port->actor_oper_port_state |= AD_STATE_LACP_TIMEOUT; | 1699 | port->actor_oper_port_state |= AD_STATE_LACP_TIMEOUT; |
1692 | } | 1700 | } |
1693 | 1701 | ||
1694 | port->partner_admin.system = null_mac_addr; | 1702 | memcpy(&port->partner_admin, &tmpl, sizeof(tmpl)); |
1695 | port->partner_oper.system = null_mac_addr; | 1703 | memcpy(&port->partner_oper, &tmpl, sizeof(tmpl)); |
1696 | port->partner_admin.system_priority = 0xffff; | 1704 | |
1697 | port->partner_oper.system_priority = 0xffff; | ||
1698 | port->partner_admin.key = 1; | ||
1699 | port->partner_oper.key = 1; | ||
1700 | port->partner_admin.port_number = 1; | ||
1701 | port->partner_oper.port_number = 1; | ||
1702 | port->partner_admin.port_priority = 0xff; | ||
1703 | port->partner_oper.port_priority = 0xff; | ||
1704 | port->partner_admin.port_state = 1; | ||
1705 | port->partner_oper.port_state = 1; | ||
1706 | port->is_enabled = 1; | 1705 | port->is_enabled = 1; |
1707 | // ****** private parameters ****** | 1706 | // ****** private parameters ****** |
1708 | port->sm_vars = 0x3; | 1707 | port->sm_vars = 0x3; |