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:	Fri, 6 Jul 2012 22:01:46 +0200
From:	Francois Romieu <romieu@...zoreil.com>
To:	Émeric Vigier 
	<emeric.vigier@...oirfairelinux.com>
Cc:	Steve Glendinning <steve@...well.net>,
	steve glendinning <steve.glendinning@...c.com>,
	netdev@...r.kernel.org, Nancy Lin <nancy.lin@...c.com>
Subject: Re: [PATCH] smsc95xx: support ethtool get_regs

Émeric Vigier <emeric.vigier@...oirfairelinux.com> :
[...]
> +static int smsc95xx_ethtool_getregslen(struct net_device *dev)
> +{
> +	/* all smsc95xx registers plus all phy registers */
> +	return COE_CR - ID_REV + 1 + 32 * sizeof(u32);

I do not see where ID_REV is accounted for in the loops below.

s/32 */PHY_SPECIAL */ or s/PHY_SPECIAL/32/ below.

I thought PHY registers were 16 bits wide. Moreover they are already
available through smsc95xx_ioctl().

> +}
> +
> +static void
> +smsc95xx_ethtool_getregs(struct net_device *netdev, struct ethtool_regs *regs,
> +			 void *buf)
> +{
> +	struct usbnet *dev = netdev_priv(netdev);
> +	unsigned int i, j = 0, retval;

	unsigned int i, j, retval;

> +	u32 *data = buf;
> +
> +	netif_dbg(dev, hw, dev->net, "ethtool_getregs\n");

The tracing framework does provide almost the same information.

> +
> +	retval = smsc95xx_read_reg(dev, ID_REV, &regs->version);
> +	if (retval < 0) {
> +		netdev_warn(dev->net, "REGS: cannot read ID_REV\n");

s/dev->net/netdev/ ?


> +		return;
> +	}
> +
> +	for (i = 0; i <= COE_CR; i += (sizeof(u32))) {
> +		retval = smsc95xx_read_reg(dev, i, &data[j++]);

	for (i = 0, j = 0; i <= COE_CR; i += sizeof(u32), j++) {
		retval = smsc95xx_read_reg(dev, i, data + j);

-- 
Ueimor
--
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