diff options
Diffstat (limited to 'drivers/net/sfc/xfp_phy.c')
-rw-r--r-- | drivers/net/sfc/xfp_phy.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/sfc/xfp_phy.c b/drivers/net/sfc/xfp_phy.c index fd4045b4d9d0..f6edecc2e588 100644 --- a/drivers/net/sfc/xfp_phy.c +++ b/drivers/net/sfc/xfp_phy.c | |||
@@ -40,7 +40,7 @@ void xfp_set_led(struct efx_nic *p, int led, int mode) | |||
40 | } | 40 | } |
41 | 41 | ||
42 | struct xfp_phy_data { | 42 | struct xfp_phy_data { |
43 | bool tx_disabled; | 43 | enum efx_phy_mode phy_mode; |
44 | }; | 44 | }; |
45 | 45 | ||
46 | #define XFP_MAX_RESET_TIME 500 | 46 | #define XFP_MAX_RESET_TIME 500 |
@@ -93,7 +93,7 @@ static int xfp_phy_init(struct efx_nic *efx) | |||
93 | " %x)\n", devid, MDIO_ID_OUI(devid), MDIO_ID_MODEL(devid), | 93 | " %x)\n", devid, MDIO_ID_OUI(devid), MDIO_ID_MODEL(devid), |
94 | MDIO_ID_REV(devid)); | 94 | MDIO_ID_REV(devid)); |
95 | 95 | ||
96 | phy_data->tx_disabled = efx->tx_disabled; | 96 | phy_data->phy_mode = efx->phy_mode; |
97 | 97 | ||
98 | rc = xfp_reset_phy(efx); | 98 | rc = xfp_reset_phy(efx); |
99 | 99 | ||
@@ -136,13 +136,14 @@ static void xfp_phy_reconfigure(struct efx_nic *efx) | |||
136 | struct xfp_phy_data *phy_data = efx->phy_data; | 136 | struct xfp_phy_data *phy_data = efx->phy_data; |
137 | 137 | ||
138 | /* Reset the PHY when moving from tx off to tx on */ | 138 | /* Reset the PHY when moving from tx off to tx on */ |
139 | if (phy_data->tx_disabled && !efx->tx_disabled) | 139 | if (!(efx->phy_mode & PHY_MODE_TX_DISABLED) && |
140 | (phy_data->phy_mode & PHY_MODE_TX_DISABLED)) | ||
140 | xfp_reset_phy(efx); | 141 | xfp_reset_phy(efx); |
141 | 142 | ||
142 | mdio_clause45_transmit_disable(efx); | 143 | mdio_clause45_transmit_disable(efx); |
143 | mdio_clause45_phy_reconfigure(efx); | 144 | mdio_clause45_phy_reconfigure(efx); |
144 | 145 | ||
145 | phy_data->tx_disabled = efx->tx_disabled; | 146 | phy_data->phy_mode = efx->phy_mode; |
146 | efx->link_up = xfp_link_ok(efx); | 147 | efx->link_up = xfp_link_ok(efx); |
147 | efx->link_options = GM_LPA_10000FULL; | 148 | efx->link_options = GM_LPA_10000FULL; |
148 | } | 149 | } |