* Under what conditions is phy_device "adjust_link()" called?
@ 2018-08-16 17:26 rpjday
2018-08-16 18:59 ` Florian Fainelli
0 siblings, 1 reply; 3+ messages in thread
From: rpjday @ 2018-08-16 17:26 UTC (permalink / raw)
To: netdev
I can see from the documentation that the callback adjust_link() is invoked
"for the enet controller to respond to changes in the link state." Is there
a specific list of the events that would generate such a change? Are we
talking initially opening the device, ifup/ifdown, physically unplugging
from the port, some or all of the above?
Not a network expert (yet), so I'm still digging through the code. Thanks.
rday
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Under what conditions is phy_device "adjust_link()" called?
2018-08-16 17:26 Under what conditions is phy_device "adjust_link()" called? rpjday
@ 2018-08-16 18:59 ` Florian Fainelli
2018-08-16 23:33 ` Andrew Lunn
0 siblings, 1 reply; 3+ messages in thread
From: Florian Fainelli @ 2018-08-16 18:59 UTC (permalink / raw)
To: rpjday, netdev
On 08/16/2018 10:26 AM, rpjday@crashcourse.ca wrote:
>
> I can see from the documentation that the callback adjust_link() is invoked
> "for the enet controller to respond to changes in the link state." Is there
> a specific list of the events that would generate such a change? Are we
> talking initially opening the device, ifup/ifdown, physically unplugging
> from the port, some or all of the above?
adjust_link() is typically called on transitions from link UP to DOWN
and DOWN to UP. This may include the initial configuration of the PHY
during e.g: phy_connect() and then typically when an event occurs than
requires a re-configuration of the MAC: link parameters (speed, status,
duplex, pause) changed.
>
> Not a network expert (yet), so I'm still digging through the code. Thanks.
Reading the PHY state machine under drivers/net/phy/phy.c will make this
more clear IMHO.
--
Florian
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Under what conditions is phy_device "adjust_link()" called?
2018-08-16 18:59 ` Florian Fainelli
@ 2018-08-16 23:33 ` Andrew Lunn
0 siblings, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2018-08-16 23:33 UTC (permalink / raw)
To: Florian Fainelli; +Cc: rpjday, netdev
On Thu, Aug 16, 2018 at 11:59:19AM -0700, Florian Fainelli wrote:
> On 08/16/2018 10:26 AM, rpjday@crashcourse.ca wrote:
> >
> > I can see from the documentation that the callback adjust_link() is invoked
> > "for the enet controller to respond to changes in the link state." Is there
> > a specific list of the events that would generate such a change? Are we
> > talking initially opening the device, ifup/ifdown, physically unplugging
> > from the port, some or all of the above?
>
> adjust_link() is typically called on transitions from link UP to DOWN
> and DOWN to UP. This may include the initial configuration of the PHY
> during e.g: phy_connect() and then typically when an event occurs than
> requires a re-configuration of the MAC: link parameters (speed, status,
> duplex, pause) changed.
Just adding to that, if you have a 10G PHY, the MAC-PHY interface mode
can also change, e.g. SGMII for 10/100/1000, and 10GBase-T for 10G,
etc.
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-08-17 2:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-16 17:26 Under what conditions is phy_device "adjust_link()" called? rpjday
2018-08-16 18:59 ` Florian Fainelli
2018-08-16 23:33 ` Andrew Lunn
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).