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]
Message-Id: <1284401251-8846-2-git-send-email-cyril@ti.com>
Date:	Mon, 13 Sep 2010 14:07:23 -0400
From:	Cyril Chemparathy <cyril@...com>
To:	netdev@...r.kernel.org,
	davinci-linux-open-source@...ux.davincidsp.com,
	linux-omap@...r.kernel.org
Cc:	michael.williamson@...ticallink.com, caglarakyuz@...il.com,
	bparrot@...com, Cyril Chemparathy <cyril@...com>
Subject: [PATCH 1/9] net: davinci_emac: allow forced 100/full via phy_id

With this patch, phy_id can be one of the following:
  1) NULL		: use the first phy on the bus,
  2) ""			: force to 100/full, no mdio control
  3) "<bus>:<addr>"	: use the specified bus and phy

The ability to force 100/full is necessary on some platforms (e.g. da830 evm),
where an on-board switch may be connected on the emac mii.

Signed-off-by: Cyril Chemparathy <cyril@...com>
Signed-off-by: Michael Williamson <michael.williamson@...ticallink.com>
Signed-off-by: Caglar Akyuz <caglarakyuz@...il.com>
---
 drivers/net/davinci_emac.c   |    2 +-
 include/linux/davinci_emac.h |    7 +++++++
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index 525b84c..363c970 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -1566,7 +1566,7 @@ static int emac_dev_open(struct net_device *ndev)
 			priv->phy_id = dev_name(phy);
 	}
 
-	if (priv->phy_id) {
+	if (priv->phy_id && *priv->phy_id) {
 		priv->phydev = phy_connect(ndev, priv->phy_id,
 					   &emac_adjust_link, 0,
 					   PHY_INTERFACE_MODE_MII);
diff --git a/include/linux/davinci_emac.h b/include/linux/davinci_emac.h
index 7508e49..9ae9ff0 100644
--- a/include/linux/davinci_emac.h
+++ b/include/linux/davinci_emac.h
@@ -25,6 +25,13 @@ struct emac_platform_data {
 	u32 ctrl_ram_offset;
 	u32 hw_ram_addr;
 	u32 ctrl_ram_size;
+
+	/*
+	 * phy_id can be one of the following:
+	 *   - NULL		: use the first phy on the bus,
+	 *   - ""		: force to 100/full, no mdio control
+	 *   - "<bus>:<addr>"	: use the specified bus and phy
+	 */
 	const char *phy_id;
 	u8 rmii_en;
 	u8 version;
-- 
1.7.0.4

--
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