From 22818333990412e3c42d6095aec4f170a9b3aab9 Mon Sep 17 00:00:00 2001 From: Srinivas Kandagatla Date: Tue, 18 Oct 2011 00:01:18 +0000 Subject: [PATCH] --- yaml --- r: 266873 b: refs/heads/master c: 79ee1dc32b945ad71248332f3a3b355332ad3376 h: refs/heads/master i: 266871: d2d4db57b3ca2a0caa64426048b19b54f894a2ce v: v3 --- [refs] | 2 +- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 407be9e0c2e7..babb72c503f9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 903e21e2eea036f6947f523f732e28b33a63ed0f +refs/heads/master: 79ee1dc32b945ad71248332f3a3b355332ad3376 diff --git a/trunk/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/trunk/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 87a6b2e59e04..ae5debb1f5cd 100644 --- a/trunk/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/trunk/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -304,7 +304,7 @@ static int stmmac_init_phy(struct net_device *dev) struct phy_device *phydev; char phy_id[MII_BUS_ID_SIZE + 3]; char bus_id[MII_BUS_ID_SIZE]; - + int interface = priv->plat->interface; priv->oldlink = 0; priv->speed = 0; priv->oldduplex = -1; @@ -314,14 +314,21 @@ static int stmmac_init_phy(struct net_device *dev) priv->plat->phy_addr); pr_debug("stmmac_init_phy: trying to attach to %s\n", phy_id); - phydev = phy_connect(dev, phy_id, &stmmac_adjust_link, 0, - priv->plat->interface); + phydev = phy_connect(dev, phy_id, &stmmac_adjust_link, 0, interface); if (IS_ERR(phydev)) { pr_err("%s: Could not attach to PHY\n", dev->name); return PTR_ERR(phydev); } + /* Stop Advertising 1000BASE Capability if interface is not GMII */ + if ((interface) && ((interface == PHY_INTERFACE_MODE_MII) || + (interface == PHY_INTERFACE_MODE_RMII))) { + phydev->supported &= (PHY_BASIC_FEATURES | SUPPORTED_Pause | + SUPPORTED_Asym_Pause); + priv->phydev->advertising = priv->phydev->supported; + } + /* * Broken HW is sometimes missing the pull-up resistor on the * MDIO line, which results in reads to non-existent devices returning