net: sh_eth: modify the PHY_INTERFACE_MODE
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Mon, 7 Mar 2011 21:59:45 +0000 (21:59 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Mar 2011 21:10:15 +0000 (14:10 -0700)
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>
arch/sh/include/asm/sh_eth.h
drivers/net/sh_eth.c
drivers/net/sh_eth.h

index 155769601065303e463e94861fe49b5a08f4946b..e86c880b7e4cf23a8e554707a38192cf0824a92c 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef __ASM_SH_ETH_H__
 #define __ASM_SH_ETH_H__
 
+#include <linux/phy.h>
+
 enum {EDMAC_LITTLE_ENDIAN, EDMAC_BIG_ENDIAN};
 enum {
        SH_ETH_REG_GIGABIT,
@@ -12,6 +14,7 @@ struct sh_eth_plat_data {
        int phy;
        int edmac_endian;
        int register_type;
+       phy_interface_t phy_interface;
 
        unsigned char mac_addr[6];
        unsigned no_ether_link:1;
index 6734311e56e45ab28c182866a8f7a8a42922653f..5d28ce68f357a674c8791ef79cad86c8869b5cd2 100644 (file)
@@ -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;
index b349c5e2bcdabacdafb47809495a39e56f7b2ec0..c3048a6ba6760e1281bfa0017c4876433b71fdc1 100644 (file)
@@ -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;
This page took 0.026755 seconds and 5 git commands to generate.