static void atlx_clear_phy_int(struct atlx_adapter *adapter) { u16 phy_data; unsigned long flags; spin_lock_irqsave(&adapter->lock, flags); atlx_read_phy_reg(&adapter->hw, 19, &phy_data); spin_unlock_irqrestore(&adapter->lock, flags); }
static void atlx_check_for_link(struct atlx_adapter *adapter) { struct net_device *netdev = adapter->netdev; u16 phy_data = 0; spin_lock(&adapter->lock); adapter->phy_timer_pending = false; atlx_read_phy_reg(&adapter->hw, MII_BMSR, &phy_data); atlx_read_phy_reg(&adapter->hw, MII_BMSR, &phy_data); spin_unlock(&adapter->lock); /* notify upper layer link down ASAP */ if (!(phy_data & BMSR_LSTATUS)) { /* Link Down */ if (netif_carrier_ok(netdev)) { /* old link state: Up */ dev_info(&adapter->pdev->dev, "%s link is down\n", netdev->name); adapter->link_speed = SPEED_0; netif_carrier_off(netdev); } } schedule_work(&adapter->link_chg_task); }