lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <926ca4e8-78af-d442-38c5-bf38141051b5@gmail.com>
Date:   Fri, 3 Nov 2017 12:52:10 -0700
From:   Florian Fainelli <f.fainelli@...il.com>
To:     Lipeng <lipeng321@...wei.com>, davem@...emloft.net
Cc:     netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        linuxarm@...wei.com, salil.mehta@...wei.com
Subject: Re: [PATCH net-next 4/6] net: hns3: add support for
 set_link_ksettings

On 11/02/2017 09:18 PM, Lipeng wrote:
> From: Fuyun Liang <liangfuyun1@...wei.com>
> 
> This patch adds set_link_ksettings support for ethtool cmd.
> 
> Signed-off-by: Fuyun Liang <liangfuyun1@...wei.com>
> Signed-off-by: Lipeng <lipeng321@...wei.com>
> ---
>  drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c
> index c7b8ebd..7fe193b 100644
> --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c
> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c
> @@ -653,6 +653,16 @@ static int hns3_get_link_ksettings(struct net_device *netdev,
>  	return 0;
>  }
>  
> +static int hns3_set_link_ksettings(struct net_device *netdev,
> +				   const struct ethtool_link_ksettings *cmd)
> +{
> +	/* Only support ksettings_set for netdev with phy attached for now */
> +	if (netdev->phydev)
> +		return phy_ethtool_ksettings_set(netdev->phydev, cmd);
> +
> +	return -EOPNOTSUPP;

Consider using phy_ethtool_get_link_ksettings() which already checks for
netdev->phydev.
-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ