diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2008-12-13 00:59:24 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-13 00:59:24 -0500 |
commit | 766ca0fa6bf1600bdf4bc7726c74f14c8455c6b8 (patch) | |
tree | b1ea2df622753f2493b1053fda21c0db3f18a043 /drivers/net/sfc/xfp_phy.c | |
parent | 04cc8cacb01c09fba2297faf1477cd570ba43f0b (diff) |
sfc: Rework MAC, PHY and board event handling
From: Steve Hodgson <shodgson@solarflare.com>
MAC, PHY and board events may be separately enabled and signalled.
Our current arrangement of chaining the polling functions can result
in events being missed. Change them to be more independent.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/xfp_phy.c')
-rw-r--r-- | drivers/net/sfc/xfp_phy.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/net/sfc/xfp_phy.c b/drivers/net/sfc/xfp_phy.c index fbe8e25a1ed5..345ffc310dca 100644 --- a/drivers/net/sfc/xfp_phy.c +++ b/drivers/net/sfc/xfp_phy.c | |||
@@ -119,24 +119,12 @@ static int xfp_link_ok(struct efx_nic *efx) | |||
119 | return mdio_clause45_links_ok(efx, XFP_REQUIRED_DEVS); | 119 | return mdio_clause45_links_ok(efx, XFP_REQUIRED_DEVS); |
120 | } | 120 | } |
121 | 121 | ||
122 | static int xfp_phy_check_hw(struct efx_nic *efx) | 122 | static void xfp_phy_poll(struct efx_nic *efx) |
123 | { | 123 | { |
124 | int rc = 0; | ||
125 | int link_up = xfp_link_ok(efx); | 124 | int link_up = xfp_link_ok(efx); |
126 | /* Simulate a PHY event if link state has changed */ | 125 | /* Simulate a PHY event if link state has changed */ |
127 | if (link_up != efx->link_up) | 126 | if (link_up != efx->link_up) |
128 | falcon_sim_phy_event(efx); | 127 | falcon_sim_phy_event(efx); |
129 | |||
130 | rc = efx->board_info.monitor(efx); | ||
131 | if (rc) { | ||
132 | struct xfp_phy_data *phy_data = efx->phy_data; | ||
133 | EFX_ERR(efx, "XFP sensor alert; putting PHY into low power\n"); | ||
134 | efx->phy_mode |= PHY_MODE_LOW_POWER; | ||
135 | mdio_clause45_set_mmds_lpower(efx, 1, XFP_REQUIRED_DEVS); | ||
136 | phy_data->phy_mode |= PHY_MODE_LOW_POWER; | ||
137 | } | ||
138 | |||
139 | return rc; | ||
140 | } | 128 | } |
141 | 129 | ||
142 | static void xfp_phy_reconfigure(struct efx_nic *efx) | 130 | static void xfp_phy_reconfigure(struct efx_nic *efx) |
@@ -173,7 +161,7 @@ struct efx_phy_operations falcon_xfp_phy_ops = { | |||
173 | .macs = EFX_XMAC, | 161 | .macs = EFX_XMAC, |
174 | .init = xfp_phy_init, | 162 | .init = xfp_phy_init, |
175 | .reconfigure = xfp_phy_reconfigure, | 163 | .reconfigure = xfp_phy_reconfigure, |
176 | .check_hw = xfp_phy_check_hw, | 164 | .poll = xfp_phy_poll, |
177 | .fini = xfp_phy_fini, | 165 | .fini = xfp_phy_fini, |
178 | .clear_interrupt = xfp_phy_clear_interrupt, | 166 | .clear_interrupt = xfp_phy_clear_interrupt, |
179 | .get_settings = mdio_clause45_get_settings, | 167 | .get_settings = mdio_clause45_get_settings, |