aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/tg3.c
diff options
context:
space:
mode:
authorNithin Sujir <nsujir@broadcom.com>2013-04-09 08:48:04 +0000
committerDavid S. Miller <davem@davemloft.net>2013-04-09 15:14:14 -0400
commitce20f1613b1a2d55257f37c8bd26b47ef31f4cba (patch)
tree430d0dc38a3cee0ab249d582f4e3cf2d23f98da8 /drivers/net/ethernet/broadcom/tg3.c
parenttg3: Remove unnecessary phy reset during ethtool commands (diff)
downloadlinux-dev-ce20f1613b1a2d55257f37c8bd26b47ef31f4cba.tar.xz
linux-dev-ce20f1613b1a2d55257f37c8bd26b47ef31f4cba.zip
tg3: Add a warning during link settings change if mgmt enabled
When the user executes certain ethtool commands such as -s, -A, -G, -L, -r a phy reset or autonegotiate is performed which results in management traffic being interrupted. Add a warning in these cases. Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/tg3.c')
-rw-r--r--drivers/net/ethernet/broadcom/tg3.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 3f0d43f912ec..a7449984c7a6 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -2531,6 +2531,13 @@ static void tg3_carrier_off(struct tg3 *tp)
tp->link_up = false;
}
+static void tg3_warn_mgmt_link_flap(struct tg3 *tp)
+{
+ if (tg3_flag(tp, ENABLE_ASF))
+ netdev_warn(tp->dev,
+ "Management side-band traffic will be interrupted during phy settings change\n");
+}
+
/* This will reset the tigon3 PHY if there is no valid
* link unless the FORCE argument is non-zero.
*/
@@ -11565,6 +11572,8 @@ static int tg3_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
tp->link_config.duplex = cmd->duplex;
}
+ tg3_warn_mgmt_link_flap(tp);
+
if (netif_running(dev))
tg3_setup_phy(tp, 1);
@@ -11643,6 +11652,8 @@ static int tg3_nway_reset(struct net_device *dev)
if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES)
return -EINVAL;
+ tg3_warn_mgmt_link_flap(tp);
+
if (tg3_flag(tp, USE_PHYLIB)) {
if (!(tp->phy_flags & TG3_PHYFLG_IS_CONNECTED))
return -EAGAIN;
@@ -11755,6 +11766,9 @@ static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam
struct tg3 *tp = netdev_priv(dev);
int err = 0;
+ if (tp->link_config.autoneg == AUTONEG_ENABLE)
+ tg3_warn_mgmt_link_flap(tp);
+
if (tg3_flag(tp, USE_PHYLIB)) {
u32 newadv;
struct phy_device *phydev;