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: <20200131153440.20870-6-calvin.johnson@nxp.com>
Date:   Fri, 31 Jan 2020 21:04:38 +0530
From:   Calvin Johnson <calvin.johnson@....com>
To:     linux.cj@...il.com, Jon Nettleton <jon@...id-run.com>,
        linux@...linux.org.uk, Makarand Pawagi <makarand.pawagi@....com>,
        cristian.sovaiala@....com, laurentiu.tudor@....com,
        ioana.ciornei@....com, V.Sethi@....com, pankaj.bansal@....com,
        "Rajesh V . Bikkina" <rajesh.bikkina@....com>
Cc:     Calvin Johnson <calvin.johnson@....nxp.com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Dmitry Torokhov <dmitry.torokhov@...il.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Sakari Ailus <sakari.ailus@...ux.intel.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        linux-kernel@...r.kernel.org
Subject: [PATCH v1 5/7] device property: Introduce fwnode_phy_is_fixed_link()

From: Calvin Johnson <calvin.johnson@....nxp.com>

Introduce fwnode_phy_is_fixed_link() function that an Ethernet driver
can call on its PHY phandle to find out whether it's a fixed link PHY
or not.

Signed-off-by: Calvin Johnson <calvin.johnson@....nxp.com>
---

 drivers/base/property.c  | 21 +++++++++++++++++++++
 include/linux/property.h |  1 +
 2 files changed, 22 insertions(+)

diff --git a/drivers/base/property.c b/drivers/base/property.c
index fdb79033d58f..a0f69fae82cd 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -827,6 +827,27 @@ enum dev_dma_attr device_get_dma_attr(struct device *dev)
 }
 EXPORT_SYMBOL_GPL(device_get_dma_attr);
 
+/*
+ * fwnode_phy_is_fixed_link()
+ */
+bool fwnode_phy_is_fixed_link(struct fwnode_handle *fwnode)
+{
+	struct fwnode_handle *fixed_node;
+	int len, err;
+	const char *managed;
+
+	fixed_node = fwnode_get_named_child_node(fwnode, "fixed-link");
+	if (fixed_node)
+		return fixed_node;
+
+	err = fwnode_property_read_string(fixed_node, "managed", &managed);
+	if (err == 0 && strcmp(managed, "auto") != 0)
+		return true;
+
+	return false;
+}
+EXPORT_SYMBOL(fwnode_phy_is_fixed_link);
+
 /**
  * fwnode_get_phy_mode - Get phy mode for given firmware node
  * @fwnode:	Pointer to the given node
diff --git a/include/linux/property.h b/include/linux/property.h
index 1998f502d2ed..ba89fcf091c8 100644
--- a/include/linux/property.h
+++ b/include/linux/property.h
@@ -333,6 +333,7 @@ int device_get_phy_mode(struct device *dev);
 
 void *device_get_mac_address(struct device *dev, char *addr, int alen);
 
+bool fwnode_phy_is_fixed_link(struct fwnode_handle *fwnode);
 int fwnode_get_phy_mode(struct fwnode_handle *fwnode,
 			phy_interface_t *interface);
 void *fwnode_get_mac_address(struct fwnode_handle *fwnode,
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ