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] [day] [month] [year] [list]
Message-ID: <1368839316.3469.69.camel@deadeye.wl.decadent.org.uk>
Date:	Sat, 18 May 2013 02:08:36 +0100
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Nithin Nayak Sujir <nsujir@...adcom.com>
CC:	<davem@...emloft.net>, <netdev@...r.kernel.org>,
	Michael Chan <mchan@...adcom.com>
Subject: Re: [PATCH net-next 4/4] tg3: Implement set/get_eee handlers

On Fri, 2013-05-17 at 08:19 -0700, Nithin Nayak Sujir wrote:
> Reviewed-by: Ben Li <benli@...adcom.com>
> Signed-off-by: Michael Chan <mchan@...adcom.com>
> Signed-off-by: Nithin Nayak Sujir <nsujir@...adcom.com>
> ---
>  drivers/net/ethernet/broadcom/tg3.c | 47 +++++++++++++++++++++++++++++++++++++
>  1 file changed, 47 insertions(+)
> 
> diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
> index 3aeb98f..7d4f664 100644
> --- a/drivers/net/ethernet/broadcom/tg3.c
> +++ b/drivers/net/ethernet/broadcom/tg3.c
> @@ -13657,6 +13657,51 @@ static int tg3_set_coalesce(struct net_device *dev, struct ethtool_coalesce *ec)
>  	return 0;
>  }
>  
> +static int tg3_set_eee(struct net_device *dev, struct ethtool_eee *edata)
> +{
> +	struct tg3 *tp = netdev_priv(dev);
> +
> +	if (!(tp->phy_flags & TG3_PHYFLG_EEE_CAP)) {
> +		netdev_warn(tp->dev,
> +			    "Board does not support EEE!\n");
> +		return -EOPNOTSUPP;
> +	}
> +
> +	if (edata->advertised != tp->eee.advertised) {
> +		netdev_warn(tp->dev,
> +			    "Direct manipulation of EEE advertisement is not supported\n");
> +		return -EINVAL;
> +	}
[...]

This should also check that edata->tx_lpi_timer is within the valid
range (16-bit, if I read your first patch right).

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ