aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc/mcdi_phy.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2011-12-19 19:44:06 -0500
committerBen Hutchings <bhutchings@solarflare.com>2012-01-09 12:08:16 -0500
commit05a9320f7e64b69cbf612a69b7358546519ffc30 (patch)
tree91fb1d688592461e589ef4ab8226ee370446e2d9 /drivers/net/ethernet/sfc/mcdi_phy.c
parent783b6bb66d4289826b3d022ad7b8ac3666951bb6 (diff)
sfc: Update MCDI (firmware interface) definitions
Some commands and constants have been renamed; adjust the code accordingly. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/ethernet/sfc/mcdi_phy.c')
-rw-r--r--drivers/net/ethernet/sfc/mcdi_phy.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/net/ethernet/sfc/mcdi_phy.c b/drivers/net/ethernet/sfc/mcdi_phy.c
index 3077bf1e7dfe..7bcad899a936 100644
--- a/drivers/net/ethernet/sfc/mcdi_phy.c
+++ b/drivers/net/ethernet/sfc/mcdi_phy.c
@@ -116,7 +116,7 @@ static int efx_mcdi_loopback_modes(struct efx_nic *efx, u64 *loopback_modes)
116 goto fail; 116 goto fail;
117 } 117 }
118 118
119 *loopback_modes = MCDI_QWORD(outbuf, GET_LOOPBACK_MODES_SUGGESTED); 119 *loopback_modes = MCDI_QWORD(outbuf, GET_LOOPBACK_MODES_OUT_SUGGESTED);
120 120
121 return 0; 121 return 0;
122 122
@@ -264,22 +264,22 @@ static u32 efx_get_mcdi_phy_flags(struct efx_nic *efx)
264 264
265 /* TODO: Advertise the capabilities supported by this PHY */ 265 /* TODO: Advertise the capabilities supported by this PHY */
266 supported = 0; 266 supported = 0;
267 if (phy_cfg->flags & (1 << MC_CMD_GET_PHY_CFG_TXDIS_LBN)) 267 if (phy_cfg->flags & (1 << MC_CMD_GET_PHY_CFG_OUT_TXDIS_LBN))
268 supported |= PHY_MODE_TX_DISABLED; 268 supported |= PHY_MODE_TX_DISABLED;
269 if (phy_cfg->flags & (1 << MC_CMD_GET_PHY_CFG_LOWPOWER_LBN)) 269 if (phy_cfg->flags & (1 << MC_CMD_GET_PHY_CFG_OUT_LOWPOWER_LBN))
270 supported |= PHY_MODE_LOW_POWER; 270 supported |= PHY_MODE_LOW_POWER;
271 if (phy_cfg->flags & (1 << MC_CMD_GET_PHY_CFG_POWEROFF_LBN)) 271 if (phy_cfg->flags & (1 << MC_CMD_GET_PHY_CFG_OUT_POWEROFF_LBN))
272 supported |= PHY_MODE_OFF; 272 supported |= PHY_MODE_OFF;
273 273
274 mode = efx->phy_mode & supported; 274 mode = efx->phy_mode & supported;
275 275
276 flags = 0; 276 flags = 0;
277 if (mode & PHY_MODE_TX_DISABLED) 277 if (mode & PHY_MODE_TX_DISABLED)
278 flags |= (1 << MC_CMD_SET_LINK_TXDIS_LBN); 278 flags |= (1 << MC_CMD_SET_LINK_IN_TXDIS_LBN);
279 if (mode & PHY_MODE_LOW_POWER) 279 if (mode & PHY_MODE_LOW_POWER)
280 flags |= (1 << MC_CMD_SET_LINK_LOWPOWER_LBN); 280 flags |= (1 << MC_CMD_SET_LINK_IN_LOWPOWER_LBN);
281 if (mode & PHY_MODE_OFF) 281 if (mode & PHY_MODE_OFF)
282 flags |= (1 << MC_CMD_SET_LINK_POWEROFF_LBN); 282 flags |= (1 << MC_CMD_SET_LINK_IN_POWEROFF_LBN);
283 283
284 return flags; 284 return flags;
285} 285}
@@ -436,8 +436,8 @@ void efx_mcdi_phy_decode_link(struct efx_nic *efx,
436 break; 436 break;
437 } 437 }
438 438
439 link_state->up = !!(flags & (1 << MC_CMD_GET_LINK_LINK_UP_LBN)); 439 link_state->up = !!(flags & (1 << MC_CMD_GET_LINK_OUT_LINK_UP_LBN));
440 link_state->fd = !!(flags & (1 << MC_CMD_GET_LINK_FULL_DUPLEX_LBN)); 440 link_state->fd = !!(flags & (1 << MC_CMD_GET_LINK_OUT_FULL_DUPLEX_LBN));
441 link_state->speed = speed; 441 link_state->speed = speed;
442} 442}
443 443
@@ -592,7 +592,7 @@ static int efx_mcdi_phy_test_alive(struct efx_nic *efx)
592 592
593 if (outlen < MC_CMD_GET_PHY_STATE_OUT_LEN) 593 if (outlen < MC_CMD_GET_PHY_STATE_OUT_LEN)
594 return -EIO; 594 return -EIO;
595 if (MCDI_DWORD(outbuf, GET_PHY_STATE_STATE) != MC_CMD_PHY_STATE_OK) 595 if (MCDI_DWORD(outbuf, GET_PHY_STATE_OUT_STATE) != MC_CMD_PHY_STATE_OK)
596 return -EINVAL; 596 return -EINVAL;
597 597
598 return 0; 598 return 0;
@@ -680,7 +680,7 @@ static int efx_mcdi_phy_run_tests(struct efx_nic *efx, int *results,
680 u32 mode; 680 u32 mode;
681 int rc; 681 int rc;
682 682
683 if (phy_cfg->flags & (1 << MC_CMD_GET_PHY_CFG_BIST_LBN)) { 683 if (phy_cfg->flags & (1 << MC_CMD_GET_PHY_CFG_OUT_BIST_LBN)) {
684 rc = efx_mcdi_bist(efx, MC_CMD_PHY_BIST, results); 684 rc = efx_mcdi_bist(efx, MC_CMD_PHY_BIST, results);
685 if (rc < 0) 685 if (rc < 0)
686 return rc; 686 return rc;
@@ -691,15 +691,15 @@ static int efx_mcdi_phy_run_tests(struct efx_nic *efx, int *results,
691 /* If we support both LONG and SHORT, then run each in response to 691 /* If we support both LONG and SHORT, then run each in response to
692 * break or not. Otherwise, run the one we support */ 692 * break or not. Otherwise, run the one we support */
693 mode = 0; 693 mode = 0;
694 if (phy_cfg->flags & (1 << MC_CMD_GET_PHY_CFG_BIST_CABLE_SHORT_LBN)) { 694 if (phy_cfg->flags & (1 << MC_CMD_GET_PHY_CFG_OUT_BIST_CABLE_SHORT_LBN)) {
695 if ((flags & ETH_TEST_FL_OFFLINE) && 695 if ((flags & ETH_TEST_FL_OFFLINE) &&
696 (phy_cfg->flags & 696 (phy_cfg->flags &
697 (1 << MC_CMD_GET_PHY_CFG_BIST_CABLE_LONG_LBN))) 697 (1 << MC_CMD_GET_PHY_CFG_OUT_BIST_CABLE_LONG_LBN)))
698 mode = MC_CMD_PHY_BIST_CABLE_LONG; 698 mode = MC_CMD_PHY_BIST_CABLE_LONG;
699 else 699 else
700 mode = MC_CMD_PHY_BIST_CABLE_SHORT; 700 mode = MC_CMD_PHY_BIST_CABLE_SHORT;
701 } else if (phy_cfg->flags & 701 } else if (phy_cfg->flags &
702 (1 << MC_CMD_GET_PHY_CFG_BIST_CABLE_LONG_LBN)) 702 (1 << MC_CMD_GET_PHY_CFG_OUT_BIST_CABLE_LONG_LBN))
703 mode = MC_CMD_PHY_BIST_CABLE_LONG; 703 mode = MC_CMD_PHY_BIST_CABLE_LONG;
704 704
705 if (mode != 0) { 705 if (mode != 0) {
@@ -717,14 +717,14 @@ static const char *efx_mcdi_phy_test_name(struct efx_nic *efx,
717{ 717{
718 struct efx_mcdi_phy_data *phy_cfg = efx->phy_data; 718 struct efx_mcdi_phy_data *phy_cfg = efx->phy_data;
719 719
720 if (phy_cfg->flags & (1 << MC_CMD_GET_PHY_CFG_BIST_LBN)) { 720 if (phy_cfg->flags & (1 << MC_CMD_GET_PHY_CFG_OUT_BIST_LBN)) {
721 if (index == 0) 721 if (index == 0)
722 return "bist"; 722 return "bist";
723 --index; 723 --index;
724 } 724 }
725 725
726 if (phy_cfg->flags & ((1 << MC_CMD_GET_PHY_CFG_BIST_CABLE_SHORT_LBN) | 726 if (phy_cfg->flags & ((1 << MC_CMD_GET_PHY_CFG_OUT_BIST_CABLE_SHORT_LBN) |
727 (1 << MC_CMD_GET_PHY_CFG_BIST_CABLE_LONG_LBN))) { 727 (1 << MC_CMD_GET_PHY_CFG_OUT_BIST_CABLE_LONG_LBN))) {
728 if (index == 0) 728 if (index == 0)
729 return "cable"; 729 return "cable";
730 --index; 730 --index;