From: Florian Fainelli <f.fainelli@gmail.com>
To: Joakim Tjernlund <Joakim.Tjernlund@infinera.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: Fixed PHYs and link up/down from user space ?
Date: Sat, 08 Sep 2018 11:14:13 -0700 [thread overview]
Message-ID: <204CAB94-B736-4966-8DE2-4FAA44EE94FD@gmail.com> (raw)
In-Reply-To: <f06e484fc7d3e0b213c53d1a5dae90c787311768.camel@infinera.com>
On September 8, 2018 6:59:31 AM PDT, Joakim Tjernlund <Joakim.Tjernlund@infinera.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
prev parent reply other threads:[~2018-09-08 23:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-08 13:59 Fixed PHYs and link up/down from user space ? Joakim Tjernlund
2018-09-08 18:14 ` Florian Fainelli [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=204CAB94-B736-4966-8DE2-4FAA44EE94FD@gmail.com \
--to=f.fainelli@gmail.com \
--cc=Joakim.Tjernlund@infinera.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox