diff options
Diffstat (limited to 'drivers/net/sfc/qt202x_phy.c')
-rw-r--r-- | drivers/net/sfc/qt202x_phy.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/drivers/net/sfc/qt202x_phy.c b/drivers/net/sfc/qt202x_phy.c index f9c354e9fc3..1b174c3e6c1 100644 --- a/drivers/net/sfc/qt202x_phy.c +++ b/drivers/net/sfc/qt202x_phy.c @@ -167,29 +167,26 @@ static int qt202x_phy_init(struct efx_nic *efx) return rc; } -static void qt202x_phy_clear_interrupt(struct efx_nic *efx) -{ - /* Read to clear link status alarm */ - efx_mdio_read(efx, MDIO_MMD_PMAPMD, MDIO_PMA_LASI_STAT); -} - static int qt202x_link_ok(struct efx_nic *efx) { return efx_mdio_links_ok(efx, QT202X_REQUIRED_DEVS); } -static void qt202x_phy_poll(struct efx_nic *efx) +static bool qt202x_phy_poll(struct efx_nic *efx) { - int link_up = qt202x_link_ok(efx); - /* Simulate a PHY event if link state has changed */ - if (link_up != efx->link_state.up) - falcon_sim_phy_event(efx); + bool was_up = efx->link_state.up; + + efx->link_state.up = qt202x_link_ok(efx); + efx->link_state.speed = 10000; + efx->link_state.fd = true; + efx->link_state.fc = efx->wanted_fc; + + return efx->link_state.up != was_up; } static void qt202x_phy_reconfigure(struct efx_nic *efx) { struct qt202x_phy_data *phy_data = efx->phy_data; - struct efx_link_state *link_state = &efx->link_state; if (efx->phy_type == PHY_TYPE_QT2025C) { /* There are several different register bits which can @@ -216,10 +213,6 @@ static void qt202x_phy_reconfigure(struct efx_nic *efx) efx_mdio_phy_reconfigure(efx); phy_data->phy_mode = efx->phy_mode; - link_state->up = qt202x_link_ok(efx); - link_state->speed = 10000; - link_state->fd = true; - link_state->fc = efx->wanted_fc; } static void qt202x_phy_get_settings(struct efx_nic *efx, struct ethtool_cmd *ecmd) @@ -240,7 +233,6 @@ struct efx_phy_operations falcon_qt202x_phy_ops = { .reconfigure = qt202x_phy_reconfigure, .poll = qt202x_phy_poll, .fini = qt202x_phy_fini, - .clear_interrupt = qt202x_phy_clear_interrupt, .get_settings = qt202x_phy_get_settings, .set_settings = efx_mdio_set_settings, .mmds = QT202X_REQUIRED_DEVS, |