static irqreturn_t bcm_sf2_switch_1_isr(int irq, void *dev_id) { struct dsa_switch *ds = dev_id; struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds); priv->irq1_stat = intrl2_1_readl(priv, INTRL2_CPU_STATUS) & ~priv->irq1_mask; intrl2_1_writel(priv, priv->irq1_stat, INTRL2_CPU_CLEAR); if (priv->irq1_stat & P_LINK_UP_IRQ(P7_IRQ_OFF)) { priv->port_sts[7].link = true; dsa_port_phylink_mac_change(ds, 7, true); } if (priv->irq1_stat & P_LINK_DOWN_IRQ(P7_IRQ_OFF)) { priv->port_sts[7].link = false; dsa_port_phylink_mac_change(ds, 7, false); } return IRQ_HANDLED; }
static void mv88e6352_serdes_irq_link(struct mv88e6xxx_chip *chip, int port) { struct dsa_switch *ds = chip->ds; u16 status; bool up; mv88e6352_serdes_read(chip, MII_BMSR, &status); /* Status must be read twice in order to give the current link * status. Otherwise the change in link status since the last * read of the register is returned. */ mv88e6352_serdes_read(chip, MII_BMSR, &status); up = status & BMSR_LSTATUS; dsa_port_phylink_mac_change(ds, port, up); }
static void mv88e6390_serdes_irq_link_sgmii(struct mv88e6xxx_chip *chip, int port, int lane) { struct dsa_switch *ds = chip->ds; u16 status; bool up; mv88e6390_serdes_read(chip, lane, MDIO_MMD_PHYXS, MV88E6390_SGMII_STATUS, &status); /* Status must be read twice in order to give the current link * status. Otherwise the change in link status since the last * read of the register is returned. */ mv88e6390_serdes_read(chip, lane, MDIO_MMD_PHYXS, MV88E6390_SGMII_STATUS, &status); up = status & MV88E6390_SGMII_STATUS_LINK; dsa_port_phylink_mac_change(ds, port, up); }