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 PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Thu, 9 Nov 2017 23:23:52 +0100 From: Andrew Lunn <andrew@...n.ch> To: David Daney <david.daney@...ium.com> Cc: linux-mips@...ux-mips.org, ralf@...ux-mips.org, James Hogan <james.hogan@...s.com>, netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>, Rob Herring <robh+dt@...nel.org>, Mark Rutland <mark.rutland@....com>, devel@...verdev.osuosl.org, Greg Kroah-Hartman <gregkh@...uxfoundation.org>, linux-kernel@...r.kernel.org, "Steven J. Hill" <steven.hill@...ium.com>, devicetree@...r.kernel.org, Florian Fainelli <f.fainelli@...il.com>, Carlos Munoz <cmunoz@...ium.com> Subject: Re: [PATCH v3 7/8] netdev: octeon-ethernet: Add Cavium Octeon III support. > + priv->phy_np = of_parse_phandle(pdev->dev.of_node, "phy-handle", 0); > + priv->phy_mode = of_get_phy_mode(pdev->dev.of_node); > + /* If phy-mode absent, default to SGMII. */ > + if (priv->phy_mode < 0) > + priv->phy_mode = PHY_INTERFACE_MODE_SGMII; > + > + if (priv->phy_mode == PHY_INTERFACE_MODE_1000BASEX) > + priv->mode_1000basex = true; > + > + if (of_phy_is_fixed_link(pdev->dev.of_node)) > + priv->bgx_as_phy = true; > + ... > + priv->mode = bgx_port_get_mode(priv->node, priv->bgx, priv->index); > + It might be a good idea to verify priv->phy_mode and priv->mode are compatible. > + switch (priv->mode) { > + case PORT_MODE_SGMII: > + case PORT_MODE_RGMII: > + priv->get_link = bgx_port_get_sgmii_link; > + priv->set_link = bgx_port_set_xgmii_link; > + break; > + case PORT_MODE_XAUI: > + case PORT_MODE_RXAUI: > + case PORT_MODE_XLAUI: > + case PORT_MODE_XFI: > + case PORT_MODE_10G_KR: > + case PORT_MODE_40G_KR4: > + priv->get_link = bgx_port_get_xaui_link; > + priv->set_link = bgx_port_set_xaui_link; > + break; Andrew
Powered by blists - more mailing lists