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  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:	Wed, 27 Jul 2016 10:05:26 +0200
From:	Andrew Lunn <>
To:	Appana Durga Kedareswara Rao <>
Cc:	"" <>,
	"" <>,
	Michal Simek <>,
	Soren Brinkmann <>,
	"" <>,
	"" <>,
	"" <>,
	"" <>,
	"" <>,
	Punnaiah Choudary Kalluri <>
Subject: Re: [RFC PATCH v2 1/4] Documentation: DT: net: Add Xilinx
 gmiitorgmii converter device tree binding documentation

Hi Appana

Here is roughly what i was thinking:

struct priv {
       phy_device *master;
       phy_device *slave;
       struct phy_driver *slave_drv;

phy_status_clone(phy_device *master, phy_device *slave)
	master->speed = slave->speed;
	master->duplex = slave->duplex;
	master->pause = slave->pause;

read_status(struct phy_device *phydev)
	struct priv *priv = phydev->priv;

	/* Get the status from the slave, and duplicate in into the
	 * master */
	 phy_status_clone(priv->master, priv->slave);

	 /* Update the gmiitorgmii with the current link parameters */

config_init(struct phy_device *phydev)
	struct priv *priv = phydev->priv;

	/* Configure the slave, and duplicate in into the master */
	phy_status_clone(priv->master, priv->slave);

struct phy_driver master_drv = {
       .read_status = read_status,
       .config_init = config_init,
       .soft_reset  = ...
       .suspend = ...

probe(mdio_device *mdio)
	struct priv *priv = devm_alloc();

	/* Use the phy-handle property to find the slave phy */
	node_phy = of_parse_phandle(mdio->of_node, "phy", 0);
	priv->slave = of_phy_find_device(node_phy);

	/* Create the master phy on the control address. Use the phy
	   ID from the slave. */
	priv->master = phy_device_create(mdio->bus, mdio->addr,

	slave_dev_drv = phydev->;
	priv->slave_drv = to_phy_driver(slave_dev_drv);
	priv->master-> = master_drv;

It would however be nice to only have one phydev structure, so you are
not copying status and settings backwards and forwards from one to the
other all the time, and need a wrapper for every function in
phy_driver. Studying the structures a bit, that might be possible. You
would then only need to wrap the read_status(), so that when the link
speed/duplex changes, you can configure the converter as appropriate.


Powered by blists - more mailing lists