* [PATCH] ucc_geth: Add ucc_geth_change_carrier()
@ 2018-12-06 15:33 Joakim Tjernlund
2018-12-07 9:15 ` Andrew Lunn
0 siblings, 1 reply; 2+ messages in thread
From: Joakim Tjernlund @ 2018-12-06 15:33 UTC (permalink / raw)
To: netdev @ vger . kernel . org, Li Yang; +Cc: Joakim Tjernlund
This allows to control carrier from /sys/class/net/ethX/carrier
Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
---
drivers/net/ethernet/freescale/ucc_geth.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c
index e8debbde0a34..2f4c2f550be6 100644
--- a/drivers/net/ethernet/freescale/ucc_geth.c
+++ b/drivers/net/ethernet/freescale/ucc_geth.c
@@ -3680,11 +3680,22 @@ static int ucc_geth_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
return phy_mii_ioctl(ugeth->phydev, rq, cmd);
}
+static int ucc_geth_change_carrier(struct net_device *dev, bool new_carrier)
+{
+ struct phy_device *phydev = dev->phydev;
+
+ if (phydev && phydev->phy_link_change)
+ phydev->phy_link_change(phydev, new_carrier, 1);
+
+ return 0;
+}
+
static const struct net_device_ops ucc_geth_netdev_ops = {
.ndo_open = ucc_geth_open,
.ndo_stop = ucc_geth_close,
.ndo_start_xmit = ucc_geth_start_xmit,
.ndo_validate_addr = eth_validate_addr,
+ .ndo_change_carrier = ucc_geth_change_carrier,
.ndo_set_mac_address = ucc_geth_set_mac_addr,
.ndo_set_rx_mode = ucc_geth_set_multi,
.ndo_tx_timeout = ucc_geth_timeout,
--
2.18.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ucc_geth: Add ucc_geth_change_carrier()
2018-12-06 15:33 [PATCH] ucc_geth: Add ucc_geth_change_carrier() Joakim Tjernlund
@ 2018-12-07 9:15 ` Andrew Lunn
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Lunn @ 2018-12-07 9:15 UTC (permalink / raw)
To: Joakim Tjernlund; +Cc: netdev @ vger . kernel . org, Li Yang
On Thu, Dec 06, 2018 at 04:33:25PM +0100, Joakim Tjernlund wrote:
> This allows to control carrier from /sys/class/net/ethX/carrier
>
> Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
See the discussion for [PATCH] gianfar: Add gfar_change_carrier().
For the moment:
NACK
Andrew
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-12-07 9:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-06 15:33 [PATCH] ucc_geth: Add ucc_geth_change_carrier() Joakim Tjernlund
2018-12-07 9:15 ` Andrew Lunn
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.