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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 17 May 2017 22:26:33 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Iyappan Subramanian <isubramanian@....com>
Cc:     davem@...emloft.net, netdev@...r.kernel.org, f.fainelli@...il.com,
        linux-arm-kernel@...ts.infradead.org, patches@....com,
        Quan Nguyen <qnguyen@....com>
Subject: Re: [PATCH net-next] drivers: net: xgene: Check all RGMII phy mode
 variants

> +bool is_xgene_enet_phy_mode_rgmii(struct net_device *ndev)
> +{
> +	struct xgene_enet_pdata *pdata = netdev_priv(ndev);
> +	int phy_mode = pdata->phy_mode;
> +	bool ret;
> +
> +	ret = phy_mode == PHY_INTERFACE_MODE_RGMII ||
> +	      phy_mode == PHY_INTERFACE_MODE_RGMII_ID ||
> +	      phy_mode == PHY_INTERFACE_MODE_RGMII_RXID ||
> +	      phy_mode == PHY_INTERFACE_MODE_RGMII_TXID;
> +
> +	return ret;
> +}

include/linux/phy.h:

/**
 * phy_interface_is_rgmii - Convenience function for testing if a PHY interface
 * is RGMII (all variants)
 * @phydev: the phy_device struct
 */
static inline bool phy_interface_is_rgmii(struct phy_device *phydev)
{
        return phydev->interface >= PHY_INTERFACE_MODE_RGMII &&
                phydev->interface <= PHY_INTERFACE_MODE_RGMII_TXID;
};

	Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ