netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* phy_connect_direct problem
@ 2009-10-27 10:28 Kristoffer Glembo
  2009-10-27 13:10 ` Kristoffer Glembo
  0 siblings, 1 reply; 2+ messages in thread
From: Kristoffer Glembo @ 2009-10-27 10:28 UTC (permalink / raw)
  To: netdev

Hi,

I'm in the process of converting an ethernet driver to using the PHY 
layer, but ran into a problem where my adjust_state handler was never 
called and the link did not go up ...

I use phy_connect to connect the PHY device with my ethernet driver. In 
phy_connect_direct I found the following code: 	

phy_prepare_link(phydev, handler);
phy_start_machine(phydev, NULL);

So first the adjust_state is set to handler by phy_prepare_link and then 
it is overwritten with the NULL parameter passed to phy_start_machine.

Maybe I'm abusing the PHY layer somehow since there are plenty of other 
drivers using this interface. However the patch below solved the issue 
for me.

Best regards,
Kristoffer Glembo


---
  drivers/net/phy/phy_device.c |    3 +--
  1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index b10fedd..d27ca80 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -311,8 +311,7 @@ int phy_connect_direct(struct net_device *dev, 
struct phy_device *phydev,
  	if (rc)
  		return rc;

-	phy_prepare_link(phydev, handler);
-	phy_start_machine(phydev, NULL);
+	phy_start_machine(phydev, handler);
  	if (phydev->irq > 0)
  		phy_start_interrupts(phydev);

-- 
1.5.2.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: phy_connect_direct problem
  2009-10-27 10:28 phy_connect_direct problem Kristoffer Glembo
@ 2009-10-27 13:10 ` Kristoffer Glembo
  0 siblings, 0 replies; 2+ messages in thread
From: Kristoffer Glembo @ 2009-10-27 13:10 UTC (permalink / raw)
  To: netdev

Hi again,

Please forget about this. I'm obviously blind as I can't see the 
difference between adjust_state and adjust_link  ...

Best regards,
Kristoffer Glembo

Kristoffer Glembo wrote:
> Hi,
> 
> I'm in the process of converting an ethernet driver to using the PHY 
> layer, but ran into a problem where my adjust_state handler was never 
> called and the link did not go up ...
> 
> I use phy_connect to connect the PHY device with my ethernet driver. In 
> phy_connect_direct I found the following code:    
> 
> phy_prepare_link(phydev, handler);
> phy_start_machine(phydev, NULL);
> 
> So first the adjust_state is set to handler by phy_prepare_link and then 
> it is overwritten with the NULL parameter passed to phy_start_machine.
> 
> Maybe I'm abusing the PHY layer somehow since there are plenty of other 
> drivers using this interface. However the patch below solved the issue 
> for me.
> 
> Best regards,
> Kristoffer Glembo
> 
> 
> ---
>  drivers/net/phy/phy_device.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
> index b10fedd..d27ca80 100644
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -311,8 +311,7 @@ int phy_connect_direct(struct net_device *dev, 
> struct phy_device *phydev,
>      if (rc)
>          return rc;
> 
> -    phy_prepare_link(phydev, handler);
> -    phy_start_machine(phydev, NULL);
> +    phy_start_machine(phydev, handler);
>      if (phydev->irq > 0)
>          phy_start_interrupts(phydev);
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-10-27 13:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-27 10:28 phy_connect_direct problem Kristoffer Glembo
2009-10-27 13:10 ` Kristoffer Glembo

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).