linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: Max Filippov <jcmvbkbc@gmail.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Marc Gauthier <marc@cadence.com>
Subject: Re: [PATCH v2 2/4] net: ethoc: implement ethtool get/set settings
Date: Fri, 31 Jan 2014 18:03:03 +0000	[thread overview]
Message-ID: <1391191383.4405.83.camel@deadeye.wl.decadent.org.uk> (raw)
In-Reply-To: <1391146867-30508-3-git-send-email-jcmvbkbc@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1503 bytes --]

On Fri, 2014-01-31 at 09:41 +0400, Max Filippov wrote:
> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>

Reviewed-by: Ben Hutchings <ben@decadent.org.uk>

> ---
> Changes v1->v2:
> - fix {get,set}_settings return code in case there's no PHY.
> 
>  drivers/net/ethernet/ethoc.c | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/drivers/net/ethernet/ethoc.c b/drivers/net/ethernet/ethoc.c
> index 0623c20..779d3c3 100644
> --- a/drivers/net/ethernet/ethoc.c
> +++ b/drivers/net/ethernet/ethoc.c
> @@ -890,7 +890,31 @@ out:
>  	return NETDEV_TX_OK;
>  }
>  
> +static int ethoc_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
> +{
> +	struct ethoc *priv = netdev_priv(dev);
> +	struct phy_device *phydev = priv->phy;
> +
> +	if (!phydev)
> +		return -EOPNOTSUPP;
> +
> +	return phy_ethtool_gset(phydev, cmd);
> +}
> +
> +static int ethoc_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
> +{
> +	struct ethoc *priv = netdev_priv(dev);
> +	struct phy_device *phydev = priv->phy;
> +
> +	if (!phydev)
> +		return -EOPNOTSUPP;
> +
> +	return phy_ethtool_sset(phydev, cmd);
> +}
> +
>  const struct ethtool_ops ethoc_ethtool_ops = {
> +	.get_settings = ethoc_get_settings,
> +	.set_settings = ethoc_set_settings,
>  	.get_link = ethtool_op_get_link,
>  	.get_ts_info = ethtool_op_get_ts_info,
>  };

-- 
Ben Hutchings
It is easier to write an incorrect program than to understand a correct one.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

  reply	other threads:[~2014-01-31 18:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-31  5:41 [PATCH v2 0/4] OpenCores 10/100 MAC ethtool operations Max Filippov
2014-01-31  5:41 ` [PATCH v2 1/4] net: ethoc: implement basic " Max Filippov
2014-01-31  5:41 ` [PATCH v2 2/4] net: ethoc: implement ethtool get/set settings Max Filippov
2014-01-31 18:03   ` Ben Hutchings [this message]
2014-01-31  5:41 ` [PATCH v2 3/4] net: ethoc: implement ethtool get registers Max Filippov
2014-01-31  5:41 ` [PATCH v2 4/4] net: ethoc: implement ethtool get/set ring parameters Max Filippov
2014-02-02  0:57 ` [PATCH v2 0/4] OpenCores 10/100 MAC ethtool operations David Miller

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=1391191383.4405.83.camel@deadeye.wl.decadent.org.uk \
    --to=ben@decadent.org.uk \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=jcmvbkbc@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc@cadence.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;
as well as URLs for NNTP newsgroup(s).