[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <VI1PR04MB5567EBAB7DBF3A5E09388319ECAA0@VI1PR04MB5567.eurprd04.prod.outlook.com>
Date: Fri, 7 Dec 2018 08:36:48 +0000
From: Madalin-cristian Bucur <madalin.bucur@....com>
To: "jocke@...inera.com" <joakim.tjernlund@...inera.com>,
"netdev @ vger . kernel . org" <netdev@...r.kernel.org>
CC: "jocke@...inera.com" <joakim.tjernlund@...inera.com>
Subject: RE: [PATCH] dpaa_eth: Add dpaa_change_carrier()
> -----Original Message-----
> From: Joakim Tjernlund <joakim.tjernlund@...inera.com>
> Sent: Thursday, December 6, 2018 5:32 PM
> To: netdev @ vger . kernel . org <netdev@...r.kernel.org>; Madalin-
> cristian Bucur <madalin.bucur@....com>
> Cc: jocke@...inera.com <joakim.tjernlund@...inera.com>
> Subject: [PATCH] dpaa_eth: Add dpaa_change_carrier()
>
> This allows to control carrier from /sys/class/net/ethX/carrier
Hi,
can you please explain why it's needed?
Thanks,
Madalin
> Signed-off-by: Joakim Tjernlund <joakim.tjernlund@...inera.com>
> ---
> drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> index a202c50d6fc7..0e93dfa6df0a 100644
> --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> @@ -2502,12 +2502,23 @@ static int dpaa_ioctl(struct net_device *net_dev,
> struct ifreq *rq, int cmd)
> return phy_mii_ioctl(net_dev->phydev, rq, cmd);
> }
>
> +static int dpaa_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 dpaa_ops = {
> .ndo_open = dpaa_open,
> .ndo_start_xmit = dpaa_start_xmit,
> .ndo_stop = dpaa_eth_stop,
> .ndo_tx_timeout = dpaa_tx_timeout,
> .ndo_get_stats64 = dpaa_get_stats64,
> + .ndo_change_carrier = dpaa_change_carrier,
> .ndo_set_mac_address = dpaa_set_mac_address,
> .ndo_validate_addr = eth_validate_addr,
> .ndo_set_rx_mode = dpaa_set_rx_mode,
> --
> 2.18.1
Powered by blists - more mailing lists