[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <204CAB94-B736-4966-8DE2-4FAA44EE94FD@gmail.com>
Date: Sat, 08 Sep 2018 11:14:13 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: Joakim Tjernlund <Joakim.Tjernlund@...inera.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: Fixed PHYs and link up/down from user space ?
On September 8, 2018 6:59:31 AM PDT, Joakim Tjernlund <Joakim.Tjernlund@...inera.com> wrote:
>I am looking for a way to set physical link state from user space for a
>Fixed PHY.
>Found the /sys/class/net/eth1/carrier I/F but that didn't work and I
>cannot find something else.
The carrier sysfs attribute is not writable by default but it can be made so by hooking a ndo_change_carrier() callback to your network device.
Fixed PHYs also offer the ability to poll a GPIO to determine the link state, or register a callback to update the link status based on an event (interrupt handler or otherwise). Note that attempting to change the carrier from user space and the fixed PHY being polled by the PHY state machine will likely both want to force the carrier, so you may have to register a fixed link status callback just to get them to agree.
>
>I want to make ifplugd/dhcp function as if there were a real cable
>there(or not)
>
>
> Jocke
--
Florian
Powered by blists - more mailing lists