diff options
Diffstat (limited to 'drivers/net/sfc/mdio_10g.c')
-rw-r--r-- | drivers/net/sfc/mdio_10g.c | 34 |
1 files changed, 6 insertions, 28 deletions
diff --git a/drivers/net/sfc/mdio_10g.c b/drivers/net/sfc/mdio_10g.c index 56b0266b441..19e68c26d10 100644 --- a/drivers/net/sfc/mdio_10g.c +++ b/drivers/net/sfc/mdio_10g.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2006-2009 Solarflare Communications Inc. | 3 | * Copyright 2006-2011 Solarflare Communications Inc. |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify it | 5 | * This program is free software; you can redistribute it and/or modify it |
6 | * under the terms of the GNU General Public License version 2 as published | 6 | * under the terms of the GNU General Public License version 2 as published |
@@ -51,13 +51,10 @@ int efx_mdio_reset_mmd(struct efx_nic *port, int mmd, | |||
51 | return spins ? spins : -ETIMEDOUT; | 51 | return spins ? spins : -ETIMEDOUT; |
52 | } | 52 | } |
53 | 53 | ||
54 | static int efx_mdio_check_mmd(struct efx_nic *efx, int mmd, int fault_fatal) | 54 | static int efx_mdio_check_mmd(struct efx_nic *efx, int mmd) |
55 | { | 55 | { |
56 | int status; | 56 | int status; |
57 | 57 | ||
58 | if (LOOPBACK_INTERNAL(efx)) | ||
59 | return 0; | ||
60 | |||
61 | if (mmd != MDIO_MMD_AN) { | 58 | if (mmd != MDIO_MMD_AN) { |
62 | /* Read MMD STATUS2 to check it is responding. */ | 59 | /* Read MMD STATUS2 to check it is responding. */ |
63 | status = efx_mdio_read(efx, mmd, MDIO_STAT2); | 60 | status = efx_mdio_read(efx, mmd, MDIO_STAT2); |
@@ -68,20 +65,6 @@ static int efx_mdio_check_mmd(struct efx_nic *efx, int mmd, int fault_fatal) | |||
68 | } | 65 | } |
69 | } | 66 | } |
70 | 67 | ||
71 | /* Read MMD STATUS 1 to check for fault. */ | ||
72 | status = efx_mdio_read(efx, mmd, MDIO_STAT1); | ||
73 | if (status & MDIO_STAT1_FAULT) { | ||
74 | if (fault_fatal) { | ||
75 | netif_err(efx, hw, efx->net_dev, | ||
76 | "PHY MMD %d reporting fatal" | ||
77 | " fault: status %x\n", mmd, status); | ||
78 | return -EIO; | ||
79 | } else { | ||
80 | netif_dbg(efx, hw, efx->net_dev, | ||
81 | "PHY MMD %d reporting status" | ||
82 | " %x (expected)\n", mmd, status); | ||
83 | } | ||
84 | } | ||
85 | return 0; | 68 | return 0; |
86 | } | 69 | } |
87 | 70 | ||
@@ -130,8 +113,7 @@ int efx_mdio_wait_reset_mmds(struct efx_nic *efx, unsigned int mmd_mask) | |||
130 | return rc; | 113 | return rc; |
131 | } | 114 | } |
132 | 115 | ||
133 | int efx_mdio_check_mmds(struct efx_nic *efx, | 116 | int efx_mdio_check_mmds(struct efx_nic *efx, unsigned int mmd_mask) |
134 | unsigned int mmd_mask, unsigned int fatal_mask) | ||
135 | { | 117 | { |
136 | int mmd = 0, probe_mmd, devs1, devs2; | 118 | int mmd = 0, probe_mmd, devs1, devs2; |
137 | u32 devices; | 119 | u32 devices; |
@@ -161,13 +143,9 @@ int efx_mdio_check_mmds(struct efx_nic *efx, | |||
161 | 143 | ||
162 | /* Check all required MMDs are responding and happy. */ | 144 | /* Check all required MMDs are responding and happy. */ |
163 | while (mmd_mask) { | 145 | while (mmd_mask) { |
164 | if (mmd_mask & 1) { | 146 | if ((mmd_mask & 1) && efx_mdio_check_mmd(efx, mmd)) |
165 | int fault_fatal = fatal_mask & 1; | 147 | return -EIO; |
166 | if (efx_mdio_check_mmd(efx, mmd, fault_fatal)) | ||
167 | return -EIO; | ||
168 | } | ||
169 | mmd_mask = mmd_mask >> 1; | 148 | mmd_mask = mmd_mask >> 1; |
170 | fatal_mask = fatal_mask >> 1; | ||
171 | mmd++; | 149 | mmd++; |
172 | } | 150 | } |
173 | 151 | ||
@@ -337,7 +315,7 @@ int efx_mdio_test_alive(struct efx_nic *efx) | |||
337 | "no MDIO PHY present with ID %d\n", efx->mdio.prtad); | 315 | "no MDIO PHY present with ID %d\n", efx->mdio.prtad); |
338 | rc = -EINVAL; | 316 | rc = -EINVAL; |
339 | } else { | 317 | } else { |
340 | rc = efx_mdio_check_mmds(efx, efx->mdio.mmds, 0); | 318 | rc = efx_mdio_check_mmds(efx, efx->mdio.mmds); |
341 | } | 319 | } |
342 | 320 | ||
343 | mutex_unlock(&efx->mac_lock); | 321 | mutex_unlock(&efx->mac_lock); |