* [PATCH 4/6] net: sh_eth: modify the PHY_INTERFACE_MODE
@ 2011-03-08 7:59 Yoshihiro Shimoda
2011-03-14 21:11 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Yoshihiro Shimoda @ 2011-03-08 7:59 UTC (permalink / raw)
To: netdev; +Cc: SH-Linux
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>
---
This patch are based on net-next-2.6.git.
arch/sh/include/asm/sh_eth.h | 3 +++
drivers/net/sh_eth.c | 3 ++-
drivers/net/sh_eth.h | 1 +
3 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/arch/sh/include/asm/sh_eth.h b/arch/sh/include/asm/sh_eth.h
index 1557696..e86c880 100644
--- a/arch/sh/include/asm/sh_eth.h
+++ b/arch/sh/include/asm/sh_eth.h
@@ -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;
diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
index 6734311..5d28ce6 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 b349c5e..c3048a6 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;
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 4/6] net: sh_eth: modify the PHY_INTERFACE_MODE
2011-03-08 7:59 [PATCH 4/6] net: sh_eth: modify the PHY_INTERFACE_MODE Yoshihiro Shimoda
@ 2011-03-14 21:11 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-03-14 21:11 UTC (permalink / raw)
To: yoshihiro.shimoda.uh; +Cc: netdev, linux-sh
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Date: Tue, 08 Mar 2011 16:59:45 +0900
> 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>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-03-14 21:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-08 7:59 [PATCH 4/6] net: sh_eth: modify the PHY_INTERFACE_MODE Yoshihiro Shimoda
2011-03-14 21:11 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).