Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 67c92c4c authored by cpratapa's avatar cpratapa Committed by Gerrit - the friendly Code Review server
Browse files

data-kernel: EMAC: Keep advertisement options from phy driver.



Don't set more advertisement features than the PHY
supports. Use basic GBIT and default features based
on the connection type. Rely on the PHY driver for
the remaining advertisement options.

Change-Id: I98e9b8d8db10e2ea55f1265d9e173b76237c4427
Signed-off-by: default avatarSunil <Paidimarri&lt;hisunil@codeaurora.org>
Signed-off-by: default avatarChaitanya <Pratapa&lt;cpratapa@codeaurora.org>
parent f518ee45
Loading
Loading
Loading
Loading
+9 −20
Original line number Diff line number Diff line
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1105,27 +1105,16 @@ static int DWC_ETH_QOS_init_phy(struct net_device *dev)

	if (pdata->interface == PHY_INTERFACE_MODE_GMII ||
	    pdata->interface == PHY_INTERFACE_MODE_RGMII) {
		phydev->supported = PHY_DEFAULT_FEATURES;
		phydev->supported |= SUPPORTED_10baseT_Full | SUPPORTED_100baseT_Full | SUPPORTED_1000baseT_Full;

#ifdef DWC_ETH_QOS_CERTIFICATION_PKTBURSTCNT_HALFDUPLEX
		phydev->supported &= ~SUPPORTED_1000baseT_Full;
#endif
		phy_set_max_speed(phydev, SPEED_1000);
		/* Half duplex not supported */
		phydev->supported &= ~(SUPPORTED_10baseT_Half | SUPPORTED_100baseT_Half | SUPPORTED_1000baseT_Half);
	} else if ((pdata->interface == PHY_INTERFACE_MODE_MII) ||
		   (pdata->interface == PHY_INTERFACE_MODE_RMII)) {
		phydev->supported = PHY_DEFAULT_FEATURES;
		phydev->supported |= SUPPORTED_10baseT_Full | SUPPORTED_100baseT_Full;
		phy_set_max_speed(phydev, SPEED_100);
		/* Half duplex is not supported */
		phydev->supported &= ~(SUPPORTED_10baseT_Half | SUPPORTED_100baseT_Half);
	}

#ifndef DWC_ETH_QOS_CONFIG_PGTEST
	phydev->supported |= (SUPPORTED_Pause | SUPPORTED_Asym_Pause);
#endif

    /* Lets Make the code support for both 100M and Giga bit */
/* #ifdef DWC_ETH_QOS_CONFIG_PGTEST */
/* phydev->supported = PHY_BASIC_FEATURES; */
/* #endif */

	phydev->advertising = phydev->supported;

	pdata->phydev = phydev;