aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/mdio.h
diff options
context:
space:
mode:
authorPhilippe Reynes <tremyfr@gmail.com>2017-01-01 19:02:45 +0100
committerDavid S. Miller <davem@davemloft.net>2017-01-02 16:59:10 -0500
commit8e4881aa1d5d2f9c7ebfd0fe5e138f0cc345832c (patch)
tree4c8ffcb75c96dfb633ec676c03a3ea9012c451da /include/linux/mdio.h
parentMerge branch 'mlx5-odp' (diff)
downloadwireguard-linux-8e4881aa1d5d2f9c7ebfd0fe5e138f0cc345832c.tar.xz
wireguard-linux-8e4881aa1d5d2f9c7ebfd0fe5e138f0cc345832c.zip
net: mdio: add mdio45_ethtool_ksettings_get
There is a function in mdio for the old ethtool api gset. We add a new function mdio45_ethtool_ksettings_get for the new ethtool api glinksettings. Signed-off-by: Philippe Reynes <tremyfr@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/mdio.h')
-rw-r--r--include/linux/mdio.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index bf9d1d750693..b6587a4b32e7 100644
--- a/include/linux/mdio.h
+++ b/include/linux/mdio.h
@@ -130,6 +130,10 @@ extern int mdio45_nway_restart(const struct mdio_if_info *mdio);
extern void mdio45_ethtool_gset_npage(const struct mdio_if_info *mdio,
struct ethtool_cmd *ecmd,
u32 npage_adv, u32 npage_lpa);
+extern void
+mdio45_ethtool_ksettings_get_npage(const struct mdio_if_info *mdio,
+ struct ethtool_link_ksettings *cmd,
+ u32 npage_adv, u32 npage_lpa);
/**
* mdio45_ethtool_gset - get settings for ETHTOOL_GSET
@@ -147,6 +151,23 @@ static inline void mdio45_ethtool_gset(const struct mdio_if_info *mdio,
mdio45_ethtool_gset_npage(mdio, ecmd, 0, 0);
}
+/**
+ * mdio45_ethtool_ksettings_get - get settings for ETHTOOL_GLINKSETTINGS
+ * @mdio: MDIO interface
+ * @cmd: Ethtool request structure
+ *
+ * Since the CSRs for auto-negotiation using next pages are not fully
+ * standardised, this function does not attempt to decode them. Use
+ * mdio45_ethtool_ksettings_get_npage() to specify advertisement bits
+ * from next pages.
+ */
+static inline void
+mdio45_ethtool_ksettings_get(const struct mdio_if_info *mdio,
+ struct ethtool_link_ksettings *cmd)
+{
+ mdio45_ethtool_ksettings_get_npage(mdio, cmd, 0, 0);
+}
+
extern int mdio_mii_ioctl(const struct mdio_if_info *mdio,
struct mii_ioctl_data *mii_data, int cmd);