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

Commit 49a9db07 authored by Wade Farnsworth's avatar Wade Farnsworth Committed by Jeff Garzik
Browse files

[PATCH] emac: add support for platform-specific unsupported PHY features



This patch adds support to the ibm_emac driver for platform-specific
unsupported PHY features.

The patch attempts to determine the highest speed and duplex when
autonegotiation is unsupported.

Signed-off-by: default avatarWade Farnsworth <wfarnsworth@mvista.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent 32b5bfab
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
@@ -1876,12 +1876,43 @@ static int emac_init_device(struct ocp_device *ocpdev, struct ibm_ocp_mal *mal)
		goto bail;
	}
	
	/* Disable any PHY features not supported by the platform */
	ep->phy_mii.def->features &= ~emacdata->phy_feat_exc;

	/* Setup initial PHY config & startup aneg */
	if (ep->phy_mii.def->ops->init)
		ep->phy_mii.def->ops->init(&ep->phy_mii);
	netif_carrier_off(ndev);
	if (ep->phy_mii.def->features & SUPPORTED_Autoneg)
		ep->want_autoneg = 1;
	else {
		ep->want_autoneg = 0;
		
		/* Select highest supported speed/duplex */
		if (ep->phy_mii.def->features & SUPPORTED_1000baseT_Full) {
			ep->phy_mii.speed = SPEED_1000;
			ep->phy_mii.duplex = DUPLEX_FULL;
		} else if (ep->phy_mii.def->features & 
			   SUPPORTED_1000baseT_Half) {
			ep->phy_mii.speed = SPEED_1000;
			ep->phy_mii.duplex = DUPLEX_HALF;
		} else if (ep->phy_mii.def->features & 
			   SUPPORTED_100baseT_Full) {
			ep->phy_mii.speed = SPEED_100;
			ep->phy_mii.duplex = DUPLEX_FULL;
		} else if (ep->phy_mii.def->features & 
			   SUPPORTED_100baseT_Half) {
			ep->phy_mii.speed = SPEED_100;
			ep->phy_mii.duplex = DUPLEX_HALF;
		} else if (ep->phy_mii.def->features & 
			   SUPPORTED_10baseT_Full) {
			ep->phy_mii.speed = SPEED_10;
			ep->phy_mii.duplex = DUPLEX_FULL;
		} else {
			ep->phy_mii.speed = SPEED_10;
			ep->phy_mii.duplex = DUPLEX_HALF;
		}
	}
	emac_start_link(ep, NULL);

	/* read the MAC Address */