Commit e122966d authored by Petri Gynther's avatar Petri Gynther Committed by David S. Miller

net: bcmgenet: add UMAC_IRQ_LINK_EVENT

Add #define UMAC_IRQ_LINK_EVENT to simplify link event handling code.
Signed-off-by: default avatarPetri Gynther <pgynther@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fac25940
...@@ -1730,9 +1730,9 @@ static int init_umac(struct bcmgenet_priv *priv) ...@@ -1730,9 +1730,9 @@ static int init_umac(struct bcmgenet_priv *priv)
/* Monitor cable plug/unplugged event for internal PHY */ /* Monitor cable plug/unplugged event for internal PHY */
if (phy_is_internal(priv->phydev)) { if (phy_is_internal(priv->phydev)) {
int0_enable |= (UMAC_IRQ_LINK_DOWN | UMAC_IRQ_LINK_UP); int0_enable |= UMAC_IRQ_LINK_EVENT;
} else if (priv->ext_phy) { } else if (priv->ext_phy) {
int0_enable |= (UMAC_IRQ_LINK_DOWN | UMAC_IRQ_LINK_UP); int0_enable |= UMAC_IRQ_LINK_EVENT;
} else if (priv->phy_interface == PHY_INTERFACE_MODE_MOCA) { } else if (priv->phy_interface == PHY_INTERFACE_MODE_MOCA) {
reg = bcmgenet_bp_mc_get(priv); reg = bcmgenet_bp_mc_get(priv);
reg |= BIT(priv->hw_params->bp_in_en_shift); reg |= BIT(priv->hw_params->bp_in_en_shift);
...@@ -2271,10 +2271,10 @@ static void bcmgenet_irq_task(struct work_struct *work) ...@@ -2271,10 +2271,10 @@ static void bcmgenet_irq_task(struct work_struct *work)
/* Link UP/DOWN event */ /* Link UP/DOWN event */
if ((priv->hw_params->flags & GENET_HAS_MDIO_INTR) && if ((priv->hw_params->flags & GENET_HAS_MDIO_INTR) &&
(priv->irq0_stat & (UMAC_IRQ_LINK_UP|UMAC_IRQ_LINK_DOWN))) { (priv->irq0_stat & UMAC_IRQ_LINK_EVENT)) {
phy_mac_interrupt(priv->phydev, phy_mac_interrupt(priv->phydev,
priv->irq0_stat & UMAC_IRQ_LINK_UP); priv->irq0_stat & UMAC_IRQ_LINK_UP);
priv->irq0_stat &= ~(UMAC_IRQ_LINK_UP|UMAC_IRQ_LINK_DOWN); priv->irq0_stat &= ~UMAC_IRQ_LINK_EVENT;
} }
} }
...@@ -2364,8 +2364,7 @@ static irqreturn_t bcmgenet_isr0(int irq, void *dev_id) ...@@ -2364,8 +2364,7 @@ static irqreturn_t bcmgenet_isr0(int irq, void *dev_id)
if (priv->irq0_stat & (UMAC_IRQ_PHY_DET_R | if (priv->irq0_stat & (UMAC_IRQ_PHY_DET_R |
UMAC_IRQ_PHY_DET_F | UMAC_IRQ_PHY_DET_F |
UMAC_IRQ_LINK_UP | UMAC_IRQ_LINK_EVENT |
UMAC_IRQ_LINK_DOWN |
UMAC_IRQ_HFB_SM | UMAC_IRQ_HFB_SM |
UMAC_IRQ_HFB_MM | UMAC_IRQ_HFB_MM |
UMAC_IRQ_MPD_R)) { UMAC_IRQ_MPD_R)) {
......
...@@ -293,6 +293,7 @@ struct bcmgenet_mib_counters { ...@@ -293,6 +293,7 @@ struct bcmgenet_mib_counters {
#define UMAC_IRQ_PHY_DET_F (1 << 3) #define UMAC_IRQ_PHY_DET_F (1 << 3)
#define UMAC_IRQ_LINK_UP (1 << 4) #define UMAC_IRQ_LINK_UP (1 << 4)
#define UMAC_IRQ_LINK_DOWN (1 << 5) #define UMAC_IRQ_LINK_DOWN (1 << 5)
#define UMAC_IRQ_LINK_EVENT (UMAC_IRQ_LINK_UP | UMAC_IRQ_LINK_DOWN)
#define UMAC_IRQ_UMAC (1 << 6) #define UMAC_IRQ_UMAC (1 << 6)
#define UMAC_IRQ_UMAC_TSV (1 << 7) #define UMAC_IRQ_UMAC_TSV (1 << 7)
#define UMAC_IRQ_TBUF_UNDERRUN (1 << 8) #define UMAC_IRQ_TBUF_UNDERRUN (1 << 8)
......
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