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: <YfNShpsWZhbff/C4@lunn.ch>
Date:   Fri, 28 Jan 2022 03:18:46 +0100
From:   Andrew Lunn <andrew@...n.ch>
To:     Joseph CHAMG <josright123@...il.com>
Cc:     "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Rob Herring <robh+dt@...nel.org>, joseph_chang@...icom.com.tw,
        netdev@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, andy.shevchenko@...il.com,
        leon@...nel.org
Subject: Re: [PATCH v14, 2/2] net: Add dm9051 driver

> +static int dm9051_mdiobus_read(struct mii_bus *bus, int addr, int regnum)
> +{
> +	struct board_info *db = bus->priv;
> +	unsigned int val = 0xffff;
> +	int ret;
> +
> +	if (addr == DM9051_PHY_ID) {

Thanks for fixing the variable name. But don't you think it would of
made sense to rename DM9051_PHY_ID as well? DM9051_PHY_ADDR?

> +static int dm9051_set_pauseparam(struct net_device *ndev,
> +				 struct ethtool_pauseparam *pause)
> +{
> +	struct board_info *db = to_dm9051_board(ndev);
> +	u8 fcr = 0;
> +	int ret;
> +
> +	db->eth_pause = *pause;
> +
> +	if (pause->autoneg)
> +		db->phydev->autoneg = AUTONEG_ENABLE;
> +	else
> +		db->phydev->autoneg = AUTONEG_DISABLE;
> +

pause->autoneg means that pause is negotiated as part of autoneg in
general. But pause->autoneg does not mean turn on autoneg. The
ksetting calls should be used for that.

If pause->autoneg is false, you write the pause settings direct to the
MAC. If it is true, you should call phy_set_sym_pause(). Once
negotiation has completed the link change callback will be called, and
you program the MAC with what has been negotiated.

    Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ