aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/net/ethernet/qualcomm/emac/emac-mac.c
diff options
context:
space:
mode:
authorTimur Tabi <timur@codeaurora.org>2017-01-27 16:43:48 -0600
committerDavid S. Miller <davem@davemloft.net>2017-01-29 19:07:02 -0500
commitfd0e97b806f0331df95f5fc58cdd488d169efb7f (patch)
tree0dc31f4a8d67dbc675a99c5e7def5aa10f058ab2 /drivers/net/ethernet/qualcomm/emac/emac-mac.c
parentnet: qcom/emac: remove extraneous wake-on-lan code (diff)
downloadwireguard-linux-fd0e97b806f0331df95f5fc58cdd488d169efb7f.tar.xz
wireguard-linux-fd0e97b806f0331df95f5fc58cdd488d169efb7f.zip
net: qcom/emac: add an error interrupt handler for the sgmii
The SGMII (internal PHY) can report decode errors via an interrupt. It can also report autonegotiation status changes, but we don't need to track those. The SGMII can recover automatically from most decode errors, so we only reset the interface if we get multiple consecutive errors. It's possible for bogus decode errors to be reported while the link is being brought up. The interrupt is registered when the interface is opened, and it's enabled after the link is up. Signed-off-by: Timur Tabi <timur@codeaurora.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qualcomm/emac/emac-mac.c')
-rw-r--r--drivers/net/ethernet/qualcomm/emac/emac-mac.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/ethernet/qualcomm/emac/emac-mac.c b/drivers/net/ethernet/qualcomm/emac/emac-mac.c
index 33d7ff1f40e0..b991219862b1 100644
--- a/drivers/net/ethernet/qualcomm/emac/emac-mac.c
+++ b/drivers/net/ethernet/qualcomm/emac/emac-mac.c
@@ -951,12 +951,16 @@ static void emac_mac_rx_descs_refill(struct emac_adapter *adpt,
static void emac_adjust_link(struct net_device *netdev)
{
struct emac_adapter *adpt = netdev_priv(netdev);
+ struct emac_sgmii *sgmii = &adpt->phy;
struct phy_device *phydev = netdev->phydev;
- if (phydev->link)
+ if (phydev->link) {
emac_mac_start(adpt);
- else
+ sgmii->link_up(adpt);
+ } else {
+ sgmii->link_down(adpt);
emac_mac_stop(adpt);
+ }
phy_print_status(phydev);
}