summaryrefslogtreecommitdiffstats
path: root/include/linux/phy.h
diff options
context:
space:
mode:
authorZach Brown2016-10-17 17:49:54 +0200
committerDavid S. Miller2016-10-18 17:56:31 +0200
commit1f9127caece42514a47011326b83ad93d95cd5d7 (patch)
treecbfcb6e923a047d61a72b45da2f47c9b9df25dd6 /include/linux/phy.h
parentnet: phy: Encapsulate actions performed during link state changes into functi... (diff)
downloadkernel-qcow2-linux-1f9127caece42514a47011326b83ad93d95cd5d7.tar.gz
kernel-qcow2-linux-1f9127caece42514a47011326b83ad93d95cd5d7.tar.xz
kernel-qcow2-linux-1f9127caece42514a47011326b83ad93d95cd5d7.zip
net: phy: Create phy_supported_speeds function which lists speeds currently supported by a phydevice
phy_supported_speeds provides a means to get a list of all the speeds a phy device currently supports. Signed-off-by: Zach Brown <zach.brown@ni.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/phy.h')
-rw-r--r--include/linux/phy.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h
index c47378c93607..4b6c246c63bb 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -85,6 +85,21 @@ typedef enum {
} phy_interface_t;
/**
+ * phy_supported_speeds - return all speeds currently supported by a phy device
+ * @phy: The phy device to return supported speeds of.
+ * @speeds: buffer to store supported speeds in.
+ * @size: size of speeds buffer.
+ *
+ * Description: Returns the number of supported speeds, and
+ * fills the speeds * buffer with the supported speeds. If speeds buffer is
+ * too small to contain * all currently supported speeds, will return as
+ * many speeds as can fit.
+ */
+unsigned int phy_supported_speeds(struct phy_device *phy,
+ unsigned int *speeds,
+ unsigned int size);
+
+/**
* It maps 'enum phy_interface_t' found in include/linux/phy.h
* into the device tree binding of 'phy-mode', so that Ethernet
* device driver can get phy interface from device tree.