All of lore.kernel.org
 help / color / mirror / Atom feed
From: Madalin-cristian Bucur <madalin.bucur@nxp.com>
To: "jocke@infinera.com" <joakim.tjernlund@infinera.com>,
	"netdev @ vger . kernel . org" <netdev@vger.kernel.org>
Cc: "jocke@infinera.com" <joakim.tjernlund@infinera.com>
Subject: RE: [PATCH] dpaa_eth: Add dpaa_change_carrier()
Date: Fri, 7 Dec 2018 08:36:48 +0000	[thread overview]
Message-ID: <VI1PR04MB5567EBAB7DBF3A5E09388319ECAA0@VI1PR04MB5567.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20181206153215.5711-1-joakim.tjernlund@infinera.com>

> -----Original Message-----
> From: Joakim Tjernlund <joakim.tjernlund@infinera.com>
> Sent: Thursday, December 6, 2018 5:32 PM
> To: netdev @ vger . kernel . org <netdev@vger.kernel.org>; Madalin-
> cristian Bucur <madalin.bucur@nxp.com>
> Cc: jocke@infinera.com <joakim.tjernlund@infinera.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@infinera.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

  reply	other threads:[~2018-12-07  8:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-06 15:32 [PATCH] dpaa_eth: Add dpaa_change_carrier() Joakim Tjernlund
2018-12-07  8:36 ` Madalin-cristian Bucur [this message]
2018-12-07  9:15   ` Andrew Lunn

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=VI1PR04MB5567EBAB7DBF3A5E09388319ECAA0@VI1PR04MB5567.eurprd04.prod.outlook.com \
    --to=madalin.bucur@nxp.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 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.