aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/xfp_phy.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/sfc/xfp_phy.c')
-rw-r--r--drivers/net/sfc/xfp_phy.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/sfc/xfp_phy.c b/drivers/net/sfc/xfp_phy.c
index f3684ad28887..276151df3a70 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
42struct xfp_phy_data { 42struct xfp_phy_data {
43 int 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}
@@ -151,7 +152,7 @@ static void xfp_phy_reconfigure(struct efx_nic *efx)
151static void xfp_phy_fini(struct efx_nic *efx) 152static void xfp_phy_fini(struct efx_nic *efx)
152{ 153{
153 /* Clobber the LED if it was blinking */ 154 /* Clobber the LED if it was blinking */
154 efx->board_info.blink(efx, 0); 155 efx->board_info.blink(efx, false);
155 156
156 /* Free the context block */ 157 /* Free the context block */
157 kfree(efx->phy_data); 158 kfree(efx->phy_data);
@@ -164,7 +165,6 @@ struct efx_phy_operations falcon_xfp_phy_ops = {
164 .check_hw = xfp_phy_check_hw, 165 .check_hw = xfp_phy_check_hw,
165 .fini = xfp_phy_fini, 166 .fini = xfp_phy_fini,
166 .clear_interrupt = xfp_phy_clear_interrupt, 167 .clear_interrupt = xfp_phy_clear_interrupt,
167 .reset_xaui = efx_port_dummy_op_void,
168 .mmds = XFP_REQUIRED_DEVS, 168 .mmds = XFP_REQUIRED_DEVS,
169 .loopbacks = XFP_LOOPBACKS, 169 .loopbacks = XFP_LOOPBACKS,
170}; 170};