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, 21 Aug 2015 14:56:35 -0700
From:	Florian Fainelli <f.fainelli@...il.com>
To:	Woojung.Huh@...rochip.com, davem@...emloft.net
CC:	netdev@...r.kernel.org
Subject: Re: [PATCH net-next 2/2] lan78xx: update eee code

On 21/08/15 14:41, Woojung.Huh@...rochip.com wrote:
> Patch to pdate EEE code.

This really deserves a better explanation of what is it that you are
fixing here.

> 
> Signed-off-by: Woojung Huh <woojung.huh@...rochip.com>
> ---
>  drivers/net/usb/lan78xx.c | 44 ++++++++++++++++++++++++--------------------
>  drivers/net/usb/lan78xx.h | 22 +++++++++++-----------
>  2 files changed, 35 insertions(+), 31 deletions(-)
> 
> diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
> index 4bcbf28..af102b0 100644
> --- a/drivers/net/usb/lan78xx.c
> +++ b/drivers/net/usb/lan78xx.c
> @@ -1296,38 +1296,37 @@ static int lan78xx_get_eee(struct net_device *net, struct ethtool_eee *edata)
>  	if (ret < 0)
>  		return ret;
>  
> +	buf = lan78xx_mmd_read(dev->net, dev->mii.phy_id,
> +			       PHY_MMD_DEV_7, PHY_EEE_ADVERTISEMENT);
> +	adv = mmd_eee_adv_to_ethtool_adv_t(buf);
> +	buf = lan78xx_mmd_read(dev->net, dev->mii.phy_id,
> +			       PHY_MMD_DEV_7, PHY_EEE_LP_ADVERTISEMENT);
> +	lpadv = mmd_eee_adv_to_ethtool_adv_t(buf);

Considering your function signatures, it sounds like you should
implement a libphy driver and you could get things like phy_init_eee()
for free.

[snip]

>  	/* enable PHY interrupts */
>  	ret = lan78xx_read_reg(dev, INT_EP_CTL, &buf);
>  	buf |= INT_ENP_PHY_INT;
> diff --git a/drivers/net/usb/lan78xx.h b/drivers/net/usb/lan78xx.h
> index ae7562e..95e721b 100644
> --- a/drivers/net/usb/lan78xx.h
> +++ b/drivers/net/usb/lan78xx.h
> @@ -1047,23 +1047,23 @@
>  #define PHY_MMD_DEV_3				3
>  
>  #define PHY_EEE_PCS_STATUS			(0x1)
> -#define PHY_EEE_PCS_STATUS_TX_LPI_RCVD_		((WORD)0x0800)
> -#define PHY_EEE_PCS_STATUS_RX_LPI_RCVD_		((WORD)0x0400)
> -#define PHY_EEE_PCS_STATUS_TX_LPI_IND_		((WORD)0x0200)
> -#define PHY_EEE_PCS_STATUS_RX_LPI_IND_		((WORD)0x0100)
> -#define PHY_EEE_PCS_STATUS_PCS_RCV_LNK_STS_	((WORD)0x0004)
> +#define PHY_EEE_PCS_STATUS_TX_LPI_RCVD_		(0x0800)
> +#define PHY_EEE_PCS_STATUS_RX_LPI_RCVD_		(0x0400)
> +#define PHY_EEE_PCS_STATUS_TX_LPI_IND_		(0x0200)
> +#define PHY_EEE_PCS_STATUS_RX_LPI_IND_		(0x0100)
> +#define PHY_EEE_PCS_STATUS_PCS_RCV_LNK_STS_	(0x0004)

Can you look at updating include/uapi/linux/mdio.h with the missing
registers for your use case instead of replicating this in a driver?
-- 
Florian
--
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