summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorYoshihiro Shimoda2011-03-07 22:59:45 +0100
committerDavid S. Miller2011-03-14 22:10:15 +0100
commite47c90523484518aac30498150e427d824ace705 (patch)
tree04a57da9305eca9a5202fd5f16627930b922e4a1 /drivers
parentnet: sh_eth: remove almost #ifdef of SH7763 (diff)
downloadkernel-qcow2-linux-e47c90523484518aac30498150e427d824ace705.tar.gz
kernel-qcow2-linux-e47c90523484518aac30498150e427d824ace705.tar.xz
kernel-qcow2-linux-e47c90523484518aac30498150e427d824ace705.zip
net: sh_eth: modify the PHY_INTERFACE_MODE
The previous code had hardcoded the PHY_INTERFACE_MODE_MII of phy_connect. So some Gigabit PHYs will not behave correctly. The patch adds the phy_interface in sh_eth_plat_data, so we can select the phy interface. Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/sh_eth.c3
-rw-r--r--drivers/net/sh_eth.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
index 6734311e56e4..5d28ce68f357 100644
--- a/drivers/net/sh_eth.c
+++ b/drivers/net/sh_eth.c
@@ -1071,7 +1071,7 @@ static int sh_eth_phy_init(struct net_device *ndev)
/* Try connect to PHY */
phydev = phy_connect(ndev, phy_id, sh_eth_adjust_link,
- 0, PHY_INTERFACE_MODE_MII);
+ 0, mdp->phy_interface);
if (IS_ERR(phydev)) {
dev_err(&ndev->dev, "phy_connect failed\n");
return PTR_ERR(phydev);
@@ -1669,6 +1669,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
pd = (struct sh_eth_plat_data *)(pdev->dev.platform_data);
/* get PHY ID */
mdp->phy_id = pd->phy;
+ mdp->phy_interface = pd->phy_interface;
/* EDMAC endian */
mdp->edmac_endian = pd->edmac_endian;
mdp->no_ether_link = pd->no_ether_link;
diff --git a/drivers/net/sh_eth.h b/drivers/net/sh_eth.h
index b349c5e2bcda..c3048a6ba676 100644
--- a/drivers/net/sh_eth.h
+++ b/drivers/net/sh_eth.h
@@ -781,6 +781,7 @@ struct sh_eth_private {
struct mii_bus *mii_bus; /* MDIO bus control */
struct phy_device *phydev; /* PHY device control */
enum phy_state link;
+ phy_interface_t phy_interface;
int msg_enable;
int speed;
int duplex;