From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Fainelli Subject: Re: Fixed PHYs and link up/down from user space ? Date: Sat, 08 Sep 2018 11:14:13 -0700 Message-ID: <204CAB94-B736-4966-8DE2-4FAA44EE94FD@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable To: Joakim Tjernlund , "netdev@vger.kernel.org" Return-path: Received: from mail-pl1-f173.google.com ([209.85.214.173]:42139 "EHLO mail-pl1-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726817AbeIHXA6 (ORCPT ); Sat, 8 Sep 2018 19:00:58 -0400 Received: by mail-pl1-f173.google.com with SMTP id g23-v6so7943790plq.9 for ; Sat, 08 Sep 2018 11:14:21 -0700 (PDT) In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On September 8, 2018 6:59:31 AM PDT, Joakim Tjernlund wrote: >I am looking for a way to set physical link state from user space for a >Fixed PHY=2E >Found the /sys/class/net/eth1/carrier I/F but that didn't work and I >cannot find something else=2E 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=2E Fixed PHYs also offer the ability to poll a GPIO to determine the link sta= te, or register a callback to update the link status based on an event (int= errupt handler or otherwise)=2E Note that attempting to change the carrier = from user space and the fixed PHY being polled by the PHY state machine wil= l likely both want to force the carrier, so you may have to register a fixe= d link status callback just to get them to agree=2E > >I want to make ifplugd/dhcp function as if there were a real cable >there(or not) >=20 > > Jocke --=20 Florian