Commit 132a01b4 authored by Russell King's avatar Russell King Committed by Greg Kroah-Hartman

net: phylink: ensure consistent phy interface mode

[ Upstream commit c6787263 ]

Ensure that we supply the same phy interface mode to mac_link_down() as
we did for the corresponding mac_link_up() call.  This ensures that MAC
drivers that use the phy interface mode in these methods can depend on
mac_link_down() always corresponding to a mac_link_up() call for the
same interface mode.
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 4c17461b
...@@ -51,6 +51,10 @@ struct phylink { ...@@ -51,6 +51,10 @@ struct phylink {
/* The link configuration settings */ /* The link configuration settings */
struct phylink_link_state link_config; struct phylink_link_state link_config;
/* The current settings */
phy_interface_t cur_interface;
struct gpio_desc *link_gpio; struct gpio_desc *link_gpio;
struct timer_list link_poll; struct timer_list link_poll;
void (*get_fixed_state)(struct net_device *dev, void (*get_fixed_state)(struct net_device *dev,
...@@ -453,12 +457,12 @@ static void phylink_resolve(struct work_struct *w) ...@@ -453,12 +457,12 @@ static void phylink_resolve(struct work_struct *w)
if (!link_state.link) { if (!link_state.link) {
netif_carrier_off(ndev); netif_carrier_off(ndev);
pl->ops->mac_link_down(ndev, pl->link_an_mode, pl->ops->mac_link_down(ndev, pl->link_an_mode,
pl->phy_state.interface); pl->cur_interface);
netdev_info(ndev, "Link is Down\n"); netdev_info(ndev, "Link is Down\n");
} else { } else {
pl->cur_interface = link_state.interface;
pl->ops->mac_link_up(ndev, pl->link_an_mode, pl->ops->mac_link_up(ndev, pl->link_an_mode,
pl->phy_state.interface, pl->cur_interface, pl->phydev);
pl->phydev);
netif_carrier_on(ndev); netif_carrier_on(ndev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment