From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Fainelli Subject: Re: Under what conditions is phy_device "adjust_link()" called? Date: Thu, 16 Aug 2018 11:59:19 -0700 Message-ID: <53c990a5-9b27-df58-43c3-517708e97511@gmail.com> References: <20180816132658.Horde.v9igInCJzJMqJVzetKhC8Jh@crashcourse.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: rpjday@crashcourse.ca, netdev@vger.kernel.org Return-path: Received: from mail-qt0-f177.google.com ([209.85.216.177]:36395 "EHLO mail-qt0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725749AbeHPV7z (ORCPT ); Thu, 16 Aug 2018 17:59:55 -0400 Received: by mail-qt0-f177.google.com with SMTP id t5-v6so6018052qtn.3 for ; Thu, 16 Aug 2018 11:59:43 -0700 (PDT) In-Reply-To: <20180816132658.Horde.v9igInCJzJMqJVzetKhC8Jh@crashcourse.ca> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: 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