aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/falcon_xmac.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2009-11-28 22:42:41 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-29 19:46:28 -0500
commitd3245b28ef2a45ec4e115062a38100bd06229289 (patch)
tree036133fdf01a20f36086d5eb8606728859c056de /drivers/net/sfc/falcon_xmac.c
parentef2b90ee4dba7a3d9001f1f0003b860b39a4aaae (diff)
sfc: Refactor link configuration
Refactor PHY, MAC and NIC configuration operations so that the existing link configuration can be re-pushed with: efx->phy_op->reconfigure(efx); efx->mac_op->reconfigure(efx); and a new configuration with: efx->nic_op->reconfigure_port(efx); (plus locking and error-checking). We have not held the link settings in software (aside from flow control), and have relied on asking the hardware what they are. This is a problem because in some cases the hardware may no longer be in a state to tell us. In particular, if an entire multi-port board is reset through one port, the driver bindings to other ports have no chance to save settings before recovering. We only actually need to keep track of the autonegotiation settings, so add an ethtool advertising mask to struct efx_nic, initialise it in PHY init and update it as necessary. Remove now-unneeded uses of efx_phy_op::{get,set}_settings() and struct ethtool_cmd. Much of this was done by Steve Hodgson <shodgson@solarflare.com>. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/falcon_xmac.c')
-rw-r--r--drivers/net/sfc/falcon_xmac.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/sfc/falcon_xmac.c b/drivers/net/sfc/falcon_xmac.c
index 60dc0975cfa..898afc1b5ef 100644
--- a/drivers/net/sfc/falcon_xmac.c
+++ b/drivers/net/sfc/falcon_xmac.c
@@ -112,7 +112,7 @@ static void falcon_mask_status_intr(struct efx_nic *efx, bool enable)
112} 112}
113 113
114/* Get status of XAUI link */ 114/* Get status of XAUI link */
115bool falcon_xaui_link_ok(struct efx_nic *efx) 115static bool falcon_xaui_link_ok(struct efx_nic *efx)
116{ 116{
117 efx_oword_t reg; 117 efx_oword_t reg;
118 bool align_done, link_ok = false; 118 bool align_done, link_ok = false;
@@ -143,7 +143,7 @@ bool falcon_xaui_link_ok(struct efx_nic *efx)
143 return link_ok; 143 return link_ok;
144} 144}
145 145
146static void falcon_reconfigure_xmac_core(struct efx_nic *efx) 146void falcon_reconfigure_xmac_core(struct efx_nic *efx)
147{ 147{
148 unsigned int max_frame_len; 148 unsigned int max_frame_len;
149 efx_oword_t reg; 149 efx_oword_t reg;
@@ -275,7 +275,7 @@ static bool falcon_xmac_check_fault(struct efx_nic *efx)
275 return !falcon_check_xaui_link_up(efx, 5); 275 return !falcon_check_xaui_link_up(efx, 5);
276} 276}
277 277
278static void falcon_reconfigure_xmac(struct efx_nic *efx) 278static int falcon_reconfigure_xmac(struct efx_nic *efx)
279{ 279{
280 falcon_mask_status_intr(efx, false); 280 falcon_mask_status_intr(efx, false);
281 281
@@ -286,6 +286,8 @@ static void falcon_reconfigure_xmac(struct efx_nic *efx)
286 286
287 efx->xmac_poll_required = !falcon_check_xaui_link_up(efx, 5); 287 efx->xmac_poll_required = !falcon_check_xaui_link_up(efx, 5);
288 falcon_mask_status_intr(efx, true); 288 falcon_mask_status_intr(efx, true);
289
290 return 0;
289} 291}
290 292
291static void falcon_update_stats_xmac(struct efx_nic *efx) 293static void falcon_update_stats_xmac(struct efx_nic *efx)