mirror of https://github.com/hak5/openwrt.git
parent
f45132d1d4
commit
162e272b4b
|
@ -422,19 +422,25 @@ static irqreturn_t nuport_mac_link_interrupt(int irq, void *dev_id)
|
||||||
struct nuport_mac_priv *priv = netdev_priv(dev);
|
struct nuport_mac_priv *priv = netdev_priv(dev);
|
||||||
u32 reg;
|
u32 reg;
|
||||||
u8 phy_addr;
|
u8 phy_addr;
|
||||||
|
unsigned long flags;
|
||||||
|
irqreturn_t ret = IRQ_HANDLED;
|
||||||
|
|
||||||
|
spin_lock_irqsave(&priv->lock, flags);
|
||||||
reg = nuport_mac_readl(LINK_INT_CSR);
|
reg = nuport_mac_readl(LINK_INT_CSR);
|
||||||
phy_addr = (reg >> LINK_PHY_ADDR_SHIFT) & (PHY_MAX_ADDR - 1);
|
phy_addr = (reg >> LINK_PHY_ADDR_SHIFT) & (PHY_MAX_ADDR - 1);
|
||||||
|
|
||||||
if (phy_addr != priv->phydev->addr) {
|
if (phy_addr != priv->phydev->addr) {
|
||||||
netdev_err(dev, "spurious PHY irq (phy: %d)\n", phy_addr);
|
netdev_err(dev, "spurious PHY irq (phy: %d)\n", phy_addr);
|
||||||
return IRQ_NONE;
|
ret = IRQ_NONE;
|
||||||
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
priv->phydev->link = (reg & LINK_UP);
|
priv->phydev->link = (reg & LINK_UP);
|
||||||
nuport_mac_adjust_link(dev);
|
nuport_mac_adjust_link(dev);
|
||||||
|
|
||||||
return IRQ_HANDLED;
|
out:
|
||||||
|
spin_unlock_irqrestore(&priv->lock, flags);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static irqreturn_t nuport_mac_tx_interrupt(int irq, void *dev_id)
|
static irqreturn_t nuport_mac_tx_interrupt(int irq, void *dev_id)
|
||||||
|
|
Loading…
Reference in New Issue