aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/ethtool.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2011-06-24 15:50:07 -0400
committerBen Hutchings <bhutchings@solarflare.com>2011-06-24 19:43:48 -0400
commit0e2a9c7cb941db993f481cdd6a99d70a302053e0 (patch)
tree1b71555f2b37dfcc10d7471c96a3de56293a1f84 /drivers/net/sfc/ethtool.c
parenta7d529ae2158b5300e4aa16c21f1828bc864449b (diff)
sfc: Fix mapping of reset reasons and flags to methods
There are certain hardware bugs that may occur on Falcon during normal operation, that require a reset to recover from. We try to minimise disruption by keeping the PHY running, following a reset sequence labelled as 'invisible'. Siena does not suffer from these hardware bugs, so we have not implemented an 'invisible' reset sequence. However, if a similar error does occur (due to a hardware fault or software bug) then the code shared with Falcon will wrongly assume that the PHY is not being reset. Since the mapping of reset reasons (internal) and flags (ethtool) to methods must differ significantly between NIC types, move it into per-NIC-type functions (replacing the insufficient reset_world_flags field). Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/sfc/ethtool.c')
-rw-r--r--drivers/net/sfc/ethtool.c27
1 files changed, 5 insertions, 22 deletions
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c
index d229027dc363..bc4643af6dd1 100644
--- a/drivers/net/sfc/ethtool.c
+++ b/drivers/net/sfc/ethtool.c
@@ -796,30 +796,13 @@ static int efx_ethtool_set_wol(struct net_device *net_dev,
796static int efx_ethtool_reset(struct net_device *net_dev, u32 *flags) 796static int efx_ethtool_reset(struct net_device *net_dev, u32 *flags)
797{ 797{
798 struct efx_nic *efx = netdev_priv(net_dev); 798 struct efx_nic *efx = netdev_priv(net_dev);
799 enum reset_type method; 799 int rc;
800 enum {
801 ETH_RESET_EFX_INVISIBLE = (ETH_RESET_DMA | ETH_RESET_FILTER |
802 ETH_RESET_OFFLOAD | ETH_RESET_MAC)
803 };
804
805 /* Check for minimal reset flags */
806 if ((*flags & ETH_RESET_EFX_INVISIBLE) != ETH_RESET_EFX_INVISIBLE)
807 return -EINVAL;
808 *flags ^= ETH_RESET_EFX_INVISIBLE;
809 method = RESET_TYPE_INVISIBLE;
810
811 if (*flags & ETH_RESET_PHY) {
812 *flags ^= ETH_RESET_PHY;
813 method = RESET_TYPE_ALL;
814 }
815 800
816 if ((*flags & efx->type->reset_world_flags) == 801 rc = efx->type->map_reset_flags(flags);
817 efx->type->reset_world_flags) { 802 if (rc < 0)
818 *flags ^= efx->type->reset_world_flags; 803 return rc;
819 method = RESET_TYPE_WORLD;
820 }
821 804
822 return efx_reset(efx, method); 805 return efx_reset(efx, rc);
823} 806}
824 807
825static int 808static int