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]
Date:	Thu, 18 Feb 2016 23:45:11 +0000
From:	Ben Hutchings <ben@...adent.org.uk>
To:	Woojung.Huh@...rochip.com, davem@...emloft.net
Cc:	netdev@...r.kernel.org
Subject: Re: [PATCH V2 net-next 2/3] lan78xx: add ethtool set & get pause
 functions

On Thu, 2016-02-18 at 22:40 +0000, Woojung.Huh@...rochip.com wrote:
> Add ethtool operations of set_pauseram and get_pauseparm.
[...]
> +static void lan78xx_get_pause(struct net_device *net,
> +			      struct ethtool_pauseparam *pause)
> +{
> +	struct lan78xx_net *dev = netdev_priv(net);
> +	struct phy_device *phydev = net->phydev;
> +	struct ethtool_cmd ecmd = { .cmd = ETHTOOL_GSET };
> +
> +	phy_ethtool_gset(phydev, &ecmd);
> +
> +	pause->autoneg = dev->fc_autoneg;
> +
> +	if (dev->fc_autoneg) {
> +		if (dev->fc_autoneg_control & FLOW_CTRL_TX)
> +			pause->tx_pause = 1;
> +
> +		if (dev->fc_autoneg_control & FLOW_CTRL_RX)
> +			pause->rx_pause = 1;

This is incorrect; you should always return the manual settings
(fc_request_control flags) here.  If autonegotiation is enabled then
your get_settings function will return the actual pause flags.

Ben.


> +	} else {
> +		if (dev->fc_request_control & FLOW_CTRL_TX)
> +			pause->tx_pause = 1;
> +
> +		if (dev->fc_request_control & FLOW_CTRL_RX)
> +			pause->rx_pause = 1;
> +	}
> +}
[...]

-- 
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.
Download attachment "signature.asc" of type "application/pgp-signature" (812 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ