diff options
-rw-r--r-- | drivers/net/team/team.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index 918a901754b6..78c7d8724614 100644 --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c | |||
@@ -1400,13 +1400,11 @@ static void team_destructor(struct net_device *dev) | |||
1400 | 1400 | ||
1401 | static int team_open(struct net_device *dev) | 1401 | static int team_open(struct net_device *dev) |
1402 | { | 1402 | { |
1403 | netif_carrier_on(dev); | ||
1404 | return 0; | 1403 | return 0; |
1405 | } | 1404 | } |
1406 | 1405 | ||
1407 | static int team_close(struct net_device *dev) | 1406 | static int team_close(struct net_device *dev) |
1408 | { | 1407 | { |
1409 | netif_carrier_off(dev); | ||
1410 | return 0; | 1408 | return 0; |
1411 | } | 1409 | } |
1412 | 1410 | ||
@@ -2560,21 +2558,43 @@ send_event: | |||
2560 | 2558 | ||
2561 | } | 2559 | } |
2562 | 2560 | ||
2561 | static void __team_carrier_check(struct team *team) | ||
2562 | { | ||
2563 | struct team_port *port; | ||
2564 | bool team_linkup; | ||
2565 | |||
2566 | team_linkup = false; | ||
2567 | list_for_each_entry(port, &team->port_list, list) { | ||
2568 | if (port->linkup) { | ||
2569 | team_linkup = true; | ||
2570 | break; | ||
2571 | } | ||
2572 | } | ||
2573 | |||
2574 | if (team_linkup) | ||
2575 | netif_carrier_on(team->dev); | ||
2576 | else | ||
2577 | netif_carrier_off(team->dev); | ||
2578 | } | ||
2579 | |||
2563 | static void __team_port_change_check(struct team_port *port, bool linkup) | 2580 | static void __team_port_change_check(struct team_port *port, bool linkup) |
2564 | { | 2581 | { |
2565 | if (port->state.linkup != linkup) | 2582 | if (port->state.linkup != linkup) |
2566 | __team_port_change_send(port, linkup); | 2583 | __team_port_change_send(port, linkup); |
2584 | __team_carrier_check(port->team); | ||
2567 | } | 2585 | } |
2568 | 2586 | ||
2569 | static void __team_port_change_port_added(struct team_port *port, bool linkup) | 2587 | static void __team_port_change_port_added(struct team_port *port, bool linkup) |
2570 | { | 2588 | { |
2571 | __team_port_change_send(port, linkup); | 2589 | __team_port_change_send(port, linkup); |
2590 | __team_carrier_check(port->team); | ||
2572 | } | 2591 | } |
2573 | 2592 | ||
2574 | static void __team_port_change_port_removed(struct team_port *port) | 2593 | static void __team_port_change_port_removed(struct team_port *port) |
2575 | { | 2594 | { |
2576 | port->removed = true; | 2595 | port->removed = true; |
2577 | __team_port_change_send(port, false); | 2596 | __team_port_change_send(port, false); |
2597 | __team_carrier_check(port->team); | ||
2578 | } | 2598 | } |
2579 | 2599 | ||
2580 | static void team_port_change_check(struct team_port *port, bool linkup) | 2600 | static void team_port_change_check(struct team_port *port, bool linkup) |